@@ -137,8 +137,7 @@ discard block |
||
| 137 | 137 | $recur = new Recurrence($this->store, $row); |
| 138 | 138 | |
| 139 | 139 | $occurrences = $recur->getItems($starttime, $starttime + $length); |
| 140 | - } |
|
| 141 | - else { |
|
| 140 | + } else { |
|
| 142 | 141 | $occurrences[] = $row; |
| 143 | 142 | } |
| 144 | 143 | |
@@ -157,8 +156,7 @@ discard block |
||
| 157 | 156 | // Get the FB interface |
| 158 | 157 | try { |
| 159 | 158 | $fbsupport = mapi_freebusysupport_open($this->session, $this->store); |
| 160 | - } |
|
| 161 | - catch (MAPIException $e) { |
|
| 159 | + } catch (MAPIException $e) { |
|
| 162 | 160 | if ($e->getCode() == MAPI_E_NOT_FOUND) { |
| 163 | 161 | $e->setHandled(); |
| 164 | 162 | if (function_exists("dump")) { |
@@ -170,8 +170,7 @@ discard block |
||
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | $props[$this->proptags["dead_occurrence"]] = false; |
| 173 | - } |
|
| 174 | - else { |
|
| 173 | + } else { |
|
| 175 | 174 | if (isset($this->action['deleteOccurrence']) && $this->action['deleteOccurrence']) { |
| 176 | 175 | return false; |
| 177 | 176 | } |
@@ -330,8 +329,7 @@ discard block |
||
| 330 | 329 | // If startdate and enddate are set on task, then slide enddate according to duration |
| 331 | 330 | if (isset($this->messageprops[$this->proptags["startdate"]], $this->messageprops[$this->proptags["duedate"]])) { |
| 332 | 331 | $newItem[$this->proptags['duedate']] = $newItem[$this->proptags['startdate']] + ($this->messageprops[$this->proptags["duedate"]] - $this->messageprops[$this->proptags["startdate"]]); |
| 333 | - } |
|
| 334 | - else { |
|
| 332 | + } else { |
|
| 335 | 333 | $newItem[$this->proptags['duedate']] = $newItem[$this->proptags['startdate']]; |
| 336 | 334 | } |
| 337 | 335 | $items[] = $newItem; |
@@ -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; |
@@ -179,8 +179,7 @@ discard block |
||
| 179 | 179 | |
| 180 | 180 | // Add the changed occurrence to the list |
| 181 | 181 | array_push($this->recur["changed_occurrences"], $changed_item); |
| 182 | - } |
|
| 183 | - else { |
|
| 182 | + } else { |
|
| 184 | 183 | // Delete the occurrence by placing it in the deleted occurrences list |
| 185 | 184 | array_push($this->recur["deleted_occurrences"], $baseday); |
| 186 | 185 | } |
@@ -269,12 +268,10 @@ discard block |
||
| 269 | 268 | if ($copy_attach_from) { |
| 270 | 269 | $this->deleteExceptionAttachment($base_date); |
| 271 | 270 | $this->createException($exception_props, $base_date, false, $exception_recips, $copy_attach_from); |
| 272 | - } |
|
| 273 | - else { |
|
| 271 | + } else { |
|
| 274 | 272 | $this->createExceptionAttachment($exception_props, $exception_recips, $copy_attach_from); |
| 275 | 273 | } |
| 276 | - } |
|
| 277 | - else { |
|
| 274 | + } else { |
|
| 278 | 275 | $message = mapi_attach_openobj($attach, MAPI_MODIFY); |
| 279 | 276 | |
| 280 | 277 | // Set exception properties on embedded message and save |
@@ -317,8 +314,7 @@ discard block |
||
| 317 | 314 | // the exception used to be. |
| 318 | 315 | $oldexception = $this->getChangeException($basedate); |
| 319 | 316 | $prevday = $this->dayStartOf($oldexception["start"]); |
| 320 | - } |
|
| 321 | - else { |
|
| 317 | + } else { |
|
| 322 | 318 | // If its a new exception, we want to look at the original placement of this item. |
| 323 | 319 | $prevday = $basedate; |
| 324 | 320 | } |
@@ -328,8 +324,7 @@ discard block |
||
| 328 | 324 | // Get all the occurrences on the days between the basedate (may be reversed) |
| 329 | 325 | if ($prevday < $startday) { |
| 330 | 326 | $items = $this->getItems($this->toGMT($this->tz, $prevday), $this->toGMT($this->tz, $startday + 24 * 60 * 60)); |
| 331 | - } |
|
| 332 | - else { |
|
| 327 | + } else { |
|
| 333 | 328 | $items = $this->getItems($this->toGMT($this->tz, $startday), $this->toGMT($this->tz, $prevday + 24 * 60 * 60)); |
| 334 | 329 | } |
| 335 | 330 | |
@@ -525,12 +520,10 @@ discard block |
||
| 525 | 520 | if ($everyn == 1) { |
| 526 | 521 | $type = dgettext("kopano", "workday"); |
| 527 | 522 | $occSingleDayRank = true; |
| 528 | - } |
|
| 529 | - elseif ($everyn == (24 * 60)) { |
|
| 523 | + } elseif ($everyn == (24 * 60)) { |
|
| 530 | 524 | $type = dgettext("kopano", "day"); |
| 531 | 525 | $occSingleDayRank = true; |
| 532 | - } |
|
| 533 | - else { |
|
| 526 | + } else { |
|
| 534 | 527 | $everyn /= (24 * 60); |
| 535 | 528 | $type = dgettext("kopano", "days"); |
| 536 | 529 | $occSingleDayRank = false; |
@@ -541,8 +534,7 @@ discard block |
||
| 541 | 534 | if ($everyn == 1) { |
| 542 | 535 | $type = dgettext("kopano", "week"); |
| 543 | 536 | $occSingleDayRank = true; |
| 544 | - } |
|
| 545 | - else { |
|
| 537 | + } else { |
|
| 546 | 538 | $type = dgettext("kopano", "weeks"); |
| 547 | 539 | $occSingleDayRank = false; |
| 548 | 540 | } |
@@ -552,8 +544,7 @@ discard block |
||
| 552 | 544 | if ($everyn == 1) { |
| 553 | 545 | $type = dgettext("kopano", "month"); |
| 554 | 546 | $occSingleDayRank = true; |
| 555 | - } |
|
| 556 | - else { |
|
| 547 | + } else { |
|
| 557 | 548 | $type = dgettext("kopano", "months"); |
| 558 | 549 | $occSingleDayRank = false; |
| 559 | 550 | } |
@@ -564,8 +555,7 @@ discard block |
||
| 564 | 555 | $everyn = 1; |
| 565 | 556 | $type = dgettext("kopano", "year"); |
| 566 | 557 | $occSingleDayRank = true; |
| 567 | - } |
|
| 568 | - else { |
|
| 558 | + } else { |
|
| 569 | 559 | $everyn = $everyn / 12; |
| 570 | 560 | $type = dgettext("kopano", "years"); |
| 571 | 561 | $occSingleDayRank = false; |
@@ -594,21 +584,17 @@ discard block |
||
| 594 | 584 | if ($occTimeRange) { |
| 595 | 585 | if ($occSingleDayRank) { |
| 596 | 586 | $pattern = sprintf(dgettext("kopano", "Occurs every %s effective %s from %s to %s."), $type, $start, $startocc, $endocc); |
| 597 | - } |
|
| 598 | - else { |
|
| 587 | + } else { |
|
| 599 | 588 | $pattern = sprintf(dgettext("kopano", "Occurs every %s %s effective %s from %s to %s."), $everyn, $type, $start, $startocc, $endocc); |
| 600 | 589 | } |
| 601 | - } |
|
| 602 | - else { |
|
| 590 | + } else { |
|
| 603 | 591 | if ($occSingleDayRank) { |
| 604 | 592 | $pattern = sprintf(dgettext("kopano", "Occurs every %s effective %s."), $type, $start); |
| 605 | - } |
|
| 606 | - else { |
|
| 593 | + } else { |
|
| 607 | 594 | $pattern = sprintf(dgettext("kopano", "Occurs every %s %s effective %s."), $everyn, $type, $start); |
| 608 | 595 | } |
| 609 | 596 | } |
| 610 | - } |
|
| 611 | - elseif ($term == 0x22) { |
|
| 597 | + } elseif ($term == 0x22) { |
|
| 612 | 598 | // After a number of times |
| 613 | 599 | if ($occTimeRange) { |
| 614 | 600 | if ($occSingleDayRank) { |
@@ -618,8 +604,7 @@ discard block |
||
| 618 | 604 | "Occurs every %s effective %s for %s occurrences from %s to %s.", |
| 619 | 605 | $numocc |
| 620 | 606 | ), $type, $start, $numocc, $startocc, $endocc); |
| 621 | - } |
|
| 622 | - else { |
|
| 607 | + } else { |
|
| 623 | 608 | $pattern = sprintf(dngettext( |
| 624 | 609 | "kopano", |
| 625 | 610 | "Occurs every %s %s effective %s for %s occurrence from %s to %s.", |
@@ -627,8 +612,7 @@ discard block |
||
| 627 | 612 | $numocc |
| 628 | 613 | ), $everyn, $type, $start, $numocc, $startocc, $endocc); |
| 629 | 614 | } |
| 630 | - } |
|
| 631 | - else { |
|
| 615 | + } else { |
|
| 632 | 616 | if ($occSingleDayRank) { |
| 633 | 617 | $pattern = sprintf(dngettext( |
| 634 | 618 | "kopano", |
@@ -636,8 +620,7 @@ discard block |
||
| 636 | 620 | "Occurs every %s effective %s for %s occurrences.", |
| 637 | 621 | $numocc |
| 638 | 622 | ), $type, $start, $numocc); |
| 639 | - } |
|
| 640 | - else { |
|
| 623 | + } else { |
|
| 641 | 624 | $pattern = sprintf(dngettext( |
| 642 | 625 | "kopano", |
| 643 | 626 | "Occurs every %s %s effective %s for %s occurrence.", |
@@ -646,22 +629,18 @@ discard block |
||
| 646 | 629 | ), $everyn, $type, $start, $numocc); |
| 647 | 630 | } |
| 648 | 631 | } |
| 649 | - } |
|
| 650 | - elseif ($term == 0x21) { |
|
| 632 | + } elseif ($term == 0x21) { |
|
| 651 | 633 | // After the given enddate |
| 652 | 634 | if ($occTimeRange) { |
| 653 | 635 | if ($occSingleDayRank) { |
| 654 | 636 | $pattern = sprintf(dgettext("kopano", "Occurs every %s effective %s until %s from %s to %s."), $type, $start, $end, $startocc, $endocc); |
| 655 | - } |
|
| 656 | - else { |
|
| 637 | + } else { |
|
| 657 | 638 | $pattern = sprintf(dgettext("kopano", "Occurs every %s %s effective %s until %s from %s to %s."), $everyn, $type, $start, $end, $startocc, $endocc); |
| 658 | 639 | } |
| 659 | - } |
|
| 660 | - else { |
|
| 640 | + } else { |
|
| 661 | 641 | if ($occSingleDayRank) { |
| 662 | 642 | $pattern = sprintf(dgettext("kopano", "Occurs every %s effective %s until %s."), $type, $start, $end); |
| 663 | - } |
|
| 664 | - else { |
|
| 643 | + } else { |
|
| 665 | 644 | $pattern = sprintf(dgettext("kopano", "Occurs every %s %s effective %s until %s."), $everyn, $type, $start, $end); |
| 666 | 645 | } |
| 667 | 646 | } |
@@ -693,8 +672,7 @@ discard block |
||
| 693 | 672 | foreach ($this->recur["changed_occurrences"] as $entry) { |
| 694 | 673 | if (!$this->isSameDay($entry["basedate"], $base_date)) { |
| 695 | 674 | $new[] = $entry; |
| 696 | - } |
|
| 697 | - else { |
|
| 675 | + } else { |
|
| 698 | 676 | $this->deleteExceptionAttachment($this->toGMT($this->tz, $base_date + $this->recur["startocc"] * 60)); |
| 699 | 677 | } |
| 700 | 678 | } |
@@ -1049,8 +1027,7 @@ discard block |
||
| 1049 | 1027 | public function setExceptionRecipients($message, $exception_recips, $copy_orig_recips = true) { |
| 1050 | 1028 | if (isset($exception_recips['add']) || isset($exception_recips['remove']) || isset($exception_recips['modify'])) { |
| 1051 | 1029 | $this->setDeltaExceptionRecipients($message, $exception_recips, $copy_orig_recips); |
| 1052 | - } |
|
| 1053 | - else { |
|
| 1030 | + } else { |
|
| 1054 | 1031 | $this->setAllExceptionRecipients($message, $exception_recips); |
| 1055 | 1032 | } |
| 1056 | 1033 | } |
@@ -1091,8 +1068,7 @@ discard block |
||
| 1091 | 1068 | foreach ($exception_recips['remove'] as &$recip) { |
| 1092 | 1069 | if (!isset($recipient[PR_RECIPIENT_FLAGS]) || $recip[PR_RECIPIENT_FLAGS] != (recipReserved | recipExceptionalDeleted | recipSendable)) { |
| 1093 | 1070 | $recip[PR_RECIPIENT_FLAGS] = recipSendable | recipExceptionalDeleted; |
| 1094 | - } |
|
| 1095 | - else { |
|
| 1071 | + } else { |
|
| 1096 | 1072 | $recip[PR_RECIPIENT_FLAGS] = recipReserved | recipExceptionalDeleted | recipSendable; |
| 1097 | 1073 | } |
| 1098 | 1074 | $recip[PR_RECIPIENT_TRACKSTATUS] = olResponseNone; // No Response required |
@@ -1167,8 +1143,7 @@ discard block |
||
| 1167 | 1143 | if (!$foundInDeletedRecipients) { |
| 1168 | 1144 | if (!isset($recipient[PR_RECIPIENT_FLAGS]) || $recipient[PR_RECIPIENT_FLAGS] != (recipReserved | recipExceptionalDeleted | recipSendable)) { |
| 1169 | 1145 | $recipient[PR_RECIPIENT_FLAGS] = recipSendable | recipExceptionalDeleted; |
| 1170 | - } |
|
| 1171 | - else { |
|
| 1146 | + } else { |
|
| 1172 | 1147 | $recipient[PR_RECIPIENT_FLAGS] = recipReserved | recipExceptionalDeleted | recipSendable; |
| 1173 | 1148 | } |
| 1174 | 1149 | $recipient[PR_RECIPIENT_TRACKSTATUS] = olRecipientTrackStatusNone; // No Response required |
@@ -1187,8 +1162,7 @@ discard block |
||
| 1187 | 1162 | } |
| 1188 | 1163 | } |
| 1189 | 1164 | $exception_recips = array_merge($exception_recips, $deletedRecipients); |
| 1190 | - } |
|
| 1191 | - else { |
|
| 1165 | + } else { |
|
| 1192 | 1166 | $exception_recips = $recipientRows; |
| 1193 | 1167 | } |
| 1194 | 1168 | if (!empty($exception_recips)) { |
@@ -1232,8 +1206,7 @@ discard block |
||
| 1232 | 1206 | foreach ($recipients as $key => $recipient) { |
| 1233 | 1207 | if (isset($recipient[PR_RECIPIENT_FLAGS]) && $recipient[PR_RECIPIENT_FLAGS] == (recipSendable | recipOrganizer)) { |
| 1234 | 1208 | $hasOrganizer = true; |
| 1235 | - } |
|
| 1236 | - elseif ($isException && !isset($recipient[PR_RECIPIENT_FLAGS])) { |
|
| 1209 | + } elseif ($isException && !isset($recipient[PR_RECIPIENT_FLAGS])) { |
|
| 1237 | 1210 | // Recipients for an occurrence |
| 1238 | 1211 | $recipients[$key][PR_RECIPIENT_FLAGS] = recipSendable | recipExceptionalResponse; |
| 1239 | 1212 | } |
@@ -103,8 +103,7 @@ discard block |
||
| 103 | 103 | |
| 104 | 104 | if (substr($split[2], 0, 2) == "0x") { |
| 105 | 105 | $id = hexdec(substr($split[2], 2)); |
| 106 | - } |
|
| 107 | - else { |
|
| 106 | + } else { |
|
| 108 | 107 | $id = $split[2]; |
| 109 | 108 | } |
| 110 | 109 | |
@@ -114,8 +113,7 @@ discard block |
||
| 114 | 113 | $guids[$split[1]] = makeguid($split[1]); |
| 115 | 114 | } |
| 116 | 115 | $guid = $guids[$split[1]]; |
| 117 | - } |
|
| 118 | - else { |
|
| 116 | + } else { |
|
| 119 | 117 | $guid = constant($split[1]); |
| 120 | 118 | } |
| 121 | 119 | |
@@ -272,8 +270,7 @@ discard block |
||
| 272 | 270 | $item = $occurrence + $row; |
| 273 | 271 | array_push($items, $item); |
| 274 | 272 | } |
| 275 | - } |
|
| 276 | - else { |
|
| 273 | + } else { |
|
| 277 | 274 | // Normal item, it matched the search criteria and therefore overlaps the interval <$viewstart, $viewend> |
| 278 | 275 | array_push($items, $row); |
| 279 | 276 | } |
@@ -376,8 +376,7 @@ discard block |
||
| 376 | 376 | // Create/modify exception |
| 377 | 377 | if ($recurr->isException($basedate)) { |
| 378 | 378 | $recurr->modifyException($exception_props, $basedate); |
| 379 | - } |
|
| 380 | - else { |
|
| 379 | + } else { |
|
| 381 | 380 | // When we are creating an exception we need copy recipients from main recurring item |
| 382 | 381 | $recipTable = mapi_message_getrecipienttable($calendaritem); |
| 383 | 382 | $recips = mapi_table_queryallrows($recipTable, $this->recipprops); |
@@ -477,8 +476,7 @@ discard block |
||
| 477 | 476 | $props = []; |
| 478 | 477 | if ($messageprops[$this->proptags['counter_proposal']]) { |
| 479 | 478 | $props[$this->proptags['counter_proposal']] = true; |
| 480 | - } |
|
| 481 | - else { |
|
| 479 | + } else { |
|
| 482 | 480 | $props[$this->proptags['counter_proposal']] = false; |
| 483 | 481 | } |
| 484 | 482 | mapi_setprops($calendaritem, $props); |
@@ -530,8 +528,7 @@ discard block |
||
| 530 | 528 | $delegatorStore = $this->getDelegatorStore($messageprops); |
| 531 | 529 | $store = $delegatorStore['store']; |
| 532 | 530 | $calFolder = $delegatorStore['calFolder']; |
| 533 | - } |
|
| 534 | - else { |
|
| 531 | + } else { |
|
| 535 | 532 | $calFolder = $this->openDefaultCalendar(); |
| 536 | 533 | } |
| 537 | 534 | |
@@ -561,8 +558,7 @@ discard block |
||
| 561 | 558 | |
| 562 | 559 | if ($recurr->isException($basedate)) { |
| 563 | 560 | $recurr->modifyException($messageprops, $basedate); |
| 564 | - } |
|
| 565 | - else { |
|
| 561 | + } else { |
|
| 566 | 562 | $recurr->createException($messageprops, $basedate); |
| 567 | 563 | } |
| 568 | 564 | } |
@@ -597,8 +593,7 @@ discard block |
||
| 597 | 593 | if (isset($messageprops[PR_RCVD_REPRESENTING_NAME])) { |
| 598 | 594 | $delegatorStore = $this->getDelegatorStore($messageprops); |
| 599 | 595 | $calFolder = $delegatorStore['calFolder']; |
| 600 | - } |
|
| 601 | - else { |
|
| 596 | + } else { |
|
| 602 | 597 | $calFolder = $this->openDefaultCalendar(); |
| 603 | 598 | } |
| 604 | 599 | /* |
@@ -613,11 +608,9 @@ discard block |
||
| 613 | 608 | if (!is_array($entryid) && isset($goid2)) { |
| 614 | 609 | $entryid = $this->findCalendarItems($goid2, $calFolder); |
| 615 | 610 | } |
| 616 | - } |
|
| 617 | - elseif (isset($goid2)) { |
|
| 611 | + } elseif (isset($goid2)) { |
|
| 618 | 612 | $entryid = $this->findCalendarItems($goid2, $calFolder); |
| 619 | - } |
|
| 620 | - else { |
|
| 613 | + } else { |
|
| 621 | 614 | return false; |
| 622 | 615 | } |
| 623 | 616 | |
@@ -675,8 +668,7 @@ discard block |
||
| 675 | 668 | |
| 676 | 669 | $store = $delegatorStore['store']; |
| 677 | 670 | $calFolder = $delegatorStore['calFolder']; |
| 678 | - } |
|
| 679 | - else { |
|
| 671 | + } else { |
|
| 680 | 672 | $calFolder = $this->openDefaultCalendar(); |
| 681 | 673 | $store = $this->store; |
| 682 | 674 | } |
@@ -783,13 +775,11 @@ discard block |
||
| 783 | 775 | if (isset($props[$this->proptags['intendedbusystatus']])) { |
| 784 | 776 | if ($tentative && $props[$this->proptags['intendedbusystatus']] !== fbFree) { |
| 785 | 777 | $props[$this->proptags['busystatus']] = $tentative; |
| 786 | - } |
|
| 787 | - else { |
|
| 778 | + } else { |
|
| 788 | 779 | $props[$this->proptags['busystatus']] = $props[$this->proptags['intendedbusystatus']]; |
| 789 | 780 | } |
| 790 | 781 | // we already have intendedbusystatus value in $props so no need to copy it |
| 791 | - } |
|
| 792 | - else { |
|
| 782 | + } else { |
|
| 793 | 783 | $props[$this->proptags['busystatus']] = $tentative ? fbTentative : fbBusy; |
| 794 | 784 | } |
| 795 | 785 | if ($userAction) { |
@@ -837,8 +827,7 @@ discard block |
||
| 837 | 827 | mapi_folder_copymessages($calFolder, [$props[PR_ENTRYID]], $wastebasket, MESSAGE_MOVE); |
| 838 | 828 | } |
| 839 | 829 | $entryid = $props[PR_ENTRYID]; |
| 840 | - } |
|
| 841 | - else { |
|
| 830 | + } else { |
|
| 842 | 831 | /** |
| 843 | 832 | * This meeting request is not recurring, so can be an exception or normal meeting. |
| 844 | 833 | * If exception then find main recurring item and update exception |
@@ -899,13 +888,11 @@ discard block |
||
| 899 | 888 | if (isset($messageprops[$this->proptags['intendedbusystatus']])) { |
| 900 | 889 | if ($tentative && $messageprops[$this->proptags['intendedbusystatus']] !== fbFree) { |
| 901 | 890 | $calItemProps[$this->proptags['busystatus']] = $tentative; |
| 902 | - } |
|
| 903 | - else { |
|
| 891 | + } else { |
|
| 904 | 892 | $calItemProps[$this->proptags['busystatus']] = $messageprops[$this->proptags['intendedbusystatus']]; |
| 905 | 893 | } |
| 906 | 894 | $calItemProps[$this->proptags['intendedbusystatus']] = $messageprops[$this->proptags['intendedbusystatus']]; |
| 907 | - } |
|
| 908 | - else { |
|
| 895 | + } else { |
|
| 909 | 896 | $calItemProps[$this->proptags['busystatus']] = $tentative ? fbTentative : fbBusy; |
| 910 | 897 | } |
| 911 | 898 | |
@@ -935,8 +922,7 @@ discard block |
||
| 935 | 922 | $this->setRecipsFromString($recips, $messageprops[$this->proptags['toattendeesstring']], MAPI_TO); |
| 936 | 923 | $this->setRecipsFromString($recips, $messageprops[$this->proptags['ccattendeesstring']], MAPI_CC); |
| 937 | 924 | mapi_message_modifyrecipients($calmsg, 0, $recips); |
| 938 | - } |
|
| 939 | - else { |
|
| 925 | + } else { |
|
| 940 | 926 | mapi_message_modifyrecipients($calmsg, MODRECIP_ADD, $recips); |
| 941 | 927 | } |
| 942 | 928 | |
@@ -948,8 +934,7 @@ discard block |
||
| 948 | 934 | |
| 949 | 935 | $messageprops = mapi_getprops($calmsg, [PR_ENTRYID]); |
| 950 | 936 | $entryid = $messageprops[PR_ENTRYID]; |
| 951 | - } |
|
| 952 | - else { |
|
| 937 | + } else { |
|
| 953 | 938 | // Create a new appointment with duplicate properties and recipient, but as an IPM.Appointment |
| 954 | 939 | $new = mapi_folder_createmessage($calFolder); |
| 955 | 940 | $props = mapi_getprops($this->message); |
@@ -967,13 +952,11 @@ discard block |
||
| 967 | 952 | if (isset($props[$this->proptags['intendedbusystatus']])) { |
| 968 | 953 | if ($tentative && $props[$this->proptags['intendedbusystatus']] !== fbFree) { |
| 969 | 954 | $props[$this->proptags['busystatus']] = $tentative; |
| 970 | - } |
|
| 971 | - else { |
|
| 955 | + } else { |
|
| 972 | 956 | $props[$this->proptags['busystatus']] = $props[$this->proptags['intendedbusystatus']]; |
| 973 | 957 | } |
| 974 | 958 | // we already have intendedbusystatus value in $props so no need to copy it |
| 975 | - } |
|
| 976 | - else { |
|
| 959 | + } else { |
|
| 977 | 960 | $props[$this->proptags['busystatus']] = $tentative ? fbTentative : fbBusy; |
| 978 | 961 | } |
| 979 | 962 | |
@@ -1008,8 +991,7 @@ discard block |
||
| 1008 | 991 | $this->setRecipsFromString($recips, $messageprops[$this->proptags['toattendeesstring']], MAPI_TO); |
| 1009 | 992 | $this->setRecipsFromString($recips, $messageprops[$this->proptags['ccattendeesstring']], MAPI_CC); |
| 1010 | 993 | mapi_message_modifyrecipients($new, 0, $recips); |
| 1011 | - } |
|
| 1012 | - else { |
|
| 994 | + } else { |
|
| 1013 | 995 | mapi_message_modifyrecipients($new, MODRECIP_ADD, $recips); |
| 1014 | 996 | } |
| 1015 | 997 | |
@@ -1020,8 +1002,7 @@ discard block |
||
| 1020 | 1002 | } |
| 1021 | 1003 | } |
| 1022 | 1004 | } |
| 1023 | - } |
|
| 1024 | - else { |
|
| 1005 | + } else { |
|
| 1025 | 1006 | // Here only properties are set on calendaritem, because user is responding from calendar. |
| 1026 | 1007 | $props = []; |
| 1027 | 1008 | $props[$this->proptags['responsestatus']] = $tentative ? olResponseTentative : olResponseAccepted; |
@@ -1029,13 +1010,11 @@ discard block |
||
| 1029 | 1010 | if (isset($messageprops[$this->proptags['intendedbusystatus']])) { |
| 1030 | 1011 | if ($tentative && $messageprops[$this->proptags['intendedbusystatus']] !== fbFree) { |
| 1031 | 1012 | $props[$this->proptags['busystatus']] = $tentative; |
| 1032 | - } |
|
| 1033 | - else { |
|
| 1013 | + } else { |
|
| 1034 | 1014 | $props[$this->proptags['busystatus']] = $messageprops[$this->proptags['intendedbusystatus']]; |
| 1035 | 1015 | } |
| 1036 | 1016 | $props[$this->proptags['intendedbusystatus']] = $messageprops[$this->proptags['intendedbusystatus']]; |
| 1037 | - } |
|
| 1038 | - else { |
|
| 1017 | + } else { |
|
| 1039 | 1018 | $props[$this->proptags['busystatus']] = $tentative ? fbTentative : fbBusy; |
| 1040 | 1019 | } |
| 1041 | 1020 | |
@@ -1051,8 +1030,7 @@ discard block |
||
| 1051 | 1030 | |
| 1052 | 1031 | if ($recurr->isException($basedate)) { |
| 1053 | 1032 | $recurr->modifyException($proposeNewTimeProps + $props, $basedate, $recips); |
| 1054 | - } |
|
| 1055 | - else { |
|
| 1033 | + } else { |
|
| 1056 | 1034 | $props[$this->proptags['startdate']] = $recurr->getOccurrenceStart($basedate); |
| 1057 | 1035 | $props[$this->proptags['duedate']] = $recurr->getOccurrenceEnd($basedate); |
| 1058 | 1036 | |
@@ -1064,8 +1042,7 @@ discard block |
||
| 1064 | 1042 | |
| 1065 | 1043 | $recurr->createException($proposeNewTimeProps + $props, $basedate, false, $recips); |
| 1066 | 1044 | } |
| 1067 | - } |
|
| 1068 | - else { |
|
| 1045 | + } else { |
|
| 1069 | 1046 | mapi_setprops($this->message, $proposeNewTimeProps + $props); |
| 1070 | 1047 | } |
| 1071 | 1048 | mapi_savechanges($this->message); |
@@ -1106,8 +1083,7 @@ discard block |
||
| 1106 | 1083 | |
| 1107 | 1084 | $store = $delegatorStore['store']; |
| 1108 | 1085 | $calFolder = $delegatorStore['calFolder']; |
| 1109 | - } |
|
| 1110 | - else { |
|
| 1086 | + } else { |
|
| 1111 | 1087 | $calFolder = $this->openDefaultCalendar(); |
| 1112 | 1088 | $store = $this->store; |
| 1113 | 1089 | } |
@@ -1141,8 +1117,7 @@ discard block |
||
| 1141 | 1117 | |
| 1142 | 1118 | if ($this->isMeetingRequest()) { |
| 1143 | 1119 | $calendaritem = false; |
| 1144 | - } |
|
| 1145 | - else { |
|
| 1120 | + } else { |
|
| 1146 | 1121 | $result = false; |
| 1147 | 1122 | } |
| 1148 | 1123 | } |
@@ -1188,8 +1163,7 @@ discard block |
||
| 1188 | 1163 | $delegatorStore = $this->getDelegatorStore($messageprops); |
| 1189 | 1164 | $store = $delegatorStore['store']; |
| 1190 | 1165 | $calFolder = $delegatorStore['calFolder']; |
| 1191 | - } |
|
| 1192 | - else { |
|
| 1166 | + } else { |
|
| 1193 | 1167 | $calFolder = $this->openDefaultCalendar(); |
| 1194 | 1168 | } |
| 1195 | 1169 | |
@@ -1243,13 +1217,11 @@ discard block |
||
| 1243 | 1217 | |
| 1244 | 1218 | // Move the message to the waste basket |
| 1245 | 1219 | mapi_folder_copymessages($sourcefolder, [$messageprops[PR_ENTRYID]], $wastebasket, MESSAGE_MOVE); |
| 1246 | - } |
|
| 1247 | - else { |
|
| 1220 | + } else { |
|
| 1248 | 1221 | // Here only properties are set on calendaritem, because user is responding from calendar. |
| 1249 | 1222 | if ($basedate) { // remove the occurrence |
| 1250 | 1223 | $this->doRemoveExceptionFromCalendar($basedate, $this->message, $store); |
| 1251 | - } |
|
| 1252 | - else { // remove normal/recurring meeting item. |
|
| 1224 | + } else { // remove normal/recurring meeting item. |
|
| 1253 | 1225 | // Move the message to the waste basket |
| 1254 | 1226 | mapi_folder_copymessages($sourcefolder, [$messageprops[PR_ENTRYID]], $wastebasket, MESSAGE_MOVE); |
| 1255 | 1227 | } |
@@ -1381,8 +1353,7 @@ discard block |
||
| 1381 | 1353 | } |
| 1382 | 1354 | } |
| 1383 | 1355 | } |
| 1384 | - } |
|
| 1385 | - else { |
|
| 1356 | + } else { |
|
| 1386 | 1357 | // Basedate found, an exception is to be sent |
| 1387 | 1358 | if ($basedate) { |
| 1388 | 1359 | $recurr = new Recurrence($this->openDefaultStore(), $this->message); |
@@ -1390,8 +1361,7 @@ discard block |
||
| 1390 | 1361 | if ($cancel) { |
| 1391 | 1362 | /* @TODO: remove occurrence from the resource's calendar if resource was booked for whole series. */ |
| 1392 | 1363 | $this->submitMeetingRequest($this->message, $cancel, $prefix, $basedate, $recurr, false); |
| 1393 | - } |
|
| 1394 | - else { |
|
| 1364 | + } else { |
|
| 1395 | 1365 | $attach = $recurr->getExceptionAttachment($basedate); |
| 1396 | 1366 | |
| 1397 | 1367 | if ($attach) { |
@@ -1410,8 +1380,7 @@ discard block |
||
| 1410 | 1380 | } |
| 1411 | 1381 | } |
| 1412 | 1382 | } |
| 1413 | - } |
|
| 1414 | - else { |
|
| 1383 | + } else { |
|
| 1415 | 1384 | // This is normal meeting |
| 1416 | 1385 | $resourceRecipData = $this->bookResources($this->message, $cancel, $prefix); |
| 1417 | 1386 | if (!$this->errorSetResource) { |
@@ -1614,8 +1583,7 @@ discard block |
||
| 1614 | 1583 | public function getDefaultFolderEntryID($prop) { |
| 1615 | 1584 | try { |
| 1616 | 1585 | $inbox = mapi_msgstore_getreceivefolder($this->store); |
| 1617 | - } |
|
| 1618 | - catch (MAPIException $e) { |
|
| 1586 | + } catch (MAPIException $e) { |
|
| 1619 | 1587 | // public store doesn't support this method |
| 1620 | 1588 | if ($e->getCode() == MAPI_E_NO_SUPPORT) { |
| 1621 | 1589 | // don't propagate this error to parent handlers, if store doesn't support it |
@@ -1712,8 +1680,7 @@ discard block |
||
| 1712 | 1680 | $props[$this->proptags['meetingstatus']] = $imsgprops[$this->proptags['meetingstatus']]; |
| 1713 | 1681 | $props[$this->proptags['responsestatus']] = $imsgprops[$this->proptags['responsestatus']]; |
| 1714 | 1682 | $props[PR_SUBJECT] = $imsgprops[PR_SUBJECT]; |
| 1715 | - } |
|
| 1716 | - else { |
|
| 1683 | + } else { |
|
| 1717 | 1684 | // Exceptions is deleted. |
| 1718 | 1685 | // Update $messageprops with timings of occurrence |
| 1719 | 1686 | $messageprops[$this->proptags['startdate']] = $recurr->getOccurrenceStart($basedate); |
@@ -1725,8 +1692,7 @@ discard block |
||
| 1725 | 1692 | |
| 1726 | 1693 | $props[$this->proptags['recurring']] = false; |
| 1727 | 1694 | $props[$this->proptags['is_exception']] = true; |
| 1728 | - } |
|
| 1729 | - else { |
|
| 1695 | + } else { |
|
| 1730 | 1696 | // we are creating a response from meeting request mail (it could be recurring or non-recurring) |
| 1731 | 1697 | // Send all recurrence info in response, if this is a recurrence meeting. |
| 1732 | 1698 | $isRecurring = isset($messageprops[$this->proptags['recurring']]) && $messageprops[$this->proptags['recurring']]; |
@@ -2033,8 +1999,7 @@ discard block |
||
| 2033 | 1999 | foreach ($recipients as $key => $recipient) { |
| 2034 | 2000 | if (isset($recipient[PR_RECIPIENT_FLAGS]) && $recipient[PR_RECIPIENT_FLAGS] == (recipSendable | recipOrganizer)) { |
| 2035 | 2001 | $hasOrganizer = true; |
| 2036 | - } |
|
| 2037 | - elseif ($isException && !isset($recipient[PR_RECIPIENT_FLAGS])) { |
|
| 2002 | + } elseif ($isException && !isset($recipient[PR_RECIPIENT_FLAGS])) { |
|
| 2038 | 2003 | // Recipients for an occurrence |
| 2039 | 2004 | $recipients[$key][PR_RECIPIENT_FLAGS] = recipSendable | recipExceptionalResponse; |
| 2040 | 2005 | } |
@@ -2189,8 +2154,7 @@ discard block |
||
| 2189 | 2154 | $delegate = mapi_getprops($copy_from, [PR_RECEIVED_BY_EMAIL_ADDRESS]); |
| 2190 | 2155 | $res = [RES_PROPERTY, [RELOP => RELOP_NE, ULPROPTAG => PR_EMAIL_ADDRESS, VALUE => $delegate[PR_RECEIVED_BY_EMAIL_ADDRESS]]]; |
| 2191 | 2156 | $recipients = mapi_table_queryallrows($recipienttable, $this->recipprops, $res); |
| 2192 | - } |
|
| 2193 | - else { |
|
| 2157 | + } else { |
|
| 2194 | 2158 | $recipients = mapi_table_queryallrows($recipienttable, $this->recipprops); |
| 2195 | 2159 | } |
| 2196 | 2160 | |
@@ -2296,8 +2260,7 @@ discard block |
||
| 2296 | 2260 | $accessToFolder = true; |
| 2297 | 2261 | } |
| 2298 | 2262 | } |
| 2299 | - } |
|
| 2300 | - catch (MAPIException $e) { |
|
| 2263 | + } catch (MAPIException $e) { |
|
| 2301 | 2264 | $e->setHandled(); |
| 2302 | 2265 | $this->errorSetResource = 1; // No access |
| 2303 | 2266 | } |
@@ -2323,8 +2286,7 @@ discard block |
||
| 2323 | 2286 | */ |
| 2324 | 2287 | // $errorSetResource = 2; |
| 2325 | 2288 | $this->nonAcceptingResources[] = $resourceRecipients[$i]; |
| 2326 | - } |
|
| 2327 | - else { |
|
| 2289 | + } else { |
|
| 2328 | 2290 | if ($declineRecurringMeetingRequests && !$cancel) { |
| 2329 | 2291 | // Check if appointment is recurring |
| 2330 | 2292 | if ($messageprops[$this->proptags['recurring']]) { |
@@ -2342,8 +2304,7 @@ discard block |
||
| 2342 | 2304 | if ($this->isMeetingConflicting($message, $userStore, $calFolder, $messageprops)) { |
| 2343 | 2305 | $conflicting = true; |
| 2344 | 2306 | } |
| 2345 | - } |
|
| 2346 | - else { |
|
| 2307 | + } else { |
|
| 2347 | 2308 | $this->errorSetResource = 1; // No access |
| 2348 | 2309 | } |
| 2349 | 2310 | if ($conflicting) { |
@@ -2398,8 +2359,7 @@ discard block |
||
| 2398 | 2359 | if (!$newResourceMsg) { |
| 2399 | 2360 | $newResourceMsg = mapi_folder_createmessage($calFolder); |
| 2400 | 2361 | } |
| 2401 | - } |
|
| 2402 | - else { |
|
| 2362 | + } else { |
|
| 2403 | 2363 | $newResourceMsg = mapi_msgstore_openentry($userStore, $rows[0]); |
| 2404 | 2364 | } |
| 2405 | 2365 | |
@@ -2413,8 +2373,7 @@ discard block |
||
| 2413 | 2373 | if ($cancel) { |
| 2414 | 2374 | $messageprops[$this->proptags['meetingstatus']] = olMeetingCanceled; // The meeting has been canceled |
| 2415 | 2375 | $messageprops[$this->proptags['busystatus']] = fbFree; // Free |
| 2416 | - } |
|
| 2417 | - else { |
|
| 2376 | + } else { |
|
| 2418 | 2377 | $messageprops[$this->proptags['meetingstatus']] = olMeetingReceived; // The recipient is receiving the request |
| 2419 | 2378 | } |
| 2420 | 2379 | $messageprops[$this->proptags['responsestatus']] = olResponseAccepted; // The resource automatically accepts the appointment |
@@ -2453,12 +2412,10 @@ discard block |
||
| 2453 | 2412 | // Update occurrence |
| 2454 | 2413 | if ($recurr->isException($basedate)) { |
| 2455 | 2414 | $recurr->modifyException($messageprops, $basedate, $recips); |
| 2456 | - } |
|
| 2457 | - else { |
|
| 2415 | + } else { |
|
| 2458 | 2416 | $recurr->createException($messageprops, $basedate, false, $recips); |
| 2459 | 2417 | } |
| 2460 | - } |
|
| 2461 | - else { |
|
| 2418 | + } else { |
|
| 2462 | 2419 | mapi_setprops($newResourceMsg, $messageprops); |
| 2463 | 2420 | |
| 2464 | 2421 | // Copy attachments |
@@ -2481,8 +2438,7 @@ discard block |
||
| 2481 | 2438 | 'msg' => $newResourceMsg, |
| 2482 | 2439 | ]; |
| 2483 | 2440 | $this->includesResources = true; |
| 2484 | - } |
|
| 2485 | - else { |
|
| 2441 | + } else { |
|
| 2486 | 2442 | /* |
| 2487 | 2443 | * If no other errors occurred and you have no access to the |
| 2488 | 2444 | * folder of the resource, throw an error=1. |
@@ -2564,8 +2520,7 @@ discard block |
||
| 2564 | 2520 | $delegate = mapi_getprops($this->message, [PR_RECEIVED_BY_EMAIL_ADDRESS]); |
| 2565 | 2521 | $res = [RES_PROPERTY, [RELOP => RELOP_NE, ULPROPTAG => PR_EMAIL_ADDRESS, VALUE => $delegate[PR_RECEIVED_BY_EMAIL_ADDRESS]]]; |
| 2566 | 2522 | $recips = mapi_table_queryallrows($reciptable, $this->recipprops, $res); |
| 2567 | - } |
|
| 2568 | - else { |
|
| 2523 | + } else { |
|
| 2569 | 2524 | $recips = mapi_table_queryallrows($reciptable, $this->recipprops); |
| 2570 | 2525 | } |
| 2571 | 2526 | |
@@ -2584,13 +2539,11 @@ discard block |
||
| 2584 | 2539 | if (isset($exception_props[$this->proptags['intendedbusystatus']])) { |
| 2585 | 2540 | if ($tentative && $exception_props[$this->proptags['intendedbusystatus']] !== fbFree) { |
| 2586 | 2541 | $exception_props[$this->proptags['busystatus']] = $tentative; |
| 2587 | - } |
|
| 2588 | - else { |
|
| 2542 | + } else { |
|
| 2589 | 2543 | $exception_props[$this->proptags['busystatus']] = $exception_props[$this->proptags['intendedbusystatus']]; |
| 2590 | 2544 | } |
| 2591 | 2545 | // we already have intendedbusystatus value in $exception_props so no need to copy it |
| 2592 | - } |
|
| 2593 | - else { |
|
| 2546 | + } else { |
|
| 2594 | 2547 | $exception_props[$this->proptags['busystatus']] = $tentative ? fbTentative : fbBusy; |
| 2595 | 2548 | } |
| 2596 | 2549 | |
@@ -2600,8 +2553,7 @@ discard block |
||
| 2600 | 2553 | } |
| 2601 | 2554 | if ($recurr->isException($basedate)) { |
| 2602 | 2555 | $recurr->modifyException($exception_props, $basedate, $recips, $occurrenceItem); |
| 2603 | - } |
|
| 2604 | - else { |
|
| 2556 | + } else { |
|
| 2605 | 2557 | $recurr->createException($exception_props, $basedate, false, $recips, $occurrenceItem); |
| 2606 | 2558 | } |
| 2607 | 2559 | |
@@ -2694,8 +2646,7 @@ discard block |
||
| 2694 | 2646 | |
| 2695 | 2647 | if (!$deletedRecips) { |
| 2696 | 2648 | $deletedRecips = array_merge([], $recipients); |
| 2697 | - } |
|
| 2698 | - else { |
|
| 2649 | + } else { |
|
| 2699 | 2650 | $deletedRecips = array_merge($deletedRecips, $recipients); |
| 2700 | 2651 | } |
| 2701 | 2652 | } |
@@ -2818,8 +2769,7 @@ discard block |
||
| 2818 | 2769 | $newmessageprops[PR_MESSAGE_CLASS] = "IPM.Schedule.Meeting.Canceled"; |
| 2819 | 2770 | $newmessageprops[$this->proptags['meetingstatus']] = olMeetingCanceled; // It's a cancel request |
| 2820 | 2771 | $newmessageprops[$this->proptags['busystatus']] = fbFree; // set the busy status as free |
| 2821 | - } |
|
| 2822 | - else { |
|
| 2772 | + } else { |
|
| 2823 | 2773 | $newmessageprops[PR_MESSAGE_CLASS] = "IPM.Schedule.Meeting.Request"; |
| 2824 | 2774 | $newmessageprops[$this->proptags['meetingstatus']] = olMeetingReceived; // The recipient is receiving the request |
| 2825 | 2775 | } |
@@ -2979,8 +2929,7 @@ discard block |
||
| 2979 | 2929 | mapi_savechanges($this->message); |
| 2980 | 2930 | $result = true; |
| 2981 | 2931 | } |
| 2982 | - } |
|
| 2983 | - elseif ((isset($calendarItemProps[$this->proptags['updatecounter']]) && $props[$this->proptags['updatecounter']] < $calendarItemProps[$this->proptags['updatecounter']]) || |
|
| 2932 | + } elseif ((isset($calendarItemProps[$this->proptags['updatecounter']]) && $props[$this->proptags['updatecounter']] < $calendarItemProps[$this->proptags['updatecounter']]) || |
|
| 2984 | 2933 | (isset($calendarItemProps[$this->proptags['owner_critical_change']]) && $props[$this->proptags['owner_critical_change']] < $calendarItemProps[$this->proptags['owner_critical_change']])) { |
| 2985 | 2934 | // we are not able to find exception, could mean that a significant change has occurred on series |
| 2986 | 2935 | // and it deleted all exceptions, so compare with series |
@@ -2989,8 +2938,7 @@ discard block |
||
| 2989 | 2938 | mapi_savechanges($this->message); |
| 2990 | 2939 | $result = true; |
| 2991 | 2940 | } |
| 2992 | - } |
|
| 2993 | - elseif ((isset($calendarItemProps[$this->proptags['updatecounter']]) && $props[$this->proptags['updatecounter']] < $calendarItemProps[$this->proptags['updatecounter']]) || |
|
| 2941 | + } elseif ((isset($calendarItemProps[$this->proptags['updatecounter']]) && $props[$this->proptags['updatecounter']] < $calendarItemProps[$this->proptags['updatecounter']]) || |
|
| 2994 | 2942 | (isset($calendarItemProps[$this->proptags['owner_critical_change']]) && $props[$this->proptags['owner_critical_change']] < $calendarItemProps[$this->proptags['owner_critical_change']])) { |
| 2995 | 2943 | // normal / recurring series |
| 2996 | 2944 | |
@@ -3061,8 +3009,7 @@ discard block |
||
| 3061 | 3009 | $message = mapi_attach_openobj($attach, MAPI_MODIFY); |
| 3062 | 3010 | } |
| 3063 | 3011 | } |
| 3064 | - } |
|
| 3065 | - else { |
|
| 3012 | + } else { |
|
| 3066 | 3013 | // use normal message or recurring series message |
| 3067 | 3014 | $message = $this->message; |
| 3068 | 3015 | } |
@@ -3105,8 +3052,7 @@ discard block |
||
| 3105 | 3052 | if (($recipient[PR_RECIPIENT_FLAGS] & recipOrganizer) != recipOrganizer) { |
| 3106 | 3053 | // Recipient is attendee, set the trackstatus to "Not Responded" |
| 3107 | 3054 | $recipient[PR_RECIPIENT_TRACKSTATUS] = olRecipientTrackStatusNone; |
| 3108 | - } |
|
| 3109 | - else { |
|
| 3055 | + } else { |
|
| 3110 | 3056 | // Recipient is organizer, this is not possible, but for safety |
| 3111 | 3057 | // it is best to clear the trackstatus for him as well by setting |
| 3112 | 3058 | // the trackstatus to "Organized". |
@@ -3133,8 +3079,7 @@ discard block |
||
| 3133 | 3079 | $delegatorStore = $this->getDelegatorStore($props); |
| 3134 | 3080 | $store = $delegatorStore['store']; |
| 3135 | 3081 | $calFolder = $delegatorStore['calFolder']; |
| 3136 | - } |
|
| 3137 | - else { |
|
| 3082 | + } else { |
|
| 3138 | 3083 | $calFolder = $this->openDefaultCalendar(); |
| 3139 | 3084 | } |
| 3140 | 3085 | |
@@ -3229,8 +3174,7 @@ discard block |
||
| 3229 | 3174 | } |
| 3230 | 3175 | |
| 3231 | 3176 | $returnValue = $noOfInstances; |
| 3232 | - } |
|
| 3233 | - else { |
|
| 3177 | + } else { |
|
| 3234 | 3178 | // Get all items in the timeframe that we want to book, and get the goid and busystatus for each item |
| 3235 | 3179 | $items = getCalendarItems($userStore, $calFolder, $msgprops[$this->proptags['startdate']], $msgprops[$this->proptags['duedate']], [$this->proptags['goid'], $this->proptags['busystatus'], PR_OWNER_APPT_ID]); |
| 3236 | 3180 | |
@@ -3390,8 +3334,7 @@ discard block |
||
| 3390 | 3334 | foreach ($localCategories as $key => $value) { |
| 3391 | 3335 | if ($recurrence->isException($key)) { |
| 3392 | 3336 | $recurrence->modifyException([$this->proptags2['categories'] => $value], $key); |
| 3393 | - } |
|
| 3394 | - else { |
|
| 3337 | + } else { |
|
| 3395 | 3338 | $recurrence->createException([$this->proptags2['categories'] => $value], $key, false); |
| 3396 | 3339 | } |
| 3397 | 3340 | mapi_savechanges($message); |
@@ -325,8 +325,7 @@ discard block |
||
| 325 | 325 | $messageprops = mapi_getprops($this->message, [$this->props['updatecount']]); |
| 326 | 326 | if (isset($messageprops)) { |
| 327 | 327 | ++$messageprops[$this->props['updatecount']]; |
| 328 | - } |
|
| 329 | - else { |
|
| 328 | + } else { |
|
| 330 | 329 | $messageprops[$this->props['updatecount']] = 1; |
| 331 | 330 | } |
| 332 | 331 | |
@@ -907,17 +906,13 @@ discard block |
||
| 907 | 906 | $body .= "\n" . dgettext("kopano", "Status") . ":\t"; |
| 908 | 907 | if ($msgProps[$this->props['status']] == 0) { |
| 909 | 908 | $body .= dgettext("kopano", "Not Started"); |
| 910 | - } |
|
| 911 | - elseif ($msgProps[$this->props['status']] == 1) { |
|
| 909 | + } elseif ($msgProps[$this->props['status']] == 1) { |
|
| 912 | 910 | $body .= dgettext("kopano", "In Progress"); |
| 913 | - } |
|
| 914 | - elseif ($msgProps[$this->props['status']] == 2) { |
|
| 911 | + } elseif ($msgProps[$this->props['status']] == 2) { |
|
| 915 | 912 | $body .= dgettext("kopano", "Complete"); |
| 916 | - } |
|
| 917 | - elseif ($msgProps[$this->props['status']] == 3) { |
|
| 913 | + } elseif ($msgProps[$this->props['status']] == 3) { |
|
| 918 | 914 | $body .= dgettext("kopano", "Wait for other person"); |
| 919 | - } |
|
| 920 | - elseif ($msgProps[$this->props['status']] == 4) { |
|
| 915 | + } elseif ($msgProps[$this->props['status']] == 4) { |
|
| 921 | 916 | $body .= dgettext("kopano", "Deferred"); |
| 922 | 917 | } |
| 923 | 918 | } |
@@ -51,8 +51,7 @@ discard block |
||
| 51 | 51 | |
| 52 | 52 | if (is_array($message)) { |
| 53 | 53 | $this->messageprops = $message; |
| 54 | - } |
|
| 55 | - else { |
|
| 54 | + } else { |
|
| 56 | 55 | $this->message = $message; |
| 57 | 56 | $this->messageprops = mapi_getprops($this->message, $this->proptags); |
| 58 | 57 | } |
@@ -207,8 +206,7 @@ discard block |
||
| 207 | 206 | $ret["regen"] = $data["regen"]; |
| 208 | 207 | if ($ret["subtype"] == 3) { |
| 209 | 208 | $ret["weekdays"] = $data["monthday"]; |
| 210 | - } |
|
| 211 | - else { |
|
| 209 | + } else { |
|
| 212 | 210 | $ret["monthday"] = $data["monthday"]; |
| 213 | 211 | } |
| 214 | 212 | |
@@ -232,8 +230,7 @@ discard block |
||
| 232 | 230 | $ret["regen"] = $data["regen"]; |
| 233 | 231 | if ($ret["subtype"] == 3) { |
| 234 | 232 | $ret["weekdays"] = $data["monthday"]; |
| 235 | - } |
|
| 236 | - else { |
|
| 233 | + } else { |
|
| 237 | 234 | $ret["monthday"] = $data["monthday"]; |
| 238 | 235 | } |
| 239 | 236 | |
@@ -582,8 +579,7 @@ discard block |
||
| 582 | 579 | if ($this->recur["subtype"] == 1) { |
| 583 | 580 | // Daily every workday |
| 584 | 581 | $rdata .= pack("VVVV", (6 * 24 * 60), 1, 0, 0x3E); |
| 585 | - } |
|
| 586 | - else { |
|
| 582 | + } else { |
|
| 587 | 583 | // Daily every N days (everyN in minutes) |
| 588 | 584 | $everyn = ((int) $this->recur["everyn"]) / 1440; |
| 589 | 585 | // Calc first occ |
@@ -651,8 +647,7 @@ discard block |
||
| 651 | 647 | |
| 652 | 648 | if ($this->recur["regen"]) { |
| 653 | 649 | $rdata .= pack("VVV", $firstocc, (int) $this->recur["everyn"], 1); |
| 654 | - } |
|
| 655 | - else { |
|
| 650 | + } else { |
|
| 656 | 651 | $rdata .= pack("VVVV", $firstocc, (int) $this->recur["everyn"], 0, (int) $this->recur["weekdays"]); |
| 657 | 652 | } |
| 658 | 653 | break; |
@@ -669,8 +664,7 @@ discard block |
||
| 669 | 664 | } |
| 670 | 665 | if ($term == 0x0C /* monthly */) { |
| 671 | 666 | $everyn = (int) $this->recur["everyn"]; |
| 672 | - } |
|
| 673 | - else { |
|
| 667 | + } else { |
|
| 674 | 668 | $everyn = $this->recur["regen"] ? ((int) $this->recur["everyn"]) * 12 : 12; |
| 675 | 669 | } |
| 676 | 670 | |
@@ -746,8 +740,7 @@ discard block |
||
| 746 | 740 | $firstocc += $this->getMonthInSeconds(1601 + floor($i / 12), ($i % 12) + 1) / 60; |
| 747 | 741 | } |
| 748 | 742 | $rdata .= pack("VVVV", $firstocc, $everyn, $this->recur["regen"], (int) $this->recur["monthday"]); |
| 749 | - } |
|
| 750 | - else { |
|
| 743 | + } else { |
|
| 751 | 744 | // Calc first occ |
| 752 | 745 | $firstocc = 0; |
| 753 | 746 | $monthIndex = (int) gmdate("n", $this->recur["start"]); |
@@ -774,8 +767,7 @@ discard block |
||
| 774 | 767 | if ($nday == 5) { |
| 775 | 768 | // Set date on the last day of the last month |
| 776 | 769 | $monthbegindow += (gmdate("t", $monthbegindow) - gmdate("j", $monthbegindow)) * 24 * 60 * 60; |
| 777 | - } |
|
| 778 | - else { |
|
| 770 | + } else { |
|
| 779 | 771 | // Set on the first day of the month |
| 780 | 772 | $monthbegindow -= ((gmdate("j", $monthbegindow) - 1) * 24 * 60 * 60); |
| 781 | 773 | } |
@@ -784,8 +776,7 @@ discard block |
||
| 784 | 776 | // Set on right month |
| 785 | 777 | if ($selmonth < $curmonth) { |
| 786 | 778 | $tmp = 12 - $curmonth + $selmonth; |
| 787 | - } |
|
| 788 | - else { |
|
| 779 | + } else { |
|
| 789 | 780 | $tmp = ($selmonth - $curmonth); |
| 790 | 781 | } |
| 791 | 782 | |
@@ -797,8 +788,7 @@ discard block |
||
| 797 | 788 | } |
| 798 | 789 | ++$curmonth; |
| 799 | 790 | } |
| 800 | - } |
|
| 801 | - else { |
|
| 791 | + } else { |
|
| 802 | 792 | // Check or you exist in the right month |
| 803 | 793 | for ($i = 0; $i < 7; ++$i) { |
| 804 | 794 | if ($nday == 5 && (1 << ((gmdate("w", $monthbegindow) - $i) % 7)) & $weekdays) { |
@@ -856,8 +846,7 @@ discard block |
||
| 856 | 846 | } |
| 857 | 847 | if ($nday == 5) { |
| 858 | 848 | $monthbegindow -= $day * 24 * 60 * 60; |
| 859 | - } |
|
| 860 | - else { |
|
| 849 | + } else { |
|
| 861 | 850 | $monthbegindow += ($day - 1) * 24 * 60 * 60; |
| 862 | 851 | } |
| 863 | 852 | |
@@ -911,8 +900,7 @@ discard block |
||
| 911 | 900 | // Strange little thing for the recurrence type "every workday" |
| 912 | 901 | if (((int) $this->recur["type"]) == 0x0B && ((int) $this->recur["subtype"]) == 1) { |
| 913 | 902 | $rdata .= pack("V", 1); |
| 914 | - } |
|
| 915 | - else { // Other recurrences |
|
| 903 | + } else { // Other recurrences |
|
| 916 | 904 | $rdata .= pack("V", 0); |
| 917 | 905 | } |
| 918 | 906 | |
@@ -1030,8 +1018,7 @@ discard block |
||
| 1030 | 1018 | if ($curmonth >= 12) { |
| 1031 | 1019 | $curmonth = 1; |
| 1032 | 1020 | ++$curyear; |
| 1033 | - } |
|
| 1034 | - else { |
|
| 1021 | + } else { |
|
| 1035 | 1022 | ++$curmonth; |
| 1036 | 1023 | } |
| 1037 | 1024 | --$forwardcount; |
@@ -1042,8 +1029,7 @@ discard block |
||
| 1042 | 1029 | gmdate("j", $occenddate) < ((int) $this->recur["monthday"])) { |
| 1043 | 1030 | if (gmdate("j", $occenddate) < 28) { |
| 1044 | 1031 | $occenddate -= gmdate("j", $occenddate) * 24 * 60 * 60; |
| 1045 | - } |
|
| 1046 | - else { |
|
| 1032 | + } else { |
|
| 1047 | 1033 | $occenddate += (gmdate("t", $occenddate) - gmdate("j", $occenddate)) * 24 * 60 * 60; |
| 1048 | 1034 | } |
| 1049 | 1035 | } |
@@ -1057,8 +1043,7 @@ discard block |
||
| 1057 | 1043 | if ($curmonth >= 12) { |
| 1058 | 1044 | $curmonth = 1; |
| 1059 | 1045 | ++$curyear; |
| 1060 | - } |
|
| 1061 | - else { |
|
| 1046 | + } else { |
|
| 1062 | 1047 | ++$curmonth; |
| 1063 | 1048 | } |
| 1064 | 1049 | --$forwardcount; |
@@ -1066,8 +1051,7 @@ discard block |
||
| 1066 | 1051 | if ($nday == 5) { |
| 1067 | 1052 | // Set date on the last day of the last month |
| 1068 | 1053 | $occenddate += (gmdate("t", $occenddate) - gmdate("j", $occenddate)) * 24 * 60 * 60; |
| 1069 | - } |
|
| 1070 | - else { |
|
| 1054 | + } else { |
|
| 1071 | 1055 | // Set date on the first day of the last month |
| 1072 | 1056 | $occenddate -= (gmdate("j", $occenddate) - 1) * 24 * 60 * 60; |
| 1073 | 1057 | } |
@@ -1133,8 +1117,7 @@ discard block |
||
| 1133 | 1117 | |
| 1134 | 1118 | // set named prop 'side_effects' to 369, needed for Outlook to ask for single or total recurrence when deleting |
| 1135 | 1119 | mapi_setprops($this->message, [$this->proptags["side_effects"] => 369]); |
| 1136 | - } |
|
| 1137 | - else { |
|
| 1120 | + } else { |
|
| 1138 | 1121 | mapi_setprops($this->message, [$this->proptags["side_effects"] => 3441]); |
| 1139 | 1122 | } |
| 1140 | 1123 | |
@@ -1164,8 +1147,7 @@ discard block |
||
| 1164 | 1147 | |
| 1165 | 1148 | if ($occ) { |
| 1166 | 1149 | mapi_setprops($this->message, [$this->proptags["flagdueby"] => $occ[$this->proptags["startdate"]] - ($reminderprops[$this->proptags["reminder_minutes"]] * 60)]); |
| 1167 | - } |
|
| 1168 | - else { |
|
| 1150 | + } else { |
|
| 1169 | 1151 | // Last reminder passed, no reminders any more. |
| 1170 | 1152 | mapi_setprops($this->message, [$this->proptags["reminder"] => false, $this->proptags["flagdueby"] => 0x7FF00000]); |
| 1171 | 1153 | } |
@@ -1367,11 +1349,9 @@ discard block |
||
| 1367 | 1349 | public function getMonthInSeconds($year, $month) { |
| 1368 | 1350 | if (in_array($month, [1, 3, 5, 7, 8, 10, 12])) { |
| 1369 | 1351 | $day = 31; |
| 1370 | - } |
|
| 1371 | - elseif (in_array($month, [4, 6, 9, 11])) { |
|
| 1352 | + } elseif (in_array($month, [4, 6, 9, 11])) { |
|
| 1372 | 1353 | $day = 30; |
| 1373 | - } |
|
| 1374 | - else { |
|
| 1354 | + } else { |
|
| 1375 | 1355 | $day = 28; |
| 1376 | 1356 | if ($this->isLeapYear($year) == 1) { |
| 1377 | 1357 | ++$day; |
@@ -1441,8 +1421,7 @@ discard block |
||
| 1441 | 1421 | if ($date > $dststart && $date < $dstend) { |
| 1442 | 1422 | $dst = true; |
| 1443 | 1423 | } |
| 1444 | - } |
|
| 1445 | - else { |
|
| 1424 | + } else { |
|
| 1446 | 1425 | // Southern hemisphere, eg DST is during Oct-Mar |
| 1447 | 1426 | if ($date < $dstend || $date > $dststart) { |
| 1448 | 1427 | $dst = true; |
@@ -1628,8 +1607,7 @@ discard block |
||
| 1628 | 1607 | |
| 1629 | 1608 | if ($this->recur['regen'] && isset($this->action['datecompleted'])) { |
| 1630 | 1609 | $daystart = $this->dayStartOf($this->action['datecompleted']); |
| 1631 | - } |
|
| 1632 | - else { |
|
| 1610 | + } else { |
|
| 1633 | 1611 | $daystart = $this->dayStartOf($this->recur["start"]); |
| 1634 | 1612 | } // start on first day of occurrence |
| 1635 | 1613 | |
@@ -1637,8 +1615,7 @@ discard block |
||
| 1637 | 1615 | // or the end of the recurrence, whichever comes first |
| 1638 | 1616 | if ($end > $this->toGMT($this->tz, $this->recur["end"])) { |
| 1639 | 1617 | $rangeend = $this->toGMT($this->tz, $this->recur["end"]); |
| 1640 | - } |
|
| 1641 | - else { |
|
| 1618 | + } else { |
|
| 1642 | 1619 | $rangeend = $end; |
| 1643 | 1620 | } |
| 1644 | 1621 | |
@@ -1720,8 +1697,7 @@ discard block |
||
| 1720 | 1697 | if ($daynow <= $dayend) { |
| 1721 | 1698 | $this->processOccurrenceItem($items, $start, $end, $daynow, $this->recur["startocc"], $this->recur["endocc"], $this->tz, $remindersonly); |
| 1722 | 1699 | } |
| 1723 | - } |
|
| 1724 | - elseif (isset($this->recur["nday"], $this->recur["weekdays"])) { // Nth [weekday] of every N months |
|
| 1700 | + } elseif (isset($this->recur["nday"], $this->recur["weekdays"])) { // Nth [weekday] of every N months |
|
| 1725 | 1701 | // Sanitize input |
| 1726 | 1702 | if ($this->recur["weekdays"] == 0) { |
| 1727 | 1703 | $this->recur["weekdays"] = 1; |
@@ -1748,8 +1724,7 @@ discard block |
||
| 1748 | 1724 | } |
| 1749 | 1725 | // $firstday is the day of the month on which the asked pattern of nth weekday matches |
| 1750 | 1726 | $daynow = $now + $firstday * 60 * 60 * 24; |
| 1751 | - } |
|
| 1752 | - else { |
|
| 1727 | + } else { |
|
| 1753 | 1728 | // Find last day in the month ($now is the firstday of the month) |
| 1754 | 1729 | $NumDaysInMonth = $this->daysInMonth($now, 1); |
| 1755 | 1730 | $daynow = $now + (($NumDaysInMonth - 1) * 24 * 60 * 60); |
@@ -1767,8 +1742,7 @@ discard block |
||
| 1767 | 1742 | if ($daynow <= $dayend && $daynow >= $daystart) { |
| 1768 | 1743 | $this->processOccurrenceItem($items, $start, $end, $daynow, $this->recur["startocc"], $this->recur["endocc"], $this->tz, $remindersonly); |
| 1769 | 1744 | } |
| 1770 | - } |
|
| 1771 | - elseif ($this->recur['regen']) { |
|
| 1745 | + } elseif ($this->recur['regen']) { |
|
| 1772 | 1746 | $next_month_start = $now + ($this->daysInMonth($now, 1) * 24 * 60 * 60); |
| 1773 | 1747 | $now = $daystart + ($this->daysInMonth($next_month_start, $this->recur['everyn']) * 24 * 60 * 60); |
| 1774 | 1748 | if ($now <= $dayend) { |
@@ -1795,8 +1769,7 @@ discard block |
||
| 1795 | 1769 | } // Cap $monthday on month length (eg 28 feb instead of 29 feb) |
| 1796 | 1770 | $daynow = $monthstart + ($monthday - 1) * 24 * 60 * 60; |
| 1797 | 1771 | $this->processOccurrenceItem($items, $start, $end, $daynow, $this->recur["startocc"], $this->recur["endocc"], $this->tz, $remindersonly); |
| 1798 | - } |
|
| 1799 | - elseif (isset($this->recur["nday"], $this->recur["weekdays"])) { // Nth [weekday] in month X of every N years |
|
| 1772 | + } elseif (isset($this->recur["nday"], $this->recur["weekdays"])) { // Nth [weekday] in month X of every N years |
|
| 1800 | 1773 | // Go the correct month |
| 1801 | 1774 | $monthnow = $now + $this->daysInMonth($now, $this->monthOfYear($this->recur["month"])) * 24 * 60 * 60; |
| 1802 | 1775 | |
@@ -1819,8 +1792,7 @@ discard block |
||
| 1819 | 1792 | } |
| 1820 | 1793 | |
| 1821 | 1794 | $this->processOccurrenceItem($items, $start, $end, $daynow, $this->recur["startocc"], $this->recur["endocc"], $this->tz, $remindersonly); |
| 1822 | - } |
|
| 1823 | - elseif ($this->recur['regen']) { |
|
| 1795 | + } elseif ($this->recur['regen']) { |
|
| 1824 | 1796 | $year_starttime = $this->gmtime($now); |
| 1825 | 1797 | $is_next_leapyear = $this->isLeapYear($year_starttime['tm_year'] + 1900 + 1); // +1 next year |
| 1826 | 1798 | $now = $daystart + ($is_next_leapyear ? 31622400 /* Leap year in seconds */ : 31536000 /* year in seconds */); |
@@ -13,8 +13,7 @@ |
||
| 13 | 13 | $version = exec("hash git 2>/dev/null && cd {$path} >/dev/null 2>&1 && git describe --always 2>/dev/null"); |
| 14 | 14 | if ($branch && $version) { |
| 15 | 15 | define("GDAV_VERSION", $branch . '-' . $version); |
| 16 | - } |
|
| 17 | - else { |
|
| 16 | + } else { |
|
| 18 | 17 | define("GDAV_VERSION", "GIT"); |
| 19 | 18 | } |
| 20 | 19 | } |
@@ -90,8 +90,7 @@ discard block |
||
| 90 | 90 | // if the entryid is not available, do the fallback to the sourcekey |
| 91 | 91 | if (isset($props[PR_ENTRYID])) { |
| 92 | 92 | $entryid = $props[PR_ENTRYID]; |
| 93 | - } |
|
| 94 | - elseif (isset($props[PR_SOURCE_KEY], $props[PR_PARENT_SOURCE_KEY])) { |
|
| 93 | + } elseif (isset($props[PR_SOURCE_KEY], $props[PR_PARENT_SOURCE_KEY])) { |
|
| 95 | 94 | $entryid = mapi_msgstore_entryidfromsourcekey($this->store, $props[PR_PARENT_SOURCE_KEY], $props[PR_SOURCE_KEY]); |
| 96 | 95 | } |
| 97 | 96 | $mapimessage = mapi_msgstore_openentry($this->store, $entryid); |
@@ -113,8 +112,7 @@ discard block |
||
| 113 | 112 | |
| 114 | 113 | if ($flags == SYNC_NEW_MESSAGE) { |
| 115 | 114 | $this->added[] = $url . $this->fileext; |
| 116 | - } |
|
| 117 | - else { |
|
| 115 | + } else { |
|
| 118 | 116 | $this->modified[] = $url . $this->fileext; |
| 119 | 117 | } |
| 120 | 118 | |
@@ -135,8 +133,7 @@ discard block |
||
| 135 | 133 | $appttsref = $this->syncstate->getAppttsref($this->folderid, bin2hex($sourcekey)); |
| 136 | 134 | if ($appttsref != null) { |
| 137 | 135 | $this->deleted[] = $appttsref . $this->fileext; |
| 138 | - } |
|
| 139 | - else { |
|
| 136 | + } else { |
|
| 140 | 137 | $this->deleted[] = bin2hex($sourcekey) . $this->fileext; |
| 141 | 138 | } |
| 142 | 139 | } |