@@ -152,15 +152,15 @@ discard block |
||
152 | 152 | $properties['reminderminutes'] = 'PT_LONG:PSETID_Common:0x8501'; |
153 | 153 | $properties['reminderset'] = 'PT_BOOLEAN:PSETID_Common:0x8503'; |
154 | 154 | $properties['sendasical'] = 'PT_BOOLEAN:PSETID_Appointment:0x8200'; |
155 | - $properties['updatecounter'] = 'PT_LONG:PSETID_Appointment:0x8201'; // AppointmentSequenceNumber |
|
156 | - $properties['last_updatecounter'] = 'PT_LONG:PSETID_Appointment:0x8203'; // AppointmentLastSequence |
|
155 | + $properties['updatecounter'] = 'PT_LONG:PSETID_Appointment:0x8201'; // AppointmentSequenceNumber |
|
156 | + $properties['last_updatecounter'] = 'PT_LONG:PSETID_Appointment:0x8203'; // AppointmentLastSequence |
|
157 | 157 | $properties['unknown7'] = 'PT_LONG:PSETID_Appointment:0x8202'; |
158 | 158 | $properties['busystatus'] = 'PT_LONG:PSETID_Appointment:0x8205'; |
159 | 159 | $properties['intendedbusystatus'] = 'PT_LONG:PSETID_Appointment:0x8224'; |
160 | 160 | $properties['start'] = 'PT_SYSTIME:PSETID_Appointment:0x820d'; |
161 | 161 | $properties['responselocation'] = 'PT_STRING8:PSETID_Meeting:0x2'; |
162 | 162 | $properties['location'] = 'PT_STRING8:PSETID_Appointment:0x8208'; |
163 | - $properties['requestsent'] = 'PT_BOOLEAN:PSETID_Appointment:0x8229'; // PidLidFInvited, MeetingRequestWasSent |
|
163 | + $properties['requestsent'] = 'PT_BOOLEAN:PSETID_Appointment:0x8229'; // PidLidFInvited, MeetingRequestWasSent |
|
164 | 164 | $properties['startdate'] = 'PT_SYSTIME:PSETID_Appointment:0x820d'; |
165 | 165 | $properties['duedate'] = 'PT_SYSTIME:PSETID_Appointment:0x820e'; |
166 | 166 | $properties['flagdueby'] = 'PT_SYSTIME:PSETID_Common:0x8560'; |
@@ -169,11 +169,11 @@ discard block |
||
169 | 169 | $properties['recurring'] = 'PT_BOOLEAN:PSETID_Appointment:0x8223'; |
170 | 170 | $properties['clipstart'] = 'PT_SYSTIME:PSETID_Appointment:0x8235'; |
171 | 171 | $properties['clipend'] = 'PT_SYSTIME:PSETID_Appointment:0x8236'; |
172 | - $properties['start_recur_date'] = 'PT_LONG:PSETID_Meeting:0xD'; // StartRecurTime |
|
173 | - $properties['start_recur_time'] = 'PT_LONG:PSETID_Meeting:0xE'; // StartRecurTime |
|
174 | - $properties['end_recur_date'] = 'PT_LONG:PSETID_Meeting:0xF'; // EndRecurDate |
|
175 | - $properties['end_recur_time'] = 'PT_LONG:PSETID_Meeting:0x10'; // EndRecurTime |
|
176 | - $properties['is_exception'] = 'PT_BOOLEAN:PSETID_Meeting:0xA'; // LID_IS_EXCEPTION |
|
172 | + $properties['start_recur_date'] = 'PT_LONG:PSETID_Meeting:0xD'; // StartRecurTime |
|
173 | + $properties['start_recur_time'] = 'PT_LONG:PSETID_Meeting:0xE'; // StartRecurTime |
|
174 | + $properties['end_recur_date'] = 'PT_LONG:PSETID_Meeting:0xF'; // EndRecurDate |
|
175 | + $properties['end_recur_time'] = 'PT_LONG:PSETID_Meeting:0x10'; // EndRecurTime |
|
176 | + $properties['is_exception'] = 'PT_BOOLEAN:PSETID_Meeting:0xA'; // LID_IS_EXCEPTION |
|
177 | 177 | $properties['apptreplyname'] = 'PT_STRING8:PSETID_Appointment:0x8230'; |
178 | 178 | // Propose new time properties |
179 | 179 | $properties['proposed_start_whole'] = 'PT_SYSTIME:PSETID_Appointment:0x8250'; |
@@ -545,7 +545,7 @@ discard block |
||
545 | 545 | $listProperties['rcvd_representing_search_key'] = PR_RCVD_REPRESENTING_SEARCH_KEY; |
546 | 546 | $messageProps = mapi_getprops($this->message, $listProperties); |
547 | 547 | |
548 | - $goid = $messageProps[$this->proptags['goid']]; // GlobalID (0x3) |
|
548 | + $goid = $messageProps[$this->proptags['goid']]; // GlobalID (0x3) |
|
549 | 549 | if (!isset($goid)) { |
550 | 550 | return; |
551 | 551 | } |
@@ -1436,7 +1436,7 @@ discard block |
||
1436 | 1436 | $props[$this->proptags['goid2']] = $goid; |
1437 | 1437 | |
1438 | 1438 | if (!isset($props[$this->proptags['updatecounter']])) { |
1439 | - $props[$this->proptags['updatecounter']] = 0; // OL also starts sequence no with zero. |
|
1439 | + $props[$this->proptags['updatecounter']] = 0; // OL also starts sequence no with zero. |
|
1440 | 1440 | $props[$this->proptags['last_updatecounter']] = 0; |
1441 | 1441 | } |
1442 | 1442 | |
@@ -2285,12 +2285,12 @@ discard block |
||
2285 | 2285 | $hasOrganizer = false; |
2286 | 2286 | // Check if meeting already has an organizer. |
2287 | 2287 | foreach ($recipients as $key => $recipient) { |
2288 | - if (isset($recipient[PR_RECIPIENT_FLAGS]) && $recipient[PR_RECIPIENT_FLAGS] == (recipSendable | recipOrganizer)) { |
|
2288 | + if (isset($recipient[PR_RECIPIENT_FLAGS]) && $recipient[PR_RECIPIENT_FLAGS] == (recipSendable|recipOrganizer)) { |
|
2289 | 2289 | $hasOrganizer = true; |
2290 | 2290 | } |
2291 | 2291 | elseif ($isException && !isset($recipient[PR_RECIPIENT_FLAGS])) { |
2292 | 2292 | // Recipients for an occurrence |
2293 | - $recipients[$key][PR_RECIPIENT_FLAGS] = recipSendable | recipExceptionalResponse; |
|
2293 | + $recipients[$key][PR_RECIPIENT_FLAGS] = recipSendable|recipExceptionalResponse; |
|
2294 | 2294 | } |
2295 | 2295 | } |
2296 | 2296 | |
@@ -2304,7 +2304,7 @@ discard block |
||
2304 | 2304 | $organizer[PR_RECIPIENT_DISPLAY_NAME] = $messageProps[PR_SENT_REPRESENTING_NAME]; |
2305 | 2305 | $organizer[PR_ADDRTYPE] = empty($messageProps[PR_SENT_REPRESENTING_ADDRTYPE]) ? 'SMTP' : $messageProps[PR_SENT_REPRESENTING_ADDRTYPE]; |
2306 | 2306 | $organizer[PR_RECIPIENT_TRACKSTATUS] = olRecipientTrackStatusNone; |
2307 | - $organizer[PR_RECIPIENT_FLAGS] = recipSendable | recipOrganizer; |
|
2307 | + $organizer[PR_RECIPIENT_FLAGS] = recipSendable|recipOrganizer; |
|
2308 | 2308 | $organizer[PR_SEARCH_KEY] = $messageProps[PR_SENT_REPRESENTING_SEARCH_KEY]; |
2309 | 2309 | |
2310 | 2310 | // Add organizer to recipients list. |
@@ -2400,7 +2400,7 @@ discard block |
||
2400 | 2400 | continue; |
2401 | 2401 | } |
2402 | 2402 | |
2403 | - $attachOld = mapi_message_openattach($copyFrom, (int) $attachProps[PR_ATTACH_NUM]); |
|
2403 | + $attachOld = mapi_message_openattach($copyFrom, (int)$attachProps[PR_ATTACH_NUM]); |
|
2404 | 2404 | $attachNewResourceMsg = mapi_message_createattach($copyTo); |
2405 | 2405 | mapi_copyto($attachOld, [], [], $attachNewResourceMsg, 0); |
2406 | 2406 | mapi_savechanges($attachNewResourceMsg); |
@@ -2491,7 +2491,7 @@ discard block |
||
2491 | 2491 | [ |
2492 | 2492 | RES_PROPERTY, |
2493 | 2493 | [ |
2494 | - RELOP => RELOP_EQ, // Equals recipient type 3: Resource |
|
2494 | + RELOP => RELOP_EQ, // Equals recipient type 3: Resource |
|
2495 | 2495 | ULPROPTAG => PR_RECIPIENT_TYPE, |
2496 | 2496 | VALUE => [PR_RECIPIENT_TYPE => MAPI_BCC], |
2497 | 2497 | ], |
@@ -2773,7 +2773,7 @@ discard block |
||
2773 | 2773 | [ |
2774 | 2774 | RES_PROPERTY, |
2775 | 2775 | [ |
2776 | - RELOP => RELOP_EQ, // Equals recipient type 3: Resource |
|
2776 | + RELOP => RELOP_EQ, // Equals recipient type 3: Resource |
|
2777 | 2777 | ULPROPTAG => PR_RECIPIENT_TYPE, |
2778 | 2778 | VALUE => [PR_RECIPIENT_TYPE => MAPI_BCC], |
2779 | 2779 | ], |
@@ -3005,7 +3005,7 @@ discard block |
||
3005 | 3005 | $restriction[1][] = [ |
3006 | 3006 | RES_PROPERTY, |
3007 | 3007 | [ |
3008 | - RELOP => RELOP_NE, // Does not equal recipient type: MAPI_BCC (Resource) |
|
3008 | + RELOP => RELOP_NE, // Does not equal recipient type: MAPI_BCC (Resource) |
|
3009 | 3009 | ULPROPTAG => PR_RECIPIENT_TYPE, |
3010 | 3010 | VALUE => [PR_RECIPIENT_TYPE => MAPI_BCC], |
3011 | 3011 | ], |
@@ -3102,7 +3102,7 @@ discard block |
||
3102 | 3102 | [ |
3103 | 3103 | RES_PROPERTY, |
3104 | 3104 | [ |
3105 | - RELOP => RELOP_NE, // Does not equal recipient type: MAPI_BCC (Resource) |
|
3105 | + RELOP => RELOP_NE, // Does not equal recipient type: MAPI_BCC (Resource) |
|
3106 | 3106 | ULPROPTAG => PR_RECIPIENT_TYPE, |
3107 | 3107 | VALUE => [PR_RECIPIENT_TYPE => MAPI_BCC], |
3108 | 3108 | ], |
@@ -3209,7 +3209,7 @@ discard block |
||
3209 | 3209 | $newmessageprops[PR_MESSAGE_CLASS] = 'IPM.Schedule.Meeting.Canceled'; |
3210 | 3210 | $newmessageprops[$this->proptags['meetingstatus']] = olMeetingCanceled; // It's a cancel request |
3211 | 3211 | $newmessageprops[$this->proptags['busystatus']] = fbFree; // set the busy status as free |
3212 | - $newmessageprops[PR_IMPORTANCE] = IMPORTANCE_HIGH; // HIGH Importance |
|
3212 | + $newmessageprops[PR_IMPORTANCE] = IMPORTANCE_HIGH; // HIGH Importance |
|
3213 | 3213 | if (isset($newmessageprops[PR_SUBJECT])) { |
3214 | 3214 | $newmessageprops[PR_SUBJECT] = _('Canceled: ') . $newmessageprops[PR_SUBJECT]; |
3215 | 3215 | } |
@@ -3269,12 +3269,12 @@ discard block |
||
3269 | 3269 | |
3270 | 3270 | // [0] => year, [1] => month, [2] => day, [3] => hour, [4] => minutes, [5] => seconds |
3271 | 3271 | // RecurStartDate = year * 512 + month_number * 32 + day_number |
3272 | - $newmessageprops[$this->proptags['start_recur_date']] = (((int) $startDate[0]) * 512) + (((int) $startDate[1]) * 32) + ((int) $startDate[2]); |
|
3272 | + $newmessageprops[$this->proptags['start_recur_date']] = (((int)$startDate[0]) * 512) + (((int)$startDate[1]) * 32) + ((int)$startDate[2]); |
|
3273 | 3273 | // RecurStartTime = hour * 4096 + minutes * 64 + seconds |
3274 | - $newmessageprops[$this->proptags['start_recur_time']] = (((int) $startDate[3]) * 4096) + (((int) $startDate[4]) * 64) + ((int) $startDate[5]); |
|
3274 | + $newmessageprops[$this->proptags['start_recur_time']] = (((int)$startDate[3]) * 4096) + (((int)$startDate[4]) * 64) + ((int)$startDate[5]); |
|
3275 | 3275 | |
3276 | - $newmessageprops[$this->proptags['end_recur_date']] = (((int) $endDate[0]) * 512) + (((int) $endDate[1]) * 32) + ((int) $endDate[2]); |
|
3277 | - $newmessageprops[$this->proptags['end_recur_time']] = (((int) $endDate[3]) * 4096) + (((int) $endDate[4]) * 64) + ((int) $endDate[5]); |
|
3276 | + $newmessageprops[$this->proptags['end_recur_date']] = (((int)$endDate[0]) * 512) + (((int)$endDate[1]) * 32) + ((int)$endDate[2]); |
|
3277 | + $newmessageprops[$this->proptags['end_recur_time']] = (((int)$endDate[3]) * 4096) + (((int)$endDate[4]) * 64) + ((int)$endDate[5]); |
|
3278 | 3278 | } |
3279 | 3279 | } |
3280 | 3280 |
@@ -573,14 +573,14 @@ discard block |
||
573 | 573 | return; |
574 | 574 | } |
575 | 575 | |
576 | - $rdata = pack("CCCCCCV", 0x04, 0x30, 0x04, 0x30, (int) $this->recur["type"], 0x20, (int) $this->recur["subtype"]); |
|
576 | + $rdata = pack("CCCCCCV", 0x04, 0x30, 0x04, 0x30, (int)$this->recur["type"], 0x20, (int)$this->recur["subtype"]); |
|
577 | 577 | |
578 | 578 | $weekstart = 1; // monday |
579 | 579 | $forwardcount = 0; |
580 | 580 | $restocc = 0; |
581 | - $dayofweek = (int) gmdate("w", (int) $this->recur["start"]); // 0 (for Sunday) through 6 (for Saturday) |
|
581 | + $dayofweek = (int)gmdate("w", (int)$this->recur["start"]); // 0 (for Sunday) through 6 (for Saturday) |
|
582 | 582 | |
583 | - $term = (int) $this->recur["type"]; |
|
583 | + $term = (int)$this->recur["type"]; |
|
584 | 584 | |
585 | 585 | switch ($term) { |
586 | 586 | case 0x0A: |
@@ -596,12 +596,12 @@ discard block |
||
596 | 596 | else { |
597 | 597 | // Daily every N days (everyN in minutes) |
598 | 598 | |
599 | - $everyn = ((int) $this->recur["everyn"]) / 1440; |
|
599 | + $everyn = ((int)$this->recur["everyn"]) / 1440; |
|
600 | 600 | |
601 | 601 | // Calc first occ |
602 | - $firstocc = $this->unixDataToRecurData($this->recur["start"]) % ((int) $this->recur["everyn"]); |
|
602 | + $firstocc = $this->unixDataToRecurData($this->recur["start"]) % ((int)$this->recur["everyn"]); |
|
603 | 603 | |
604 | - $rdata .= pack("VVV", $firstocc, (int) $this->recur["everyn"], $this->recur["regen"] ? 1 : 0); |
|
604 | + $rdata .= pack("VVV", $firstocc, (int)$this->recur["everyn"], $this->recur["regen"] ? 1 : 0); |
|
605 | 605 | } |
606 | 606 | |
607 | 607 | break; |
@@ -624,7 +624,7 @@ discard block |
||
624 | 624 | $daycount = 0; |
625 | 625 | $dayskip = -1; |
626 | 626 | for ($j = 0; $j < 7; ++$j) { |
627 | - if (((int) $this->recur["weekdays"]) & (1 << (($dayofweek + $j) % 7))) { |
|
627 | + if (((int)$this->recur["weekdays"]) & (1 << (($dayofweek + $j) % 7))) { |
|
628 | 628 | if ($dayskip == -1) { |
629 | 629 | $dayskip = $j; |
630 | 630 | } |
@@ -643,35 +643,35 @@ discard block |
||
643 | 643 | |
644 | 644 | // Check if the recurrence ends after a number of occurrences, in that case we must calculate the |
645 | 645 | // remaining occurrences based on the start of the recurrence. |
646 | - if (((int) $this->recur["term"]) == 0x22) { |
|
646 | + if (((int)$this->recur["term"]) == 0x22) { |
|
647 | 647 | // $weekskip is the amount of weeks to skip from the startdate before the first occurrence |
648 | 648 | // $forwardcount is the maximum number of week occurrences we can go ahead after the first occurrence that |
649 | 649 | // is still inside the recurrence. We subtract one to make sure that the last week is never forwarded over |
650 | 650 | // (eg when numoccur = 2, and daycount = 1) |
651 | - $forwardcount = floor((int) ($this->recur["numoccur"] - 1) / $daycount); |
|
651 | + $forwardcount = floor((int)($this->recur["numoccur"] - 1) / $daycount); |
|
652 | 652 | |
653 | 653 | // $restocc is the number of occurrences left after $forwardcount whole weeks of occurrences, minus one |
654 | 654 | // for the occurrence on the first day |
655 | - $restocc = ((int) $this->recur["numoccur"]) - ($forwardcount * $daycount) - 1; |
|
655 | + $restocc = ((int)$this->recur["numoccur"]) - ($forwardcount * $daycount) - 1; |
|
656 | 656 | |
657 | 657 | // $forwardcount is now the number of weeks we can go forward and still be inside the recurrence |
658 | - $forwardcount *= (int) $this->recur["everyn"]; |
|
658 | + $forwardcount *= (int)$this->recur["everyn"]; |
|
659 | 659 | } |
660 | 660 | |
661 | 661 | // The real start is start + dayskip + weekskip-1 (since dayskip will already bring us into the next week) |
662 | - $this->recur["start"] = ((int) $this->recur["start"]) + ($dayskip * 24 * 60 * 60) + ($weekskip * (((int) $this->recur["everyn"]) - 1) * 7 * 24 * 60 * 60); |
|
662 | + $this->recur["start"] = ((int)$this->recur["start"]) + ($dayskip * 24 * 60 * 60) + ($weekskip * (((int)$this->recur["everyn"]) - 1) * 7 * 24 * 60 * 60); |
|
663 | 663 | } |
664 | 664 | |
665 | 665 | // Calc first occ |
666 | - $firstocc = ($this->unixDataToRecurData($this->recur["start"])) % (((int) $this->recur["everyn"]) * 7 * 24 * 60); |
|
666 | + $firstocc = ($this->unixDataToRecurData($this->recur["start"])) % (((int)$this->recur["everyn"]) * 7 * 24 * 60); |
|
667 | 667 | |
668 | - $firstocc -= (((int) gmdate("w", (int) $this->recur["start"])) - 1) * 24 * 60; |
|
668 | + $firstocc -= (((int)gmdate("w", (int)$this->recur["start"])) - 1) * 24 * 60; |
|
669 | 669 | |
670 | 670 | if ($this->recur["regen"]) { |
671 | - $rdata .= pack("VVV", $firstocc, (int) $this->recur["everyn"], 1); |
|
671 | + $rdata .= pack("VVV", $firstocc, (int)$this->recur["everyn"], 1); |
|
672 | 672 | } |
673 | 673 | else { |
674 | - $rdata .= pack("VVVV", $firstocc, (int) $this->recur["everyn"], 0, (int) $this->recur["weekdays"]); |
|
674 | + $rdata .= pack("VVVV", $firstocc, (int)$this->recur["everyn"], 0, (int)$this->recur["weekdays"]); |
|
675 | 675 | } |
676 | 676 | |
677 | 677 | break; |
@@ -688,31 +688,31 @@ discard block |
||
688 | 688 | } |
689 | 689 | |
690 | 690 | if ($term == 0x0C /* monthly */) { |
691 | - $everyn = (int) $this->recur["everyn"]; |
|
691 | + $everyn = (int)$this->recur["everyn"]; |
|
692 | 692 | } |
693 | 693 | else { |
694 | - $everyn = $this->recur["regen"] ? ((int) $this->recur["everyn"]) * 12 : 12; |
|
694 | + $everyn = $this->recur["regen"] ? ((int)$this->recur["everyn"]) * 12 : 12; |
|
695 | 695 | } |
696 | 696 | |
697 | 697 | // Get montday/month/year of original start |
698 | - $curmonthday = gmdate("j", (int) $this->recur["start"]); |
|
699 | - $curyear = gmdate("Y", (int) $this->recur["start"]); |
|
700 | - $curmonth = gmdate("n", (int) $this->recur["start"]); |
|
698 | + $curmonthday = gmdate("j", (int)$this->recur["start"]); |
|
699 | + $curyear = gmdate("Y", (int)$this->recur["start"]); |
|
700 | + $curmonth = gmdate("n", (int)$this->recur["start"]); |
|
701 | 701 | |
702 | 702 | // Check if the recurrence ends after a number of occurrences, in that case we must calculate the |
703 | 703 | // remaining occurrences based on the start of the recurrence. |
704 | - if (((int) $this->recur["term"]) == 0x22) { |
|
704 | + if (((int)$this->recur["term"]) == 0x22) { |
|
705 | 705 | // $forwardcount is the number of occurrences we can skip and still be inside the recurrence range (minus |
706 | 706 | // one to make sure there are always at least one occurrence left) |
707 | - $forwardcount = ((((int) $this->recur["numoccur"]) - 1) * $everyn); |
|
707 | + $forwardcount = ((((int)$this->recur["numoccur"]) - 1) * $everyn); |
|
708 | 708 | } |
709 | 709 | |
710 | 710 | // Get month for yearly on D'th day of month M |
711 | 711 | if ($term == 0x0D /* yearly */) { |
712 | - $selmonth = floor(((int) $this->recur["month"]) / (24 * 60 * 29)) + 1; // 1=jan, 2=feb, eg |
|
712 | + $selmonth = floor(((int)$this->recur["month"]) / (24 * 60 * 29)) + 1; // 1=jan, 2=feb, eg |
|
713 | 713 | } |
714 | 714 | |
715 | - switch ((int) $this->recur["subtype"]) { |
|
715 | + switch ((int)$this->recur["subtype"]) { |
|
716 | 716 | // on D day of every M month |
717 | 717 | case 2: |
718 | 718 | if (!isset($this->recur["monthday"])) { |
@@ -725,11 +725,11 @@ discard block |
||
725 | 725 | // Go the beginning of the month |
726 | 726 | $this->recur["start"] -= ($curmonthday - 1) * 24 * 60 * 60; |
727 | 727 | // Go the the correct month day |
728 | - $this->recur["start"] += (((int) $this->recur["monthday"]) - 1) * 24 * 60 * 60; |
|
728 | + $this->recur["start"] += (((int)$this->recur["monthday"]) - 1) * 24 * 60 * 60; |
|
729 | 729 | |
730 | 730 | // If the previous calculation gave us a start date different than the original start date, then we need to skip to the first occurrence |
731 | - if (($term == 0x0C /* monthly */ && ((int) $this->recur["monthday"]) < $curmonthday) || |
|
732 | - ($term == 0x0D /* yearly */ && ($selmonth != $curmonth || ($selmonth == $curmonth && ((int) $this->recur["monthday"]) < $curmonthday)))) { |
|
731 | + if (($term == 0x0C /* monthly */ && ((int)$this->recur["monthday"]) < $curmonthday) || |
|
732 | + ($term == 0x0D /* yearly */ && ($selmonth != $curmonth || ($selmonth == $curmonth && ((int)$this->recur["monthday"]) < $curmonthday)))) { |
|
733 | 733 | if ($term == 0x0D /* yearly */) { |
734 | 734 | if ($curmonth > $selmonth) {// go to next occurrence in 'everyn' months minus difference in first occurrence and original date |
735 | 735 | $count = $everyn - ($curmonth - $selmonth); |
@@ -739,7 +739,7 @@ discard block |
||
739 | 739 | } |
740 | 740 | else { |
741 | 741 | // Go to next occurrence while recurrence start date is greater than occurrence date but within same month |
742 | - if (((int) $this->recur["monthday"]) < $curmonthday) { |
|
742 | + if (((int)$this->recur["monthday"]) < $curmonthday) { |
|
743 | 743 | $count = $everyn; |
744 | 744 | } |
745 | 745 | } |
@@ -765,33 +765,33 @@ discard block |
||
765 | 765 | // of each month will overshoot in february (29 days). We compensate for that by checking |
766 | 766 | // if the day of the month we got is wrong, and then back up to the last day of the previous |
767 | 767 | // month. |
768 | - if (((int) $this->recur["monthday"]) >= 28 && ((int) $this->recur["monthday"]) <= 31 && |
|
769 | - gmdate("j", ((int) $this->recur["start"])) < ((int) $this->recur["monthday"])) { |
|
770 | - $this->recur["start"] -= gmdate("j", ((int) $this->recur["start"])) * 24 * 60 * 60; |
|
768 | + if (((int)$this->recur["monthday"]) >= 28 && ((int)$this->recur["monthday"]) <= 31 && |
|
769 | + gmdate("j", ((int)$this->recur["start"])) < ((int)$this->recur["monthday"])) { |
|
770 | + $this->recur["start"] -= gmdate("j", ((int)$this->recur["start"])) * 24 * 60 * 60; |
|
771 | 771 | } |
772 | 772 | |
773 | 773 | // "start" is now the first occurrence |
774 | 774 | |
775 | 775 | if ($term == 0x0C /* monthly */) { |
776 | 776 | // Calc first occ |
777 | - $monthIndex = ((((12 % $everyn) * ((((int) gmdate("Y", $this->recur["start"])) - 1601) % $everyn)) % $everyn) + (((int) gmdate("n", $this->recur["start"])) - 1)) % $everyn; |
|
777 | + $monthIndex = ((((12 % $everyn) * ((((int)gmdate("Y", $this->recur["start"])) - 1601) % $everyn)) % $everyn) + (((int)gmdate("n", $this->recur["start"])) - 1)) % $everyn; |
|
778 | 778 | |
779 | 779 | $firstocc = 0; |
780 | 780 | for ($i = 0; $i < $monthIndex; ++$i) { |
781 | 781 | $firstocc += $this->getMonthInSeconds(1601 + floor($i / 12), ($i % 12) + 1) / 60; |
782 | 782 | } |
783 | 783 | |
784 | - $rdata .= pack("VVVV", $firstocc, $everyn, $this->recur["regen"], (int) $this->recur["monthday"]); |
|
784 | + $rdata .= pack("VVVV", $firstocc, $everyn, $this->recur["regen"], (int)$this->recur["monthday"]); |
|
785 | 785 | } |
786 | 786 | else { |
787 | 787 | // Calc first occ |
788 | 788 | $firstocc = 0; |
789 | - $monthIndex = (int) gmdate("n", $this->recur["start"]); |
|
789 | + $monthIndex = (int)gmdate("n", $this->recur["start"]); |
|
790 | 790 | for ($i = 1; $i < $monthIndex; ++$i) { |
791 | 791 | $firstocc += $this->getMonthInSeconds(1601 + floor($i / 12), $i) / 60; |
792 | 792 | } |
793 | 793 | |
794 | - $rdata .= pack("VVVV", $firstocc, $everyn, $this->recur["regen"], (int) $this->recur["monthday"]); |
|
794 | + $rdata .= pack("VVVV", $firstocc, $everyn, $this->recur["regen"], (int)$this->recur["monthday"]); |
|
795 | 795 | } |
796 | 796 | |
797 | 797 | break; |
@@ -803,11 +803,11 @@ discard block |
||
803 | 803 | return; |
804 | 804 | } |
805 | 805 | |
806 | - $weekdays = (int) $this->recur["weekdays"]; |
|
807 | - $nday = (int) $this->recur["nday"]; |
|
806 | + $weekdays = (int)$this->recur["weekdays"]; |
|
807 | + $nday = (int)$this->recur["nday"]; |
|
808 | 808 | |
809 | 809 | // Calc startdate |
810 | - $monthbegindow = (int) $this->recur["start"]; |
|
810 | + $monthbegindow = (int)$this->recur["start"]; |
|
811 | 811 | |
812 | 812 | if ($nday == 5) { |
813 | 813 | // Set date on the last day of the last month |
@@ -842,12 +842,12 @@ discard block |
||
842 | 842 | |
843 | 843 | $dayofweek = gmdate("w", $monthbegindow); |
844 | 844 | for ($i = 0; $i < 7; ++$i) { |
845 | - if ($nday == 5 && (($dayofweek - $i) % 7 >= 0) && (1 << (($dayofweek - $i) % 7)) & $weekdays) { |
|
845 | + if ($nday == 5 && (($dayofweek - $i) % 7 >= 0) && (1 << (($dayofweek - $i) % 7))&$weekdays) { |
|
846 | 846 | $day = gmdate("j", $monthbegindow) - $i; |
847 | 847 | |
848 | 848 | break; |
849 | 849 | } |
850 | - if ($nday != 5 && (1 << (($dayofweek + $i) % 7)) & $weekdays) { |
|
850 | + if ($nday != 5 && (1 << (($dayofweek + $i) % 7))&$weekdays) { |
|
851 | 851 | $day = (($nday - 1) * 7) + ($i + 1); |
852 | 852 | |
853 | 853 | break; |
@@ -855,7 +855,7 @@ discard block |
||
855 | 855 | } |
856 | 856 | |
857 | 857 | // Goto the next X month |
858 | - if (isset($day) && ($day < gmdate("j", (int) $this->recur["start"]))) { |
|
858 | + if (isset($day) && ($day < gmdate("j", (int)$this->recur["start"]))) { |
|
859 | 859 | if ($nday == 5) { |
860 | 860 | $monthbegindow += 24 * 60 * 60; |
861 | 861 | if ($curmonth == 12) { |
@@ -887,12 +887,12 @@ discard block |
||
887 | 887 | // Set start on the right day |
888 | 888 | $dayofweek = gmdate("w", $monthbegindow); |
889 | 889 | for ($i = 0; $i < 7; ++$i) { |
890 | - if ($nday == 5 && (($dayofweek - $i) % 7) >= 0 && (1 << (($dayofweek - $i) % 7)) & $weekdays) { |
|
890 | + if ($nday == 5 && (($dayofweek - $i) % 7) >= 0 && (1 << (($dayofweek - $i) % 7))&$weekdays) { |
|
891 | 891 | $day = $i; |
892 | 892 | |
893 | 893 | break; |
894 | 894 | } |
895 | - if ($nday != 5 && (1 << (($dayofweek + $i) % 7)) & $weekdays) { |
|
895 | + if ($nday != 5 && (1 << (($dayofweek + $i) % 7))&$weekdays) { |
|
896 | 896 | $day = ($nday - 1) * 7 + ($i + 1); |
897 | 897 | |
898 | 898 | break; |
@@ -909,7 +909,7 @@ discard block |
||
909 | 909 | |
910 | 910 | if ($term == 0x0C /* monthly */) { |
911 | 911 | // Calc first occ |
912 | - $monthIndex = ((((12 % $everyn) * (((int) gmdate("Y", $this->recur["start"]) - 1601) % $everyn)) % $everyn) + (((int) gmdate("n", $this->recur["start"])) - 1)) % $everyn; |
|
912 | + $monthIndex = ((((12 % $everyn) * (((int)gmdate("Y", $this->recur["start"]) - 1601) % $everyn)) % $everyn) + (((int)gmdate("n", $this->recur["start"])) - 1)) % $everyn; |
|
913 | 913 | |
914 | 914 | for ($i = 0; $i < $monthIndex; ++$i) { |
915 | 915 | $firstocc += $this->getMonthInSeconds(1601 + floor($i / 12), ($i % 12) + 1) / 60; |
@@ -919,7 +919,7 @@ discard block |
||
919 | 919 | } |
920 | 920 | else { |
921 | 921 | // Calc first occ |
922 | - $monthIndex = (int) gmdate("n", $this->recur["start"]); |
|
922 | + $monthIndex = (int)gmdate("n", $this->recur["start"]); |
|
923 | 923 | |
924 | 924 | for ($i = 1; $i < $monthIndex; ++$i) { |
925 | 925 | $firstocc += $this->getMonthInSeconds(1601 + floor($i / 12), $i) / 60; |
@@ -939,7 +939,7 @@ discard block |
||
939 | 939 | } |
940 | 940 | |
941 | 941 | // Terminate |
942 | - $term = (int) $this->recur["term"]; |
|
942 | + $term = (int)$this->recur["term"]; |
|
943 | 943 | $rdata .= pack("CCCC", $term, 0x20, 0x00, 0x00); |
944 | 944 | |
945 | 945 | switch ($term) { |
@@ -954,7 +954,7 @@ discard block |
||
954 | 954 | return; |
955 | 955 | } |
956 | 956 | |
957 | - $rdata .= pack("V", (int) $this->recur["numoccur"]); |
|
957 | + $rdata .= pack("V", (int)$this->recur["numoccur"]); |
|
958 | 958 | |
959 | 959 | break; |
960 | 960 | // Never ends |
@@ -965,7 +965,7 @@ discard block |
||
965 | 965 | } |
966 | 966 | |
967 | 967 | // Strange little thing for the recurrence type "every workday" |
968 | - if (((int) $this->recur["type"]) == 0x0B && ((int) $this->recur["subtype"]) == 1) { |
|
968 | + if (((int)$this->recur["type"]) == 0x0B && ((int)$this->recur["subtype"]) == 1) { |
|
969 | 969 | $rdata .= pack("V", 1); |
970 | 970 | } |
971 | 971 | else { // Other recurrences |
@@ -1009,25 +1009,25 @@ discard block |
||
1009 | 1009 | } |
1010 | 1010 | |
1011 | 1011 | // Set start date |
1012 | - $rdata .= pack("V", $this->unixDataToRecurData((int) $this->recur["start"])); |
|
1012 | + $rdata .= pack("V", $this->unixDataToRecurData((int)$this->recur["start"])); |
|
1013 | 1013 | |
1014 | 1014 | // Set enddate |
1015 | 1015 | switch ($term) { |
1016 | 1016 | // After the given enddate |
1017 | 1017 | case 0x21: |
1018 | - $rdata .= pack("V", $this->unixDataToRecurData((int) $this->recur["end"])); |
|
1018 | + $rdata .= pack("V", $this->unixDataToRecurData((int)$this->recur["end"])); |
|
1019 | 1019 | |
1020 | 1020 | break; |
1021 | 1021 | // After a number of times |
1022 | 1022 | case 0x22: |
1023 | 1023 | // @todo: calculate enddate with intval($this->recur["startocc"]) + intval($this->recur["duration"]) > 24 hour |
1024 | - $occenddate = (int) $this->recur["start"]; |
|
1024 | + $occenddate = (int)$this->recur["start"]; |
|
1025 | 1025 | |
1026 | - switch ((int) $this->recur["type"]) { |
|
1026 | + switch ((int)$this->recur["type"]) { |
|
1027 | 1027 | case 0x0A: // daily |
1028 | 1028 | if ($this->recur["subtype"] == 1) { |
1029 | 1029 | // Daily every workday |
1030 | - $restocc = (int) $this->recur["numoccur"]; |
|
1030 | + $restocc = (int)$this->recur["numoccur"]; |
|
1031 | 1031 | |
1032 | 1032 | // Get starting weekday |
1033 | 1033 | $nowtime = $this->gmtime($occenddate); |
@@ -1049,7 +1049,7 @@ discard block |
||
1049 | 1049 | } |
1050 | 1050 | else { |
1051 | 1051 | // -1 because the first day already counts (from 1-1-1980 to 1-1-1980 is 1 occurrence) |
1052 | - $occenddate += (((int) $this->recur["everyn"]) * 60 * (((int) $this->recur["numoccur"] - 1))); |
|
1052 | + $occenddate += (((int)$this->recur["everyn"]) * 60 * (((int)$this->recur["numoccur"] - 1))); |
|
1053 | 1053 | } |
1054 | 1054 | |
1055 | 1055 | break; |
@@ -1068,11 +1068,11 @@ discard block |
||
1068 | 1068 | for ($j = 1; $restocc > 0; ++$j) { |
1069 | 1069 | // Jump to the next week (which may be N weeks away) when going over the week boundary |
1070 | 1070 | if ((($dayofweek + $j) % 7) == $weekstart) { |
1071 | - $occenddate += (((int) $this->recur["everyn"]) - 1) * 7 * 24 * 60 * 60; |
|
1071 | + $occenddate += (((int)$this->recur["everyn"]) - 1) * 7 * 24 * 60 * 60; |
|
1072 | 1072 | } |
1073 | 1073 | |
1074 | 1074 | // If this is a matching day, once less occurrence to process |
1075 | - if (((int) $this->recur["weekdays"]) & (1 << (($dayofweek + $j) % 7))) { |
|
1075 | + if (((int)$this->recur["weekdays"]) & (1 << (($dayofweek + $j) % 7))) { |
|
1076 | 1076 | --$restocc; |
1077 | 1077 | } |
1078 | 1078 | |
@@ -1084,11 +1084,11 @@ discard block |
||
1084 | 1084 | |
1085 | 1085 | case 0x0C: // monthly |
1086 | 1086 | case 0x0D: // yearly |
1087 | - $curyear = gmdate("Y", (int) $this->recur["start"]); |
|
1088 | - $curmonth = gmdate("n", (int) $this->recur["start"]); |
|
1087 | + $curyear = gmdate("Y", (int)$this->recur["start"]); |
|
1088 | + $curmonth = gmdate("n", (int)$this->recur["start"]); |
|
1089 | 1089 | // $forwardcount = months |
1090 | 1090 | |
1091 | - switch ((int) $this->recur["subtype"]) { |
|
1091 | + switch ((int)$this->recur["subtype"]) { |
|
1092 | 1092 | case 2: // on D day of every M month |
1093 | 1093 | while ($forwardcount > 0) { |
1094 | 1094 | $occenddate += $this->getMonthInSeconds($curyear, $curmonth); |
@@ -1104,8 +1104,8 @@ discard block |
||
1104 | 1104 | } |
1105 | 1105 | |
1106 | 1106 | // compensation between 28 and 31 |
1107 | - if (((int) $this->recur["monthday"]) >= 28 && ((int) $this->recur["monthday"]) <= 31 && |
|
1108 | - gmdate("j", $occenddate) < ((int) $this->recur["monthday"])) { |
|
1107 | + if (((int)$this->recur["monthday"]) >= 28 && ((int)$this->recur["monthday"]) <= 31 && |
|
1108 | + gmdate("j", $occenddate) < ((int)$this->recur["monthday"])) { |
|
1109 | 1109 | if (gmdate("j", $occenddate) < 28) { |
1110 | 1110 | $occenddate -= gmdate("j", $occenddate) * 24 * 60 * 60; |
1111 | 1111 | } |
@@ -1117,8 +1117,8 @@ discard block |
||
1117 | 1117 | break; |
1118 | 1118 | |
1119 | 1119 | case 3: // on Nth weekday of every M month |
1120 | - $nday = (int) $this->recur["nday"]; // 1 tot 5 |
|
1121 | - $weekdays = (int) $this->recur["weekdays"]; |
|
1120 | + $nday = (int)$this->recur["nday"]; // 1 tot 5 |
|
1121 | + $weekdays = (int)$this->recur["weekdays"]; |
|
1122 | 1122 | |
1123 | 1123 | while ($forwardcount > 0) { |
1124 | 1124 | $occenddate += $this->getMonthInSeconds($curyear, $curmonth); |
@@ -1144,12 +1144,12 @@ discard block |
||
1144 | 1144 | |
1145 | 1145 | $dayofweek = gmdate("w", $occenddate); |
1146 | 1146 | for ($i = 0; $i < 7; ++$i) { |
1147 | - if ($nday == 5 && (($dayofweek - $i) % 7) >= 0 && (1 << (($dayofweek - $i) % 7)) & $weekdays) { |
|
1147 | + if ($nday == 5 && (($dayofweek - $i) % 7) >= 0 && (1 << (($dayofweek - $i) % 7))&$weekdays) { |
|
1148 | 1148 | $occenddate -= $i * 24 * 60 * 60; |
1149 | 1149 | |
1150 | 1150 | break; |
1151 | 1151 | } |
1152 | - if ($nday != 5 && (1 << (($dayofweek + $i) % 7)) & $weekdays) { |
|
1152 | + if ($nday != 5 && (1 << (($dayofweek + $i) % 7))&$weekdays) { |
|
1153 | 1153 | $occenddate += ($i + (($nday - 1) * 7)) * 24 * 60 * 60; |
1154 | 1154 | |
1155 | 1155 | break; |
@@ -1168,7 +1168,7 @@ discard block |
||
1168 | 1168 | |
1169 | 1169 | $this->recur["end"] = $occenddate; |
1170 | 1170 | |
1171 | - $rdata .= pack("V", $this->unixDataToRecurData((int) $this->recur["end"])); |
|
1171 | + $rdata .= pack("V", $this->unixDataToRecurData((int)$this->recur["end"])); |
|
1172 | 1172 | |
1173 | 1173 | break; |
1174 | 1174 | // Never ends |
@@ -1181,12 +1181,12 @@ discard block |
||
1181 | 1181 | } |
1182 | 1182 | |
1183 | 1183 | // UTC date |
1184 | - $utcstart = $this->toGMT($this->tz, (int) $this->recur["start"]); |
|
1185 | - $utcend = $this->toGMT($this->tz, (int) $this->recur["end"]); |
|
1184 | + $utcstart = $this->toGMT($this->tz, (int)$this->recur["start"]); |
|
1185 | + $utcend = $this->toGMT($this->tz, (int)$this->recur["end"]); |
|
1186 | 1186 | |
1187 | 1187 | // utc date+time |
1188 | - $utcfirstoccstartdatetime = (isset($this->recur["startocc"])) ? $utcstart + (((int) $this->recur["startocc"]) * 60) : $utcstart; |
|
1189 | - $utcfirstoccenddatetime = (isset($this->recur["endocc"])) ? $utcstart + (((int) $this->recur["endocc"]) * 60) : $utcstart; |
|
1188 | + $utcfirstoccstartdatetime = (isset($this->recur["startocc"])) ? $utcstart + (((int)$this->recur["startocc"]) * 60) : $utcstart; |
|
1189 | + $utcfirstoccenddatetime = (isset($this->recur["endocc"])) ? $utcstart + (((int)$this->recur["endocc"]) * 60) : $utcstart; |
|
1190 | 1190 | |
1191 | 1191 | $propsToSet = []; |
1192 | 1192 | // update reminder time |
@@ -1204,7 +1204,7 @@ discard block |
||
1204 | 1204 | |
1205 | 1205 | // recurrencetype |
1206 | 1206 | // Strange enough is the property recurrencetype, (type-0x9) and not the CDO recurrencetype |
1207 | - $propsToSet[$this->proptags["recurrencetype"]] = ((int) $this->recur["type"]) - 0x9; |
|
1207 | + $propsToSet[$this->proptags["recurrencetype"]] = ((int)$this->recur["type"]) - 0x9; |
|
1208 | 1208 | |
1209 | 1209 | // set named prop 'side_effects' to 369, needed for Outlook to ask for single or total recurrence when deleting |
1210 | 1210 | $propsToSet[$this->proptags["side_effects"]] = 369; |
@@ -1253,7 +1253,7 @@ discard block |
||
1253 | 1253 | |
1254 | 1254 | if (isset($this->recur["startocc"], $this->recur["endocc"])) { |
1255 | 1255 | // Set start and endtime in minutes |
1256 | - $rdata .= pack("VV", (int) $this->recur["startocc"], (int) $this->recur["endocc"]); |
|
1256 | + $rdata .= pack("VV", (int)$this->recur["startocc"], (int)$this->recur["endocc"]); |
|
1257 | 1257 | } |
1258 | 1258 | |
1259 | 1259 | // Detailed exception data |
@@ -1918,7 +1918,7 @@ discard block |
||
1918 | 1918 | } |
1919 | 1919 | elseif ($this->recur['regen']) { |
1920 | 1920 | $year_starttime = $this->gmtime($now); |
1921 | - $is_next_leapyear = $this->isLeapYear($year_starttime['tm_year'] + 1900 + 1); // +1 next year |
|
1921 | + $is_next_leapyear = $this->isLeapYear($year_starttime['tm_year'] + 1900 + 1); // +1 next year |
|
1922 | 1922 | $now = $daystart + ($is_next_leapyear ? 31622400 /* Leap year in seconds */ : 31536000 /* year in seconds */); |
1923 | 1923 | |
1924 | 1924 | if ($now <= $dayend) { |
@@ -54,7 +54,7 @@ |
||
54 | 54 | // assign display message |
55 | 55 | $this->displayMessage = $displayMessage; |
56 | 56 | |
57 | - parent::__construct($errorMessage, (int) $code, $previous); |
|
57 | + parent::__construct($errorMessage, (int)$code, $previous); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
@@ -284,7 +284,7 @@ |
||
284 | 284 | $attachments = mapi_table_queryallrows($attachmentTable, [PR_ATTACH_NUM, PR_ATTACH_SIZE, PR_ATTACH_LONG_FILENAME, PR_ATTACHMENT_HIDDEN, PR_DISPLAY_NAME, PR_ATTACH_METHOD]); |
285 | 285 | |
286 | 286 | foreach ($attachments as $attach_props) { |
287 | - $attach_old = mapi_message_openattach($this->message, (int) $attach_props[PR_ATTACH_NUM]); |
|
287 | + $attach_old = mapi_message_openattach($this->message, (int)$attach_props[PR_ATTACH_NUM]); |
|
288 | 288 | $attach_newResourceMsg = mapi_message_createattach($newMessage); |
289 | 289 | |
290 | 290 | mapi_copyto($attach_old, [], [], $attach_newResourceMsg, 0); |