@@ -304,8 +304,7 @@ discard block |
||
| 304 | 304 | if (isset($messageprops[PR_RCVD_REPRESENTING_ENTRYID])) { |
| 305 | 305 | $delegatorStore = $this->getDelegatorStore($messageprops[PR_RCVD_REPRESENTING_ENTRYID], [PR_IPM_APPOINTMENT_ENTRYID]); |
| 306 | 306 | $userStore = $delegatorStore['store']; |
| 307 | - } |
|
| 308 | - else { |
|
| 307 | + } else { |
|
| 309 | 308 | $userStore = $this->store; |
| 310 | 309 | } |
| 311 | 310 | |
@@ -373,8 +372,7 @@ discard block |
||
| 373 | 372 | // Create/modify exception |
| 374 | 373 | if ($recurr->isException($basedate)) { |
| 375 | 374 | $recurr->modifyException($exception_props, $basedate); |
| 376 | - } |
|
| 377 | - else { |
|
| 375 | + } else { |
|
| 378 | 376 | // When we are creating an exception we need copy recipients from main recurring item |
| 379 | 377 | $recipTable = mapi_message_getrecipienttable($calendarItem); |
| 380 | 378 | $recips = mapi_table_queryallrows($recipTable, $this->recipprops); |
@@ -392,8 +390,7 @@ discard block |
||
| 392 | 390 | if ($attach) { |
| 393 | 391 | $recurringItem = $calendarItem; |
| 394 | 392 | $calendarItem = mapi_attach_openobj($attach, MAPI_MODIFY); |
| 395 | - } |
|
| 396 | - else { |
|
| 393 | + } else { |
|
| 397 | 394 | return false; |
| 398 | 395 | } |
| 399 | 396 | } |
@@ -480,8 +477,7 @@ discard block |
||
| 480 | 477 | $props = []; |
| 481 | 478 | if ($messageprops[$this->proptags['counter_proposal']]) { |
| 482 | 479 | $props[$this->proptags['counter_proposal']] = true; |
| 483 | - } |
|
| 484 | - else { |
|
| 480 | + } else { |
|
| 485 | 481 | $props[$this->proptags['counter_proposal']] = false; |
| 486 | 482 | } |
| 487 | 483 | |
@@ -537,8 +533,7 @@ discard block |
||
| 537 | 533 | |
| 538 | 534 | $store = $delegatorStore['store']; |
| 539 | 535 | $calFolder = $delegatorStore[PR_IPM_APPOINTMENT_ENTRYID]; |
| 540 | - } |
|
| 541 | - else { |
|
| 536 | + } else { |
|
| 542 | 537 | $store = $this->store; |
| 543 | 538 | $calFolder = $this->openDefaultCalendar(); |
| 544 | 539 | } |
@@ -566,13 +561,11 @@ discard block |
||
| 566 | 561 | |
| 567 | 562 | if ($recurr->isException($basedate)) { |
| 568 | 563 | $recurr->modifyException($messageProps, $basedate); |
| 569 | - } |
|
| 570 | - else { |
|
| 564 | + } else { |
|
| 571 | 565 | $recurr->createException($messageProps, $basedate); |
| 572 | 566 | } |
| 573 | 567 | } |
| 574 | - } |
|
| 575 | - else { |
|
| 568 | + } else { |
|
| 576 | 569 | // set the properties of the cancellation object |
| 577 | 570 | mapi_setprops($calendarItem, $messageProps); |
| 578 | 571 | } |
@@ -626,8 +619,7 @@ discard block |
||
| 626 | 619 | |
| 627 | 620 | $store = $delegatorStore['store']; |
| 628 | 621 | $calFolder = $delegatorStore[PR_IPM_APPOINTMENT_ENTRYID]; |
| 629 | - } |
|
| 630 | - else { |
|
| 622 | + } else { |
|
| 631 | 623 | $calFolder = $this->openDefaultCalendar(); |
| 632 | 624 | $store = $this->store; |
| 633 | 625 | } |
@@ -690,8 +682,7 @@ discard block |
||
| 690 | 682 | $senderEntryId = isset($messageprops[PR_SENT_REPRESENTING_ENTRYID]) ? $messageprops[PR_SENT_REPRESENTING_ENTRYID] : $messageprops[PR_SENDER_ENTRYID]; |
| 691 | 683 | if (isset($messageprops[PR_RECEIVED_BY_ENTRYID]) && $GLOBALS["entryid"]->compareEntryIds($senderEntryId, $messageprops[PR_RECEIVED_BY_ENTRYID])) { |
| 692 | 684 | $entryid = $this->accept(false, $sendresponse, $move, $proposeNewTimeProps, $body, true, $store, $calFolder, $basedate); |
| 693 | - } |
|
| 694 | - else { |
|
| 685 | + } else { |
|
| 695 | 686 | $entryid = $this->accept($tentative, $sendresponse, $move, $proposeNewTimeProps, $body, $userAction, $store, $calFolder, $basedate); |
| 696 | 687 | } |
| 697 | 688 | |
@@ -745,8 +736,7 @@ discard block |
||
| 745 | 736 | if (!$calendarItem) { |
| 746 | 737 | // Recurring item not found, so create new meeting in Calendar |
| 747 | 738 | $calendarItem = mapi_folder_createmessage($calFolder); |
| 748 | - } |
|
| 749 | - else { |
|
| 739 | + } else { |
|
| 750 | 740 | // we have found the main recurring item, check if this meeting request is already processed |
| 751 | 741 | if (isset($messageprops[PR_PROCESSED]) && $messageprops[PR_PROCESSED] == true) { |
| 752 | 742 | // only set required properties, other properties are already copied when processing this meeting request |
@@ -768,8 +758,7 @@ discard block |
||
| 768 | 758 | if (isset($props[$this->proptags['reminderminutes']])) { |
| 769 | 759 | $props[$this->proptags['flagdueby']] = $props[$this->proptags['startdate']] - ($props[$this->proptags['reminderminutes']] * 60); |
| 770 | 760 | } |
| 771 | - } |
|
| 772 | - else { |
|
| 761 | + } else { |
|
| 773 | 762 | // only get required properties so we will not overwrite existing updated properties from calendar |
| 774 | 763 | $props = mapi_getprops($this->message, [PR_ENTRYID]); |
| 775 | 764 | } |
@@ -790,13 +779,11 @@ discard block |
||
| 790 | 779 | if (isset($props[$this->proptags['intendedbusystatus']])) { |
| 791 | 780 | if ($tentative && $props[$this->proptags['intendedbusystatus']] !== fbFree) { |
| 792 | 781 | $props[$this->proptags['busystatus']] = fbTentative; |
| 793 | - } |
|
| 794 | - else { |
|
| 782 | + } else { |
|
| 795 | 783 | $props[$this->proptags['busystatus']] = $props[$this->proptags['intendedbusystatus']]; |
| 796 | 784 | } |
| 797 | 785 | // we already have intendedbusystatus value in $props so no need to copy it |
| 798 | - } |
|
| 799 | - else { |
|
| 786 | + } else { |
|
| 800 | 787 | $props[$this->proptags['busystatus']] = $tentative ? fbTentative : fbBusy; |
| 801 | 788 | } |
| 802 | 789 | |
@@ -859,8 +846,7 @@ discard block |
||
| 859 | 846 | } |
| 860 | 847 | |
| 861 | 848 | $entryid = $props[PR_ENTRYID]; |
| 862 | - } |
|
| 863 | - else { |
|
| 849 | + } else { |
|
| 864 | 850 | /** |
| 865 | 851 | * This meeting request is not recurring, so can be an exception or normal meeting. |
| 866 | 852 | * If exception then find main recurring item and update exception |
@@ -933,13 +919,11 @@ discard block |
||
| 933 | 919 | if (isset($messageprops[$this->proptags['intendedbusystatus']])) { |
| 934 | 920 | if ($tentative && $messageprops[$this->proptags['intendedbusystatus']] !== fbFree) { |
| 935 | 921 | $calItemProps[$this->proptags['busystatus']] = fbTentative; |
| 936 | - } |
|
| 937 | - else { |
|
| 922 | + } else { |
|
| 938 | 923 | $calItemProps[$this->proptags['busystatus']] = $messageprops[$this->proptags['intendedbusystatus']]; |
| 939 | 924 | } |
| 940 | 925 | $calItemProps[$this->proptags['intendedbusystatus']] = $messageprops[$this->proptags['intendedbusystatus']]; |
| 941 | - } |
|
| 942 | - else { |
|
| 926 | + } else { |
|
| 943 | 927 | $calItemProps[$this->proptags['busystatus']] = $tentative ? fbTentative : fbBusy; |
| 944 | 928 | } |
| 945 | 929 | |
@@ -989,8 +973,7 @@ discard block |
||
| 989 | 973 | |
| 990 | 974 | $messageprops = mapi_getprops($calmsg, [PR_ENTRYID]); |
| 991 | 975 | $entryid = $messageprops[PR_ENTRYID]; |
| 992 | - } |
|
| 993 | - else { |
|
| 976 | + } else { |
|
| 994 | 977 | // Create a new appointment with duplicate properties and recipient, but as an IPM.Appointment |
| 995 | 978 | $new = mapi_folder_createmessage($calFolder); |
| 996 | 979 | $props = mapi_getprops($this->message); |
@@ -1036,13 +1019,11 @@ discard block |
||
| 1036 | 1019 | if (isset($props[$this->proptags['intendedbusystatus']])) { |
| 1037 | 1020 | if ($tentative && $props[$this->proptags['intendedbusystatus']] !== fbFree) { |
| 1038 | 1021 | $props[$this->proptags['busystatus']] = fbTentative; |
| 1039 | - } |
|
| 1040 | - else { |
|
| 1022 | + } else { |
|
| 1041 | 1023 | $props[$this->proptags['busystatus']] = $props[$this->proptags['intendedbusystatus']]; |
| 1042 | 1024 | } |
| 1043 | 1025 | // we already have intendedbusystatus value in $props so no need to copy it |
| 1044 | - } |
|
| 1045 | - else { |
|
| 1026 | + } else { |
|
| 1046 | 1027 | $props[$this->proptags['busystatus']] = $tentative ? fbTentative : fbBusy; |
| 1047 | 1028 | } |
| 1048 | 1029 | |
@@ -1072,8 +1053,7 @@ discard block |
||
| 1072 | 1053 | ], |
| 1073 | 1054 | ]; |
| 1074 | 1055 | $recips = mapi_table_queryallrows($reciptable, $this->recipprops, $res); |
| 1075 | - } |
|
| 1076 | - else { |
|
| 1056 | + } else { |
|
| 1077 | 1057 | $recips = mapi_table_queryallrows($reciptable, $this->recipprops); |
| 1078 | 1058 | } |
| 1079 | 1059 | |
@@ -1086,8 +1066,7 @@ discard block |
||
| 1086 | 1066 | } |
| 1087 | 1067 | } |
| 1088 | 1068 | } |
| 1089 | - } |
|
| 1090 | - else { |
|
| 1069 | + } else { |
|
| 1091 | 1070 | // Here only properties are set on calendaritem, because user is responding from calendar. |
| 1092 | 1071 | $props = []; |
| 1093 | 1072 | $props[$this->proptags['responsestatus']] = $tentative ? olResponseTentative : olResponseAccepted; |
@@ -1095,13 +1074,11 @@ discard block |
||
| 1095 | 1074 | if (isset($messageprops[$this->proptags['intendedbusystatus']])) { |
| 1096 | 1075 | if ($tentative && $messageprops[$this->proptags['intendedbusystatus']] !== fbFree) { |
| 1097 | 1076 | $props[$this->proptags['busystatus']] = fbTentative; |
| 1098 | - } |
|
| 1099 | - else { |
|
| 1077 | + } else { |
|
| 1100 | 1078 | $props[$this->proptags['busystatus']] = $messageprops[$this->proptags['intendedbusystatus']]; |
| 1101 | 1079 | } |
| 1102 | 1080 | $props[$this->proptags['intendedbusystatus']] = $messageprops[$this->proptags['intendedbusystatus']]; |
| 1103 | - } |
|
| 1104 | - else { |
|
| 1081 | + } else { |
|
| 1105 | 1082 | $props[$this->proptags['busystatus']] = $tentative ? fbTentative : fbBusy; |
| 1106 | 1083 | } |
| 1107 | 1084 | |
@@ -1124,8 +1101,7 @@ discard block |
||
| 1124 | 1101 | |
| 1125 | 1102 | if ($recurr->isException($basedate)) { |
| 1126 | 1103 | $recurr->modifyException($proposeNewTimeProps + $props, $basedate, $recips); |
| 1127 | - } |
|
| 1128 | - else { |
|
| 1104 | + } else { |
|
| 1129 | 1105 | $props[$this->proptags['startdate']] = $recurr->getOccurrenceStart($basedate); |
| 1130 | 1106 | $props[$this->proptags['duedate']] = $recurr->getOccurrenceEnd($basedate); |
| 1131 | 1107 | |
@@ -1137,8 +1113,7 @@ discard block |
||
| 1137 | 1113 | |
| 1138 | 1114 | $recurr->createException($proposeNewTimeProps + $props, $basedate, false, $recips); |
| 1139 | 1115 | } |
| 1140 | - } |
|
| 1141 | - else { |
|
| 1116 | + } else { |
|
| 1142 | 1117 | mapi_setprops($this->message, $proposeNewTimeProps + $props); |
| 1143 | 1118 | } |
| 1144 | 1119 | mapi_savechanges($this->message); |
@@ -1179,8 +1154,7 @@ discard block |
||
| 1179 | 1154 | |
| 1180 | 1155 | $store = $delegatorStore['store']; |
| 1181 | 1156 | $calFolder = $delegatorStore[PR_IPM_APPOINTMENT_ENTRYID]; |
| 1182 | - } |
|
| 1183 | - else { |
|
| 1157 | + } else { |
|
| 1184 | 1158 | $calFolder = $this->openDefaultCalendar(); |
| 1185 | 1159 | $store = $this->store; |
| 1186 | 1160 | } |
@@ -1272,8 +1246,7 @@ discard block |
||
| 1272 | 1246 | |
| 1273 | 1247 | $store = $delegatorStore['store']; |
| 1274 | 1248 | $calFolder = $delegatorStore[PR_IPM_APPOINTMENT_ENTRYID]; |
| 1275 | - } |
|
| 1276 | - else { |
|
| 1249 | + } else { |
|
| 1277 | 1250 | $store = $this->store; |
| 1278 | 1251 | $calFolder = $this->openDefaultCalendar(); |
| 1279 | 1252 | } |
@@ -1305,8 +1278,7 @@ discard block |
||
| 1305 | 1278 | // exception found, remove it from calendar |
| 1306 | 1279 | $this->doRemoveExceptionFromCalendar($basedate, $calendarItem, $store); |
| 1307 | 1280 | } |
| 1308 | - } |
|
| 1309 | - else { |
|
| 1281 | + } else { |
|
| 1310 | 1282 | // remove normal / recurring series from calendar |
| 1311 | 1283 | $entryids = mapi_getprops($calendarItem, [PR_ENTRYID]); |
| 1312 | 1284 | |
@@ -1321,14 +1293,12 @@ discard block |
||
| 1321 | 1293 | |
| 1322 | 1294 | // Move the cancellation mail to wastebasket |
| 1323 | 1295 | mapi_folder_copymessages($sourcefolder, [$messageprops[PR_ENTRYID]], $wastebasket, MESSAGE_MOVE); |
| 1324 | - } |
|
| 1325 | - else { |
|
| 1296 | + } else { |
|
| 1326 | 1297 | // Here only properties are set on calendaritem, because user is responding from calendar. |
| 1327 | 1298 | if ($basedate) { |
| 1328 | 1299 | // remove the occurrence |
| 1329 | 1300 | $this->doRemoveExceptionFromCalendar($basedate, $this->message, $store); |
| 1330 | - } |
|
| 1331 | - else { |
|
| 1301 | + } else { |
|
| 1332 | 1302 | // remove normal/recurring meeting item. |
| 1333 | 1303 | // Move the message to the waste basket |
| 1334 | 1304 | mapi_folder_copymessages($sourcefolder, [$messageprops[PR_ENTRYID]], $wastebasket, MESSAGE_MOVE); |
@@ -1375,8 +1345,7 @@ discard block |
||
| 1375 | 1345 | |
| 1376 | 1346 | // save changes in the message |
| 1377 | 1347 | mapi_savechanges($this->message); |
| 1378 | - } |
|
| 1379 | - else { |
|
| 1348 | + } else { |
|
| 1380 | 1349 | // cancellation of normal meeting request |
| 1381 | 1350 | // Send the cancellation |
| 1382 | 1351 | $this->updateMeetingRequest(); |
@@ -1523,8 +1492,7 @@ discard block |
||
| 1523 | 1492 | } |
| 1524 | 1493 | } |
| 1525 | 1494 | } |
| 1526 | - } |
|
| 1527 | - else { |
|
| 1495 | + } else { |
|
| 1528 | 1496 | // Basedate found, an exception is to be send |
| 1529 | 1497 | if ($basedate) { |
| 1530 | 1498 | $recurr = new Recurrence($this->openDefaultStore(), $this->message); |
@@ -1532,8 +1500,7 @@ discard block |
||
| 1532 | 1500 | if ($cancel) { |
| 1533 | 1501 | // @TODO: remove occurrence from Resource's Calendar if resource was booked for whole series |
| 1534 | 1502 | $this->submitMeetingRequest($this->message, $cancel, $prefix, $basedate, $recurr, false); |
| 1535 | - } |
|
| 1536 | - else { |
|
| 1503 | + } else { |
|
| 1537 | 1504 | $attach = $recurr->getExceptionAttachment($basedate); |
| 1538 | 1505 | |
| 1539 | 1506 | if ($attach) { |
@@ -1552,8 +1519,7 @@ discard block |
||
| 1552 | 1519 | } |
| 1553 | 1520 | } |
| 1554 | 1521 | } |
| 1555 | - } |
|
| 1556 | - else { |
|
| 1522 | + } else { |
|
| 1557 | 1523 | // This is normal meeting |
| 1558 | 1524 | $resourceRecipData = $this->bookResources($this->message, $cancel, $prefix); |
| 1559 | 1525 | |
@@ -1600,20 +1566,15 @@ discard block |
||
| 1600 | 1566 | $blockItem['end'] = $event['EndTime']; |
| 1601 | 1567 | if ($event['BusyType'] == 'Free') { |
| 1602 | 1568 | $blockItem['status'] = 0; |
| 1603 | - } |
|
| 1604 | - elseif ($event['BusyType'] == 'Tentative') { |
|
| 1569 | + } elseif ($event['BusyType'] == 'Tentative') { |
|
| 1605 | 1570 | $blockItem['status'] = 1; |
| 1606 | - } |
|
| 1607 | - elseif ($event['BusyType'] == 'Busy') { |
|
| 1571 | + } elseif ($event['BusyType'] == 'Busy') { |
|
| 1608 | 1572 | $blockItem['status'] = 2; |
| 1609 | - } |
|
| 1610 | - elseif ($event['BusyType'] == 'OOF') { |
|
| 1573 | + } elseif ($event['BusyType'] == 'OOF') { |
|
| 1611 | 1574 | $blockItem['status'] = 3; |
| 1612 | - } |
|
| 1613 | - elseif ($event['BusyType'] == 'WorkingElsewhere') { |
|
| 1575 | + } elseif ($event['BusyType'] == 'WorkingElsewhere') { |
|
| 1614 | 1576 | $blockItem['status'] = 4; |
| 1615 | - } |
|
| 1616 | - else { |
|
| 1577 | + } else { |
|
| 1617 | 1578 | $blockItem['status'] = -1; |
| 1618 | 1579 | } |
| 1619 | 1580 | $last_end = $event['EndTime']; |
@@ -1637,8 +1598,7 @@ discard block |
||
| 1637 | 1598 | |
| 1638 | 1599 | if (!isset($messageprops[$this->proptags['goid']])) { |
| 1639 | 1600 | $this->setMeetingRequest($basedate); |
| 1640 | - } |
|
| 1641 | - else { |
|
| 1601 | + } else { |
|
| 1642 | 1602 | $counter = $messageprops[$this->proptags['last_updatecounter']] + 1; |
| 1643 | 1603 | |
| 1644 | 1604 | // increment value of last_updatecounter, last_updatecounter will be common for recurring series |
@@ -1657,8 +1617,7 @@ discard block |
||
| 1657 | 1617 | if (!$this->isMeetingRequest($props[PR_MESSAGE_CLASS]) && !$this->isMeetingRequestResponse($props[PR_MESSAGE_CLASS]) && !$this->isMeetingCancellation($props[PR_MESSAGE_CLASS])) { |
| 1658 | 1618 | // we are checking with calendar item |
| 1659 | 1619 | $calendarItem = $this->message; |
| 1660 | - } |
|
| 1661 | - else { |
|
| 1620 | + } else { |
|
| 1662 | 1621 | // we are checking with meeting request / response / cancellation mail |
| 1663 | 1622 | // get calendar items |
| 1664 | 1623 | $calendarItem = $this->getCorrespondentCalendarItem(true); |
@@ -1790,8 +1749,7 @@ discard block |
||
| 1790 | 1749 | if (isset($inboxprops[$prop])) { |
| 1791 | 1750 | return $inboxprops[$prop]; |
| 1792 | 1751 | } |
| 1793 | - } |
|
| 1794 | - catch (MAPIException $e) { |
|
| 1752 | + } catch (MAPIException $e) { |
|
| 1795 | 1753 | // public store doesn't support this method |
| 1796 | 1754 | if ($e->getCode() == MAPI_E_NO_SUPPORT) { |
| 1797 | 1755 | // don't propagate this error to parent handlers, if store doesn't support it |
@@ -1881,8 +1839,7 @@ discard block |
||
| 1881 | 1839 | if (($folderProps[PR_ACCESS] & MAPI_ACCESS_CREATE_CONTENTS) === MAPI_ACCESS_CREATE_CONTENTS) { |
| 1882 | 1840 | $accessToFolder = true; |
| 1883 | 1841 | } |
| 1884 | - } |
|
| 1885 | - catch (MAPIException $e) { |
|
| 1842 | + } catch (MAPIException $e) { |
|
| 1886 | 1843 | // we don't have rights to open folder, so return false |
| 1887 | 1844 | if ($e->getCode() == MAPI_E_NO_ACCESS) { |
| 1888 | 1845 | return $accessToFolder; |
@@ -1912,8 +1869,7 @@ discard block |
||
| 1912 | 1869 | $delegatorStore = $this->getDelegatorStore($messageProps[PR_RCVD_REPRESENTING_ENTRYID]); |
| 1913 | 1870 | |
| 1914 | 1871 | $store = $delegatorStore['store']; |
| 1915 | - } |
|
| 1916 | - else { |
|
| 1872 | + } else { |
|
| 1917 | 1873 | $store = $this->store; |
| 1918 | 1874 | } |
| 1919 | 1875 | } |
@@ -1923,8 +1879,7 @@ discard block |
||
| 1923 | 1879 | if (isset($provider[PR_MDB_PROVIDER]) && $provider[PR_MDB_PROVIDER] === ZARAFA_STORE_PUBLIC_GUID) { |
| 1924 | 1880 | $entryid = mapi_getprops($this->message, [PR_PARENT_ENTRYID]); |
| 1925 | 1881 | $entryid = $entryid[PR_PARENT_ENTRYID]; |
| 1926 | - } |
|
| 1927 | - else { |
|
| 1882 | + } else { |
|
| 1928 | 1883 | $entryid = $this->getDefaultFolderEntryID(PR_IPM_APPOINTMENT_ENTRYID, $store); |
| 1929 | 1884 | if ($entryid === false) { |
| 1930 | 1885 | $entryid = $this->getBaseEntryID(PR_IPM_APPOINTMENT_ENTRYID, $store); |
@@ -1950,8 +1905,7 @@ discard block |
||
| 1950 | 1905 | |
| 1951 | 1906 | try { |
| 1952 | 1907 | $mailuser = mapi_ab_openentry($ab, $ownerentryid); |
| 1953 | - } |
|
| 1954 | - catch (MAPIException $e) { |
|
| 1908 | + } catch (MAPIException $e) { |
|
| 1955 | 1909 | return; |
| 1956 | 1910 | } |
| 1957 | 1911 | |
@@ -2018,8 +1972,7 @@ discard block |
||
| 2018 | 1972 | $props[$this->proptags['meetingstatus']] = $imsgprops[$this->proptags['meetingstatus']]; |
| 2019 | 1973 | $props[$this->proptags['responsestatus']] = $imsgprops[$this->proptags['responsestatus']]; |
| 2020 | 1974 | $props[PR_SUBJECT] = $imsgprops[PR_SUBJECT]; |
| 2021 | - } |
|
| 2022 | - else { |
|
| 1975 | + } else { |
|
| 2023 | 1976 | // Exceptions is deleted. |
| 2024 | 1977 | // Update $messageprops with timings of occurrence |
| 2025 | 1978 | $messageprops[$this->proptags['startdate']] = $recurr->getOccurrenceStart($basedate); |
@@ -2031,8 +1984,7 @@ discard block |
||
| 2031 | 1984 | |
| 2032 | 1985 | $props[$this->proptags['recurring']] = false; |
| 2033 | 1986 | $props[$this->proptags['is_exception']] = true; |
| 2034 | - } |
|
| 2035 | - else { |
|
| 1987 | + } else { |
|
| 2036 | 1988 | // we are creating a response from meeting request mail (it could be recurring or non-recurring) |
| 2037 | 1989 | // Send all recurrence info in response, if this is a recurrence meeting. |
| 2038 | 1990 | $isRecurring = isset($messageprops[$this->proptags['recurring']]) && $messageprops[$this->proptags['recurring']]; |
@@ -2215,8 +2167,7 @@ discard block |
||
| 2215 | 2167 | if (!$abitem) { |
| 2216 | 2168 | return ''; |
| 2217 | 2169 | } |
| 2218 | - } |
|
| 2219 | - catch (MAPIException $e) { |
|
| 2170 | + } catch (MAPIException $e) { |
|
| 2220 | 2171 | return ''; |
| 2221 | 2172 | } |
| 2222 | 2173 | |
@@ -2311,8 +2262,7 @@ discard block |
||
| 2311 | 2262 | foreach ($recipients as $key => $recipient) { |
| 2312 | 2263 | if (isset($recipient[PR_RECIPIENT_FLAGS]) && $recipient[PR_RECIPIENT_FLAGS] == (recipSendable | recipOrganizer)) { |
| 2313 | 2264 | $hasOrganizer = true; |
| 2314 | - } |
|
| 2315 | - elseif ($isException && !isset($recipient[PR_RECIPIENT_FLAGS])) { |
|
| 2265 | + } elseif ($isException && !isset($recipient[PR_RECIPIENT_FLAGS])) { |
|
| 2316 | 2266 | // Recipients for an occurrence |
| 2317 | 2267 | $recipients[$key][PR_RECIPIENT_FLAGS] = recipSendable | recipExceptionalResponse; |
| 2318 | 2268 | } |
@@ -2453,8 +2403,7 @@ discard block |
||
| 2453 | 2403 | ], |
| 2454 | 2404 | ]; |
| 2455 | 2405 | $recipients = mapi_table_queryallrows($recipientTable, $this->recipprops, $res); |
| 2456 | - } |
|
| 2457 | - else { |
|
| 2406 | + } else { |
|
| 2458 | 2407 | $recipients = mapi_table_queryallrows($recipientTable, $this->recipprops); |
| 2459 | 2408 | } |
| 2460 | 2409 | |
@@ -2546,8 +2495,7 @@ discard block |
||
| 2546 | 2495 | if ($accessToFolder) { |
| 2547 | 2496 | $calFolder = mapi_msgstore_openentry($userStore, $userRootProps[PR_IPM_APPOINTMENT_ENTRYID]); |
| 2548 | 2497 | } |
| 2549 | - } |
|
| 2550 | - catch (MAPIException $e) { |
|
| 2498 | + } catch (MAPIException $e) { |
|
| 2551 | 2499 | $e->setHandled(); |
| 2552 | 2500 | $this->errorSetResource = 1; // No access |
| 2553 | 2501 | } |
@@ -2573,8 +2521,7 @@ discard block |
||
| 2573 | 2521 | */ |
| 2574 | 2522 | // $errorSetResource = 2; |
| 2575 | 2523 | $this->nonAcceptingResources[] = $resourceRecipients[$i]; |
| 2576 | - } |
|
| 2577 | - else { |
|
| 2524 | + } else { |
|
| 2578 | 2525 | if ($declineRecurringMeetingRequests && !$cancel) { |
| 2579 | 2526 | // Check if appointment is recurring |
| 2580 | 2527 | if ($messageprops[$this->proptags['recurring']]) { |
@@ -2634,8 +2581,7 @@ discard block |
||
| 2634 | 2581 | if (!$newResourceMsg) { |
| 2635 | 2582 | $newResourceMsg = mapi_folder_createmessage($calFolder); |
| 2636 | 2583 | } |
| 2637 | - } |
|
| 2638 | - else { |
|
| 2584 | + } else { |
|
| 2639 | 2585 | $newResourceMsg = mapi_msgstore_openentry($userStore, $rows[0]); |
| 2640 | 2586 | } |
| 2641 | 2587 | |
@@ -2649,8 +2595,7 @@ discard block |
||
| 2649 | 2595 | if ($cancel) { |
| 2650 | 2596 | $messageprops[$this->proptags['meetingstatus']] = olMeetingCanceled; // The meeting has been canceled |
| 2651 | 2597 | $messageprops[$this->proptags['busystatus']] = fbFree; // Free |
| 2652 | - } |
|
| 2653 | - else { |
|
| 2598 | + } else { |
|
| 2654 | 2599 | $messageprops[$this->proptags['meetingstatus']] = olMeetingReceived; // The recipient is receiving the request |
| 2655 | 2600 | } |
| 2656 | 2601 | $messageprops[$this->proptags['responsestatus']] = olResponseAccepted; // The resource automatically accepts the appointment |
@@ -2694,8 +2639,7 @@ discard block |
||
| 2694 | 2639 | $messageprops[PR_SENT_REPRESENTING_ENTRYID] = $ownerentryid; |
| 2695 | 2640 | $messageprops[PR_SENT_REPRESENTING_SEARCH_KEY] = $ownersearchkey; |
| 2696 | 2641 | } |
| 2697 | - } |
|
| 2698 | - else { |
|
| 2642 | + } else { |
|
| 2699 | 2643 | // get organizer information |
| 2700 | 2644 | $addrinfo = $this->getOwnerAddress($this->store); |
| 2701 | 2645 | |
@@ -2731,12 +2675,10 @@ discard block |
||
| 2731 | 2675 | // Update occurrence |
| 2732 | 2676 | if ($recurr->isException($basedate)) { |
| 2733 | 2677 | $recurr->modifyException($messageprops, $basedate, $recips); |
| 2734 | - } |
|
| 2735 | - else { |
|
| 2678 | + } else { |
|
| 2736 | 2679 | $recurr->createException($messageprops, $basedate, false, $recips); |
| 2737 | 2680 | } |
| 2738 | - } |
|
| 2739 | - else { |
|
| 2681 | + } else { |
|
| 2740 | 2682 | mapi_setprops($newResourceMsg, $messageprops); |
| 2741 | 2683 | |
| 2742 | 2684 | // Copy attachments |
@@ -2760,8 +2702,7 @@ discard block |
||
| 2760 | 2702 | 'msg' => $newResourceMsg, |
| 2761 | 2703 | ]; |
| 2762 | 2704 | $this->includesResources = true; |
| 2763 | - } |
|
| 2764 | - else { |
|
| 2705 | + } else { |
|
| 2765 | 2706 | /* |
| 2766 | 2707 | * If no other errors occurred and you have no access to the |
| 2767 | 2708 | * folder of the resource, throw an error=1. |
@@ -2837,8 +2778,7 @@ discard block |
||
| 2837 | 2778 | ], |
| 2838 | 2779 | ]; |
| 2839 | 2780 | $recips = mapi_table_queryallrows($reciptable, $this->recipprops, $res); |
| 2840 | - } |
|
| 2841 | - else { |
|
| 2781 | + } else { |
|
| 2842 | 2782 | $recips = mapi_table_queryallrows($reciptable, $this->recipprops); |
| 2843 | 2783 | } |
| 2844 | 2784 | |
@@ -2856,13 +2796,11 @@ discard block |
||
| 2856 | 2796 | if (isset($exception_props[$this->proptags['intendedbusystatus']])) { |
| 2857 | 2797 | if ($tentative && $exception_props[$this->proptags['intendedbusystatus']] !== fbFree) { |
| 2858 | 2798 | $exception_props[$this->proptags['busystatus']] = fbTentative; |
| 2859 | - } |
|
| 2860 | - else { |
|
| 2799 | + } else { |
|
| 2861 | 2800 | $exception_props[$this->proptags['busystatus']] = $exception_props[$this->proptags['intendedbusystatus']]; |
| 2862 | 2801 | } |
| 2863 | 2802 | // we already have intendedbusystatus value in $exception_props so no need to copy it |
| 2864 | - } |
|
| 2865 | - else { |
|
| 2803 | + } else { |
|
| 2866 | 2804 | $exception_props[$this->proptags['busystatus']] = $tentative ? fbTentative : fbBusy; |
| 2867 | 2805 | } |
| 2868 | 2806 | |
@@ -2878,8 +2816,7 @@ discard block |
||
| 2878 | 2816 | |
| 2879 | 2817 | if ($recurr->isException($basedate)) { |
| 2880 | 2818 | $recurr->modifyException($exception_props, $basedate, $recips, $occurrenceItem); |
| 2881 | - } |
|
| 2882 | - else { |
|
| 2819 | + } else { |
|
| 2883 | 2820 | $recurr->createException($exception_props, $basedate, false, $recips, $occurrenceItem); |
| 2884 | 2821 | } |
| 2885 | 2822 | |
@@ -2916,8 +2853,7 @@ discard block |
||
| 2916 | 2853 | |
| 2917 | 2854 | if ($recurr->isException($basedate)) { |
| 2918 | 2855 | $recurr->modifyException($exception_props, $basedate, $recips, $occurrenceItem); |
| 2919 | - } |
|
| 2920 | - else { |
|
| 2856 | + } else { |
|
| 2921 | 2857 | $recurr->createException($exception_props, $basedate, false, $recips, $occurrenceItem); |
| 2922 | 2858 | } |
| 2923 | 2859 | |
@@ -3011,8 +2947,7 @@ discard block |
||
| 3011 | 2947 | |
| 3012 | 2948 | if (!$deletedRecips) { |
| 3013 | 2949 | $deletedRecips = array_merge([], $recipients); |
| 3014 | - } |
|
| 3015 | - else { |
|
| 2950 | + } else { |
|
| 3016 | 2951 | $deletedRecips = array_merge($deletedRecips, $recipients); |
| 3017 | 2952 | } |
| 3018 | 2953 | } |
@@ -3151,8 +3086,7 @@ discard block |
||
| 3151 | 3086 | $newmessageprops[PR_MESSAGE_CLASS] = 'IPM.Schedule.Meeting.Canceled'; |
| 3152 | 3087 | $newmessageprops[$this->proptags['meetingstatus']] = olMeetingCanceled; // It's a cancel request |
| 3153 | 3088 | $newmessageprops[$this->proptags['busystatus']] = fbFree; // set the busy status as free |
| 3154 | - } |
|
| 3155 | - else { |
|
| 3089 | + } else { |
|
| 3156 | 3090 | $newmessageprops[PR_MESSAGE_CLASS] = 'IPM.Schedule.Meeting.Request'; |
| 3157 | 3091 | $newmessageprops[$this->proptags['meetingstatus']] = olMeetingReceived; // The recipient is receiving the request |
| 3158 | 3092 | } |
@@ -3320,8 +3254,7 @@ discard block |
||
| 3320 | 3254 | $sentprops[PR_SENDER_SEARCH_KEY] = $ownersearchkey; |
| 3321 | 3255 | } |
| 3322 | 3256 | } |
| 3323 | - } |
|
| 3324 | - else { |
|
| 3257 | + } else { |
|
| 3325 | 3258 | // normal user is sending mail, so both set of properties will be same |
| 3326 | 3259 | $userDetails = $this->getOwnerAddress($userStore); |
| 3327 | 3260 | |
@@ -3487,8 +3420,7 @@ discard block |
||
| 3487 | 3420 | $message = mapi_attach_openobj($attach, MAPI_MODIFY); |
| 3488 | 3421 | } |
| 3489 | 3422 | } |
| 3490 | - } |
|
| 3491 | - else { |
|
| 3423 | + } else { |
|
| 3492 | 3424 | // use normal message or recurring series message |
| 3493 | 3425 | $message = $this->message; |
| 3494 | 3426 | } |
@@ -3531,8 +3463,7 @@ discard block |
||
| 3531 | 3463 | if (($recipient[PR_RECIPIENT_FLAGS] & recipOrganizer) != recipOrganizer) { |
| 3532 | 3464 | // Recipient is attendee, set the trackstatus to 'Not Responded' |
| 3533 | 3465 | $recipient[PR_RECIPIENT_TRACKSTATUS] = olRecipientTrackStatusNone; |
| 3534 | - } |
|
| 3535 | - else { |
|
| 3466 | + } else { |
|
| 3536 | 3467 | // Recipient is organizer, this is not possible, but for safety |
| 3537 | 3468 | // it is best to clear the trackstatus for him as well by setting |
| 3538 | 3469 | // the trackstatus to 'Organized'. |
@@ -3570,8 +3501,7 @@ discard block |
||
| 3570 | 3501 | |
| 3571 | 3502 | $store = $delegatorStore['store']; |
| 3572 | 3503 | $calFolder = $delegatorStore[PR_IPM_APPOINTMENT_ENTRYID]; |
| 3573 | - } |
|
| 3574 | - else { |
|
| 3504 | + } else { |
|
| 3575 | 3505 | $store = $this->store; |
| 3576 | 3506 | $calFolder = $this->openDefaultCalendar(); |
| 3577 | 3507 | } |
@@ -3633,8 +3563,7 @@ discard block |
||
| 3633 | 3563 | if (isset($props[PR_RCVD_REPRESENTING_ENTRYID])) { |
| 3634 | 3564 | $delegatorStore = $this->getDelegatorStore($props[PR_RCVD_REPRESENTING_ENTRYID]); |
| 3635 | 3565 | $store = $delegatorStore['store']; |
| 3636 | - } |
|
| 3637 | - else { |
|
| 3566 | + } else { |
|
| 3638 | 3567 | $store = $this->store; |
| 3639 | 3568 | } |
| 3640 | 3569 | } |
@@ -3722,8 +3651,7 @@ discard block |
||
| 3722 | 3651 | ++$noOfInstances; |
| 3723 | 3652 | break; |
| 3724 | 3653 | } |
| 3725 | - } |
|
| 3726 | - else { |
|
| 3654 | + } else { |
|
| 3727 | 3655 | ++$noOfInstances; |
| 3728 | 3656 | break; |
| 3729 | 3657 | } |
@@ -3734,8 +3662,7 @@ discard block |
||
| 3734 | 3662 | if ($noOfInstances > 0) { |
| 3735 | 3663 | $returnValue = $noOfInstances; |
| 3736 | 3664 | } |
| 3737 | - } |
|
| 3738 | - else { |
|
| 3665 | + } else { |
|
| 3739 | 3666 | // Get all items in the timeframe that we want to book, and get the goid and busystatus for each item |
| 3740 | 3667 | $items = getCalendarItems($userStore, $calFolder, $messageProps[$this->proptags['startdate']], $messageProps[$this->proptags['duedate']], [$this->proptags['goid'], $this->proptags['busystatus']]); |
| 3741 | 3668 | |
@@ -3756,8 +3683,7 @@ discard block |
||
| 3756 | 3683 | $returnValue = true; |
| 3757 | 3684 | break; |
| 3758 | 3685 | } |
| 3759 | - } |
|
| 3760 | - else { |
|
| 3686 | + } else { |
|
| 3761 | 3687 | $returnValue = true; |
| 3762 | 3688 | break; |
| 3763 | 3689 | } |
@@ -3918,8 +3844,7 @@ discard block |
||
| 3918 | 3844 | foreach ($localCategories as $key => $value) { |
| 3919 | 3845 | if ($recurrence->isException($key)) { |
| 3920 | 3846 | $recurrence->modifyException([$this->proptags['categories'] => $value], $key); |
| 3921 | - } |
|
| 3922 | - else { |
|
| 3847 | + } else { |
|
| 3923 | 3848 | $recurrence->createException([$this->proptags['categories'] => $value], $key, false); |
| 3924 | 3849 | } |
| 3925 | 3850 | mapi_savechanges($message); |