@@ -44,8 +44,7 @@ |
||
44 | 44 | |
45 | 45 | try { |
46 | 46 | return mapi_msgstore_openentry($store, $localFreeBusyEntryids[self::DELEGATE_PROPERTIES]); |
47 | - } |
|
48 | - catch (MAPIException $e) { |
|
47 | + } catch (MAPIException $e) { |
|
49 | 48 | // Either user store have malformed entryid in PR_FREEBUSY_ENTRYIDS or |
50 | 49 | // No message found of given entryid in 'Freebusy Data' folder. |
51 | 50 | if ($e->getCode() == MAPI_E_NOT_FOUND || $e->getCode() == MAPI_E_INVALID_ENTRYID) { |
@@ -24,12 +24,12 @@ discard block |
||
24 | 24 | * carried in the IPM.TaskRequest item (although this information seems |
25 | 25 | * redundant due to that information already being available in PR_MESSAGE_CLASS). |
26 | 26 | */ |
27 | -define('tdmtNothing', 0); // Value in IPM.Task items |
|
28 | -define('tdmtTaskReq', 1); // Assigner -> Assignee |
|
29 | -define('tdmtTaskAcc', 2); // Assignee -> Assigner |
|
30 | -define('tdmtTaskDec', 3); // Assignee -> Assigner |
|
31 | -define('tdmtTaskUpd', 4); // Assignee -> Assigner |
|
32 | -define('tdmtTaskSELF', 5); // Assigner -> Assigner (?) |
|
27 | +define('tdmtNothing', 0); // Value in IPM.Task items |
|
28 | +define('tdmtTaskReq', 1); // Assigner -> Assignee |
|
29 | +define('tdmtTaskAcc', 2); // Assignee -> Assigner |
|
30 | +define('tdmtTaskDec', 3); // Assignee -> Assigner |
|
31 | +define('tdmtTaskUpd', 4); // Assignee -> Assigner |
|
32 | +define('tdmtTaskSELF', 5); // Assigner -> Assigner (?) |
|
33 | 33 | |
34 | 34 | /* The TaskHistory is used to show the last action on the task |
35 | 35 | * on both the assigner and the assignee's side. |
@@ -39,22 +39,22 @@ discard block |
||
39 | 39 | * the format 'Accepted by <user> on 01-01-2010 11:00'. |
40 | 40 | */ |
41 | 41 | define('thNone', 0); |
42 | -define('thAccepted', 1); // Set by assignee |
|
43 | -define('thDeclined', 2); // Set by assignee |
|
44 | -define('thUpdated', 3); // Set by assignee |
|
42 | +define('thAccepted', 1); // Set by assignee |
|
43 | +define('thDeclined', 2); // Set by assignee |
|
44 | +define('thUpdated', 3); // Set by assignee |
|
45 | 45 | define('thDueDateChanged', 4); |
46 | -define('thAssigned', 5); // Set by assigner |
|
46 | +define('thAssigned', 5); // Set by assigner |
|
47 | 47 | |
48 | 48 | /* The TaskState value is used to differentiate the version of a task |
49 | 49 | * in the assigner's folder and the version in the |
50 | 50 | * assignee's folder. The buttons shown depend on this and |
51 | 51 | * the 'taskaccepted' boolean (for the assignee) |
52 | 52 | */ |
53 | -define('tdsNOM', 0); // Got a response to a deleted task, and re-created the task for the assigner |
|
54 | -define('tdsOWNNEW', 1); // Not assigned |
|
55 | -define('tdsOWN', 2); // Assignee version |
|
56 | -define('tdsACC', 3); // Assigner version |
|
57 | -define('tdsDEC', 4); // Assigner version, but assignee declined |
|
53 | +define('tdsNOM', 0); // Got a response to a deleted task, and re-created the task for the assigner |
|
54 | +define('tdsOWNNEW', 1); // Not assigned |
|
55 | +define('tdsOWN', 2); // Assignee version |
|
56 | +define('tdsACC', 3); // Assigner version |
|
57 | +define('tdsDEC', 4); // Assigner version, but assignee declined |
|
58 | 58 | |
59 | 59 | /* The TaskAcceptanceState is used for the assigner to indicate state */ |
60 | 60 | define('olTaskNotDelegated', 0); |
@@ -64,13 +64,13 @@ discard block |
||
64 | 64 | |
65 | 65 | /* The task ownership indicates the role of the current user relative to the task. */ |
66 | 66 | define('olNewTask', 0); |
67 | -define('olDelegatedTask', 1); // Task has been assigned |
|
68 | -define('olOwnTask', 2); // Task owned |
|
67 | +define('olDelegatedTask', 1); // Task has been assigned |
|
68 | +define('olOwnTask', 2); // Task owned |
|
69 | 69 | |
70 | 70 | /* taskmultrecips indicates whether the task request sent or received has multiple assignees or not. */ |
71 | 71 | define('tmrNone', 0); |
72 | -define('tmrSent', 1); // Task has been sent to multiple assignee |
|
73 | -define('tmrReceived', 2); // Task Request received has multiple assignee |
|
72 | +define('tmrSent', 1); // Task has been sent to multiple assignee |
|
73 | +define('tmrReceived', 2); // Task Request received has multiple assignee |
|
74 | 74 | |
75 | 75 | // Task icon index. |
76 | 76 | define('ICON_TASK_ASSIGNEE', 0x00000502); |
@@ -1266,7 +1266,7 @@ discard block |
||
1266 | 1266 | } |
1267 | 1267 | |
1268 | 1268 | foreach ($recips as $recip) { |
1269 | - $recip[PR_RECIPIENT_TYPE] = MAPI_TO; // Change recipient type to MAPI_TO |
|
1269 | + $recip[PR_RECIPIENT_TYPE] = MAPI_TO; // Change recipient type to MAPI_TO |
|
1270 | 1270 | mapi_message_modifyrecipients($outgoing, MODRECIP_ADD, [$recip]); |
1271 | 1271 | } |
1272 | 1272 |
@@ -291,8 +291,7 @@ discard block |
||
291 | 291 | $props = mapi_getprops($this->message, $senderProps); |
292 | 292 | $props[PR_MESSAGE_CLASS] = 'IPM.Task'; |
293 | 293 | mapi_setprops($task, $props); |
294 | - } |
|
295 | - else { |
|
294 | + } else { |
|
296 | 295 | // If there are multiple, just use the first |
297 | 296 | $entryid = $rows[0][PR_ENTRYID]; |
298 | 297 | |
@@ -613,8 +612,7 @@ discard block |
||
613 | 612 | |
614 | 613 | if (isset($messageprops)) { |
615 | 614 | ++$messageprops[$this->props['updatecount']]; |
616 | - } |
|
617 | - else { |
|
615 | + } else { |
|
618 | 616 | $messageprops[$this->props['updatecount']] = 1; |
619 | 617 | } |
620 | 618 | |
@@ -797,8 +795,7 @@ discard block |
||
797 | 795 | $props = mapi_getprops($this->message, [$this->props['taskupdates'], $this->props['tasksoc'], $this->props['recurring'], $this->props['complete']]); |
798 | 796 | if (!$props[$this->props['complete']] && $props[$this->props['taskupdates']] && !(isset($props[$this->props['recurring']]) && $props[$this->props['recurring']])) { |
799 | 797 | $this->sendResponse(tdmtTaskUpd, _("Task Updated:") . " "); |
800 | - } |
|
801 | - elseif ($props[$this->props['complete']]) { |
|
798 | + } elseif ($props[$this->props['complete']]) { |
|
802 | 799 | $this->sendResponse(tdmtTaskUpd, _("Task Completed:") . " "); |
803 | 800 | } |
804 | 801 | |
@@ -821,8 +818,7 @@ discard block |
||
821 | 818 | |
822 | 819 | if (!$ownerentryid) { |
823 | 820 | $store = $this->store; |
824 | - } |
|
825 | - else { |
|
821 | + } else { |
|
826 | 822 | $ab = mapi_openaddressbook($this->session); |
827 | 823 | if (!$ab) { |
828 | 824 | return false; |
@@ -964,8 +960,7 @@ discard block |
||
964 | 960 | mapi_setprops($sub, [PR_ICON_INDEX => ICON_TASK_ASSIGNER]); |
965 | 961 | if ($messageprops[$this->props['complete']]) { |
966 | 962 | $props[PR_MESSAGE_CLASS] = "IPM.TaskRequest.Complete"; |
967 | - } |
|
968 | - else { |
|
963 | + } else { |
|
969 | 964 | $props[PR_MESSAGE_CLASS] = "IPM.TaskRequest.Update"; |
970 | 965 | } |
971 | 966 | |
@@ -1049,8 +1044,7 @@ discard block |
||
1049 | 1044 | try { |
1050 | 1045 | $attach = mapi_message_openattach($this->message, $row[PR_ATTACH_NUM]); |
1051 | 1046 | $task = mapi_attach_openobj($attach); |
1052 | - } |
|
1053 | - catch (MAPIException $e) { |
|
1047 | + } catch (MAPIException $e) { |
|
1054 | 1048 | continue; |
1055 | 1049 | } |
1056 | 1050 |
@@ -1077,7 +1077,7 @@ discard block |
||
1077 | 1077 | else { |
1078 | 1078 | $recip[PR_RECIPIENT_FLAGS] = recipReserved | recipExceptionalDeleted | recipSendable; |
1079 | 1079 | } |
1080 | - $recip[PR_RECIPIENT_TRACKSTATUS] = olResponseNone; // No Response required |
|
1080 | + $recip[PR_RECIPIENT_TRACKSTATUS] = olResponseNone; // No Response required |
|
1081 | 1081 | } |
1082 | 1082 | unset($recip); |
1083 | 1083 | mapi_message_modifyrecipients($exception, MODRECIP_MODIFY, $exception_recips['remove']); |
@@ -1152,7 +1152,7 @@ discard block |
||
1152 | 1152 | else { |
1153 | 1153 | $recipient[PR_RECIPIENT_FLAGS] = recipReserved | recipExceptionalDeleted | recipSendable; |
1154 | 1154 | } |
1155 | - $recipient[PR_RECIPIENT_TRACKSTATUS] = olRecipientTrackStatusNone; // No Response required |
|
1155 | + $recipient[PR_RECIPIENT_TRACKSTATUS] = olRecipientTrackStatusNone; // No Response required |
|
1156 | 1156 | $deletedRecipients[] = $recipient; |
1157 | 1157 | } |
1158 | 1158 | } |
@@ -51,8 +51,7 @@ discard block |
||
51 | 51 | public function __construct($store, $message, $proptags = []) { |
52 | 52 | if (!empty($proptags)) { |
53 | 53 | $this->proptags = $proptags; |
54 | - } |
|
55 | - else { |
|
54 | + } else { |
|
56 | 55 | $properties = []; |
57 | 56 | $properties["entryid"] = PR_ENTRYID; |
58 | 57 | $properties["parent_entryid"] = PR_PARENT_ENTRYID; |
@@ -192,8 +191,7 @@ discard block |
||
192 | 191 | |
193 | 192 | // Add the changed occurrence to the list |
194 | 193 | array_push($this->recur["changed_occurrences"], $changed_item); |
195 | - } |
|
196 | - else { |
|
194 | + } else { |
|
197 | 195 | // Delete the occurrence by placing it in the deleted occurrences list |
198 | 196 | array_push($this->recur["deleted_occurrences"], $baseday); |
199 | 197 | } |
@@ -290,12 +288,10 @@ discard block |
||
290 | 288 | if ($copy_attach_from) { |
291 | 289 | $this->deleteExceptionAttachment($base_date); |
292 | 290 | $this->createException($exception_props, $base_date, false, $exception_recips, $copy_attach_from); |
293 | - } |
|
294 | - else { |
|
291 | + } else { |
|
295 | 292 | $this->createExceptionAttachment($exception_props, $exception_recips, $copy_attach_from); |
296 | 293 | } |
297 | - } |
|
298 | - else { |
|
294 | + } else { |
|
299 | 295 | $message = mapi_attach_openobj($attach, MAPI_MODIFY); |
300 | 296 | |
301 | 297 | // Set exception properties on embedded message and save |
@@ -339,8 +335,7 @@ discard block |
||
339 | 335 | // the exception used to be. |
340 | 336 | $oldexception = $this->getChangeException($basedate); |
341 | 337 | $prevday = $this->dayStartOf($oldexception["start"]); |
342 | - } |
|
343 | - else { |
|
338 | + } else { |
|
344 | 339 | // If its a new exception, we want to look at the original placement of this item. |
345 | 340 | $prevday = $basedate; |
346 | 341 | } |
@@ -350,8 +345,7 @@ discard block |
||
350 | 345 | // Get all the occurrences on the days between the basedate (may be reversed) |
351 | 346 | if ($prevday < $startday) { |
352 | 347 | $items = $this->getItems($this->toGMT($this->tz, $prevday), $this->toGMT($this->tz, $startday + 24 * 60 * 60)); |
353 | - } |
|
354 | - else { |
|
348 | + } else { |
|
355 | 349 | $items = $this->getItems($this->toGMT($this->tz, $startday), $this->toGMT($this->tz, $prevday + 24 * 60 * 60)); |
356 | 350 | } |
357 | 351 | |
@@ -538,12 +532,10 @@ discard block |
||
538 | 532 | if ($everyn == 1) { |
539 | 533 | $type = dgettext('zarafa', 'workday'); |
540 | 534 | $occSingleDayRank = true; |
541 | - } |
|
542 | - elseif ($everyn == (24 * 60)) { |
|
535 | + } elseif ($everyn == (24 * 60)) { |
|
543 | 536 | $type = dgettext('zarafa', 'day'); |
544 | 537 | $occSingleDayRank = true; |
545 | - } |
|
546 | - else { |
|
538 | + } else { |
|
547 | 539 | $everyn /= (24 * 60); |
548 | 540 | $type = dgettext('zarafa', 'days'); |
549 | 541 | $occSingleDayRank = false; |
@@ -554,8 +546,7 @@ discard block |
||
554 | 546 | if ($everyn == 1) { |
555 | 547 | $type = dgettext('zarafa', 'week'); |
556 | 548 | $occSingleDayRank = true; |
557 | - } |
|
558 | - else { |
|
549 | + } else { |
|
559 | 550 | $type = dgettext('zarafa', 'weeks'); |
560 | 551 | $occSingleDayRank = false; |
561 | 552 | } |
@@ -565,8 +556,7 @@ discard block |
||
565 | 556 | if ($everyn == 1) { |
566 | 557 | $type = dgettext('zarafa', 'month'); |
567 | 558 | $occSingleDayRank = true; |
568 | - } |
|
569 | - else { |
|
559 | + } else { |
|
570 | 560 | $type = dgettext('zarafa', 'months'); |
571 | 561 | $occSingleDayRank = false; |
572 | 562 | } |
@@ -577,8 +567,7 @@ discard block |
||
577 | 567 | $everyn = 1; |
578 | 568 | $type = dgettext('zarafa', 'year'); |
579 | 569 | $occSingleDayRank = true; |
580 | - } |
|
581 | - else { |
|
570 | + } else { |
|
582 | 571 | $everyn = $everyn / 12; |
583 | 572 | $type = dgettext('zarafa', 'years'); |
584 | 573 | $occSingleDayRank = false; |
@@ -607,21 +596,17 @@ discard block |
||
607 | 596 | if ($occTimeRange) { |
608 | 597 | if ($occSingleDayRank) { |
609 | 598 | $pattern = sprintf(dgettext('zarafa', 'Occurs every %s effective %s from %s to %s.'), $type, $start, $startocc, $endocc); |
610 | - } |
|
611 | - else { |
|
599 | + } else { |
|
612 | 600 | $pattern = sprintf(dgettext('zarafa', 'Occurs every %s %s effective %s from %s to %s.'), $everyn, $type, $start, $startocc, $endocc); |
613 | 601 | } |
614 | - } |
|
615 | - else { |
|
602 | + } else { |
|
616 | 603 | if ($occSingleDayRank) { |
617 | 604 | $pattern = sprintf(dgettext('zarafa', 'Occurs every %s effective %s.'), $type, $start); |
618 | - } |
|
619 | - else { |
|
605 | + } else { |
|
620 | 606 | $pattern = sprintf(dgettext('zarafa', 'Occurs every %s %s effective %s.'), $everyn, $type, $start); |
621 | 607 | } |
622 | 608 | } |
623 | - } |
|
624 | - elseif ($term == 0x22) { |
|
609 | + } elseif ($term == 0x22) { |
|
625 | 610 | // After a number of times |
626 | 611 | if ($occTimeRange) { |
627 | 612 | if ($occSingleDayRank) { |
@@ -631,8 +616,7 @@ discard block |
||
631 | 616 | 'Occurs every %s effective %s for %s occurrences from %s to %s.', |
632 | 617 | $numocc |
633 | 618 | ), $type, $start, $numocc, $startocc, $endocc); |
634 | - } |
|
635 | - else { |
|
619 | + } else { |
|
636 | 620 | $pattern = sprintf(dngettext( |
637 | 621 | 'zarafa', |
638 | 622 | 'Occurs every %s %s effective %s for %s occurrence from %s to %s.', |
@@ -640,8 +624,7 @@ discard block |
||
640 | 624 | $numocc |
641 | 625 | ), $everyn, $type, $start, $numocc, $startocc, $endocc); |
642 | 626 | } |
643 | - } |
|
644 | - else { |
|
627 | + } else { |
|
645 | 628 | if ($occSingleDayRank) { |
646 | 629 | $pattern = sprintf(dngettext( |
647 | 630 | 'zarafa', |
@@ -649,8 +632,7 @@ discard block |
||
649 | 632 | 'Occurs every %s effective %s for %s occurrences.', |
650 | 633 | $numocc |
651 | 634 | ), $type, $start, $numocc); |
652 | - } |
|
653 | - else { |
|
635 | + } else { |
|
654 | 636 | $pattern = sprintf(dngettext( |
655 | 637 | 'zarafa', |
656 | 638 | 'Occurs every %s %s effective %s for %s occurrence.', |
@@ -659,22 +641,18 @@ discard block |
||
659 | 641 | ), $everyn, $type, $start, $numocc); |
660 | 642 | } |
661 | 643 | } |
662 | - } |
|
663 | - elseif ($term == 0x21) { |
|
644 | + } elseif ($term == 0x21) { |
|
664 | 645 | // After the given enddate |
665 | 646 | if ($occTimeRange) { |
666 | 647 | if ($occSingleDayRank) { |
667 | 648 | $pattern = sprintf(dgettext('zarafa', 'Occurs every %s effective %s until %s from %s to %s.'), $type, $start, $end, $startocc, $endocc); |
668 | - } |
|
669 | - else { |
|
649 | + } else { |
|
670 | 650 | $pattern = sprintf(dgettext('zarafa', 'Occurs every %s %s effective %s until %s from %s to %s.'), $everyn, $type, $start, $end, $startocc, $endocc); |
671 | 651 | } |
672 | - } |
|
673 | - else { |
|
652 | + } else { |
|
674 | 653 | if ($occSingleDayRank) { |
675 | 654 | $pattern = sprintf(dgettext('zarafa', 'Occurs every %s effective %s until %s.'), $type, $start, $end); |
676 | - } |
|
677 | - else { |
|
655 | + } else { |
|
678 | 656 | $pattern = sprintf(dgettext('zarafa', 'Occurs every %s %s effective %s until %s.'), $everyn, $type, $start, $end); |
679 | 657 | } |
680 | 658 | } |
@@ -709,8 +687,7 @@ discard block |
||
709 | 687 | foreach ($this->recur["changed_occurrences"] as $entry) { |
710 | 688 | if (!$this->isSameDay($entry["basedate"], $base_date)) { |
711 | 689 | $new[] = $entry; |
712 | - } |
|
713 | - else { |
|
690 | + } else { |
|
714 | 691 | $this->deleteExceptionAttachment($this->toGMT($this->tz, $base_date + $this->recur["startocc"] * 60)); |
715 | 692 | } |
716 | 693 | } |
@@ -1031,8 +1008,7 @@ discard block |
||
1031 | 1008 | public function setExceptionRecipients($message, $exception_recips, $copy_orig_recips = true): void { |
1032 | 1009 | if (isset($exception_recips['add']) || isset($exception_recips['remove']) || isset($exception_recips['modify'])) { |
1033 | 1010 | $this->setDeltaExceptionRecipients($message, $exception_recips, $copy_orig_recips); |
1034 | - } |
|
1035 | - else { |
|
1011 | + } else { |
|
1036 | 1012 | $this->setAllExceptionRecipients($message, $exception_recips); |
1037 | 1013 | } |
1038 | 1014 | } |
@@ -1073,8 +1049,7 @@ discard block |
||
1073 | 1049 | foreach ($exception_recips['remove'] as &$recip) { |
1074 | 1050 | if (!isset($recip[PR_RECIPIENT_FLAGS]) || $recip[PR_RECIPIENT_FLAGS] != (recipReserved | recipExceptionalDeleted | recipSendable)) { |
1075 | 1051 | $recip[PR_RECIPIENT_FLAGS] = recipSendable | recipExceptionalDeleted; |
1076 | - } |
|
1077 | - else { |
|
1052 | + } else { |
|
1078 | 1053 | $recip[PR_RECIPIENT_FLAGS] = recipReserved | recipExceptionalDeleted | recipSendable; |
1079 | 1054 | } |
1080 | 1055 | $recip[PR_RECIPIENT_TRACKSTATUS] = olResponseNone; // No Response required |
@@ -1148,8 +1123,7 @@ discard block |
||
1148 | 1123 | if (!$foundInDeletedRecipients) { |
1149 | 1124 | if (!isset($recipient[PR_RECIPIENT_FLAGS]) || $recipient[PR_RECIPIENT_FLAGS] != (recipReserved | recipExceptionalDeleted | recipSendable)) { |
1150 | 1125 | $recipient[PR_RECIPIENT_FLAGS] = recipSendable | recipExceptionalDeleted; |
1151 | - } |
|
1152 | - else { |
|
1126 | + } else { |
|
1153 | 1127 | $recipient[PR_RECIPIENT_FLAGS] = recipReserved | recipExceptionalDeleted | recipSendable; |
1154 | 1128 | } |
1155 | 1129 | $recipient[PR_RECIPIENT_TRACKSTATUS] = olRecipientTrackStatusNone; // No Response required |
@@ -1168,8 +1142,7 @@ discard block |
||
1168 | 1142 | } |
1169 | 1143 | } |
1170 | 1144 | $exception_recips = array_merge($exception_recips, $deletedRecipients); |
1171 | - } |
|
1172 | - else { |
|
1145 | + } else { |
|
1173 | 1146 | $exception_recips = $recipientRows; |
1174 | 1147 | } |
1175 | 1148 | |
@@ -1213,8 +1186,7 @@ discard block |
||
1213 | 1186 | foreach ($recipients as $key => $recipient) { |
1214 | 1187 | if (isset($recipient[PR_RECIPIENT_FLAGS]) && $recipient[PR_RECIPIENT_FLAGS] == (recipSendable | recipOrganizer)) { |
1215 | 1188 | $hasOrganizer = true; |
1216 | - } |
|
1217 | - elseif ($isException && !isset($recipient[PR_RECIPIENT_FLAGS])) { |
|
1189 | + } elseif ($isException && !isset($recipient[PR_RECIPIENT_FLAGS])) { |
|
1218 | 1190 | // Recipients for an occurrence |
1219 | 1191 | $recipients[$key][PR_RECIPIENT_FLAGS] = recipSendable | recipExceptionalResponse; |
1220 | 1192 | } |
@@ -16,40 +16,40 @@ discard block |
||
16 | 16 | |
17 | 17 | /* Object type */ |
18 | 18 | |
19 | -define('MAPI_STORE', 0x00000001); /* Message Store */ |
|
20 | -define('MAPI_ADDRBOOK', 0x00000002); /* Address Book */ |
|
21 | -define('MAPI_FOLDER', 0x00000003); /* Folder */ |
|
22 | -define('MAPI_ABCONT', 0x00000004); /* Address Book Container */ |
|
23 | -define('MAPI_MESSAGE', 0x00000005); /* Message */ |
|
24 | -define('MAPI_MAILUSER', 0x00000006); /* Individual Recipient */ |
|
25 | -define('MAPI_ATTACH', 0x00000007); /* Attachment */ |
|
26 | -define('MAPI_DISTLIST', 0x00000008); /* Distribution List Recipient */ |
|
27 | -define('MAPI_PROFSECT', 0x00000009); /* Profile Section */ |
|
28 | -define('MAPI_STATUS', 0x0000000A); /* Status Object */ |
|
29 | -define('MAPI_SESSION', 0x0000000B); /* Session */ |
|
30 | -define('MAPI_FORMINFO', 0x0000000C); /* Form Information */ |
|
19 | +define('MAPI_STORE', 0x00000001); /* Message Store */ |
|
20 | +define('MAPI_ADDRBOOK', 0x00000002); /* Address Book */ |
|
21 | +define('MAPI_FOLDER', 0x00000003); /* Folder */ |
|
22 | +define('MAPI_ABCONT', 0x00000004); /* Address Book Container */ |
|
23 | +define('MAPI_MESSAGE', 0x00000005); /* Message */ |
|
24 | +define('MAPI_MAILUSER', 0x00000006); /* Individual Recipient */ |
|
25 | +define('MAPI_ATTACH', 0x00000007); /* Attachment */ |
|
26 | +define('MAPI_DISTLIST', 0x00000008); /* Distribution List Recipient */ |
|
27 | +define('MAPI_PROFSECT', 0x00000009); /* Profile Section */ |
|
28 | +define('MAPI_STATUS', 0x0000000A); /* Status Object */ |
|
29 | +define('MAPI_SESSION', 0x0000000B); /* Session */ |
|
30 | +define('MAPI_FORMINFO', 0x0000000C); /* Form Information */ |
|
31 | 31 | |
32 | 32 | define('MV_FLAG', 0x1000); |
33 | 33 | define('MV_INSTANCE', 0x2000); |
34 | 34 | define('MVI_FLAG', MV_FLAG | MV_INSTANCE); |
35 | 35 | |
36 | -define('PT_UNSPECIFIED', 0); /* (Reserved for interface use) type doesn't matter to caller */ |
|
37 | -define('PT_NULL', 1); /* NULL property value */ |
|
38 | -define('PT_I2', 2); /* Signed 16-bit value */ |
|
39 | -define('PT_LONG', 3); /* Signed 32-bit value */ |
|
40 | -define('PT_R4', 4); /* 4-byte floating point */ |
|
41 | -define('PT_DOUBLE', 5); /* Floating point double */ |
|
42 | -define('PT_CURRENCY', 6); /* Signed 64-bit int (decimal w/4 digits right of decimal pt) */ |
|
43 | -define('PT_APPTIME', 7); /* Application time */ |
|
44 | -define('PT_ERROR', 10); /* 32-bit error value */ |
|
45 | -define('PT_BOOLEAN', 11); /* 16-bit boolean (non-zero true) */ |
|
46 | -define('PT_OBJECT', 13); /* Embedded object in a property */ |
|
47 | -define('PT_I8', 20); /* 8-byte signed integer */ |
|
48 | -define('PT_STRING8', 30); /* Null terminated 8-bit character string */ |
|
49 | -define('PT_UNICODE', 31); /* Null terminated Unicode string */ |
|
50 | -define('PT_SYSTIME', 64); /* FILETIME 64-bit int w/ number of 100ns periods since Jan 1,1601 */ |
|
51 | -define('PT_CLSID', 72); /* OLE GUID */ |
|
52 | -define('PT_BINARY', 258); /* Uninterpreted (counted byte array) */ |
|
36 | +define('PT_UNSPECIFIED', 0); /* (Reserved for interface use) type doesn't matter to caller */ |
|
37 | +define('PT_NULL', 1); /* NULL property value */ |
|
38 | +define('PT_I2', 2); /* Signed 16-bit value */ |
|
39 | +define('PT_LONG', 3); /* Signed 32-bit value */ |
|
40 | +define('PT_R4', 4); /* 4-byte floating point */ |
|
41 | +define('PT_DOUBLE', 5); /* Floating point double */ |
|
42 | +define('PT_CURRENCY', 6); /* Signed 64-bit int (decimal w/4 digits right of decimal pt) */ |
|
43 | +define('PT_APPTIME', 7); /* Application time */ |
|
44 | +define('PT_ERROR', 10); /* 32-bit error value */ |
|
45 | +define('PT_BOOLEAN', 11); /* 16-bit boolean (non-zero true) */ |
|
46 | +define('PT_OBJECT', 13); /* Embedded object in a property */ |
|
47 | +define('PT_I8', 20); /* 8-byte signed integer */ |
|
48 | +define('PT_STRING8', 30); /* Null terminated 8-bit character string */ |
|
49 | +define('PT_UNICODE', 31); /* Null terminated Unicode string */ |
|
50 | +define('PT_SYSTIME', 64); /* FILETIME 64-bit int w/ number of 100ns periods since Jan 1,1601 */ |
|
51 | +define('PT_CLSID', 72); /* OLE GUID */ |
|
52 | +define('PT_BINARY', 258); /* Uninterpreted (counted byte array) */ |
|
53 | 53 | /* Changes are likely to these numbers, and to their structures. */ |
54 | 54 | |
55 | 55 | /* Alternate property type names for ease of use */ |
@@ -190,14 +190,14 @@ discard block |
||
190 | 190 | |
191 | 191 | /* Values for PR_RESOURCE_TYPE, _METHODS, _FLAGS */ |
192 | 192 | |
193 | -define('MAPI_STORE_PROVIDER', 33); /* Message Store */ |
|
194 | -define('MAPI_AB', 34); /* Address Book */ |
|
195 | -define('MAPI_AB_PROVIDER', 35); /* Address Book Provider */ |
|
193 | +define('MAPI_STORE_PROVIDER', 33); /* Message Store */ |
|
194 | +define('MAPI_AB', 34); /* Address Book */ |
|
195 | +define('MAPI_AB_PROVIDER', 35); /* Address Book Provider */ |
|
196 | 196 | define('MAPI_TRANSPORT_PROVIDER', 36); /* Transport Provider */ |
197 | -define('MAPI_SPOOLER', 37); /* Message Spooler */ |
|
198 | -define('MAPI_PROFILE_PROVIDER', 38); /* Profile Provider */ |
|
199 | -define('MAPI_SUBSYSTEM', 39); /* Overall Subsystem Status */ |
|
200 | -define('MAPI_HOOK_PROVIDER', 40); /* Spooler Hook */ |
|
197 | +define('MAPI_SPOOLER', 37); /* Message Spooler */ |
|
198 | +define('MAPI_PROFILE_PROVIDER', 38); /* Profile Provider */ |
|
199 | +define('MAPI_SUBSYSTEM', 39); /* Overall Subsystem Status */ |
|
200 | +define('MAPI_HOOK_PROVIDER', 40); /* Spooler Hook */ |
|
201 | 201 | define('STATUS_VALIDATE_STATE', 0x00000001); |
202 | 202 | define('STATUS_SETTINGS_DIALOG', 0x00000002); |
203 | 203 | define('STATUS_CHANGE_PASSWORD', 0x00000004); |
@@ -243,10 +243,10 @@ discard block |
||
243 | 243 | define('MODRECIP_MODIFY', 0x00000004); |
244 | 244 | define('MODRECIP_REMOVE', 0x00000008); |
245 | 245 | |
246 | -define('MAPI_ORIG', 0); /* Recipient is message originator */ |
|
247 | -define('MAPI_TO', 1); /* Recipient is a primary recipient */ |
|
248 | -define('MAPI_CC', 2); /* Recipient is a copy recipient */ |
|
249 | -define('MAPI_BCC', 3); /* Recipient is blind copy recipient */ |
|
246 | +define('MAPI_ORIG', 0); /* Recipient is message originator */ |
|
247 | +define('MAPI_TO', 1); /* Recipient is a primary recipient */ |
|
248 | +define('MAPI_CC', 2); /* Recipient is a copy recipient */ |
|
249 | +define('MAPI_BCC', 3); /* Recipient is blind copy recipient */ |
|
250 | 250 | |
251 | 251 | /* IAttach Interface ------------------------------------------------------- */ |
252 | 252 | |
@@ -307,26 +307,26 @@ discard block |
||
307 | 307 | define('MAPI_SEND_NO_RICH_INFO', 0x00010000); |
308 | 308 | |
309 | 309 | /* flags for PR_STORE_SUPPORT_MASK */ |
310 | -define('STORE_ANSI_OK', 0x00020000); // The message store supports properties containing ANSI (8-bit) characters. |
|
311 | -define('STORE_ATTACH_OK', 0x00000020); // The message store supports attachments (OLE or non-OLE) to messages. |
|
312 | -define('STORE_CATEGORIZE_OK', 0x00000400); // The message store supports categorized views of tables. |
|
313 | -define('STORE_CREATE_OK', 0x00000010); // The message store supports creation of new messages. |
|
314 | -define('STORE_ENTRYID_UNIQUE', 0x00000001); // Entry identifiers for the objects in the message store are unique, that is, never reused during the life of the store. |
|
315 | -define('STORE_HTML_OK', 0x00010000); // The message store supports Hypertext Markup Language (HTML) messages, stored in the PR_BODY_HTML property. Note that STORE_HTML_OK is not defined in versions of MAPIDEFS.H included with Microsoft� Exchange 2000 Server and earlier. If your development environment uses a MAPIDEFS.H file that does not include STORE_HTML_OK, use the value 0x00010000 instead. |
|
316 | -define('STORE_LOCALSTORE', 0x00080000); // This flag is reserved and should not be used. |
|
317 | -define('STORE_MODIFY_OK', 0x00000008); // The message store supports modification of its existing messages. |
|
318 | -define('STORE_MV_PROPS_OK', 0x00000200); // The message store supports multivalued properties, guarantees the stability of value order in a multivalued property throughout a save operation, and supports instantiation of multivalued properties in tables. |
|
319 | -define('STORE_NOTIFY_OK', 0x00000100); // The message store supports notifications. |
|
320 | -define('STORE_OLE_OK', 0x00000040); // The message store supports OLE attachments. The OLE data is accessible through an IStorage interface, such as that available through the PR_ATTACH_DATA_OBJ property. |
|
321 | -define('STORE_PUBLIC_FOLDERS', 0x00004000); // The folders in this store are public (multi-user), not private (possibly multi-instance but not multi-user). |
|
322 | -define('STORE_READONLY', 0x00000002); // All interfaces for the message store have a read-only access level. |
|
323 | -define('STORE_RESTRICTION_OK', 0x00001000); // The message store supports restrictions. |
|
324 | -define('STORE_RTF_OK', 0x00000800); // The message store supports Rich Text Format (RTF) messages, usually stored compressed, and the store itself keeps PR_BODY and PR_RTF_COMPRESSED synchronized. |
|
325 | -define('STORE_SEARCH_OK', 0x00000004); // The message store supports search-results folders. |
|
326 | -define('STORE_SORT_OK', 0x00002000); // The message store supports sorting views of tables. |
|
327 | -define('STORE_SUBMIT_OK', 0x00000080); // The message store supports marking a message for submission. |
|
310 | +define('STORE_ANSI_OK', 0x00020000); // The message store supports properties containing ANSI (8-bit) characters. |
|
311 | +define('STORE_ATTACH_OK', 0x00000020); // The message store supports attachments (OLE or non-OLE) to messages. |
|
312 | +define('STORE_CATEGORIZE_OK', 0x00000400); // The message store supports categorized views of tables. |
|
313 | +define('STORE_CREATE_OK', 0x00000010); // The message store supports creation of new messages. |
|
314 | +define('STORE_ENTRYID_UNIQUE', 0x00000001); // Entry identifiers for the objects in the message store are unique, that is, never reused during the life of the store. |
|
315 | +define('STORE_HTML_OK', 0x00010000); // The message store supports Hypertext Markup Language (HTML) messages, stored in the PR_BODY_HTML property. Note that STORE_HTML_OK is not defined in versions of MAPIDEFS.H included with Microsoft� Exchange 2000 Server and earlier. If your development environment uses a MAPIDEFS.H file that does not include STORE_HTML_OK, use the value 0x00010000 instead. |
|
316 | +define('STORE_LOCALSTORE', 0x00080000); // This flag is reserved and should not be used. |
|
317 | +define('STORE_MODIFY_OK', 0x00000008); // The message store supports modification of its existing messages. |
|
318 | +define('STORE_MV_PROPS_OK', 0x00000200); // The message store supports multivalued properties, guarantees the stability of value order in a multivalued property throughout a save operation, and supports instantiation of multivalued properties in tables. |
|
319 | +define('STORE_NOTIFY_OK', 0x00000100); // The message store supports notifications. |
|
320 | +define('STORE_OLE_OK', 0x00000040); // The message store supports OLE attachments. The OLE data is accessible through an IStorage interface, such as that available through the PR_ATTACH_DATA_OBJ property. |
|
321 | +define('STORE_PUBLIC_FOLDERS', 0x00004000); // The folders in this store are public (multi-user), not private (possibly multi-instance but not multi-user). |
|
322 | +define('STORE_READONLY', 0x00000002); // All interfaces for the message store have a read-only access level. |
|
323 | +define('STORE_RESTRICTION_OK', 0x00001000); // The message store supports restrictions. |
|
324 | +define('STORE_RTF_OK', 0x00000800); // The message store supports Rich Text Format (RTF) messages, usually stored compressed, and the store itself keeps PR_BODY and PR_RTF_COMPRESSED synchronized. |
|
325 | +define('STORE_SEARCH_OK', 0x00000004); // The message store supports search-results folders. |
|
326 | +define('STORE_SORT_OK', 0x00002000); // The message store supports sorting views of tables. |
|
327 | +define('STORE_SUBMIT_OK', 0x00000080); // The message store supports marking a message for submission. |
|
328 | 328 | define('STORE_UNCOMPRESSED_RTF', 0x00008000); // The message store supports storage of Rich Text Format (RTF) messages in uncompressed form. An uncompressed RTF stream is identified by the value dwMagicUncompressedRTF in the stream header. The dwMagicUncompressedRTF value is defined in the RTFLIB.H file. |
329 | -define('STORE_UNICODE_OK', 0x00040000); // The message store supports properties containing Unicode characters. |
|
329 | +define('STORE_UNICODE_OK', 0x00040000); // The message store supports properties containing Unicode characters. |
|
330 | 330 | |
331 | 331 | /* PR_DISPLAY_TYPEs */ |
332 | 332 | /* For address book contents tables */ |
@@ -439,21 +439,21 @@ discard block |
||
439 | 439 | define('BMR_NEZ', 0x00000001); |
440 | 440 | |
441 | 441 | /* array index values of restrictions -- same values are used in php-ext/main.cpp::PHPArraytoSRestriction() */ |
442 | -define('VALUE', 0); // propval |
|
443 | -define('RELOP', 1); // compare method |
|
444 | -define('FUZZYLEVEL', 2); // string search flags |
|
445 | -define('CB', 3); // size restriction |
|
446 | -define('ULTYPE', 4); // bit mask restriction type BMR_xxx |
|
447 | -define('ULMASK', 5); // bitmask |
|
448 | -define('ULPROPTAG', 6); // property |
|
449 | -define('ULPROPTAG1', 7); // RES_COMPAREPROPS 1st property |
|
450 | -define('ULPROPTAG2', 8); // RES_COMPAREPROPS 2nd property |
|
451 | -define('PROPS', 9); // RES_COMMENT properties |
|
442 | +define('VALUE', 0); // propval |
|
443 | +define('RELOP', 1); // compare method |
|
444 | +define('FUZZYLEVEL', 2); // string search flags |
|
445 | +define('CB', 3); // size restriction |
|
446 | +define('ULTYPE', 4); // bit mask restriction type BMR_xxx |
|
447 | +define('ULMASK', 5); // bitmask |
|
448 | +define('ULPROPTAG', 6); // property |
|
449 | +define('ULPROPTAG1', 7); // RES_COMPAREPROPS 1st property |
|
450 | +define('ULPROPTAG2', 8); // RES_COMPAREPROPS 2nd property |
|
451 | +define('PROPS', 9); // RES_COMMENT properties |
|
452 | 452 | define('RESTRICTION', 10); // RES_COMMENT and RES_SUBRESTRICTION restriction |
453 | 453 | |
454 | 454 | /* GUID's for PR_MDB_PROVIDER */ |
455 | -define("ZARAFA_SERVICE_GUID", makeGuid("{C0A19454-7F29-1B10-A587-08002B2A2517}")); // default store |
|
456 | -define("ZARAFA_STORE_PUBLIC_GUID", makeGuid("{70FAB278-F7AF-CD11-9BC8-00AA002FC45A}")); // public store |
|
455 | +define("ZARAFA_SERVICE_GUID", makeGuid("{C0A19454-7F29-1B10-A587-08002B2A2517}")); // default store |
|
456 | +define("ZARAFA_STORE_PUBLIC_GUID", makeGuid("{70FAB278-F7AF-CD11-9BC8-00AA002FC45A}")); // public store |
|
457 | 457 | define("ZARAFA_STORE_DELEGATE_GUID", makeGuid("{0077B49E-E474-CE11-8C5E-00AA004254E2}")); // other store |
458 | 458 | define('ZARAFA_STORE_ARCHIVER_GUID', makeGuid("{BC8953AD-2E3F-4172-9404-896FF459870F}")); // archive store |
459 | 459 | |
@@ -586,38 +586,38 @@ discard block |
||
586 | 586 | define('SYNC_NO_FOREIGN_KEYS', 0x100); |
587 | 587 | define('SYNC_LIMITED_IMESSAGE', 0x200); |
588 | 588 | define('SYNC_CATCHUP', 0x400); |
589 | -define('SYNC_NEW_MESSAGE', 0x800); // only applicable to ImportMessageChange() |
|
590 | -define('SYNC_MSG_SELECTIVE', 0x1000); // Used internally. Will reject if used by clients. |
|
589 | +define('SYNC_NEW_MESSAGE', 0x800); // only applicable to ImportMessageChange() |
|
590 | +define('SYNC_MSG_SELECTIVE', 0x1000); // Used internally. Will reject if used by clients. |
|
591 | 591 | define('SYNC_BEST_BODY', 0x2000); |
592 | 592 | define('SYNC_IGNORE_SPECIFIED_ON_ASSOCIATED', 0x4000); |
593 | -define('SYNC_PROGRESS_MODE', 0x8000); // AirMapi progress mode |
|
593 | +define('SYNC_PROGRESS_MODE', 0x8000); // AirMapi progress mode |
|
594 | 594 | define('SYNC_FXRECOVERMODE', 0x10000); |
595 | 595 | define('SYNC_DEFER_CONFIG', 0x20000); |
596 | -define('SYNC_FORCE_UNICODE', 0x40000); // Forces server to return Unicode properties |
|
597 | -define('SYNC_STATE_READONLY', 0x80000); // Server will not update the states in the DB, setting up exporter with this flag states are read only |
|
596 | +define('SYNC_FORCE_UNICODE', 0x40000); // Forces server to return Unicode properties |
|
597 | +define('SYNC_STATE_READONLY', 0x80000); // Server will not update the states in the DB, setting up exporter with this flag states are read only |
|
598 | 598 | |
599 | -define('EMS_AB_ADDRESS_LOOKUP', 0x00000001); // Flag for resolvename to resolve only exact matches |
|
599 | +define('EMS_AB_ADDRESS_LOOKUP', 0x00000001); // Flag for resolvename to resolve only exact matches |
|
600 | 600 | |
601 | -define('TBL_BATCH', 0x00000002); // Batch multiple table commands |
|
601 | +define('TBL_BATCH', 0x00000002); // Batch multiple table commands |
|
602 | 602 | |
603 | 603 | /* Flags for recipients in exceptions */ |
604 | -define('recipSendable', 0x00000001); // sendable attendee. |
|
605 | -define('recipOrganizer', 0x00000002); // meeting organizer |
|
606 | -define('recipExceptionalResponse', 0x00000010); // attendee gave a response for the exception |
|
607 | -define('recipExceptionalDeleted', 0x00000020); // recipientRow exists, but it is treated as if the corresponding recipient is deleted from meeting |
|
608 | -define('recipOriginal', 0x00000100); // recipient is an original Attendee |
|
604 | +define('recipSendable', 0x00000001); // sendable attendee. |
|
605 | +define('recipOrganizer', 0x00000002); // meeting organizer |
|
606 | +define('recipExceptionalResponse', 0x00000010); // attendee gave a response for the exception |
|
607 | +define('recipExceptionalDeleted', 0x00000020); // recipientRow exists, but it is treated as if the corresponding recipient is deleted from meeting |
|
608 | +define('recipOriginal', 0x00000100); // recipient is an original Attendee |
|
609 | 609 | define('recipReserved', 0x00000200); |
610 | 610 | |
611 | 611 | /* Flags which indicates type of Meeting Object */ |
612 | -define('mtgEmpty', 0x00000000); // Unspecified. |
|
613 | -define('mtgRequest', 0x00000001); // Initial meeting request. |
|
614 | -define('mtgFull', 0x00010000); // Full update. |
|
615 | -define('mtgInfo', 0x00020000); // Informational update. |
|
616 | -define('mtgOutOfDate', 0x00080000); // A newer Meeting Request object or Meeting Update object was received after this one. |
|
617 | -define('mtgDelegatorCopy', 0x00100000); // This is set on the delegator's copy when a delegate will handle meeting-related objects. |
|
612 | +define('mtgEmpty', 0x00000000); // Unspecified. |
|
613 | +define('mtgRequest', 0x00000001); // Initial meeting request. |
|
614 | +define('mtgFull', 0x00010000); // Full update. |
|
615 | +define('mtgInfo', 0x00020000); // Informational update. |
|
616 | +define('mtgOutOfDate', 0x00080000); // A newer Meeting Request object or Meeting Update object was received after this one. |
|
617 | +define('mtgDelegatorCopy', 0x00100000); // This is set on the delegator's copy when a delegate will handle meeting-related objects. |
|
618 | 618 | |
619 | -define('MAPI_ONE_OFF_UNICODE', 0x8000); // the flag that defines whether the embedded strings are Unicode in one off entryids. |
|
620 | -define('MAPI_ONE_OFF_NO_RICH_INFO', 0x0001); // the flag that specifies whether the recipient gets TNEF or not. |
|
619 | +define('MAPI_ONE_OFF_UNICODE', 0x8000); // the flag that defines whether the embedded strings are Unicode in one off entryids. |
|
620 | +define('MAPI_ONE_OFF_NO_RICH_INFO', 0x0001); // the flag that specifies whether the recipient gets TNEF or not. |
|
621 | 621 | |
622 | 622 | /* Mask flags for mapi_msgstore_advise */ |
623 | 623 | define('fnevCriticalError', 0x00000001); |
@@ -634,21 +634,21 @@ discard block |
||
634 | 634 | define('fnevExtended', 0x80000000); |
635 | 635 | |
636 | 636 | /* PersistBlockType values PR_ADDITIONAL_REN_ENTRYIDS_EX / PR_ADDITIONAL_REN_ENTRYIDS_EX PersistIDs */ |
637 | -define('PERSIST_SENTINEL', 0x0000); // Indicates that the PersistData structure is the last one contained in the PidTagAdditionalRenEntryIdsEx property |
|
638 | -define('RSF_PID_RSS_SUBSCRIPTION', 0x8001); // Indicates that the structure contains data for the RSS Feeds folder |
|
639 | -define('RSF_PID_SEND_AND_TRACK', 0x8002); // Indicates that the structure contains data for the Tracked Mail Processing folder |
|
640 | -define('RSF_PID_TODO_SEARCH', 0x8004); // Indicates that the structure contains data for the To-Do folder |
|
641 | -define('RSF_PID_CONV_ACTIONS', 0x8006); // Indicates that the structure contains data for the Conversation Action Settings folder |
|
642 | -define('RSF_PID_COMBINED_ACTIONS', 0x8007); // This value is reserved. |
|
643 | -define('RSF_PID_SUGGESTED_CONTACTS', 0x8008); // Indicates that the structure contains data for the Suggested Contacts folder. |
|
644 | -define('RSF_PID_CONTACT_SEARCH', 0x8009); // Indicates that the structure contains data for the Contacts Search folder. |
|
645 | -define('RSF_PID_BUDDYLIST_PDLS', 0x800A); // Indicates that the structure contains data for the IM Contacts List folder. |
|
646 | -define('RSF_PID_BUDDYLIST_CONTACTS', 0x800B); // Indicates that the structure contains data for the Quick Contacts folder. |
|
637 | +define('PERSIST_SENTINEL', 0x0000); // Indicates that the PersistData structure is the last one contained in the PidTagAdditionalRenEntryIdsEx property |
|
638 | +define('RSF_PID_RSS_SUBSCRIPTION', 0x8001); // Indicates that the structure contains data for the RSS Feeds folder |
|
639 | +define('RSF_PID_SEND_AND_TRACK', 0x8002); // Indicates that the structure contains data for the Tracked Mail Processing folder |
|
640 | +define('RSF_PID_TODO_SEARCH', 0x8004); // Indicates that the structure contains data for the To-Do folder |
|
641 | +define('RSF_PID_CONV_ACTIONS', 0x8006); // Indicates that the structure contains data for the Conversation Action Settings folder |
|
642 | +define('RSF_PID_COMBINED_ACTIONS', 0x8007); // This value is reserved. |
|
643 | +define('RSF_PID_SUGGESTED_CONTACTS', 0x8008); // Indicates that the structure contains data for the Suggested Contacts folder. |
|
644 | +define('RSF_PID_CONTACT_SEARCH', 0x8009); // Indicates that the structure contains data for the Contacts Search folder. |
|
645 | +define('RSF_PID_BUDDYLIST_PDLS', 0x800A); // Indicates that the structure contains data for the IM Contacts List folder. |
|
646 | +define('RSF_PID_BUDDYLIST_CONTACTS', 0x800B); // Indicates that the structure contains data for the Quick Contacts folder. |
|
647 | 647 | |
648 | 648 | /* PersistElementType Values ElementIDs for persist data of PR_ADDITIONAL_REN_ENTRYIDS_EX / PR_ADDITIONAL_REN_ENTRYIDS_EX */ |
649 | -define('ELEMENT_SENTINEL', 0x0000); // 0 bytes Indicates that the PersistElement structure is the last one contained in the DataElements field of the PersistData structure. |
|
650 | -define('RSF_ELID_ENTRYID', 0x0001); // variable Indicates that the ElementData field contains the entry ID of the special folder that is of the type indicated by the value of the PersistID field of the PersistData structure. |
|
651 | -define('RSF_ELID_HEADER', 0x0002); // 4 bytes Indicates that the ElementData field contains a 4-byte header value equal to 0x00000000. |
|
649 | +define('ELEMENT_SENTINEL', 0x0000); // 0 bytes Indicates that the PersistElement structure is the last one contained in the DataElements field of the PersistData structure. |
|
650 | +define('RSF_ELID_ENTRYID', 0x0001); // variable Indicates that the ElementData field contains the entry ID of the special folder that is of the type indicated by the value of the PersistID field of the PersistData structure. |
|
651 | +define('RSF_ELID_HEADER', 0x0002); // 4 bytes Indicates that the ElementData field contains a 4-byte header value equal to 0x00000000. |
|
652 | 652 | |
653 | 653 | define('STGM_DIRECT', 0x00000000); |
654 | 654 | define('STGM_TRANSACTED', 0x00010000); |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | [ |
213 | 213 | RES_OR, |
214 | 214 | [ |
215 | - [RES_AND, // Normal items: itemEnd must be after viewStart, itemStart must be before viewEnd |
|
215 | + [RES_AND, // Normal items: itemEnd must be after viewStart, itemStart must be before viewEnd |
|
216 | 216 | [ |
217 | 217 | [ |
218 | 218 | RES_PROPERTY, |
@@ -241,8 +241,8 @@ discard block |
||
241 | 241 | VALUE => true, |
242 | 242 | ], |
243 | 243 | ], |
244 | - ], // EXISTS OR |
|
245 | - ]; // global OR |
|
244 | + ], // EXISTS OR |
|
245 | + ]; // global OR |
|
246 | 246 | |
247 | 247 | // Get requested properties, plus whatever we need |
248 | 248 | $proplist = [PR_ENTRYID, $properties["recurring"], $properties["recurring_data"], $properties["timezone_data"]]; |
@@ -67,8 +67,7 @@ discard block |
||
67 | 67 | } |
68 | 68 | } |
69 | 69 | } |
70 | - } |
|
71 | - else { |
|
70 | + } else { |
|
72 | 71 | return "NOERROR"; |
73 | 72 | } |
74 | 73 | |
@@ -109,11 +108,9 @@ discard block |
||
109 | 108 | |
110 | 109 | if (substr($split[2], 0, 2) == "0x") { |
111 | 110 | $id = hexdec(substr($split[2], 2)); |
112 | - } |
|
113 | - elseif (preg_match('/^[1-9][0-9]{0,12}$/', $split[2])) { |
|
111 | + } elseif (preg_match('/^[1-9][0-9]{0,12}$/', $split[2])) { |
|
114 | 112 | $id = (int) $split[2]; |
115 | - } |
|
116 | - else { |
|
113 | + } else { |
|
117 | 114 | $id = $split[2]; |
118 | 115 | } |
119 | 116 | |
@@ -123,8 +120,7 @@ discard block |
||
123 | 120 | $guids[$split[1]] = makeguid($split[1]); |
124 | 121 | } |
125 | 122 | $guid = $guids[$split[1]]; |
126 | - } |
|
127 | - else { |
|
123 | + } else { |
|
128 | 124 | $guid = constant($split[1]); |
129 | 125 | } |
130 | 126 | |
@@ -134,8 +130,7 @@ discard block |
||
134 | 130 | $ids["guid"][$num] = $guid; |
135 | 131 | $ids["type"][$num] = $split[0]; |
136 | 132 | ++$num; |
137 | - } |
|
138 | - else { |
|
133 | + } else { |
|
139 | 134 | // not a named property |
140 | 135 | $props[$name] = $val; |
141 | 136 | } |
@@ -266,8 +261,7 @@ discard block |
||
266 | 261 | $item = $occurrence + $row; |
267 | 262 | array_push($items, $item); |
268 | 263 | } |
269 | - } |
|
270 | - else { |
|
264 | + } else { |
|
271 | 265 | // Normal item, it matched the search criteria and therefore overlaps the interval <$viewstart, $viewend> |
272 | 266 | array_push($items, $row); |
273 | 267 | } |
@@ -165,15 +165,15 @@ discard block |
||
165 | 165 | $properties['reminderminutes'] = 'PT_LONG:PSETID_Common:' . PidLidReminderDelta; |
166 | 166 | $properties['reminderset'] = 'PT_BOOLEAN:PSETID_Common:' . PidLidReminderSet; |
167 | 167 | $properties['sendasical'] = 'PT_BOOLEAN:PSETID_Appointment:0x8200'; |
168 | - $properties['updatecounter'] = 'PT_LONG:PSETID_Appointment:' . PidLidAppointmentSequence; // AppointmentSequenceNumber |
|
168 | + $properties['updatecounter'] = 'PT_LONG:PSETID_Appointment:' . PidLidAppointmentSequence; // AppointmentSequenceNumber |
|
169 | 169 | $properties['unknown7'] = 'PT_LONG:PSETID_Appointment:0x8202'; |
170 | - $properties['last_updatecounter'] = 'PT_LONG:PSETID_Appointment:0x8203'; // AppointmentLastSequence |
|
170 | + $properties['last_updatecounter'] = 'PT_LONG:PSETID_Appointment:0x8203'; // AppointmentLastSequence |
|
171 | 171 | $properties['busystatus'] = 'PT_LONG:PSETID_Appointment:' . PidLidBusyStatus; |
172 | 172 | $properties['intendedbusystatus'] = 'PT_LONG:PSETID_Appointment:' . PidLidIntendedBusyStatus; |
173 | 173 | $properties['start'] = 'PT_SYSTIME:PSETID_Appointment:' . PidLidAppointmentStartWhole; |
174 | 174 | $properties['responselocation'] = 'PT_STRING8:PSETID_Meeting:0x2'; |
175 | 175 | $properties['location'] = 'PT_STRING8:PSETID_Appointment:' . PidLidLocation; |
176 | - $properties['requestsent'] = 'PT_BOOLEAN:PSETID_Appointment:0x8229'; // PidLidFInvited, MeetingRequestWasSent |
|
176 | + $properties['requestsent'] = 'PT_BOOLEAN:PSETID_Appointment:0x8229'; // PidLidFInvited, MeetingRequestWasSent |
|
177 | 177 | $properties['startdate'] = 'PT_SYSTIME:PSETID_Appointment:' . PidLidAppointmentStartWhole; |
178 | 178 | $properties['duedate'] = 'PT_SYSTIME:PSETID_Appointment:' . PidLidAppointmentEndWhole; |
179 | 179 | $properties['flagdueby'] = 'PT_SYSTIME:PSETID_Common:' . PidLidReminderSignalTime; |
@@ -182,11 +182,11 @@ discard block |
||
182 | 182 | $properties['recurring'] = 'PT_BOOLEAN:PSETID_Appointment:' . PidLidRecurring; |
183 | 183 | $properties['clipstart'] = 'PT_SYSTIME:PSETID_Appointment:' . PidLidClipStart; |
184 | 184 | $properties['clipend'] = 'PT_SYSTIME:PSETID_Appointment:' . PidLidClipEnd; |
185 | - $properties['start_recur_date'] = 'PT_LONG:PSETID_Meeting:0xD'; // StartRecurTime |
|
186 | - $properties['start_recur_time'] = 'PT_LONG:PSETID_Meeting:0xE'; // StartRecurTime |
|
187 | - $properties['end_recur_date'] = 'PT_LONG:PSETID_Meeting:0xF'; // EndRecurDate |
|
188 | - $properties['end_recur_time'] = 'PT_LONG:PSETID_Meeting:0x10'; // EndRecurTime |
|
189 | - $properties['is_exception'] = 'PT_BOOLEAN:PSETID_Meeting:0xA'; // LID_IS_EXCEPTION |
|
185 | + $properties['start_recur_date'] = 'PT_LONG:PSETID_Meeting:0xD'; // StartRecurTime |
|
186 | + $properties['start_recur_time'] = 'PT_LONG:PSETID_Meeting:0xE'; // StartRecurTime |
|
187 | + $properties['end_recur_date'] = 'PT_LONG:PSETID_Meeting:0xF'; // EndRecurDate |
|
188 | + $properties['end_recur_time'] = 'PT_LONG:PSETID_Meeting:0x10'; // EndRecurTime |
|
189 | + $properties['is_exception'] = 'PT_BOOLEAN:PSETID_Meeting:0xA'; // LID_IS_EXCEPTION |
|
190 | 190 | $properties['apptreplyname'] = 'PT_STRING8:PSETID_Appointment:0x8230'; |
191 | 191 | // Propose new time properties |
192 | 192 | $properties['proposed_start_whole'] = 'PT_SYSTIME:PSETID_Appointment:' . PidLidAppointmentProposedStartWhole; |
@@ -563,7 +563,7 @@ discard block |
||
563 | 563 | $listProperties['rcvd_representing_search_key'] = PR_RCVD_REPRESENTING_SEARCH_KEY; |
564 | 564 | $messageProps = mapi_getprops($this->message, $listProperties); |
565 | 565 | |
566 | - $goid = $messageProps[$this->proptags['goid']]; // GlobalID (0x3) |
|
566 | + $goid = $messageProps[$this->proptags['goid']]; // GlobalID (0x3) |
|
567 | 567 | if (!isset($goid)) { |
568 | 568 | return; |
569 | 569 | } |
@@ -1507,7 +1507,7 @@ discard block |
||
1507 | 1507 | $props[$this->proptags['goid2']] = $goid; |
1508 | 1508 | |
1509 | 1509 | if (!isset($props[$this->proptags['updatecounter']])) { |
1510 | - $props[$this->proptags['updatecounter']] = 0; // OL also starts sequence no with zero. |
|
1510 | + $props[$this->proptags['updatecounter']] = 0; // OL also starts sequence no with zero. |
|
1511 | 1511 | $props[$this->proptags['last_updatecounter']] = 0; |
1512 | 1512 | } |
1513 | 1513 | |
@@ -2522,7 +2522,7 @@ discard block |
||
2522 | 2522 | $getResourcesRestriction = [ |
2523 | 2523 | RES_PROPERTY, |
2524 | 2524 | [ |
2525 | - RELOP => RELOP_EQ, // Equals recipient type 3: Resource |
|
2525 | + RELOP => RELOP_EQ, // Equals recipient type 3: Resource |
|
2526 | 2526 | ULPROPTAG => PR_RECIPIENT_TYPE, |
2527 | 2527 | VALUE => [PR_RECIPIENT_TYPE => MAPI_BCC], |
2528 | 2528 | ], |
@@ -2798,7 +2798,7 @@ discard block |
||
2798 | 2798 | $getResourcesRestriction = [ |
2799 | 2799 | RES_PROPERTY, |
2800 | 2800 | [ |
2801 | - RELOP => RELOP_EQ, // Equals recipient type 3: Resource |
|
2801 | + RELOP => RELOP_EQ, // Equals recipient type 3: Resource |
|
2802 | 2802 | ULPROPTAG => PR_RECIPIENT_TYPE, |
2803 | 2803 | VALUE => [PR_RECIPIENT_TYPE => MAPI_BCC], |
2804 | 2804 | ], |
@@ -3016,7 +3016,7 @@ discard block |
||
3016 | 3016 | $restriction[1][] = [ |
3017 | 3017 | RES_PROPERTY, |
3018 | 3018 | [ |
3019 | - RELOP => RELOP_NE, // Does not equal recipient type: MAPI_BCC (Resource) |
|
3019 | + RELOP => RELOP_NE, // Does not equal recipient type: MAPI_BCC (Resource) |
|
3020 | 3020 | ULPROPTAG => PR_RECIPIENT_TYPE, |
3021 | 3021 | VALUE => [PR_RECIPIENT_TYPE => MAPI_BCC], |
3022 | 3022 | ], |
@@ -3119,7 +3119,7 @@ discard block |
||
3119 | 3119 | $stripResourcesRestriction[1][] = [ |
3120 | 3120 | RES_PROPERTY, |
3121 | 3121 | [ |
3122 | - RELOP => RELOP_NE, // Does not equal recipient type: MAPI_BCC (Resource) |
|
3122 | + RELOP => RELOP_NE, // Does not equal recipient type: MAPI_BCC (Resource) |
|
3123 | 3123 | ULPROPTAG => PR_RECIPIENT_TYPE, |
3124 | 3124 | VALUE => [PR_RECIPIENT_TYPE => MAPI_BCC], |
3125 | 3125 | ], |
@@ -3225,7 +3225,7 @@ discard block |
||
3225 | 3225 | $newmessageprops[PR_MESSAGE_CLASS] = 'IPM.Schedule.Meeting.Canceled'; |
3226 | 3226 | $newmessageprops[$this->proptags['meetingstatus']] = olMeetingCanceled; // It's a cancel request |
3227 | 3227 | $newmessageprops[$this->proptags['busystatus']] = fbFree; // set the busy status as free |
3228 | - $newmessageprops[PR_IMPORTANCE] = IMPORTANCE_HIGH; // HIGH Importance |
|
3228 | + $newmessageprops[PR_IMPORTANCE] = IMPORTANCE_HIGH; // HIGH Importance |
|
3229 | 3229 | if (isset($newmessageprops[PR_SUBJECT])) { |
3230 | 3230 | $newmessageprops[PR_SUBJECT] = dgettext('zarafa', 'Canceled') . ': ' . $newmessageprops[PR_SUBJECT]; |
3231 | 3231 | } |
@@ -339,8 +339,7 @@ discard block |
||
339 | 339 | if (isset($messageprops[PR_RCVD_REPRESENTING_ENTRYID])) { |
340 | 340 | $delegatorStore = $this->getDelegatorStore($messageprops[PR_RCVD_REPRESENTING_ENTRYID], [PR_IPM_APPOINTMENT_ENTRYID]); |
341 | 341 | $userStore = $delegatorStore['store']; |
342 | - } |
|
343 | - else { |
|
342 | + } else { |
|
344 | 343 | $userStore = $this->store; |
345 | 344 | } |
346 | 345 | |
@@ -410,8 +409,7 @@ discard block |
||
410 | 409 | // Create/modify exception |
411 | 410 | if ($recurr->isException($basedate)) { |
412 | 411 | $recurr->modifyException($exception_props, $basedate); |
413 | - } |
|
414 | - else { |
|
412 | + } else { |
|
415 | 413 | // When we are creating an exception we need copy recipients from main recurring item |
416 | 414 | $recipTable = mapi_message_getrecipienttable($calendarItem); |
417 | 415 | $recips = mapi_table_queryallrows($recipTable, $this->recipprops); |
@@ -429,8 +427,7 @@ discard block |
||
429 | 427 | if ($attach) { |
430 | 428 | $recurringItem = $calendarItem; |
431 | 429 | $calendarItem = mapi_attach_openobj($attach, MAPI_MODIFY); |
432 | - } |
|
433 | - else { |
|
430 | + } else { |
|
434 | 431 | return false; |
435 | 432 | } |
436 | 433 | } |
@@ -517,8 +514,7 @@ discard block |
||
517 | 514 | $props = []; |
518 | 515 | if ($messageprops[$this->proptags['counter_proposal']]) { |
519 | 516 | $props[$this->proptags['counter_proposal']] = true; |
520 | - } |
|
521 | - else { |
|
517 | + } else { |
|
522 | 518 | $props[$this->proptags['counter_proposal']] = false; |
523 | 519 | } |
524 | 520 | |
@@ -573,8 +569,7 @@ discard block |
||
573 | 569 | $delegatorStore = $this->getDelegatorStore($messageProps[PR_RCVD_REPRESENTING_ENTRYID], [PR_IPM_APPOINTMENT_ENTRYID]); |
574 | 570 | |
575 | 571 | $store = $delegatorStore['store']; |
576 | - } |
|
577 | - else { |
|
572 | + } else { |
|
578 | 573 | $store = $this->store; |
579 | 574 | } |
580 | 575 | |
@@ -601,13 +596,11 @@ discard block |
||
601 | 596 | |
602 | 597 | if ($recurr->isException($basedate)) { |
603 | 598 | $recurr->modifyException($messageProps, $basedate); |
604 | - } |
|
605 | - else { |
|
599 | + } else { |
|
606 | 600 | $recurr->createException($messageProps, $basedate); |
607 | 601 | } |
608 | 602 | } |
609 | - } |
|
610 | - else { |
|
603 | + } else { |
|
611 | 604 | // set the properties of the cancellation object |
612 | 605 | mapi_setprops($calendarItem, $messageProps); |
613 | 606 | } |
@@ -661,8 +654,7 @@ discard block |
||
661 | 654 | |
662 | 655 | $store = $delegatorStore['store']; |
663 | 656 | $calFolder = $delegatorStore[PR_IPM_APPOINTMENT_ENTRYID]; |
664 | - } |
|
665 | - else { |
|
657 | + } else { |
|
666 | 658 | $calFolder = $this->openDefaultCalendar(); |
667 | 659 | $store = $this->store; |
668 | 660 | } |
@@ -725,8 +717,7 @@ discard block |
||
725 | 717 | $senderEntryId = isset($messageprops[PR_SENT_REPRESENTING_ENTRYID]) ? $messageprops[PR_SENT_REPRESENTING_ENTRYID] : $messageprops[PR_SENDER_ENTRYID]; |
726 | 718 | if (isset($messageprops[PR_RECEIVED_BY_ENTRYID]) && compareEntryIds($senderEntryId, $messageprops[PR_RECEIVED_BY_ENTRYID])) { |
727 | 719 | $entryid = $this->accept(false, $sendresponse, $move, $proposeNewTimeProps, $body, true, $store, $calFolder, $basedate); |
728 | - } |
|
729 | - else { |
|
720 | + } else { |
|
730 | 721 | $entryid = $this->accept($tentative, $sendresponse, $move, $proposeNewTimeProps, $body, $userAction, $store, $calFolder, $basedate); |
731 | 722 | } |
732 | 723 | |
@@ -789,8 +780,7 @@ discard block |
||
789 | 780 | if (!$calendarItem) { |
790 | 781 | // Recurring item not found, so create new meeting in Calendar |
791 | 782 | $calendarItem = mapi_folder_createmessage($calFolder); |
792 | - } |
|
793 | - else { |
|
783 | + } else { |
|
794 | 784 | // we have found the main recurring item, check if this meeting request is already processed |
795 | 785 | if (isset($messageprops[PR_PROCESSED]) && $messageprops[PR_PROCESSED] == true) { |
796 | 786 | // only set required properties, other properties are already copied when processing this meeting request |
@@ -812,8 +802,7 @@ discard block |
||
812 | 802 | if (isset($props[$this->proptags['reminderminutes']])) { |
813 | 803 | $props[$this->proptags['flagdueby']] = $props[$this->proptags['startdate']] - ($props[$this->proptags['reminderminutes']] * 60); |
814 | 804 | } |
815 | - } |
|
816 | - else { |
|
805 | + } else { |
|
817 | 806 | // only get required properties so we will not overwrite existing updated properties from calendar |
818 | 807 | $props = mapi_getprops($this->message, [PR_ENTRYID]); |
819 | 808 | } |
@@ -834,13 +823,11 @@ discard block |
||
834 | 823 | if (isset($props[$this->proptags['intendedbusystatus']])) { |
835 | 824 | if ($tentative && $props[$this->proptags['intendedbusystatus']] !== fbFree) { |
836 | 825 | $props[$this->proptags['busystatus']] = fbTentative; |
837 | - } |
|
838 | - else { |
|
826 | + } else { |
|
839 | 827 | $props[$this->proptags['busystatus']] = $props[$this->proptags['intendedbusystatus']]; |
840 | 828 | } |
841 | 829 | // we already have intendedbusystatus value in $props so no need to copy it |
842 | - } |
|
843 | - else { |
|
830 | + } else { |
|
844 | 831 | $props[$this->proptags['busystatus']] = $tentative ? fbTentative : fbBusy; |
845 | 832 | } |
846 | 833 | |
@@ -903,8 +890,7 @@ discard block |
||
903 | 890 | } |
904 | 891 | |
905 | 892 | $entryid = $props[PR_ENTRYID]; |
906 | - } |
|
907 | - else { |
|
893 | + } else { |
|
908 | 894 | /** |
909 | 895 | * This meeting request is not recurring, so can be an exception or normal meeting. |
910 | 896 | * If exception then find main recurring item and update exception |
@@ -977,13 +963,11 @@ discard block |
||
977 | 963 | if (isset($messageprops[$this->proptags['intendedbusystatus']])) { |
978 | 964 | if ($tentative && $messageprops[$this->proptags['intendedbusystatus']] !== fbFree) { |
979 | 965 | $calItemProps[$this->proptags['busystatus']] = fbTentative; |
980 | - } |
|
981 | - else { |
|
966 | + } else { |
|
982 | 967 | $calItemProps[$this->proptags['busystatus']] = $messageprops[$this->proptags['intendedbusystatus']]; |
983 | 968 | } |
984 | 969 | $calItemProps[$this->proptags['intendedbusystatus']] = $messageprops[$this->proptags['intendedbusystatus']]; |
985 | - } |
|
986 | - else { |
|
970 | + } else { |
|
987 | 971 | $calItemProps[$this->proptags['busystatus']] = $tentative ? fbTentative : fbBusy; |
988 | 972 | } |
989 | 973 | |
@@ -1033,8 +1017,7 @@ discard block |
||
1033 | 1017 | |
1034 | 1018 | $messageprops = mapi_getprops($calmsg, [PR_ENTRYID]); |
1035 | 1019 | $entryid = $messageprops[PR_ENTRYID]; |
1036 | - } |
|
1037 | - else { |
|
1020 | + } else { |
|
1038 | 1021 | // Create a new appointment with duplicate properties and recipient, but as an IPM.Appointment |
1039 | 1022 | $new = mapi_folder_createmessage($calFolder); |
1040 | 1023 | $props = mapi_getprops($this->message); |
@@ -1080,13 +1063,11 @@ discard block |
||
1080 | 1063 | if (isset($props[$this->proptags['intendedbusystatus']])) { |
1081 | 1064 | if ($tentative && $props[$this->proptags['intendedbusystatus']] !== fbFree) { |
1082 | 1065 | $props[$this->proptags['busystatus']] = fbTentative; |
1083 | - } |
|
1084 | - else { |
|
1066 | + } else { |
|
1085 | 1067 | $props[$this->proptags['busystatus']] = $props[$this->proptags['intendedbusystatus']]; |
1086 | 1068 | } |
1087 | 1069 | // we already have intendedbusystatus value in $props so no need to copy it |
1088 | - } |
|
1089 | - else { |
|
1070 | + } else { |
|
1090 | 1071 | $props[$this->proptags['busystatus']] = $tentative ? fbTentative : fbBusy; |
1091 | 1072 | } |
1092 | 1073 | |
@@ -1117,8 +1098,7 @@ discard block |
||
1117 | 1098 | ], |
1118 | 1099 | ]; |
1119 | 1100 | $recips = mapi_table_queryallrows($reciptable, $this->recipprops, $res); |
1120 | - } |
|
1121 | - else { |
|
1101 | + } else { |
|
1122 | 1102 | $recips = mapi_table_queryallrows($reciptable, $this->recipprops); |
1123 | 1103 | } |
1124 | 1104 | |
@@ -1131,8 +1111,7 @@ discard block |
||
1131 | 1111 | } |
1132 | 1112 | } |
1133 | 1113 | } |
1134 | - } |
|
1135 | - else { |
|
1114 | + } else { |
|
1136 | 1115 | // Here only properties are set on calendaritem, because user is responding from calendar. |
1137 | 1116 | $props = []; |
1138 | 1117 | $props[$this->proptags['responsestatus']] = $tentative ? olResponseTentative : olResponseAccepted; |
@@ -1140,13 +1119,11 @@ discard block |
||
1140 | 1119 | if (isset($messageprops[$this->proptags['intendedbusystatus']])) { |
1141 | 1120 | if ($tentative && $messageprops[$this->proptags['intendedbusystatus']] !== fbFree) { |
1142 | 1121 | $props[$this->proptags['busystatus']] = fbTentative; |
1143 | - } |
|
1144 | - else { |
|
1122 | + } else { |
|
1145 | 1123 | $props[$this->proptags['busystatus']] = $messageprops[$this->proptags['intendedbusystatus']]; |
1146 | 1124 | } |
1147 | 1125 | $props[$this->proptags['intendedbusystatus']] = $messageprops[$this->proptags['intendedbusystatus']]; |
1148 | - } |
|
1149 | - else { |
|
1126 | + } else { |
|
1150 | 1127 | $props[$this->proptags['busystatus']] = $tentative ? fbTentative : fbBusy; |
1151 | 1128 | } |
1152 | 1129 | |
@@ -1169,8 +1146,7 @@ discard block |
||
1169 | 1146 | |
1170 | 1147 | if ($recurr->isException($basedate)) { |
1171 | 1148 | $recurr->modifyException($proposeNewTimeProps + $props, $basedate, $recips); |
1172 | - } |
|
1173 | - else { |
|
1149 | + } else { |
|
1174 | 1150 | $props[$this->proptags['startdate']] = $recurr->getOccurrenceStart($basedate); |
1175 | 1151 | $props[$this->proptags['duedate']] = $recurr->getOccurrenceEnd($basedate); |
1176 | 1152 | |
@@ -1182,8 +1158,7 @@ discard block |
||
1182 | 1158 | |
1183 | 1159 | $recurr->createException($proposeNewTimeProps + $props, $basedate, false, $recips); |
1184 | 1160 | } |
1185 | - } |
|
1186 | - else { |
|
1161 | + } else { |
|
1187 | 1162 | mapi_setprops($this->message, $proposeNewTimeProps + $props); |
1188 | 1163 | } |
1189 | 1164 | mapi_savechanges($this->message); |
@@ -1224,8 +1199,7 @@ discard block |
||
1224 | 1199 | |
1225 | 1200 | $store = $delegatorStore['store']; |
1226 | 1201 | $calFolder = $delegatorStore[PR_IPM_APPOINTMENT_ENTRYID]; |
1227 | - } |
|
1228 | - else { |
|
1202 | + } else { |
|
1229 | 1203 | $calFolder = $this->openDefaultCalendar(); |
1230 | 1204 | $store = $this->store; |
1231 | 1205 | } |
@@ -1319,8 +1293,7 @@ discard block |
||
1319 | 1293 | |
1320 | 1294 | $store = $delegatorStore['store']; |
1321 | 1295 | $calFolder = $delegatorStore[PR_IPM_APPOINTMENT_ENTRYID]; |
1322 | - } |
|
1323 | - else { |
|
1296 | + } else { |
|
1324 | 1297 | $store = $this->store; |
1325 | 1298 | $calFolder = $this->openDefaultCalendar(); |
1326 | 1299 | } |
@@ -1352,8 +1325,7 @@ discard block |
||
1352 | 1325 | // exception found, remove it from calendar |
1353 | 1326 | $this->doRemoveExceptionFromCalendar($basedate, $calendarItem, $store); |
1354 | 1327 | } |
1355 | - } |
|
1356 | - else { |
|
1328 | + } else { |
|
1357 | 1329 | // remove normal / recurring series from calendar |
1358 | 1330 | $entryids = mapi_getprops($calendarItem, [PR_ENTRYID]); |
1359 | 1331 | |
@@ -1368,14 +1340,12 @@ discard block |
||
1368 | 1340 | |
1369 | 1341 | // Move the cancellation mail to wastebasket |
1370 | 1342 | mapi_folder_copymessages($sourcefolder, [$messageprops[PR_ENTRYID]], $wastebasket, MESSAGE_MOVE); |
1371 | - } |
|
1372 | - else { |
|
1343 | + } else { |
|
1373 | 1344 | // Here only properties are set on calendaritem, because user is responding from calendar. |
1374 | 1345 | if ($basedate) { |
1375 | 1346 | // remove the occurrence |
1376 | 1347 | $this->doRemoveExceptionFromCalendar($basedate, $this->message, $store); |
1377 | - } |
|
1378 | - else { |
|
1348 | + } else { |
|
1379 | 1349 | // remove normal/recurring meeting item. |
1380 | 1350 | // Move the message to the waste basket |
1381 | 1351 | mapi_folder_copymessages($sourcefolder, [$messageprops[PR_ENTRYID]], $wastebasket, MESSAGE_MOVE); |
@@ -1423,8 +1393,7 @@ discard block |
||
1423 | 1393 | |
1424 | 1394 | // save changes in the message |
1425 | 1395 | mapi_savechanges($this->message); |
1426 | - } |
|
1427 | - else { |
|
1396 | + } else { |
|
1428 | 1397 | // cancellation of normal meeting request |
1429 | 1398 | // Send the cancellation |
1430 | 1399 | $this->updateMeetingRequest(); |
@@ -1574,8 +1543,7 @@ discard block |
||
1574 | 1543 | } |
1575 | 1544 | } |
1576 | 1545 | } |
1577 | - } |
|
1578 | - else { |
|
1546 | + } else { |
|
1579 | 1547 | // Basedate found, an exception is to be sent |
1580 | 1548 | if ($basedate) { |
1581 | 1549 | $recurr = new Recurrence($this->openDefaultStore(), $this->message); |
@@ -1583,8 +1551,7 @@ discard block |
||
1583 | 1551 | if ($cancel) { |
1584 | 1552 | // @TODO: remove occurrence from Resource's Calendar if resource was booked for whole series |
1585 | 1553 | $this->submitMeetingRequest($this->message, $cancel, $prefix, $basedate, $recurr, false); |
1586 | - } |
|
1587 | - else { |
|
1554 | + } else { |
|
1588 | 1555 | $attach = $recurr->getExceptionAttachment($basedate); |
1589 | 1556 | |
1590 | 1557 | if ($attach) { |
@@ -1603,8 +1570,7 @@ discard block |
||
1603 | 1570 | } |
1604 | 1571 | } |
1605 | 1572 | } |
1606 | - } |
|
1607 | - else { |
|
1573 | + } else { |
|
1608 | 1574 | // This is normal meeting |
1609 | 1575 | $resourceRecipData = $this->bookResources($this->message, $cancel, $prefix); |
1610 | 1576 | |
@@ -1638,8 +1604,7 @@ discard block |
||
1638 | 1604 | |
1639 | 1605 | if (!isset($messageprops[$this->proptags['goid']])) { |
1640 | 1606 | $this->setMeetingRequest($basedate); |
1641 | - } |
|
1642 | - else { |
|
1607 | + } else { |
|
1643 | 1608 | $counter = $messageprops[$this->proptags['last_updatecounter']] + 1; |
1644 | 1609 | |
1645 | 1610 | // increment value of last_updatecounter, last_updatecounter will be common for recurring series |
@@ -1658,8 +1623,7 @@ discard block |
||
1658 | 1623 | if (!$this->isMeetingRequest($props[PR_MESSAGE_CLASS]) && !$this->isMeetingRequestResponse($props[PR_MESSAGE_CLASS]) && !$this->isMeetingCancellation($props[PR_MESSAGE_CLASS])) { |
1659 | 1624 | // we are checking with calendar item |
1660 | 1625 | $calendarItem = $this->message; |
1661 | - } |
|
1662 | - else { |
|
1626 | + } else { |
|
1663 | 1627 | // we are checking with meeting request / response / cancellation mail |
1664 | 1628 | // get calendar items |
1665 | 1629 | $calendarItem = $this->getCorrespondentCalendarItem(true); |
@@ -1791,8 +1755,7 @@ discard block |
||
1791 | 1755 | if (isset($inboxprops[$prop])) { |
1792 | 1756 | return $inboxprops[$prop]; |
1793 | 1757 | } |
1794 | - } |
|
1795 | - catch (MAPIException $e) { |
|
1758 | + } catch (MAPIException $e) { |
|
1796 | 1759 | // public store doesn't support this method |
1797 | 1760 | if ($e->getCode() == MAPI_E_NO_SUPPORT) { |
1798 | 1761 | // don't propagate this error to parent handlers, if store doesn't support it |
@@ -1882,8 +1845,7 @@ discard block |
||
1882 | 1845 | if (($folderProps[PR_ACCESS] & MAPI_ACCESS_CREATE_CONTENTS) === MAPI_ACCESS_CREATE_CONTENTS) { |
1883 | 1846 | $accessToFolder = true; |
1884 | 1847 | } |
1885 | - } |
|
1886 | - catch (MAPIException $e) { |
|
1848 | + } catch (MAPIException $e) { |
|
1887 | 1849 | // we don't have rights to open folder, so return false |
1888 | 1850 | if ($e->getCode() == MAPI_E_NO_ACCESS) { |
1889 | 1851 | return $accessToFolder; |
@@ -1912,8 +1874,7 @@ discard block |
||
1912 | 1874 | $delegatorStore = $this->getDelegatorStore($messageProps[PR_RCVD_REPRESENTING_ENTRYID]); |
1913 | 1875 | |
1914 | 1876 | $store = $delegatorStore['store']; |
1915 | - } |
|
1916 | - else { |
|
1877 | + } else { |
|
1917 | 1878 | $store = $this->store; |
1918 | 1879 | } |
1919 | 1880 | } |
@@ -1923,8 +1884,7 @@ discard block |
||
1923 | 1884 | if (isset($provider[PR_MDB_PROVIDER]) && $provider[PR_MDB_PROVIDER] === ZARAFA_STORE_PUBLIC_GUID) { |
1924 | 1885 | $entryid = mapi_getprops($this->message, [PR_PARENT_ENTRYID]); |
1925 | 1886 | $entryid = $entryid[PR_PARENT_ENTRYID]; |
1926 | - } |
|
1927 | - else { |
|
1887 | + } else { |
|
1928 | 1888 | $entryid = $this->getDefaultFolderEntryID(PR_IPM_APPOINTMENT_ENTRYID, $store); |
1929 | 1889 | if ($entryid === false) { |
1930 | 1890 | $entryid = $this->getBaseEntryID(PR_IPM_APPOINTMENT_ENTRYID, $store); |
@@ -1950,8 +1910,7 @@ discard block |
||
1950 | 1910 | |
1951 | 1911 | try { |
1952 | 1912 | $mailuser = mapi_ab_openentry($ab, $ownerentryid); |
1953 | - } |
|
1954 | - catch (MAPIException $e) { |
|
1913 | + } catch (MAPIException $e) { |
|
1955 | 1914 | return; |
1956 | 1915 | } |
1957 | 1916 | |
@@ -2021,8 +1980,7 @@ discard block |
||
2021 | 1980 | $props[$this->proptags['meetingstatus']] = $imsgprops[$this->proptags['meetingstatus']]; |
2022 | 1981 | $props[$this->proptags['responsestatus']] = $imsgprops[$this->proptags['responsestatus']]; |
2023 | 1982 | $props[PR_SUBJECT] = $imsgprops[PR_SUBJECT]; |
2024 | - } |
|
2025 | - else { |
|
1983 | + } else { |
|
2026 | 1984 | // Exceptions is deleted. |
2027 | 1985 | // Update $messageprops with timings of occurrence |
2028 | 1986 | $messageprops[$this->proptags['startdate']] = $recurr->getOccurrenceStart($basedate); |
@@ -2034,8 +1992,7 @@ discard block |
||
2034 | 1992 | |
2035 | 1993 | $props[$this->proptags['recurring']] = false; |
2036 | 1994 | $props[$this->proptags['is_exception']] = true; |
2037 | - } |
|
2038 | - else { |
|
1995 | + } else { |
|
2039 | 1996 | // we are creating a response from meeting request mail (it could be recurring or non-recurring) |
2040 | 1997 | // Send all recurrence info in response, if this is a recurrence meeting. |
2041 | 1998 | $isRecurring = isset($messageprops[$this->proptags['recurring']]) && $messageprops[$this->proptags['recurring']]; |
@@ -2221,8 +2178,7 @@ discard block |
||
2221 | 2178 | if (!$abitem) { |
2222 | 2179 | return ''; |
2223 | 2180 | } |
2224 | - } |
|
2225 | - catch (MAPIException $e) { |
|
2181 | + } catch (MAPIException $e) { |
|
2226 | 2182 | return ''; |
2227 | 2183 | } |
2228 | 2184 | |
@@ -2319,8 +2275,7 @@ discard block |
||
2319 | 2275 | foreach ($recipients as $key => $recipient) { |
2320 | 2276 | if (isset($recipient[PR_RECIPIENT_FLAGS]) && $recipient[PR_RECIPIENT_FLAGS] == (recipSendable | recipOrganizer)) { |
2321 | 2277 | $hasOrganizer = true; |
2322 | - } |
|
2323 | - elseif ($isException && !isset($recipient[PR_RECIPIENT_FLAGS])) { |
|
2278 | + } elseif ($isException && !isset($recipient[PR_RECIPIENT_FLAGS])) { |
|
2324 | 2279 | // Recipients for an occurrence |
2325 | 2280 | $recipients[$key][PR_RECIPIENT_FLAGS] = recipSendable | recipExceptionalResponse; |
2326 | 2281 | } |
@@ -2459,8 +2414,7 @@ discard block |
||
2459 | 2414 | ], |
2460 | 2415 | ]; |
2461 | 2416 | $recipients = mapi_table_queryallrows($recipientTable, $this->recipprops, $res); |
2462 | - } |
|
2463 | - else { |
|
2417 | + } else { |
|
2464 | 2418 | $recipients = mapi_table_queryallrows($recipientTable, $this->recipprops); |
2465 | 2419 | } |
2466 | 2420 | |
@@ -2556,8 +2510,7 @@ discard block |
||
2556 | 2510 | if ($accessToFolder) { |
2557 | 2511 | $calFolder = mapi_msgstore_openentry($userStore, $userRootProps[PR_IPM_APPOINTMENT_ENTRYID]); |
2558 | 2512 | } |
2559 | - } |
|
2560 | - catch (MAPIException $e) { |
|
2513 | + } catch (MAPIException $e) { |
|
2561 | 2514 | $e->setHandled(); |
2562 | 2515 | $this->errorSetResource = 1; // No access |
2563 | 2516 | } |
@@ -2583,8 +2536,7 @@ discard block |
||
2583 | 2536 | */ |
2584 | 2537 | // $errorSetResource = 2; |
2585 | 2538 | $this->nonAcceptingResources[] = $resourceRecipients[$i]; |
2586 | - } |
|
2587 | - else { |
|
2539 | + } else { |
|
2588 | 2540 | if ($declineRecurringMeetingRequests && !$cancel) { |
2589 | 2541 | // Check if appointment is recurring |
2590 | 2542 | if ($messageprops[$this->proptags['recurring']]) { |
@@ -2644,8 +2596,7 @@ discard block |
||
2644 | 2596 | if (!$newResourceMsg) { |
2645 | 2597 | $newResourceMsg = mapi_folder_createmessage($calFolder); |
2646 | 2598 | } |
2647 | - } |
|
2648 | - else { |
|
2599 | + } else { |
|
2649 | 2600 | $newResourceMsg = mapi_msgstore_openentry($userStore, $rows[0]); |
2650 | 2601 | } |
2651 | 2602 | |
@@ -2659,8 +2610,7 @@ discard block |
||
2659 | 2610 | if ($cancel) { |
2660 | 2611 | $messageprops[$this->proptags['meetingstatus']] = olMeetingCanceled; // The meeting has been canceled |
2661 | 2612 | $messageprops[$this->proptags['busystatus']] = fbFree; // Free |
2662 | - } |
|
2663 | - else { |
|
2613 | + } else { |
|
2664 | 2614 | $messageprops[$this->proptags['meetingstatus']] = olMeetingReceived; // The recipient is receiving the request |
2665 | 2615 | } |
2666 | 2616 | $messageprops[$this->proptags['responsestatus']] = olResponseAccepted; // The resource automatically accepts the appointment |
@@ -2704,8 +2654,7 @@ discard block |
||
2704 | 2654 | $messageprops[PR_SENT_REPRESENTING_ENTRYID] = $ownerentryid; |
2705 | 2655 | $messageprops[PR_SENT_REPRESENTING_SEARCH_KEY] = $ownersearchkey; |
2706 | 2656 | } |
2707 | - } |
|
2708 | - else { |
|
2657 | + } else { |
|
2709 | 2658 | // get organizer information |
2710 | 2659 | $addrInfo = $this->getOwnerAddress($this->store); |
2711 | 2660 | |
@@ -2741,12 +2690,10 @@ discard block |
||
2741 | 2690 | // Update occurrence |
2742 | 2691 | if ($recurr->isException($basedate)) { |
2743 | 2692 | $recurr->modifyException($messageprops, $basedate, $recips); |
2744 | - } |
|
2745 | - else { |
|
2693 | + } else { |
|
2746 | 2694 | $recurr->createException($messageprops, $basedate, false, $recips); |
2747 | 2695 | } |
2748 | - } |
|
2749 | - else { |
|
2696 | + } else { |
|
2750 | 2697 | mapi_setprops($newResourceMsg, $messageprops); |
2751 | 2698 | |
2752 | 2699 | // Copy attachments |
@@ -2770,8 +2717,7 @@ discard block |
||
2770 | 2717 | 'msg' => $newResourceMsg, |
2771 | 2718 | ]; |
2772 | 2719 | $this->includesResources = true; |
2773 | - } |
|
2774 | - else { |
|
2720 | + } else { |
|
2775 | 2721 | /* |
2776 | 2722 | * If no other errors occurred and you have no access to the |
2777 | 2723 | * folder of the resource, throw an error=1. |
@@ -2849,8 +2795,7 @@ discard block |
||
2849 | 2795 | ], |
2850 | 2796 | ]; |
2851 | 2797 | $recips = mapi_table_queryallrows($reciptable, $this->recipprops, $res); |
2852 | - } |
|
2853 | - else { |
|
2798 | + } else { |
|
2854 | 2799 | $recips = mapi_table_queryallrows($reciptable, $this->recipprops); |
2855 | 2800 | } |
2856 | 2801 | |
@@ -2868,13 +2813,11 @@ discard block |
||
2868 | 2813 | if (isset($exception_props[$this->proptags['intendedbusystatus']])) { |
2869 | 2814 | if ($tentative && $exception_props[$this->proptags['intendedbusystatus']] !== fbFree) { |
2870 | 2815 | $exception_props[$this->proptags['busystatus']] = fbTentative; |
2871 | - } |
|
2872 | - else { |
|
2816 | + } else { |
|
2873 | 2817 | $exception_props[$this->proptags['busystatus']] = $exception_props[$this->proptags['intendedbusystatus']]; |
2874 | 2818 | } |
2875 | 2819 | // we already have intendedbusystatus value in $exception_props so no need to copy it |
2876 | - } |
|
2877 | - else { |
|
2820 | + } else { |
|
2878 | 2821 | $exception_props[$this->proptags['busystatus']] = $tentative ? fbTentative : fbBusy; |
2879 | 2822 | } |
2880 | 2823 | |
@@ -2890,8 +2833,7 @@ discard block |
||
2890 | 2833 | |
2891 | 2834 | if ($recurr->isException($basedate)) { |
2892 | 2835 | $recurr->modifyException($exception_props, $basedate, $recips, $occurrenceItem); |
2893 | - } |
|
2894 | - else { |
|
2836 | + } else { |
|
2895 | 2837 | $recurr->createException($exception_props, $basedate, false, $recips, $occurrenceItem); |
2896 | 2838 | } |
2897 | 2839 | |
@@ -2928,8 +2870,7 @@ discard block |
||
2928 | 2870 | |
2929 | 2871 | if ($recurr->isException($basedate)) { |
2930 | 2872 | $recurr->modifyException($exception_props, $basedate, $recips, $occurrenceItem); |
2931 | - } |
|
2932 | - else { |
|
2873 | + } else { |
|
2933 | 2874 | $recurr->createException($exception_props, $basedate, false, $recips, $occurrenceItem); |
2934 | 2875 | } |
2935 | 2876 | |
@@ -3028,8 +2969,7 @@ discard block |
||
3028 | 2969 | |
3029 | 2970 | if (!$deletedRecips) { |
3030 | 2971 | $deletedRecips = array_merge([], $recipients); |
3031 | - } |
|
3032 | - else { |
|
2972 | + } else { |
|
3033 | 2973 | $deletedRecips = array_merge($deletedRecips, $recipients); |
3034 | 2974 | } |
3035 | 2975 | } |
@@ -3174,8 +3114,7 @@ discard block |
||
3174 | 3114 | $newmessageprops[PR_MESSAGE_CLASS] = 'IPM.Schedule.Meeting.Canceled'; |
3175 | 3115 | $newmessageprops[$this->proptags['meetingstatus']] = olMeetingCanceled; // It's a cancel request |
3176 | 3116 | $newmessageprops[$this->proptags['busystatus']] = fbFree; // set the busy status as free |
3177 | - } |
|
3178 | - else { |
|
3117 | + } else { |
|
3179 | 3118 | $newmessageprops[PR_MESSAGE_CLASS] = 'IPM.Schedule.Meeting.Request'; |
3180 | 3119 | $newmessageprops[$this->proptags['meetingstatus']] = olMeetingReceived; // The recipient is receiving the request |
3181 | 3120 | } |
@@ -3343,8 +3282,7 @@ discard block |
||
3343 | 3282 | $sentprops[PR_SENDER_SEARCH_KEY] = $ownersearchkey; |
3344 | 3283 | } |
3345 | 3284 | } |
3346 | - } |
|
3347 | - else { |
|
3285 | + } else { |
|
3348 | 3286 | // normal user is sending mail, so both set of properties will be same |
3349 | 3287 | $userDetails = $this->getOwnerAddress($userStore); |
3350 | 3288 | |
@@ -3508,8 +3446,7 @@ discard block |
||
3508 | 3446 | $message = mapi_attach_openobj($attach, MAPI_MODIFY); |
3509 | 3447 | } |
3510 | 3448 | } |
3511 | - } |
|
3512 | - else { |
|
3449 | + } else { |
|
3513 | 3450 | // use normal message or recurring series message |
3514 | 3451 | $message = $this->message; |
3515 | 3452 | } |
@@ -3552,8 +3489,7 @@ discard block |
||
3552 | 3489 | if (($recipient[PR_RECIPIENT_FLAGS] & recipOrganizer) != recipOrganizer) { |
3553 | 3490 | // Recipient is attendee, set the trackstatus to 'Not Responded' |
3554 | 3491 | $recipient[PR_RECIPIENT_TRACKSTATUS] = olRecipientTrackStatusNone; |
3555 | - } |
|
3556 | - else { |
|
3492 | + } else { |
|
3557 | 3493 | // Recipient is organizer, this is not possible, but for safety |
3558 | 3494 | // it is best to clear the trackstatus for him as well by setting |
3559 | 3495 | // the trackstatus to 'Organized'. |
@@ -3591,8 +3527,7 @@ discard block |
||
3591 | 3527 | |
3592 | 3528 | $store = $delegatorStore['store']; |
3593 | 3529 | $calFolder = $delegatorStore[PR_IPM_APPOINTMENT_ENTRYID]; |
3594 | - } |
|
3595 | - else { |
|
3530 | + } else { |
|
3596 | 3531 | $store = $this->store; |
3597 | 3532 | $calFolder = $this->openDefaultCalendar(); |
3598 | 3533 | } |
@@ -3654,8 +3589,7 @@ discard block |
||
3654 | 3589 | if (isset($props[PR_RCVD_REPRESENTING_ENTRYID])) { |
3655 | 3590 | $delegatorStore = $this->getDelegatorStore($props[PR_RCVD_REPRESENTING_ENTRYID]); |
3656 | 3591 | $store = $delegatorStore['store']; |
3657 | - } |
|
3658 | - else { |
|
3592 | + } else { |
|
3659 | 3593 | $store = $this->store; |
3660 | 3594 | } |
3661 | 3595 | } |
@@ -3743,8 +3677,7 @@ discard block |
||
3743 | 3677 | ++$noOfInstances; |
3744 | 3678 | break; |
3745 | 3679 | } |
3746 | - } |
|
3747 | - else { |
|
3680 | + } else { |
|
3748 | 3681 | ++$noOfInstances; |
3749 | 3682 | break; |
3750 | 3683 | } |
@@ -3755,8 +3688,7 @@ discard block |
||
3755 | 3688 | if ($noOfInstances > 0) { |
3756 | 3689 | $returnValue = $noOfInstances; |
3757 | 3690 | } |
3758 | - } |
|
3759 | - else { |
|
3691 | + } else { |
|
3760 | 3692 | // Get all items in the timeframe that we want to book, and get the goid and busystatus for each item |
3761 | 3693 | $items = getCalendarItems($userStore, $calFolder, $messageProps[$this->proptags['startdate']], $messageProps[$this->proptags['duedate']], [$this->proptags['goid'], $this->proptags['busystatus']]); |
3762 | 3694 | |
@@ -3777,8 +3709,7 @@ discard block |
||
3777 | 3709 | $returnValue = true; |
3778 | 3710 | break; |
3779 | 3711 | } |
3780 | - } |
|
3781 | - else { |
|
3712 | + } else { |
|
3782 | 3713 | $returnValue = true; |
3783 | 3714 | break; |
3784 | 3715 | } |
@@ -3939,8 +3870,7 @@ discard block |
||
3939 | 3870 | foreach ($localCategories as $key => $value) { |
3940 | 3871 | if ($recurrence->isException($key)) { |
3941 | 3872 | $recurrence->modifyException([$this->proptags['categories'] => $value], $key); |
3942 | - } |
|
3943 | - else { |
|
3873 | + } else { |
|
3944 | 3874 | $recurrence->createException([$this->proptags['categories'] => $value], $key, false); |
3945 | 3875 | } |
3946 | 3876 | mapi_savechanges($message); |
@@ -1400,7 +1400,7 @@ discard block |
||
1400 | 1400 | if ($this->tz["timezone"] != 0) { |
1401 | 1401 | // Create user readable timezone information |
1402 | 1402 | $timezone = sprintf( |
1403 | - "(GMT %s%02d:%02d)",-$this->tz["timezone"] > 0 ? "+" : "-", |
|
1403 | + "(GMT %s%02d:%02d)", -$this->tz["timezone"] > 0 ? "+" : "-", |
|
1404 | 1404 | abs($this->tz["timezone"] / 60), |
1405 | 1405 | abs($this->tz["timezone"] % 60) |
1406 | 1406 | ); |
@@ -1951,7 +1951,7 @@ discard block |
||
1951 | 1951 | } |
1952 | 1952 | elseif ($this->recur['regen']) { |
1953 | 1953 | $year_starttime = $this->gmtime($now); |
1954 | - $is_next_leapyear = $this->isLeapYear($year_starttime['tm_year'] + 1900 + 1); // +1 next year |
|
1954 | + $is_next_leapyear = $this->isLeapYear($year_starttime['tm_year'] + 1900 + 1); // +1 next year |
|
1955 | 1955 | $now = $daystart + ($is_next_leapyear ? 31622400 /* Leap year in seconds */ : 31536000 /* year in seconds */); |
1956 | 1956 | |
1957 | 1957 | if ($now <= $dayend) { |
@@ -52,8 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | if (is_array($message)) { |
54 | 54 | $this->messageprops = $message; |
55 | - } |
|
56 | - else { |
|
55 | + } else { |
|
57 | 56 | $this->message = $message; |
58 | 57 | $this->messageprops = mapi_getprops($this->message, $this->proptags); |
59 | 58 | } |
@@ -241,8 +240,7 @@ discard block |
||
241 | 240 | |
242 | 241 | if ($ret["subtype"] == rptMonthNth) { |
243 | 242 | $ret["weekdays"] = $data["monthday"]; |
244 | - } |
|
245 | - else { |
|
243 | + } else { |
|
246 | 244 | $ret["monthday"] = $data["monthday"]; |
247 | 245 | } |
248 | 246 | |
@@ -274,8 +272,7 @@ discard block |
||
274 | 272 | |
275 | 273 | if ($ret["subtype"] == rptMonthNth) { |
276 | 274 | $ret["weekdays"] = $data["monthday"]; |
277 | - } |
|
278 | - else { |
|
275 | + } else { |
|
279 | 276 | $ret["monthday"] = $data["monthday"]; |
280 | 277 | } |
281 | 278 | |
@@ -636,8 +633,7 @@ discard block |
||
636 | 633 | if ($this->recur["subtype"] == rptWeek) { |
637 | 634 | // Daily every workday |
638 | 635 | $rdata .= pack("VVVV", 6 * 24 * 60, 1, 0, 0x3E); |
639 | - } |
|
640 | - else { |
|
636 | + } else { |
|
641 | 637 | // Calc first occ |
642 | 638 | $firstocc = $this->unixDataToRecurData($this->recur["start"]) % ((int) $this->recur["everyn"]); |
643 | 639 | |
@@ -707,8 +703,7 @@ discard block |
||
707 | 703 | |
708 | 704 | if ($this->recur["regen"]) { |
709 | 705 | $rdata .= pack("VVV", $firstocc, (int) $this->recur["everyn"], 1); |
710 | - } |
|
711 | - else { |
|
706 | + } else { |
|
712 | 707 | $rdata .= pack("VVVV", $firstocc, (int) $this->recur["everyn"], 0, (int) $this->recur["weekdays"]); |
713 | 708 | } |
714 | 709 | break; |
@@ -727,8 +722,7 @@ discard block |
||
727 | 722 | if ($everyn > 99 || $everyn < 0) { |
728 | 723 | return; |
729 | 724 | } |
730 | - } |
|
731 | - else { |
|
725 | + } else { |
|
732 | 726 | $everyn = $this->recur["regen"] ? ((int) $this->recur["everyn"]) * 12 : 12; |
733 | 727 | } |
734 | 728 | |
@@ -771,18 +765,15 @@ discard block |
||
771 | 765 | if ($rtype == IDC_RCEV_PAT_ORB_YEARLY) { |
772 | 766 | if ($curmonth > $selmonth) {// go to next occurrence in 'everyn' months minus difference in first occurrence and original date |
773 | 767 | $count = $everyn - ($curmonth - $selmonth); |
774 | - } |
|
775 | - elseif ($curmonth < $selmonth) {// go to next occurrence upto difference in first occurrence and original date |
|
768 | + } elseif ($curmonth < $selmonth) {// go to next occurrence upto difference in first occurrence and original date |
|
776 | 769 | $count = $selmonth - $curmonth; |
777 | - } |
|
778 | - else { |
|
770 | + } else { |
|
779 | 771 | // Go to next occurrence while recurrence start date is greater than occurrence date but within same month |
780 | 772 | if (((int) $this->recur["monthday"]) < $curmonthday) { |
781 | 773 | $count = $everyn; |
782 | 774 | } |
783 | 775 | } |
784 | - } |
|
785 | - else { |
|
776 | + } else { |
|
786 | 777 | $count = $everyn; // Monthly, go to next occurrence in 'everyn' months |
787 | 778 | } |
788 | 779 | |
@@ -819,8 +810,7 @@ discard block |
||
819 | 810 | } |
820 | 811 | |
821 | 812 | $rdata .= pack("VVVV", $firstocc, $everyn, $this->recur["regen"], (int) $this->recur["monthday"]); |
822 | - } |
|
823 | - else { |
|
813 | + } else { |
|
824 | 814 | // Calc first occ |
825 | 815 | $firstocc = 0; |
826 | 816 | $monthIndex = (int) gmdate("n", $this->recur["start"]); |
@@ -848,8 +838,7 @@ discard block |
||
848 | 838 | if ($nday == 5) { |
849 | 839 | // Set date on the last day of the last month |
850 | 840 | $monthbegindow += (gmdate("t", $monthbegindow) - gmdate("j", $monthbegindow)) * 24 * 60 * 60; |
851 | - } |
|
852 | - else { |
|
841 | + } else { |
|
853 | 842 | // Set on the first day of the month |
854 | 843 | $monthbegindow -= ((gmdate("j", $monthbegindow) - 1) * 24 * 60 * 60); |
855 | 844 | } |
@@ -858,8 +847,7 @@ discard block |
||
858 | 847 | // Set on right month |
859 | 848 | if ($selmonth < $curmonth) { |
860 | 849 | $tmp = 12 - $curmonth + $selmonth; |
861 | - } |
|
862 | - else { |
|
850 | + } else { |
|
863 | 851 | $tmp = ($selmonth - $curmonth); |
864 | 852 | } |
865 | 853 | |
@@ -872,8 +860,7 @@ discard block |
||
872 | 860 | } |
873 | 861 | ++$curmonth; |
874 | 862 | } |
875 | - } |
|
876 | - else { |
|
863 | + } else { |
|
877 | 864 | // Check or you exist in the right month |
878 | 865 | |
879 | 866 | $dayofweek = gmdate("w", $monthbegindow); |
@@ -932,8 +919,7 @@ discard block |
||
932 | 919 | } |
933 | 920 | if ($nday == 5) { |
934 | 921 | $monthbegindow -= $day * 24 * 60 * 60; |
935 | - } |
|
936 | - else { |
|
922 | + } else { |
|
937 | 923 | $monthbegindow += ($day - 1) * 24 * 60 * 60; |
938 | 924 | } |
939 | 925 | |
@@ -947,8 +933,7 @@ discard block |
||
947 | 933 | } |
948 | 934 | |
949 | 935 | $rdata .= pack("VVVVV", $firstocc, $everyn, 0, $weekdays, $nday); |
950 | - } |
|
951 | - else { |
|
936 | + } else { |
|
952 | 937 | // Calc first occ |
953 | 938 | $monthIndex = (int) gmdate("n", $this->recur["start"]); |
954 | 939 | |
@@ -991,8 +976,7 @@ discard block |
||
991 | 976 | // Strange little thing for the recurrence type "every workday" |
992 | 977 | if ($rtype == IDC_RCEV_PAT_ORB_WEEKLY && ((int) $this->recur["subtype"]) == 1) { |
993 | 978 | $rdata .= pack("V", 1); |
994 | - } |
|
995 | - else { // Other recurrences |
|
979 | + } else { // Other recurrences |
|
996 | 980 | $rdata .= pack("V", 0); |
997 | 981 | } |
998 | 982 | |
@@ -1069,8 +1053,7 @@ discard block |
||
1069 | 1053 | |
1070 | 1054 | $occenddate += 24 * 60 * 60; |
1071 | 1055 | } |
1072 | - } |
|
1073 | - else { |
|
1056 | + } else { |
|
1074 | 1057 | // -1 because the first day already counts (from 1-1-1980 to 1-1-1980 is 1 occurrence) |
1075 | 1058 | $occenddate += (((int) $this->recur["everyn"]) * 60 * ((int) $this->recur["numoccur"] - 1)); |
1076 | 1059 | } |
@@ -1118,8 +1101,7 @@ discard block |
||
1118 | 1101 | if ($curmonth >= 12) { |
1119 | 1102 | $curmonth = 1; |
1120 | 1103 | ++$curyear; |
1121 | - } |
|
1122 | - else { |
|
1104 | + } else { |
|
1123 | 1105 | ++$curmonth; |
1124 | 1106 | } |
1125 | 1107 | --$forwardcount; |
@@ -1130,8 +1112,7 @@ discard block |
||
1130 | 1112 | gmdate("j", $occenddate) < ((int) $this->recur["monthday"])) { |
1131 | 1113 | if (gmdate("j", $occenddate) < 28) { |
1132 | 1114 | $occenddate -= gmdate("j", $occenddate) * 24 * 60 * 60; |
1133 | - } |
|
1134 | - else { |
|
1115 | + } else { |
|
1135 | 1116 | $occenddate += (gmdate("t", $occenddate) - gmdate("j", $occenddate)) * 24 * 60 * 60; |
1136 | 1117 | } |
1137 | 1118 | } |
@@ -1147,8 +1128,7 @@ discard block |
||
1147 | 1128 | if ($curmonth >= 12) { |
1148 | 1129 | $curmonth = 1; |
1149 | 1130 | ++$curyear; |
1150 | - } |
|
1151 | - else { |
|
1131 | + } else { |
|
1152 | 1132 | ++$curmonth; |
1153 | 1133 | } |
1154 | 1134 | |
@@ -1158,8 +1138,7 @@ discard block |
||
1158 | 1138 | if ($nday == 5) { |
1159 | 1139 | // Set date on the last day of the last month |
1160 | 1140 | $occenddate += (gmdate("t", $occenddate) - gmdate("j", $occenddate)) * 24 * 60 * 60; |
1161 | - } |
|
1162 | - else { |
|
1141 | + } else { |
|
1163 | 1142 | // Set date on the first day of the last month |
1164 | 1143 | $occenddate -= (gmdate("j", $occenddate) - 1) * 24 * 60 * 60; |
1165 | 1144 | } |
@@ -1226,8 +1205,7 @@ discard block |
||
1226 | 1205 | |
1227 | 1206 | // set named prop 'side_effects' to 369, needed for Outlook to ask for single or total recurrence when deleting |
1228 | 1207 | $propsToSet[$this->proptags["side_effects"]] = 369; |
1229 | - } |
|
1230 | - else { |
|
1208 | + } else { |
|
1231 | 1209 | $propsToSet[$this->proptags["side_effects"]] = 3441; |
1232 | 1210 | } |
1233 | 1211 | |
@@ -1257,12 +1235,10 @@ discard block |
||
1257 | 1235 | if ($occ) { |
1258 | 1236 | if (isset($reminderprops[$this->proptags["flagdueby"]])) { |
1259 | 1237 | $propsToSet[$this->proptags["flagdueby"]] = $reminderprops[$this->proptags["flagdueby"]]; |
1260 | - } |
|
1261 | - else { |
|
1238 | + } else { |
|
1262 | 1239 | $propsToSet[$this->proptags["flagdueby"]] = $occ[$this->proptags["startdate"]] - ($reminderprops[$this->proptags["reminder_minutes"]] * 60); |
1263 | 1240 | } |
1264 | - } |
|
1265 | - else { |
|
1241 | + } else { |
|
1266 | 1242 | // Last reminder passed, no reminders any more. |
1267 | 1243 | $propsToSet[$this->proptags["reminder"]] = false; |
1268 | 1244 | $propsToSet[$this->proptags["flagdueby"]] = 0x7FF00000; |
@@ -1487,11 +1463,9 @@ discard block |
||
1487 | 1463 | public function getMonthInSeconds($year, $month): int { |
1488 | 1464 | if (in_array($month, [1, 3, 5, 7, 8, 10, 12])) { |
1489 | 1465 | $day = 31; |
1490 | - } |
|
1491 | - elseif (in_array($month, [4, 6, 9, 11])) { |
|
1466 | + } elseif (in_array($month, [4, 6, 9, 11])) { |
|
1492 | 1467 | $day = 30; |
1493 | - } |
|
1494 | - else { |
|
1468 | + } else { |
|
1495 | 1469 | $day = 28; |
1496 | 1470 | if ($this->isLeapYear($year) == 1) { |
1497 | 1471 | ++$day; |
@@ -1561,8 +1535,7 @@ discard block |
||
1561 | 1535 | if ($date > $dststart && $date < $dstend) { |
1562 | 1536 | $dst = true; |
1563 | 1537 | } |
1564 | - } |
|
1565 | - else { |
|
1538 | + } else { |
|
1566 | 1539 | // Southern hemisphere, eg DST is during Oct-Mar |
1567 | 1540 | if ($date < $dstend || $date > $dststart) { |
1568 | 1541 | $dst = true; |
@@ -1761,8 +1734,7 @@ discard block |
||
1761 | 1734 | |
1762 | 1735 | if (isset($this->recur['regen'], $this->action['datecompleted']) && $this->recur['regen']) { |
1763 | 1736 | $daystart = $this->dayStartOf($this->action['datecompleted']); |
1764 | - } |
|
1765 | - else { |
|
1737 | + } else { |
|
1766 | 1738 | $daystart = $this->dayStartOf($this->recur["start"]); // start on first day of occurrence |
1767 | 1739 | } |
1768 | 1740 | |
@@ -1770,8 +1742,7 @@ discard block |
||
1770 | 1742 | // or the end of the recurrence, whichever comes first |
1771 | 1743 | if ($end > $this->toGMT($this->tz, $this->recur["end"])) { |
1772 | 1744 | $rangeend = $this->toGMT($this->tz, $this->recur["end"]); |
1773 | - } |
|
1774 | - else { |
|
1745 | + } else { |
|
1775 | 1746 | $rangeend = $end; |
1776 | 1747 | } |
1777 | 1748 | |
@@ -1791,8 +1762,7 @@ discard block |
||
1791 | 1762 | for ($now = $daystart; $now <= $dayend && ($limit == 0 || count($items) < $limit); $now += 60 * $this->recur["everyn"]) { |
1792 | 1763 | $this->processOccurrenceItem($items, $start, $end, $now, $this->recur["startocc"], $this->recur["endocc"], $this->tz, $remindersonly); |
1793 | 1764 | } |
1794 | - } |
|
1795 | - else { |
|
1765 | + } else { |
|
1796 | 1766 | // Every workday |
1797 | 1767 | for ($now = $daystart; $now <= $dayend && ($limit == 0 || count($items) < $limit); $now += 60 * 1440) { |
1798 | 1768 | $nowtime = $this->gmtime($now); |
@@ -1816,8 +1786,7 @@ discard block |
||
1816 | 1786 | for ($now = $daystart; $now <= $dayend && ($limit == 0 || count($items) < $limit); $now += (60 * 60 * 24 * 7 * $this->recur["everyn"])) { |
1817 | 1787 | if ($this->recur['regen']) { |
1818 | 1788 | $this->processOccurrenceItem($items, $start, $end, $now, $this->recur["startocc"], $this->recur["endocc"], $this->tz, $remindersonly); |
1819 | - } |
|
1820 | - else { |
|
1789 | + } else { |
|
1821 | 1790 | // Loop through the whole following week to the first occurrence of the week, add each day that is specified |
1822 | 1791 | for ($wday = 0; $wday < 7; ++$wday) { |
1823 | 1792 | $daynow = $now + $wday * 60 * 60 * 24; |
@@ -1850,8 +1819,7 @@ discard block |
||
1850 | 1819 | if ($daynow <= $dayend) { |
1851 | 1820 | $this->processOccurrenceItem($items, $start, $end, $daynow, $this->recur["startocc"], $this->recur["endocc"], $this->tz, $remindersonly); |
1852 | 1821 | } |
1853 | - } |
|
1854 | - elseif (isset($this->recur["nday"], $this->recur["weekdays"])) { // Nth [weekday] of every N months |
|
1822 | + } elseif (isset($this->recur["nday"], $this->recur["weekdays"])) { // Nth [weekday] of every N months |
|
1855 | 1823 | // Sanitize input |
1856 | 1824 | if ($this->recur["weekdays"] == 0) { |
1857 | 1825 | $this->recur["weekdays"] = 1; |
@@ -1877,8 +1845,7 @@ discard block |
||
1877 | 1845 | } |
1878 | 1846 | // $firstday is the day of the month on which the asked pattern of nth weekday matches |
1879 | 1847 | $daynow = $now + $firstday * 60 * 60 * 24; |
1880 | - } |
|
1881 | - else { |
|
1848 | + } else { |
|
1882 | 1849 | // Find last day in the month ($now is the firstday of the month) |
1883 | 1850 | $NumDaysInMonth = $this->daysInMonth($now, 1); |
1884 | 1851 | $daynow = $now + (($NumDaysInMonth - 1) * 24 * 60 * 60); |
@@ -1896,8 +1863,7 @@ discard block |
||
1896 | 1863 | if ($daynow <= $dayend && $daynow >= $daystart) { |
1897 | 1864 | $this->processOccurrenceItem($items, $start, $end, $daynow, $this->recur["startocc"], $this->recur["endocc"], $this->tz, $remindersonly); |
1898 | 1865 | } |
1899 | - } |
|
1900 | - elseif ($this->recur['regen']) { |
|
1866 | + } elseif ($this->recur['regen']) { |
|
1901 | 1867 | $next_month_start = $now + ($this->daysInMonth($now, 1) * 24 * 60 * 60); |
1902 | 1868 | $now = $daystart + ($this->daysInMonth($next_month_start, $this->recur['everyn']) * 24 * 60 * 60); |
1903 | 1869 | |
@@ -1924,8 +1890,7 @@ discard block |
||
1924 | 1890 | } // Cap $monthday on month length (eg 28 feb instead of 29 feb) |
1925 | 1891 | $daynow = $monthstart + ($monthday - 1) * 24 * 60 * 60; |
1926 | 1892 | $this->processOccurrenceItem($items, $start, $end, $daynow, $this->recur["startocc"], $this->recur["endocc"], $this->tz, $remindersonly); |
1927 | - } |
|
1928 | - elseif (isset($this->recur["nday"], $this->recur["weekdays"])) { // Nth [weekday] in month X of every N years |
|
1893 | + } elseif (isset($this->recur["nday"], $this->recur["weekdays"])) { // Nth [weekday] in month X of every N years |
|
1929 | 1894 | // Go the correct month |
1930 | 1895 | $monthnow = $now + $this->daysInMonth($now, $this->monthOfYear($this->recur["month"])) * 24 * 60 * 60; |
1931 | 1896 | |
@@ -1948,8 +1913,7 @@ discard block |
||
1948 | 1913 | } |
1949 | 1914 | |
1950 | 1915 | $this->processOccurrenceItem($items, $start, $end, $daynow, $this->recur["startocc"], $this->recur["endocc"], $this->tz, $remindersonly); |
1951 | - } |
|
1952 | - elseif ($this->recur['regen']) { |
|
1916 | + } elseif ($this->recur['regen']) { |
|
1953 | 1917 | $year_starttime = $this->gmtime($now); |
1954 | 1918 | $is_next_leapyear = $this->isLeapYear($year_starttime['tm_year'] + 1900 + 1); // +1 next year |
1955 | 1919 | $now = $daystart + ($is_next_leapyear ? 31622400 /* Leap year in seconds */ : 31536000 /* year in seconds */); |
@@ -169,8 +169,7 @@ discard block |
||
169 | 169 | } |
170 | 170 | |
171 | 171 | $props[$this->proptags["dead_occurrence"]] = false; |
172 | - } |
|
173 | - else { |
|
172 | + } else { |
|
174 | 173 | if (isset($this->action['deleteOccurrence']) && $this->action['deleteOccurrence']) { |
175 | 174 | return false; |
176 | 175 | } |
@@ -328,8 +327,7 @@ discard block |
||
328 | 327 | // If startdate and enddate are set on task, then slide enddate according to duration |
329 | 328 | if (isset($this->messageprops[$this->proptags["startdate"]], $this->messageprops[$this->proptags["duedate"]])) { |
330 | 329 | $newItem[$this->proptags['duedate']] = $newItem[$this->proptags['startdate']] + ($this->messageprops[$this->proptags["duedate"]] - $this->messageprops[$this->proptags["startdate"]]); |
331 | - } |
|
332 | - else { |
|
330 | + } else { |
|
333 | 331 | $newItem[$this->proptags['duedate']] = $newItem[$this->proptags['startdate']]; |
334 | 332 | } |
335 | 333 | |
@@ -383,8 +381,7 @@ discard block |
||
383 | 381 | $props[$this->proptags['flagdueby']] = $next_reminder_time; |
384 | 382 | $this->action['reminder'] = $props[$this->proptags['reminder']] = true; |
385 | 383 | } |
386 | - } |
|
387 | - else { |
|
384 | + } else { |
|
388 | 385 | // Didn't get next occurrence, probably this is the last occurrence |
389 | 386 | $props[$this->proptags['reminder']] = false; |
390 | 387 | $props[$this->proptags['reset_reminder']] = false; |