@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | define('TIMEZONE', ''); |
| 15 | 15 | |
| 16 | 16 | // Defines the base path on the server |
| 17 | - define('BASE_PATH', dirname($_SERVER['SCRIPT_FILENAME']) . '/'); |
|
| 17 | + define('BASE_PATH', dirname($_SERVER['SCRIPT_FILENAME']).'/'); |
|
| 18 | 18 | |
| 19 | 19 | // Try to set unlimited timeout |
| 20 | 20 | define('SCRIPT_TIMEOUT', 0); |
@@ -80,8 +80,8 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | // Filelog settings |
| 82 | 82 | define('LOGFILEDIR', '/var/log/grommunio-sync/'); |
| 83 | - define('LOGFILE', LOGFILEDIR . 'grommunio-sync.log'); |
|
| 84 | - define('LOGERRORFILE', LOGFILEDIR . 'grommunio-sync-error.log'); |
|
| 83 | + define('LOGFILE', LOGFILEDIR.'grommunio-sync.log'); |
|
| 84 | + define('LOGERRORFILE', LOGFILEDIR.'grommunio-sync-error.log'); |
|
| 85 | 85 | |
| 86 | 86 | // Syslog settings |
| 87 | 87 | // false will log to local syslog, otherwise put the remote syslog IP here |
@@ -23,12 +23,12 @@ discard block |
||
| 23 | 23 | * carried in the IPM.TaskRequest item (although this information seems |
| 24 | 24 | * redundant due to that information already being available in PR_MESSAGE_CLASS). |
| 25 | 25 | */ |
| 26 | - define('tdmtNothing', 0); // Value in IPM.Task items |
|
| 27 | - define('tdmtTaskReq', 1); // Assigner -> Assignee |
|
| 28 | - define('tdmtTaskAcc', 2); // Assignee -> Assigner |
|
| 29 | - define('tdmtTaskDec', 3); // Assignee -> Assigner |
|
| 30 | - define('tdmtTaskUpd', 4); // Assignee -> Assigner |
|
| 31 | - define('tdmtTaskSELF', 5); // Assigner -> Assigner (?) |
|
| 26 | + define('tdmtNothing', 0); // Value in IPM.Task items |
|
| 27 | + define('tdmtTaskReq', 1); // Assigner -> Assignee |
|
| 28 | + define('tdmtTaskAcc', 2); // Assignee -> Assigner |
|
| 29 | + define('tdmtTaskDec', 3); // Assignee -> Assigner |
|
| 30 | + define('tdmtTaskUpd', 4); // Assignee -> Assigner |
|
| 31 | + define('tdmtTaskSELF', 5); // Assigner -> Assigner (?) |
|
| 32 | 32 | |
| 33 | 33 | /* The TaskHistory is used to show the last action on the task |
| 34 | 34 | * on both the assigner and the assignee's side. |
@@ -38,22 +38,22 @@ discard block |
||
| 38 | 38 | * the format 'Accepted by <user> on 01-01-2010 11:00'. |
| 39 | 39 | */ |
| 40 | 40 | define('thNone', 0); |
| 41 | - define('thAccepted', 1); // Set by assignee |
|
| 42 | - define('thDeclined', 2); // Set by assignee |
|
| 43 | - define('thUpdated', 3); // Set by assignee |
|
| 41 | + define('thAccepted', 1); // Set by assignee |
|
| 42 | + define('thDeclined', 2); // Set by assignee |
|
| 43 | + define('thUpdated', 3); // Set by assignee |
|
| 44 | 44 | define('thDueDateChanged', 4); |
| 45 | - define('thAssigned', 5); // Set by assigner |
|
| 45 | + define('thAssigned', 5); // Set by assigner |
|
| 46 | 46 | |
| 47 | 47 | /* The TaskState value is used to differentiate the version of a task |
| 48 | 48 | * in the assigner's folder and the version in the |
| 49 | 49 | * assignee's folder. The buttons shown depend on this and |
| 50 | 50 | * the 'taskaccepted' boolean (for the assignee) |
| 51 | 51 | */ |
| 52 | - define('tdsNOM', 0); // Got a response to a deleted task, and re-created the task for the assigner |
|
| 53 | - define('tdsOWNNEW', 1); // Not assigned |
|
| 54 | - define('tdsOWN', 2); // Assignee version |
|
| 55 | - define('tdsACC', 3); // Assigner version |
|
| 56 | - define('tdsDEC', 4); // Assigner version, but assignee declined |
|
| 52 | + define('tdsNOM', 0); // Got a response to a deleted task, and re-created the task for the assigner |
|
| 53 | + define('tdsOWNNEW', 1); // Not assigned |
|
| 54 | + define('tdsOWN', 2); // Assignee version |
|
| 55 | + define('tdsACC', 3); // Assigner version |
|
| 56 | + define('tdsDEC', 4); // Assigner version, but assignee declined |
|
| 57 | 57 | |
| 58 | 58 | /* The TaskAcceptanceState is used for the assigner to indicate state */ |
| 59 | 59 | define('olTaskNotDelegated', 0); |
@@ -63,13 +63,13 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | /* The task ownership indicates the role of the current user relative to the task. */ |
| 65 | 65 | define('olNewTask', 0); |
| 66 | - define('olDelegatedTask', 1); // Task has been assigned |
|
| 67 | - define('olOwnTask', 2); // Task owned |
|
| 66 | + define('olDelegatedTask', 1); // Task has been assigned |
|
| 67 | + define('olOwnTask', 2); // Task owned |
|
| 68 | 68 | |
| 69 | 69 | /* taskmultrecips indicates whether the task request sent or received has multiple assignees or not. */ |
| 70 | 70 | define('tmrNone', 0); |
| 71 | - define('tmrSent', 1); // Task has been sent to multiple assignee |
|
| 72 | - define('tmrReceived', 2); // Task Request received has multiple assignee |
|
| 71 | + define('tmrSent', 1); // Task has been sent to multiple assignee |
|
| 72 | + define('tmrReceived', 2); // Task Request received has multiple assignee |
|
| 73 | 73 | |
| 74 | 74 | // Task icon index. |
| 75 | 75 | define('ICON_TASK_ASSIGNEE', 0x00000502); |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | VALUE => $goid, ], |
| 301 | 301 | ]; |
| 302 | 302 | |
| 303 | - $table = mapi_folder_getcontentstable($folder, MAPI_DEFERRED_ERRORS | SHOW_SOFT_DELETES); |
|
| 303 | + $table = mapi_folder_getcontentstable($folder, MAPI_DEFERRED_ERRORS|SHOW_SOFT_DELETES); |
|
| 304 | 304 | $softDeletedItems = mapi_table_queryallrows($table, [PR_ENTRYID], $restriction); |
| 305 | 305 | if (!empty($softDeletedItems)) { |
| 306 | 306 | return true; |
@@ -503,14 +503,14 @@ discard block |
||
| 503 | 503 | // Set properties on Task Request |
| 504 | 504 | mapi_setprops($this->message, [ |
| 505 | 505 | $this->props['task_goid'] => $taskid, /* our new task_goid */ |
| 506 | - $this->props['taskstate'] => tdsACC, /* state for our outgoing request */ |
|
| 507 | - $this->props['taskmode'] => tdmtNothing, /* we're not sending a change */ |
|
| 508 | - $this->props['updatecount'] => 2, /* version 2 (no idea) */ |
|
| 506 | + $this->props['taskstate'] => tdsACC, /* state for our outgoing request */ |
|
| 507 | + $this->props['taskmode'] => tdmtNothing, /* we're not sending a change */ |
|
| 508 | + $this->props['updatecount'] => 2, /* version 2 (no idea) */ |
|
| 509 | 509 | $this->props['task_acceptance_state'] => olTaskDelegationUnknown, /* no reply yet */ |
| 510 | 510 | $this->props['ownership'] => olDelegatedTask, /* Task has been assigned */ |
| 511 | - $this->props['taskhistory'] => thAssigned, /* Task has been assigned */ |
|
| 511 | + $this->props['taskhistory'] => thAssigned, /* Task has been assigned */ |
|
| 512 | 512 | PR_CONVERSATION_TOPIC => $messageprops[PR_SUBJECT], |
| 513 | - PR_ICON_INDEX => ICON_TASK_ASSIGNER, /* Task request icon */ |
|
| 513 | + PR_ICON_INDEX => ICON_TASK_ASSIGNER, /* Task request icon */ |
|
| 514 | 514 | ]); |
| 515 | 515 | $this->setLastUser(); |
| 516 | 516 | $this->setOwnerForAssignor(); |
@@ -525,12 +525,12 @@ discard block |
||
| 525 | 525 | |
| 526 | 526 | // Make it a task request, and put it in sent items after it is sent |
| 527 | 527 | mapi_setprops($outgoing, [ |
| 528 | - PR_MESSAGE_CLASS => 'IPM.TaskRequest', /* class is task request */ |
|
| 529 | - $this->props['taskstate'] => tdsOWN, /* for the recipient he is the task owner */ |
|
| 530 | - $this->props['taskmode'] => tdmtTaskReq, /* for the recipient it's a request */ |
|
| 531 | - $this->props['updatecount'] => 1, /* version 2 is in the attachment */ |
|
| 528 | + PR_MESSAGE_CLASS => 'IPM.TaskRequest', /* class is task request */ |
|
| 529 | + $this->props['taskstate'] => tdsOWN, /* for the recipient he is the task owner */ |
|
| 530 | + $this->props['taskmode'] => tdmtTaskReq, /* for the recipient it's a request */ |
|
| 531 | + $this->props['updatecount'] => 1, /* version 2 is in the attachment */ |
|
| 532 | 532 | PR_SUBJECT_PREFIX => $prefix, |
| 533 | - PR_SUBJECT => $prefix . $messageprops[PR_SUBJECT], |
|
| 533 | + PR_SUBJECT => $prefix.$messageprops[PR_SUBJECT], |
|
| 534 | 534 | ]); |
| 535 | 535 | |
| 536 | 536 | $attach = mapi_message_createattach($outgoing); |
@@ -539,7 +539,7 @@ discard block |
||
| 539 | 539 | PR_ATTACHMENT_HIDDEN => true, |
| 540 | 540 | PR_DISPLAY_NAME => $messageprops[PR_SUBJECT], ]); |
| 541 | 541 | |
| 542 | - $sub = mapi_attach_openproperty($attach, PR_ATTACH_DATA_OBJ, IID_IMessage, 0, MAPI_MODIFY | MAPI_CREATE); |
|
| 542 | + $sub = mapi_attach_openproperty($attach, PR_ATTACH_DATA_OBJ, IID_IMessage, 0, MAPI_MODIFY|MAPI_CREATE); |
|
| 543 | 543 | |
| 544 | 544 | mapi_copyto($this->message, [], [], $sub); |
| 545 | 545 | mapi_savechanges($sub); |
@@ -636,7 +636,7 @@ discard block |
||
| 636 | 636 | * @return entryid EntryID of the accepted task |
| 637 | 637 | */ |
| 638 | 638 | public function doAccept() { |
| 639 | - $prefix = _('Task Accepted:') . ' '; |
|
| 639 | + $prefix = _('Task Accepted:').' '; |
|
| 640 | 640 | $messageProps = mapi_getprops($this->message, [PR_MESSAGE_CLASS, $this->props['taskstate']]); |
| 641 | 641 | |
| 642 | 642 | if (!isset($messageProps[$this->props['taskstate']]) || tdsOWN != $messageProps[$this->props['taskstate']]) { |
@@ -685,7 +685,7 @@ discard block |
||
| 685 | 685 | * @return boolean TRUE on success, FALSE on failure |
| 686 | 686 | */ |
| 687 | 687 | public function doDecline() { |
| 688 | - $prefix = _('Task Declined:') . ' '; |
|
| 688 | + $prefix = _('Task Declined:').' '; |
|
| 689 | 689 | $messageProps = mapi_getprops($this->message, [$this->props['taskstate']]); |
| 690 | 690 | |
| 691 | 691 | if (!isset($messageProps[$this->props['taskstate']]) || tdsOWN != $messageProps[$this->props['taskstate']]) { |
@@ -740,9 +740,9 @@ discard block |
||
| 740 | 740 | |
| 741 | 741 | $props = mapi_getprops($this->message, [$this->props['taskupdates'], $this->props['tasksoc'], $this->props['recurring'], $this->props['complete']]); |
| 742 | 742 | if (!$props[$this->props['complete']] && $props[$this->props['taskupdates']] && !(isset($props[$this->props['recurring']]) && $props[$this->props['recurring']])) { |
| 743 | - $this->sendResponse(tdmtTaskUpd, _('Task Updated:') . ' '); |
|
| 743 | + $this->sendResponse(tdmtTaskUpd, _('Task Updated:').' '); |
|
| 744 | 744 | } elseif ($props[$this->props['complete']]) { |
| 745 | - $this->sendResponse(tdmtTaskUpd, _('Task Completed:') . ' '); |
|
| 745 | + $this->sendResponse(tdmtTaskUpd, _('Task Completed:').' '); |
|
| 746 | 746 | } |
| 747 | 747 | |
| 748 | 748 | return true; |
@@ -875,7 +875,7 @@ discard block |
||
| 875 | 875 | |
| 876 | 876 | $attach = mapi_message_createattach($outgoing); |
| 877 | 877 | mapi_setprops($attach, [PR_ATTACH_METHOD => ATTACH_EMBEDDED_MSG, PR_DISPLAY_NAME => $messageprops[PR_CONVERSATION_TOPIC], PR_ATTACHMENT_HIDDEN => true]); |
| 878 | - $sub = mapi_attach_openproperty($attach, PR_ATTACH_DATA_OBJ, IID_IMessage, 0, MAPI_CREATE | MAPI_MODIFY); |
|
| 878 | + $sub = mapi_attach_openproperty($attach, PR_ATTACH_DATA_OBJ, IID_IMessage, 0, MAPI_CREATE|MAPI_MODIFY); |
|
| 879 | 879 | |
| 880 | 880 | $message = !$this->isTaskRequest() ? $this->message : $this->getAssociatedTask(false); |
| 881 | 881 | |
@@ -917,7 +917,7 @@ discard block |
||
| 917 | 917 | mapi_savechanges($sub); |
| 918 | 918 | mapi_savechanges($attach); |
| 919 | 919 | |
| 920 | - $props[PR_SUBJECT] = $prefix . $messageprops[PR_CONVERSATION_TOPIC]; |
|
| 920 | + $props[PR_SUBJECT] = $prefix.$messageprops[PR_CONVERSATION_TOPIC]; |
|
| 921 | 921 | $props[$this->props['taskmode']] = $type; |
| 922 | 922 | $props[$this->props['task_assigned_time']] = time(); |
| 923 | 923 | |
@@ -927,7 +927,7 @@ discard block |
||
| 927 | 927 | // edit response before sending task response. |
| 928 | 928 | if ($this->taskCommentsInfo) { |
| 929 | 929 | $comments = $this->getTaskCommentsInfo(); |
| 930 | - $stream = mapi_openproperty($outgoing, PR_BODY, IID_IStream, STGM_TRANSACTED, MAPI_CREATE | MAPI_MODIFY); |
|
| 930 | + $stream = mapi_openproperty($outgoing, PR_BODY, IID_IStream, STGM_TRANSACTED, MAPI_CREATE|MAPI_MODIFY); |
|
| 931 | 931 | mapi_stream_setsize($stream, strlen($comments)); |
| 932 | 932 | mapi_stream_write($stream, $comments); |
| 933 | 933 | mapi_stream_commit($stream); |
@@ -1181,7 +1181,7 @@ discard block |
||
| 1181 | 1181 | } |
| 1182 | 1182 | |
| 1183 | 1183 | foreach ($recips as $recip) { |
| 1184 | - $recip[PR_RECIPIENT_TYPE] = MAPI_TO; // Change recipient type to MAPI_TO |
|
| 1184 | + $recip[PR_RECIPIENT_TYPE] = MAPI_TO; // Change recipient type to MAPI_TO |
|
| 1185 | 1185 | mapi_message_modifyrecipients($outgoing, MODRECIP_ADD, [$recip]); |
| 1186 | 1186 | } |
| 1187 | 1187 | |
@@ -587,8 +587,8 @@ discard block |
||
| 587 | 587 | } |
| 588 | 588 | |
| 589 | 589 | // get timings of the first occurence |
| 590 | - $firstoccstartdate = isset($startocc) ? $start + (((int) $startocc) * 60) : $start; |
|
| 591 | - $firstoccenddate = isset($endocc) ? $end + (((int) $endocc) * 60) : $end; |
|
| 590 | + $firstoccstartdate = isset($startocc) ? $start + (((int)$startocc) * 60) : $start; |
|
| 591 | + $firstoccenddate = isset($endocc) ? $end + (((int)$endocc) * 60) : $end; |
|
| 592 | 592 | |
| 593 | 593 | $start = gmdate(_('d-m-Y'), $firstoccstartdate); |
| 594 | 594 | $end = gmdate(_('d-m-Y'), $firstoccenddate); |
@@ -720,7 +720,7 @@ discard block |
||
| 720 | 720 | $props[PR_EXCEPTION_ENDTIME] = $this->fromGMT($this->tz, $exception_props[$this->proptags['duedate']]); |
| 721 | 721 | mapi_setprops($attachment, $props); |
| 722 | 722 | |
| 723 | - $imessage = mapi_attach_openobj($attachment, MAPI_CREATE | MAPI_MODIFY); |
|
| 723 | + $imessage = mapi_attach_openobj($attachment, MAPI_CREATE|MAPI_MODIFY); |
|
| 724 | 724 | |
| 725 | 725 | if ($copy_attach_from) { |
| 726 | 726 | $attachmentTable = mapi_message_getattachmenttable($copy_attach_from); |
@@ -728,7 +728,7 @@ discard block |
||
| 728 | 728 | $attachments = mapi_table_queryallrows($attachmentTable, [PR_ATTACH_NUM, PR_ATTACH_SIZE, PR_ATTACH_LONG_FILENAME, PR_ATTACHMENT_HIDDEN, PR_DISPLAY_NAME, PR_ATTACH_METHOD]); |
| 729 | 729 | |
| 730 | 730 | foreach ($attachments as $attach_props) { |
| 731 | - $attach_old = mapi_message_openattach($copy_attach_from, (int) $attach_props[PR_ATTACH_NUM]); |
|
| 731 | + $attach_old = mapi_message_openattach($copy_attach_from, (int)$attach_props[PR_ATTACH_NUM]); |
|
| 732 | 732 | $attach_newResourceMsg = mapi_message_createattach($imessage); |
| 733 | 733 | mapi_copyto($attach_old, [], [], $attach_newResourceMsg, 0); |
| 734 | 734 | mapi_savechanges($attach_newResourceMsg); |
@@ -1097,12 +1097,12 @@ discard block |
||
| 1097 | 1097 | // Remove all deleted recipients |
| 1098 | 1098 | if (isset($exception_recips['remove'])) { |
| 1099 | 1099 | foreach ($exception_recips['remove'] as &$recip) { |
| 1100 | - if (!isset($recip[PR_RECIPIENT_FLAGS]) || $recip[PR_RECIPIENT_FLAGS] != (recipReserved | recipExceptionalDeleted | recipSendable)) { |
|
| 1101 | - $recip[PR_RECIPIENT_FLAGS] = recipSendable | recipExceptionalDeleted; |
|
| 1100 | + if (!isset($recip[PR_RECIPIENT_FLAGS]) || $recip[PR_RECIPIENT_FLAGS] != (recipReserved|recipExceptionalDeleted|recipSendable)) { |
|
| 1101 | + $recip[PR_RECIPIENT_FLAGS] = recipSendable|recipExceptionalDeleted; |
|
| 1102 | 1102 | } else { |
| 1103 | - $recip[PR_RECIPIENT_FLAGS] = recipReserved | recipExceptionalDeleted | recipSendable; |
|
| 1103 | + $recip[PR_RECIPIENT_FLAGS] = recipReserved|recipExceptionalDeleted|recipSendable; |
|
| 1104 | 1104 | } |
| 1105 | - $recip[PR_RECIPIENT_TRACKSTATUS] = olResponseNone; // No Response required |
|
| 1105 | + $recip[PR_RECIPIENT_TRACKSTATUS] = olResponseNone; // No Response required |
|
| 1106 | 1106 | } |
| 1107 | 1107 | unset($recip); |
| 1108 | 1108 | mapi_message_modifyrecipients($exception, MODRECIP_MODIFY, $exception_recips['remove']); |
@@ -1172,12 +1172,12 @@ discard block |
||
| 1172 | 1172 | |
| 1173 | 1173 | // If recipient is not in list of deleted recipient, add him |
| 1174 | 1174 | if (!$foundInDeletedRecipients) { |
| 1175 | - if (!isset($recipient[PR_RECIPIENT_FLAGS]) || $recipient[PR_RECIPIENT_FLAGS] != (recipReserved | recipExceptionalDeleted | recipSendable)) { |
|
| 1176 | - $recipient[PR_RECIPIENT_FLAGS] = recipSendable | recipExceptionalDeleted; |
|
| 1175 | + if (!isset($recipient[PR_RECIPIENT_FLAGS]) || $recipient[PR_RECIPIENT_FLAGS] != (recipReserved|recipExceptionalDeleted|recipSendable)) { |
|
| 1176 | + $recipient[PR_RECIPIENT_FLAGS] = recipSendable|recipExceptionalDeleted; |
|
| 1177 | 1177 | } else { |
| 1178 | - $recipient[PR_RECIPIENT_FLAGS] = recipReserved | recipExceptionalDeleted | recipSendable; |
|
| 1178 | + $recipient[PR_RECIPIENT_FLAGS] = recipReserved|recipExceptionalDeleted|recipSendable; |
|
| 1179 | 1179 | } |
| 1180 | - $recipient[PR_RECIPIENT_TRACKSTATUS] = olRecipientTrackStatusNone; // No Response required |
|
| 1180 | + $recipient[PR_RECIPIENT_TRACKSTATUS] = olRecipientTrackStatusNone; // No Response required |
|
| 1181 | 1181 | $deletedRecipients[] = $recipient; |
| 1182 | 1182 | } |
| 1183 | 1183 | } |
@@ -1236,11 +1236,11 @@ discard block |
||
| 1236 | 1236 | $hasOrganizer = false; |
| 1237 | 1237 | // Check if meeting already has an organizer. |
| 1238 | 1238 | foreach ($recipients as $key => $recipient) { |
| 1239 | - if (isset($recipient[PR_RECIPIENT_FLAGS]) && $recipient[PR_RECIPIENT_FLAGS] == (recipSendable | recipOrganizer)) { |
|
| 1239 | + if (isset($recipient[PR_RECIPIENT_FLAGS]) && $recipient[PR_RECIPIENT_FLAGS] == (recipSendable|recipOrganizer)) { |
|
| 1240 | 1240 | $hasOrganizer = true; |
| 1241 | 1241 | } elseif ($isException && !isset($recipient[PR_RECIPIENT_FLAGS])) { |
| 1242 | 1242 | // Recipients for an occurrence |
| 1243 | - $recipients[$key][PR_RECIPIENT_FLAGS] = recipSendable | recipExceptionalResponse; |
|
| 1243 | + $recipients[$key][PR_RECIPIENT_FLAGS] = recipSendable|recipExceptionalResponse; |
|
| 1244 | 1244 | } |
| 1245 | 1245 | } |
| 1246 | 1246 | |
@@ -1254,7 +1254,7 @@ discard block |
||
| 1254 | 1254 | $organizer[PR_RECIPIENT_DISPLAY_NAME] = $messageProps[PR_SENT_REPRESENTING_NAME]; |
| 1255 | 1255 | $organizer[PR_ADDRTYPE] = empty($messageProps[PR_SENT_REPRESENTING_ADDRTYPE]) ? 'SMTP' : $messageProps[PR_SENT_REPRESENTING_ADDRTYPE]; |
| 1256 | 1256 | $organizer[PR_RECIPIENT_TRACKSTATUS] = olRecipientTrackStatusNone; |
| 1257 | - $organizer[PR_RECIPIENT_FLAGS] = recipSendable | recipOrganizer; |
|
| 1257 | + $organizer[PR_RECIPIENT_FLAGS] = recipSendable|recipOrganizer; |
|
| 1258 | 1258 | $organizer[PR_SEARCH_KEY] = $messageProps[PR_SENT_REPRESENTING_SEARCH_KEY]; |
| 1259 | 1259 | |
| 1260 | 1260 | // Add organizer to recipients list. |
@@ -189,7 +189,7 @@ |
||
| 189 | 189 | ], |
| 190 | 190 | ], // EXISTS OR |
| 191 | 191 | ], |
| 192 | - ]; // global OR |
|
| 192 | + ]; // global OR |
|
| 193 | 193 | |
| 194 | 194 | $contents = mapi_folder_getcontentstable($this->calendar); |
| 195 | 195 | mapi_table_restrict($contents, $restrict); |
@@ -632,7 +632,7 @@ |
||
| 632 | 632 | /* PersistElementType Values ElementIDs for persist data of PR_IPM_OL2007_ENTRYIDS / PR_ADDITIONAL_REN_ENTRYIDS_EX */ |
| 633 | 633 | define('ELEMENT_SENTINEL', 0x0000); // 0 bytes Indicates that the PersistElement structure is the last one contained in the DataElements field of the PersistData structure. |
| 634 | 634 | define('RSF_ELID_ENTRYID', 0x0001); // variable Indicates that the ElementData field contains the entry ID of the special folder |
| 635 | - // that is of the type indicated by the value of the PersistID field of the PersistData structure. |
|
| 635 | + // that is of the type indicated by the value of the PersistID field of the PersistData structure. |
|
| 636 | 636 | define('RSF_ELID_HEADER', 0x0002); // 4 bytes Indicates that the ElementData field contains a 4-byte header value equal to 0x00000000. |
| 637 | 637 | |
| 638 | 638 | define('STGM_DIRECT', 0x00000000); |
@@ -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 | -define('MVI_FLAG', MV_FLAG | MV_INSTANCE); |
|
| 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) */ |
|
| 34 | +define('MVI_FLAG', MV_FLAG|MV_INSTANCE); |
|
| 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) */ |
|
| 53 | 53 | /* Changes are likely to these numbers, and to their structures. */ |
| 54 | 54 | |
| 55 | 55 | /* Alternate property type names for ease of use */ |
@@ -61,18 +61,18 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | define('PT_TSTRING', PT_STRING8); |
| 63 | 63 | |
| 64 | -define('PT_MV_I2', (MV_FLAG | PT_I2)); |
|
| 65 | -define('PT_MV_LONG', (MV_FLAG | PT_LONG)); |
|
| 66 | -define('PT_MV_R4', (MV_FLAG | PT_R4)); |
|
| 67 | -define('PT_MV_DOUBLE', (MV_FLAG | PT_DOUBLE)); |
|
| 68 | -define('PT_MV_CURRENCY', (MV_FLAG | PT_CURRENCY)); |
|
| 69 | -define('PT_MV_APPTIME', (MV_FLAG | PT_APPTIME)); |
|
| 70 | -define('PT_MV_SYSTIME', (MV_FLAG | PT_SYSTIME)); |
|
| 71 | -define('PT_MV_STRING8', (MV_FLAG | PT_STRING8)); |
|
| 72 | -define('PT_MV_BINARY', (MV_FLAG | PT_BINARY)); |
|
| 73 | -define('PT_MV_UNICODE', (MV_FLAG | PT_UNICODE)); |
|
| 74 | -define('PT_MV_CLSID', (MV_FLAG | PT_CLSID)); |
|
| 75 | -define('PT_MV_I8', (MV_FLAG | PT_I8)); |
|
| 64 | +define('PT_MV_I2', (MV_FLAG|PT_I2)); |
|
| 65 | +define('PT_MV_LONG', (MV_FLAG|PT_LONG)); |
|
| 66 | +define('PT_MV_R4', (MV_FLAG|PT_R4)); |
|
| 67 | +define('PT_MV_DOUBLE', (MV_FLAG|PT_DOUBLE)); |
|
| 68 | +define('PT_MV_CURRENCY', (MV_FLAG|PT_CURRENCY)); |
|
| 69 | +define('PT_MV_APPTIME', (MV_FLAG|PT_APPTIME)); |
|
| 70 | +define('PT_MV_SYSTIME', (MV_FLAG|PT_SYSTIME)); |
|
| 71 | +define('PT_MV_STRING8', (MV_FLAG|PT_STRING8)); |
|
| 72 | +define('PT_MV_BINARY', (MV_FLAG|PT_BINARY)); |
|
| 73 | +define('PT_MV_UNICODE', (MV_FLAG|PT_UNICODE)); |
|
| 74 | +define('PT_MV_CLSID', (MV_FLAG|PT_CLSID)); |
|
| 75 | +define('PT_MV_I8', (MV_FLAG|PT_I8)); |
|
| 76 | 76 | |
| 77 | 77 | define('PT_MV_TSTRING', PT_MV_STRING8); |
| 78 | 78 | /* bit 0: set if descending, clear if ascending */ |
@@ -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 */ |
|
| 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 */ |
|
| 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 | +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 */ |
|
| 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 | |
@@ -438,23 +438,23 @@ discard block |
||
| 438 | 438 | define('BMR_NEZ', 0x00000001); |
| 439 | 439 | |
| 440 | 440 | /* array index values of restrictions -- same values are used in php-ext/main.cpp::PHPArraytoSRestriction() */ |
| 441 | -define('VALUE', 0); // propval |
|
| 442 | -define('RELOP', 1); // compare method |
|
| 443 | -define('FUZZYLEVEL', 2); // string search flags |
|
| 444 | -define('CB', 3); // size restriction |
|
| 445 | -define('ULTYPE', 4); // bit mask restriction type BMR_xxx |
|
| 446 | -define('ULMASK', 5); // bitmask |
|
| 447 | -define('ULPROPTAG', 6); // property |
|
| 448 | -define('ULPROPTAG1', 7); // RES_COMPAREPROPS 1st property |
|
| 449 | -define('ULPROPTAG2', 8); // RES_COMPAREPROPS 2nd property |
|
| 450 | -define('PROPS', 9); // RES_COMMENT properties |
|
| 451 | -define('RESTRICTION', 10); // RES_COMMENT and RES_SUBRESTRICTION restriction |
|
| 441 | +define('VALUE', 0); // propval |
|
| 442 | +define('RELOP', 1); // compare method |
|
| 443 | +define('FUZZYLEVEL', 2); // string search flags |
|
| 444 | +define('CB', 3); // size restriction |
|
| 445 | +define('ULTYPE', 4); // bit mask restriction type BMR_xxx |
|
| 446 | +define('ULMASK', 5); // bitmask |
|
| 447 | +define('ULPROPTAG', 6); // property |
|
| 448 | +define('ULPROPTAG1', 7); // RES_COMPAREPROPS 1st property |
|
| 449 | +define('ULPROPTAG2', 8); // RES_COMPAREPROPS 2nd property |
|
| 450 | +define('PROPS', 9); // RES_COMMENT properties |
|
| 451 | +define('RESTRICTION', 10); // RES_COMMENT and RES_SUBRESTRICTION restriction |
|
| 452 | 452 | |
| 453 | 453 | /* GUID's for PR_MDB_PROVIDER */ |
| 454 | -define('ZARAFA_SERVICE_GUID', makeGuid('{3C253DCA-D227-443C-94FE-425FAB958C19}')); // default store |
|
| 455 | -define('ZARAFA_STORE_PUBLIC_GUID', makeGuid('{70FAB278-F7AF-CD11-9BC8-00AA002FC45A}')); // public store |
|
| 456 | -define('ZARAFA_STORE_DELEGATE_GUID', makeGuid('{7C7C1085-BC6D-4E53-9DAB-8A53F8DEF808}')); // other store |
|
| 457 | -define('ZARAFA_STORE_ARCHIVER_GUID', makeGuid('{BC8953AD-2E3F-4172-9404-896FF459870F}')); // archive store |
|
| 454 | +define('ZARAFA_SERVICE_GUID', makeGuid('{3C253DCA-D227-443C-94FE-425FAB958C19}')); // default store |
|
| 455 | +define('ZARAFA_STORE_PUBLIC_GUID', makeGuid('{70FAB278-F7AF-CD11-9BC8-00AA002FC45A}')); // public store |
|
| 456 | +define('ZARAFA_STORE_DELEGATE_GUID', makeGuid('{7C7C1085-BC6D-4E53-9DAB-8A53F8DEF808}')); // other store |
|
| 457 | +define('ZARAFA_STORE_ARCHIVER_GUID', makeGuid('{BC8953AD-2E3F-4172-9404-896FF459870F}')); // archive store |
|
| 458 | 458 | |
| 459 | 459 | /* global profile section guid */ |
| 460 | 460 | define('pbGlobalProfileSectionGuid', makeGuid('{C8B0DB13-05AA-1A10-9BB0-00AA002FC45A}')); |
@@ -481,10 +481,10 @@ discard block |
||
| 481 | 481 | // define('ecrightsContact' ,0x00000200); |
| 482 | 482 | define('ecRightsFolderVisible', 0x00000400); |
| 483 | 483 | |
| 484 | -define('ecRightsAll', ecRightsReadAny | ecRightsCreate | ecRightsEditOwned | ecRightsDeleteOwned | ecRightsEditAny | ecRightsDeleteAny | ecRightsCreateSubfolder | ecRightsFolderAccess | ecRightsFolderVisible); |
|
| 485 | -define('ecRightsFullControl', ecRightsReadAny | ecRightsCreate | ecRightsEditOwned | ecRightsDeleteOwned | ecRightsEditAny | ecRightsDeleteAny | ecRightsCreateSubfolder | ecRightsFolderVisible); |
|
| 486 | -define('ecRightsDefault', ecRightsNone | ecRightsFolderVisible); |
|
| 487 | -define('ecRightsDefaultPublic', ecRightsReadAny | ecRightsFolderVisible); |
|
| 484 | +define('ecRightsAll', ecRightsReadAny|ecRightsCreate|ecRightsEditOwned|ecRightsDeleteOwned|ecRightsEditAny|ecRightsDeleteAny|ecRightsCreateSubfolder|ecRightsFolderAccess|ecRightsFolderVisible); |
|
| 485 | +define('ecRightsFullControl', ecRightsReadAny|ecRightsCreate|ecRightsEditOwned|ecRightsDeleteOwned|ecRightsEditAny|ecRightsDeleteAny|ecRightsCreateSubfolder|ecRightsFolderVisible); |
|
| 486 | +define('ecRightsDefault', ecRightsNone|ecRightsFolderVisible); |
|
| 487 | +define('ecRightsDefaultPublic', ecRightsReadAny|ecRightsFolderVisible); |
|
| 488 | 488 | define('ecRightsAdmin', 0x00001000); |
| 489 | 489 | define('ecRightsAllMask', 0x000015FB); |
| 490 | 490 | |
@@ -500,7 +500,7 @@ discard block |
||
| 500 | 500 | define('ROW_ADD', 0x0001); |
| 501 | 501 | define('ROW_MODIFY', 0x0002); |
| 502 | 502 | define('ROW_REMOVE', 0x0004); |
| 503 | -define('ROW_EMPTY', (ROW_ADD | ROW_REMOVE)); |
|
| 503 | +define('ROW_EMPTY', (ROW_ADD|ROW_REMOVE)); |
|
| 504 | 504 | |
| 505 | 505 | // new property types |
| 506 | 506 | define('PT_SRESTRICTION', 0x00FD); |
@@ -570,38 +570,38 @@ discard block |
||
| 570 | 570 | define('SYNC_NO_FOREIGN_KEYS', 0x100); |
| 571 | 571 | define('SYNC_LIMITED_IMESSAGE', 0x200); |
| 572 | 572 | define('SYNC_CATCHUP', 0x400); |
| 573 | -define('SYNC_NEW_MESSAGE', 0x800); // only applicable to ImportMessageChange() |
|
| 574 | -define('SYNC_MSG_SELECTIVE', 0x1000); // Used internally. Will reject if used by clients. |
|
| 573 | +define('SYNC_NEW_MESSAGE', 0x800); // only applicable to ImportMessageChange() |
|
| 574 | +define('SYNC_MSG_SELECTIVE', 0x1000); // Used internally. Will reject if used by clients. |
|
| 575 | 575 | define('SYNC_BEST_BODY', 0x2000); |
| 576 | 576 | define('SYNC_IGNORE_SPECIFIED_ON_ASSOCIATED', 0x4000); |
| 577 | -define('SYNC_PROGRESS_MODE', 0x8000); // AirMapi progress mode |
|
| 577 | +define('SYNC_PROGRESS_MODE', 0x8000); // AirMapi progress mode |
|
| 578 | 578 | define('SYNC_FXRECOVERMODE', 0x10000); |
| 579 | 579 | define('SYNC_DEFER_CONFIG', 0x20000); |
| 580 | -define('SYNC_FORCE_UNICODE', 0x40000); // Forces server to return Unicode properties |
|
| 581 | -define('SYNC_STATE_READONLY', 0x80000); // Server will not update the states in the DB, setting up exporter with this flag states are read only |
|
| 580 | +define('SYNC_FORCE_UNICODE', 0x40000); // Forces server to return Unicode properties |
|
| 581 | +define('SYNC_STATE_READONLY', 0x80000); // Server will not update the states in the DB, setting up exporter with this flag states are read only |
|
| 582 | 582 | |
| 583 | -define('EMS_AB_ADDRESS_LOOKUP', 0x00000001); // Flag for resolvename to resolve only exact matches |
|
| 583 | +define('EMS_AB_ADDRESS_LOOKUP', 0x00000001); // Flag for resolvename to resolve only exact matches |
|
| 584 | 584 | |
| 585 | -define('TBL_BATCH', 0x00000002); // Batch multiple table commands |
|
| 585 | +define('TBL_BATCH', 0x00000002); // Batch multiple table commands |
|
| 586 | 586 | |
| 587 | 587 | /* Flags for recipients in exceptions */ |
| 588 | -define('recipSendable', 0x00000001); // sendable attendee. |
|
| 589 | -define('recipOrganizer', 0x00000002); // meeting organizer |
|
| 590 | -define('recipExceptionalResponse', 0x00000010); // attendee gave a response for the exception |
|
| 591 | -define('recipExceptionalDeleted', 0x00000020); // recipientRow exists, but it is treated as if the corresponding recipient is deleted from meeting |
|
| 592 | -define('recipOriginal', 0x00000100); // recipient is an original Attendee |
|
| 588 | +define('recipSendable', 0x00000001); // sendable attendee. |
|
| 589 | +define('recipOrganizer', 0x00000002); // meeting organizer |
|
| 590 | +define('recipExceptionalResponse', 0x00000010); // attendee gave a response for the exception |
|
| 591 | +define('recipExceptionalDeleted', 0x00000020); // recipientRow exists, but it is treated as if the corresponding recipient is deleted from meeting |
|
| 592 | +define('recipOriginal', 0x00000100); // recipient is an original Attendee |
|
| 593 | 593 | define('recipReserved', 0x00000200); |
| 594 | 594 | |
| 595 | 595 | /* Flags which indicates type of Meeting Object */ |
| 596 | -define('mtgEmpty', 0x00000000); // Unspecified. |
|
| 597 | -define('mtgRequest', 0x00000001); // Initial meeting request. |
|
| 598 | -define('mtgFull', 0x00010000); // Full update. |
|
| 599 | -define('mtgInfo', 0x00020000); // Informational update. |
|
| 600 | -define('mtgOutOfDate', 0x00080000); // A newer Meeting Request object or Meeting Update object was received after this one. |
|
| 601 | -define('mtgDelegatorCopy', 0x00100000); // This is set on the delegator's copy when a delegate will handle meeting-related objects. |
|
| 602 | - |
|
| 603 | -define('MAPI_ONE_OFF_UNICODE', 0x8000); // the flag that defines whether the embedded strings are Unicode in one off entryids. |
|
| 604 | -define('MAPI_ONE_OFF_NO_RICH_INFO', 0x0001); // the flag that specifies whether the recipient gets TNEF or not. |
|
| 596 | +define('mtgEmpty', 0x00000000); // Unspecified. |
|
| 597 | +define('mtgRequest', 0x00000001); // Initial meeting request. |
|
| 598 | +define('mtgFull', 0x00010000); // Full update. |
|
| 599 | +define('mtgInfo', 0x00020000); // Informational update. |
|
| 600 | +define('mtgOutOfDate', 0x00080000); // A newer Meeting Request object or Meeting Update object was received after this one. |
|
| 601 | +define('mtgDelegatorCopy', 0x00100000); // This is set on the delegator's copy when a delegate will handle meeting-related objects. |
|
| 602 | + |
|
| 603 | +define('MAPI_ONE_OFF_UNICODE', 0x8000); // the flag that defines whether the embedded strings are Unicode in one off entryids. |
|
| 604 | +define('MAPI_ONE_OFF_NO_RICH_INFO', 0x0001); // the flag that specifies whether the recipient gets TNEF or not. |
|
| 605 | 605 | |
| 606 | 606 | /* Mask flags for mapi_msgstore_advise */ |
| 607 | 607 | define('fnevCriticalError', 0x00000001); |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | * @param mixed $guid |
| 24 | 24 | */ |
| 25 | 25 | function makeGuid($guid) { |
| 26 | - return pack('vvvv', hexdec(substr($guid, 5, 4)), hexdec(substr($guid, 1, 4)), hexdec(substr($guid, 10, 4)), hexdec(substr($guid, 15, 4))) . hex2bin(substr($guid, 20, 4)) . hex2bin(substr($guid, 25, 12)); |
|
| 26 | + return pack('vvvv', hexdec(substr($guid, 5, 4)), hexdec(substr($guid, 1, 4)), hexdec(substr($guid, 10, 4)), hexdec(substr($guid, 15, 4))).hex2bin(substr($guid, 20, 4)).hex2bin(substr($guid, 25, 12)); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | /** |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | * we have to manually typecast value to integer, so float will be converted in integer, |
| 49 | 49 | * but still its out of bound for integer limit so it will be auto adjusted to minus value |
| 50 | 50 | */ |
| 51 | - if ($errcode == (int) $value) { |
|
| 51 | + if ($errcode == (int)$value) { |
|
| 52 | 52 | // Check that we have an actual MAPI error or warning definition |
| 53 | 53 | $prefix = substr($key, 0, 7); |
| 54 | 54 | if ('MAPI_E_' == $prefix || 'MAPI_W_' == $prefix) { |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | // error code not found, return hex value (this is a fix for 64-bit systems, we can't use the dechex() function for this) |
| 64 | 64 | $result = unpack('H*', pack('N', $errcode)); |
| 65 | 65 | |
| 66 | - return '0x' . $result[1]; |
|
| 66 | + return '0x'.$result[1]; |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | /** |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | * @param mixed $value |
| 164 | 164 | */ |
| 165 | 165 | function DTE_IS_REMOTE_VALID($value) { |
| 166 | - return (bool) ($value & DTE_FLAG_REMOTE_VALID); |
|
| 166 | + return (bool)($value & DTE_FLAG_REMOTE_VALID); |
|
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | /** |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | * @param mixed $value |
| 173 | 173 | */ |
| 174 | 174 | function DTE_IS_ACL_CAPABLE($value) { |
| 175 | - return (bool) ($value & DTE_FLAG_ACL_CAPABLE); |
|
| 175 | + return (bool)($value & DTE_FLAG_ACL_CAPABLE); |
|
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | function DTE_REMOTE($value) { |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | // OR |
| 220 | 220 | [RES_OR, |
| 221 | 221 | [ |
| 222 | - [RES_AND, // Normal items: itemEnd must be after viewStart, itemStart must be before viewEnd |
|
| 222 | + [RES_AND, // Normal items: itemEnd must be after viewStart, itemStart must be before viewEnd |
|
| 223 | 223 | [ |
| 224 | 224 | [RES_PROPERTY, |
| 225 | 225 | [RELOP => RELOP_GT, |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | ], |
| 244 | 244 | ], |
| 245 | 245 | ], // EXISTS OR |
| 246 | - ]; // global OR |
|
| 246 | + ]; // global OR |
|
| 247 | 247 | |
| 248 | 248 | // Get requested properties, plus whatever we need |
| 249 | 249 | $proplist = [PR_ENTRYID, $properties['recurring'], $properties['recurring_data'], $properties['timezone_data']]; |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | * @param mixed $code |
| 28 | 28 | */ |
| 29 | 29 | function make_mapi_e($code) { |
| 30 | - return (int) mapi_make_scode(1, $code); |
|
| 30 | + return (int)mapi_make_scode(1, $code); |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | /** |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | * @param mixed $code |
| 37 | 37 | */ |
| 38 | 38 | function make_mapi_s($code) { |
| 39 | - return (int) mapi_make_scode(0, $code); |
|
| 39 | + return (int)mapi_make_scode(0, $code); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | /* From mapicode.h */ |
@@ -152,15 +152,15 @@ discard block |
||
| 152 | 152 | $properties['reminderminutes'] = 'PT_LONG:PSETID_Common:0x8501'; |
| 153 | 153 | $properties['reminderset'] = 'PT_BOOLEAN:PSETID_Common:0x8503'; |
| 154 | 154 | $properties['sendasical'] = 'PT_BOOLEAN:PSETID_Appointment:0x8200'; |
| 155 | - $properties['updatecounter'] = 'PT_LONG:PSETID_Appointment:0x8201'; // AppointmentSequenceNumber |
|
| 156 | - $properties['last_updatecounter'] = 'PT_LONG:PSETID_Appointment:0x8203'; // AppointmentLastSequence |
|
| 155 | + $properties['updatecounter'] = 'PT_LONG:PSETID_Appointment:0x8201'; // AppointmentSequenceNumber |
|
| 156 | + $properties['last_updatecounter'] = 'PT_LONG:PSETID_Appointment:0x8203'; // AppointmentLastSequence |
|
| 157 | 157 | $properties['unknown7'] = 'PT_LONG:PSETID_Appointment:0x8202'; |
| 158 | 158 | $properties['busystatus'] = 'PT_LONG:PSETID_Appointment:0x8205'; |
| 159 | 159 | $properties['intendedbusystatus'] = 'PT_LONG:PSETID_Appointment:0x8224'; |
| 160 | 160 | $properties['start'] = 'PT_SYSTIME:PSETID_Appointment:0x820d'; |
| 161 | 161 | $properties['responselocation'] = 'PT_STRING8:PSETID_Meeting:0x2'; |
| 162 | 162 | $properties['location'] = 'PT_STRING8:PSETID_Appointment:0x8208'; |
| 163 | - $properties['requestsent'] = 'PT_BOOLEAN:PSETID_Appointment:0x8229'; // PidLidFInvited, MeetingRequestWasSent |
|
| 163 | + $properties['requestsent'] = 'PT_BOOLEAN:PSETID_Appointment:0x8229'; // PidLidFInvited, MeetingRequestWasSent |
|
| 164 | 164 | $properties['startdate'] = 'PT_SYSTIME:PSETID_Appointment:0x820d'; |
| 165 | 165 | $properties['duedate'] = 'PT_SYSTIME:PSETID_Appointment:0x820e'; |
| 166 | 166 | $properties['flagdueby'] = 'PT_SYSTIME:PSETID_Common:0x8560'; |
@@ -169,11 +169,11 @@ discard block |
||
| 169 | 169 | $properties['recurring'] = 'PT_BOOLEAN:PSETID_Appointment:0x8223'; |
| 170 | 170 | $properties['clipstart'] = 'PT_SYSTIME:PSETID_Appointment:0x8235'; |
| 171 | 171 | $properties['clipend'] = 'PT_SYSTIME:PSETID_Appointment:0x8236'; |
| 172 | - $properties['start_recur_date'] = 'PT_LONG:PSETID_Meeting:0xD'; // StartRecurTime |
|
| 173 | - $properties['start_recur_time'] = 'PT_LONG:PSETID_Meeting:0xE'; // StartRecurTime |
|
| 174 | - $properties['end_recur_date'] = 'PT_LONG:PSETID_Meeting:0xF'; // EndRecurDate |
|
| 175 | - $properties['end_recur_time'] = 'PT_LONG:PSETID_Meeting:0x10'; // EndRecurTime |
|
| 176 | - $properties['is_exception'] = 'PT_BOOLEAN:PSETID_Meeting:0xA'; // LID_IS_EXCEPTION |
|
| 172 | + $properties['start_recur_date'] = 'PT_LONG:PSETID_Meeting:0xD'; // StartRecurTime |
|
| 173 | + $properties['start_recur_time'] = 'PT_LONG:PSETID_Meeting:0xE'; // StartRecurTime |
|
| 174 | + $properties['end_recur_date'] = 'PT_LONG:PSETID_Meeting:0xF'; // EndRecurDate |
|
| 175 | + $properties['end_recur_time'] = 'PT_LONG:PSETID_Meeting:0x10'; // EndRecurTime |
|
| 176 | + $properties['is_exception'] = 'PT_BOOLEAN:PSETID_Meeting:0xA'; // LID_IS_EXCEPTION |
|
| 177 | 177 | $properties['apptreplyname'] = 'PT_STRING8:PSETID_Appointment:0x8230'; |
| 178 | 178 | // Propose new time properties |
| 179 | 179 | $properties['proposed_start_whole'] = 'PT_SYSTIME:PSETID_Appointment:0x8250'; |
@@ -540,7 +540,7 @@ discard block |
||
| 540 | 540 | $listProperties['rcvd_representing_search_key'] = PR_RCVD_REPRESENTING_SEARCH_KEY; |
| 541 | 541 | $messageProps = mapi_getprops($this->message, $listProperties); |
| 542 | 542 | |
| 543 | - $goid = $messageProps[$this->proptags['goid']]; // GlobalID (0x3) |
|
| 543 | + $goid = $messageProps[$this->proptags['goid']]; // GlobalID (0x3) |
|
| 544 | 544 | if (!isset($goid)) { |
| 545 | 545 | return; |
| 546 | 546 | } |
@@ -1404,7 +1404,7 @@ discard block |
||
| 1404 | 1404 | $props[$this->proptags['goid2']] = $goid; |
| 1405 | 1405 | |
| 1406 | 1406 | if (!isset($props[$this->proptags['updatecounter']])) { |
| 1407 | - $props[$this->proptags['updatecounter']] = 0; // OL also starts sequence no with zero. |
|
| 1407 | + $props[$this->proptags['updatecounter']] = 0; // OL also starts sequence no with zero. |
|
| 1408 | 1408 | $props[$this->proptags['last_updatecounter']] = 0; |
| 1409 | 1409 | } |
| 1410 | 1410 | |
@@ -2029,9 +2029,9 @@ discard block |
||
| 2029 | 2029 | $subjectprefix = _('New Time Proposed'); |
| 2030 | 2030 | } |
| 2031 | 2031 | |
| 2032 | - $props[PR_SUBJECT] = $subjectprefix . ': ' . $messageprops[PR_SUBJECT]; |
|
| 2032 | + $props[PR_SUBJECT] = $subjectprefix.': '.$messageprops[PR_SUBJECT]; |
|
| 2033 | 2033 | |
| 2034 | - $props[PR_MESSAGE_CLASS] = 'IPM.Schedule.Meeting.Resp.' . $classpostfix; |
|
| 2034 | + $props[PR_MESSAGE_CLASS] = 'IPM.Schedule.Meeting.Resp.'.$classpostfix; |
|
| 2035 | 2035 | if (isset($messageprops[PR_OWNER_APPT_ID])) { |
| 2036 | 2036 | $props[PR_OWNER_APPT_ID] = $messageprops[PR_OWNER_APPT_ID]; |
| 2037 | 2037 | } |
@@ -2237,11 +2237,11 @@ discard block |
||
| 2237 | 2237 | $hasOrganizer = false; |
| 2238 | 2238 | // Check if meeting already has an organizer. |
| 2239 | 2239 | foreach ($recipients as $key => $recipient) { |
| 2240 | - if (isset($recipient[PR_RECIPIENT_FLAGS]) && $recipient[PR_RECIPIENT_FLAGS] == (recipSendable | recipOrganizer)) { |
|
| 2240 | + if (isset($recipient[PR_RECIPIENT_FLAGS]) && $recipient[PR_RECIPIENT_FLAGS] == (recipSendable|recipOrganizer)) { |
|
| 2241 | 2241 | $hasOrganizer = true; |
| 2242 | 2242 | } elseif ($isException && !isset($recipient[PR_RECIPIENT_FLAGS])) { |
| 2243 | 2243 | // Recipients for an occurrence |
| 2244 | - $recipients[$key][PR_RECIPIENT_FLAGS] = recipSendable | recipExceptionalResponse; |
|
| 2244 | + $recipients[$key][PR_RECIPIENT_FLAGS] = recipSendable|recipExceptionalResponse; |
|
| 2245 | 2245 | } |
| 2246 | 2246 | } |
| 2247 | 2247 | |
@@ -2255,7 +2255,7 @@ discard block |
||
| 2255 | 2255 | $organizer[PR_RECIPIENT_DISPLAY_NAME] = $messageProps[PR_SENT_REPRESENTING_NAME]; |
| 2256 | 2256 | $organizer[PR_ADDRTYPE] = empty($messageProps[PR_SENT_REPRESENTING_ADDRTYPE]) ? 'SMTP' : $messageProps[PR_SENT_REPRESENTING_ADDRTYPE]; |
| 2257 | 2257 | $organizer[PR_RECIPIENT_TRACKSTATUS] = olRecipientTrackStatusNone; |
| 2258 | - $organizer[PR_RECIPIENT_FLAGS] = recipSendable | recipOrganizer; |
|
| 2258 | + $organizer[PR_RECIPIENT_FLAGS] = recipSendable|recipOrganizer; |
|
| 2259 | 2259 | $organizer[PR_SEARCH_KEY] = $messageProps[PR_SENT_REPRESENTING_SEARCH_KEY]; |
| 2260 | 2260 | |
| 2261 | 2261 | // Add organizer to recipients list. |
@@ -2313,7 +2313,7 @@ discard block |
||
| 2313 | 2313 | $month = $basedate ? sprintf('%02s', dechex(gmdate('m', $basedate))) : '00'; |
| 2314 | 2314 | $day = $basedate ? sprintf('%02s', dechex(gmdate('d', $basedate))) : '00'; |
| 2315 | 2315 | |
| 2316 | - return hex2bin(strtoupper(substr($hexguid, 0, 32) . $year . $month . $day . substr($hexguid, 40))); |
|
| 2316 | + return hex2bin(strtoupper(substr($hexguid, 0, 32).$year.$month.$day.substr($hexguid, 40))); |
|
| 2317 | 2317 | } |
| 2318 | 2318 | |
| 2319 | 2319 | /** |
@@ -2351,7 +2351,7 @@ discard block |
||
| 2351 | 2351 | continue; |
| 2352 | 2352 | } |
| 2353 | 2353 | |
| 2354 | - $attachOld = mapi_message_openattach($copyFrom, (int) $attachProps[PR_ATTACH_NUM]); |
|
| 2354 | + $attachOld = mapi_message_openattach($copyFrom, (int)$attachProps[PR_ATTACH_NUM]); |
|
| 2355 | 2355 | $attachNewResourceMsg = mapi_message_createattach($copyTo); |
| 2356 | 2356 | mapi_copyto($attachOld, [], [], $attachNewResourceMsg, 0); |
| 2357 | 2357 | mapi_savechanges($attachNewResourceMsg); |
@@ -2437,7 +2437,7 @@ discard block |
||
| 2437 | 2437 | // Get resource recipients |
| 2438 | 2438 | $getResourcesRestriction = [RES_AND, |
| 2439 | 2439 | [[RES_PROPERTY, |
| 2440 | - [RELOP => RELOP_EQ, // Equals recipient type 3: Resource |
|
| 2440 | + [RELOP => RELOP_EQ, // Equals recipient type 3: Resource |
|
| 2441 | 2441 | ULPROPTAG => PR_RECIPIENT_TYPE, |
| 2442 | 2442 | VALUE => [PR_RECIPIENT_TYPE => MAPI_BCC], |
| 2443 | 2443 | ], |
@@ -2566,7 +2566,7 @@ discard block |
||
| 2566 | 2566 | |
| 2567 | 2567 | // Prefix the subject if needed |
| 2568 | 2568 | if ($prefix && isset($messageprops[PR_SUBJECT])) { |
| 2569 | - $messageprops[PR_SUBJECT] = $prefix . $messageprops[PR_SUBJECT]; |
|
| 2569 | + $messageprops[PR_SUBJECT] = $prefix.$messageprops[PR_SUBJECT]; |
|
| 2570 | 2570 | } |
| 2571 | 2571 | |
| 2572 | 2572 | // Set status to cancelled if needed |
@@ -2707,7 +2707,7 @@ discard block |
||
| 2707 | 2707 | // Get resource recipients |
| 2708 | 2708 | $getResourcesRestriction = [RES_AND, |
| 2709 | 2709 | [[RES_PROPERTY, |
| 2710 | - [RELOP => RELOP_EQ, // Equals recipient type 3: Resource |
|
| 2710 | + [RELOP => RELOP_EQ, // Equals recipient type 3: Resource |
|
| 2711 | 2711 | ULPROPTAG => PR_RECIPIENT_TYPE, |
| 2712 | 2712 | VALUE => [PR_RECIPIENT_TYPE => MAPI_BCC], |
| 2713 | 2713 | ], |
@@ -2929,7 +2929,7 @@ discard block |
||
| 2929 | 2929 | // In direct-booking mode, we don't need to send cancellations to resources |
| 2930 | 2930 | if ($this->enableDirectBooking) { |
| 2931 | 2931 | $restriction[1][] = [RES_PROPERTY, |
| 2932 | - [RELOP => RELOP_NE, // Does not equal recipient type: MAPI_BCC (Resource) |
|
| 2932 | + [RELOP => RELOP_NE, // Does not equal recipient type: MAPI_BCC (Resource) |
|
| 2933 | 2933 | ULPROPTAG => PR_RECIPIENT_TYPE, |
| 2934 | 2934 | VALUE => [PR_RECIPIENT_TYPE => MAPI_BCC], |
| 2935 | 2935 | ], |
@@ -2984,7 +2984,7 @@ discard block |
||
| 2984 | 2984 | |
| 2985 | 2985 | // Prefix the subject if needed |
| 2986 | 2986 | if ($prefix && isset($newmessageprops[PR_SUBJECT])) { |
| 2987 | - $newmessageprops[PR_SUBJECT] = $prefix . $newmessageprops[PR_SUBJECT]; |
|
| 2987 | + $newmessageprops[PR_SUBJECT] = $prefix.$newmessageprops[PR_SUBJECT]; |
|
| 2988 | 2988 | } |
| 2989 | 2989 | |
| 2990 | 2990 | if (isset($newmessageprops[$this->proptags['categories']]) |
@@ -3018,7 +3018,7 @@ discard block |
||
| 3018 | 3018 | if ($this->enableDirectBooking) { |
| 3019 | 3019 | $stripResourcesRestriction[1][] = |
| 3020 | 3020 | [RES_PROPERTY, |
| 3021 | - [RELOP => RELOP_NE, // Does not equal recipient type: MAPI_BCC (Resource) |
|
| 3021 | + [RELOP => RELOP_NE, // Does not equal recipient type: MAPI_BCC (Resource) |
|
| 3022 | 3022 | ULPROPTAG => PR_RECIPIENT_TYPE, |
| 3023 | 3023 | VALUE => [PR_RECIPIENT_TYPE => MAPI_BCC], |
| 3024 | 3024 | ], |
@@ -3124,9 +3124,9 @@ discard block |
||
| 3124 | 3124 | $newmessageprops[PR_MESSAGE_CLASS] = 'IPM.Schedule.Meeting.Canceled'; |
| 3125 | 3125 | $newmessageprops[$this->proptags['meetingstatus']] = olMeetingCanceled; // It's a cancel request |
| 3126 | 3126 | $newmessageprops[$this->proptags['busystatus']] = fbFree; // set the busy status as free |
| 3127 | - $newmessageprops[PR_IMPORTANCE] = IMPORTANCE_HIGH; // HIGH Importance |
|
| 3127 | + $newmessageprops[PR_IMPORTANCE] = IMPORTANCE_HIGH; // HIGH Importance |
|
| 3128 | 3128 | if (isset($newmessageprops[PR_SUBJECT])) { |
| 3129 | - $newmessageprops[PR_SUBJECT] = _('Canceled: ') . $newmessageprops[PR_SUBJECT]; |
|
| 3129 | + $newmessageprops[PR_SUBJECT] = _('Canceled: ').$newmessageprops[PR_SUBJECT]; |
|
| 3130 | 3130 | } |
| 3131 | 3131 | |
| 3132 | 3132 | mapi_setprops($new, $newmessageprops); |
@@ -3184,12 +3184,12 @@ discard block |
||
| 3184 | 3184 | |
| 3185 | 3185 | // [0] => year, [1] => month, [2] => day, [3] => hour, [4] => minutes, [5] => seconds |
| 3186 | 3186 | // RecurStartDate = year * 512 + month_number * 32 + day_number |
| 3187 | - $newmessageprops[$this->proptags['start_recur_date']] = (((int) $startDate[0]) * 512) + (((int) $startDate[1]) * 32) + ((int) $startDate[2]); |
|
| 3187 | + $newmessageprops[$this->proptags['start_recur_date']] = (((int)$startDate[0]) * 512) + (((int)$startDate[1]) * 32) + ((int)$startDate[2]); |
|
| 3188 | 3188 | // RecurStartTime = hour * 4096 + minutes * 64 + seconds |
| 3189 | - $newmessageprops[$this->proptags['start_recur_time']] = (((int) $startDate[3]) * 4096) + (((int) $startDate[4]) * 64) + ((int) $startDate[5]); |
|
| 3189 | + $newmessageprops[$this->proptags['start_recur_time']] = (((int)$startDate[3]) * 4096) + (((int)$startDate[4]) * 64) + ((int)$startDate[5]); |
|
| 3190 | 3190 | |
| 3191 | - $newmessageprops[$this->proptags['end_recur_date']] = (((int) $endDate[0]) * 512) + (((int) $endDate[1]) * 32) + ((int) $endDate[2]); |
|
| 3192 | - $newmessageprops[$this->proptags['end_recur_time']] = (((int) $endDate[3]) * 4096) + (((int) $endDate[4]) * 64) + ((int) $endDate[5]); |
|
| 3191 | + $newmessageprops[$this->proptags['end_recur_date']] = (((int)$endDate[0]) * 512) + (((int)$endDate[1]) * 32) + ((int)$endDate[2]); |
|
| 3192 | + $newmessageprops[$this->proptags['end_recur_time']] = (((int)$endDate[3]) * 4096) + (((int)$endDate[4]) * 64) + ((int)$endDate[5]); |
|
| 3193 | 3193 | } |
| 3194 | 3194 | } |
| 3195 | 3195 | |
@@ -1711,186 +1711,186 @@ |
||
| 1711 | 1711 | // Loop through the entire recurrence range of dates, and check for each occurrence whether it is in the view range. |
| 1712 | 1712 | |
| 1713 | 1713 | switch ($this->recur['type']) { |
| 1714 | - case 10: |
|
| 1715 | - // Daily |
|
| 1716 | - if ($this->recur['everyn'] <= 0) { |
|
| 1717 | - $this->recur['everyn'] = 1440; |
|
| 1718 | - } |
|
| 1719 | - |
|
| 1720 | - if (0 == $this->recur['subtype']) { |
|
| 1721 | - // Every Nth day |
|
| 1722 | - for ($now = $daystart; $now <= $dayend && (0 == $limit || count($items) < $limit); $now += 60 * $this->recur['everyn']) { |
|
| 1723 | - $this->processOccurrenceItem($items, $start, $end, $now, $this->recur['startocc'], $this->recur['endocc'], $this->tz, $remindersonly); |
|
| 1714 | + case 10: |
|
| 1715 | + // Daily |
|
| 1716 | + if ($this->recur['everyn'] <= 0) { |
|
| 1717 | + $this->recur['everyn'] = 1440; |
|
| 1724 | 1718 | } |
| 1725 | - } else { |
|
| 1726 | - // Every workday |
|
| 1727 | - for ($now = $daystart; $now <= $dayend && (0 == $limit || count($items) < $limit); $now += 60 * 1440) { |
|
| 1728 | - $nowtime = $this->gmtime($now); |
|
| 1729 | - if ($nowtime['tm_wday'] > 0 && $nowtime['tm_wday'] < 6) { // only add items in the given timespace |
|
| 1719 | + |
|
| 1720 | + if (0 == $this->recur['subtype']) { |
|
| 1721 | + // Every Nth day |
|
| 1722 | + for ($now = $daystart; $now <= $dayend && (0 == $limit || count($items) < $limit); $now += 60 * $this->recur['everyn']) { |
|
| 1730 | 1723 | $this->processOccurrenceItem($items, $start, $end, $now, $this->recur['startocc'], $this->recur['endocc'], $this->tz, $remindersonly); |
| 1731 | 1724 | } |
| 1725 | + } else { |
|
| 1726 | + // Every workday |
|
| 1727 | + for ($now = $daystart; $now <= $dayend && (0 == $limit || count($items) < $limit); $now += 60 * 1440) { |
|
| 1728 | + $nowtime = $this->gmtime($now); |
|
| 1729 | + if ($nowtime['tm_wday'] > 0 && $nowtime['tm_wday'] < 6) { // only add items in the given timespace |
|
| 1730 | + $this->processOccurrenceItem($items, $start, $end, $now, $this->recur['startocc'], $this->recur['endocc'], $this->tz, $remindersonly); |
|
| 1731 | + } |
|
| 1732 | + } |
|
| 1732 | 1733 | } |
| 1733 | - } |
|
| 1734 | 1734 | |
| 1735 | - break; |
|
| 1736 | - |
|
| 1737 | - case 11: |
|
| 1738 | - // Weekly |
|
| 1739 | - if ($this->recur['everyn'] <= 0) { |
|
| 1740 | - $this->recur['everyn'] = 1; |
|
| 1741 | - } |
|
| 1735 | + break; |
|
| 1742 | 1736 | |
| 1743 | - // If sliding flag is set then move to 'n' weeks |
|
| 1744 | - if ($this->recur['regen']) { |
|
| 1745 | - $daystart += (60 * 60 * 24 * 7 * $this->recur['everyn']); |
|
| 1746 | - } |
|
| 1737 | + case 11: |
|
| 1738 | + // Weekly |
|
| 1739 | + if ($this->recur['everyn'] <= 0) { |
|
| 1740 | + $this->recur['everyn'] = 1; |
|
| 1741 | + } |
|
| 1747 | 1742 | |
| 1748 | - for ($now = $daystart; $now <= $dayend && (0 == $limit || count($items) < $limit); $now += (60 * 60 * 24 * 7 * $this->recur['everyn'])) { |
|
| 1743 | + // If sliding flag is set then move to 'n' weeks |
|
| 1749 | 1744 | if ($this->recur['regen']) { |
| 1750 | - $this->processOccurrenceItem($items, $start, $end, $now, $this->recur['startocc'], $this->recur['endocc'], $this->tz, $remindersonly); |
|
| 1751 | - } else { |
|
| 1752 | - // Loop through the whole following week to the first occurrence of the week, add each day that is specified |
|
| 1753 | - for ($wday = 0; $wday < 7; ++$wday) { |
|
| 1754 | - $daynow = $now + $wday * 60 * 60 * 24; |
|
| 1755 | - // checks weather the next coming day in recurring pattern is less than or equal to end day of the recurring item |
|
| 1756 | - if ($daynow <= $dayend) { |
|
| 1757 | - $nowtime = $this->gmtime($daynow); // Get the weekday of the current day |
|
| 1758 | - if (($this->recur['weekdays'] & (1 << $nowtime['tm_wday']))) { // Selected ? |
|
| 1759 | - $this->processOccurrenceItem($items, $start, $end, $daynow, $this->recur['startocc'], $this->recur['endocc'], $this->tz, $remindersonly); |
|
| 1745 | + $daystart += (60 * 60 * 24 * 7 * $this->recur['everyn']); |
|
| 1746 | + } |
|
| 1747 | + |
|
| 1748 | + for ($now = $daystart; $now <= $dayend && (0 == $limit || count($items) < $limit); $now += (60 * 60 * 24 * 7 * $this->recur['everyn'])) { |
|
| 1749 | + if ($this->recur['regen']) { |
|
| 1750 | + $this->processOccurrenceItem($items, $start, $end, $now, $this->recur['startocc'], $this->recur['endocc'], $this->tz, $remindersonly); |
|
| 1751 | + } else { |
|
| 1752 | + // Loop through the whole following week to the first occurrence of the week, add each day that is specified |
|
| 1753 | + for ($wday = 0; $wday < 7; ++$wday) { |
|
| 1754 | + $daynow = $now + $wday * 60 * 60 * 24; |
|
| 1755 | + // checks weather the next coming day in recurring pattern is less than or equal to end day of the recurring item |
|
| 1756 | + if ($daynow <= $dayend) { |
|
| 1757 | + $nowtime = $this->gmtime($daynow); // Get the weekday of the current day |
|
| 1758 | + if (($this->recur['weekdays'] & (1 << $nowtime['tm_wday']))) { // Selected ? |
|
| 1759 | + $this->processOccurrenceItem($items, $start, $end, $daynow, $this->recur['startocc'], $this->recur['endocc'], $this->tz, $remindersonly); |
|
| 1760 | + } |
|
| 1760 | 1761 | } |
| 1761 | 1762 | } |
| 1762 | 1763 | } |
| 1763 | 1764 | } |
| 1764 | - } |
|
| 1765 | 1765 | |
| 1766 | - break; |
|
| 1767 | - |
|
| 1768 | - case 12: |
|
| 1769 | - // Monthly |
|
| 1770 | - if ($this->recur['everyn'] <= 0) { |
|
| 1771 | - $this->recur['everyn'] = 1; |
|
| 1772 | - } |
|
| 1766 | + break; |
|
| 1773 | 1767 | |
| 1774 | - // Loop through all months from start to end of occurrence, starting at beginning of first month |
|
| 1775 | - for ($now = $this->monthStartOf($daystart); $now <= $dayend && (0 == $limit || count($items) < $limit); $now += $this->daysInMonth($now, $this->recur['everyn']) * 24 * 60 * 60) { |
|
| 1776 | - if (isset($this->recur['monthday']) && ('undefined' != $this->recur['monthday']) && !$this->recur['regen']) { // Day M of every N months |
|
| 1777 | - $difference = 1; |
|
| 1778 | - if ($this->daysInMonth($now, $this->recur['everyn']) < $this->recur['monthday']) { |
|
| 1779 | - $difference = $this->recur['monthday'] - $this->daysInMonth($now, $this->recur['everyn']) + 1; |
|
| 1780 | - } |
|
| 1781 | - $daynow = $now + (($this->recur['monthday'] - $difference) * 24 * 60 * 60); |
|
| 1782 | - // checks weather the next coming day in recurrence pattern is less than or equal to end day of the recurring item |
|
| 1783 | - if ($daynow <= $dayend) { |
|
| 1784 | - $this->processOccurrenceItem($items, $start, $end, $daynow, $this->recur['startocc'], $this->recur['endocc'], $this->tz, $remindersonly); |
|
| 1785 | - } |
|
| 1786 | - } elseif (isset($this->recur['nday'], $this->recur['weekdays'])) { // Nth [weekday] of every N months |
|
| 1787 | - // Sanitize input |
|
| 1788 | - if (0 == $this->recur['weekdays']) { |
|
| 1789 | - $this->recur['weekdays'] = 1; |
|
| 1790 | - } |
|
| 1768 | + case 12: |
|
| 1769 | + // Monthly |
|
| 1770 | + if ($this->recur['everyn'] <= 0) { |
|
| 1771 | + $this->recur['everyn'] = 1; |
|
| 1772 | + } |
|
| 1791 | 1773 | |
| 1792 | - // If nday is not set to the last day in the month |
|
| 1793 | - if ($this->recur['nday'] < 5) { |
|
| 1794 | - // keep the track of no. of time correct selection pattern(like 2nd weekday, 4th fiday, etc.)is matched |
|
| 1795 | - $ndaycounter = 0; |
|
| 1796 | - // Find matching weekday in this month |
|
| 1797 | - for ($day = 0, $total = $this->daysInMonth($now, 1); $day < $total; ++$day) { |
|
| 1798 | - $daynow = $now + $day * 60 * 60 * 24; |
|
| 1799 | - $nowtime = $this->gmtime($daynow); // Get the weekday of the current day |
|
| 1774 | + // Loop through all months from start to end of occurrence, starting at beginning of first month |
|
| 1775 | + for ($now = $this->monthStartOf($daystart); $now <= $dayend && (0 == $limit || count($items) < $limit); $now += $this->daysInMonth($now, $this->recur['everyn']) * 24 * 60 * 60) { |
|
| 1776 | + if (isset($this->recur['monthday']) && ('undefined' != $this->recur['monthday']) && !$this->recur['regen']) { // Day M of every N months |
|
| 1777 | + $difference = 1; |
|
| 1778 | + if ($this->daysInMonth($now, $this->recur['everyn']) < $this->recur['monthday']) { |
|
| 1779 | + $difference = $this->recur['monthday'] - $this->daysInMonth($now, $this->recur['everyn']) + 1; |
|
| 1780 | + } |
|
| 1781 | + $daynow = $now + (($this->recur['monthday'] - $difference) * 24 * 60 * 60); |
|
| 1782 | + // checks weather the next coming day in recurrence pattern is less than or equal to end day of the recurring item |
|
| 1783 | + if ($daynow <= $dayend) { |
|
| 1784 | + $this->processOccurrenceItem($items, $start, $end, $daynow, $this->recur['startocc'], $this->recur['endocc'], $this->tz, $remindersonly); |
|
| 1785 | + } |
|
| 1786 | + } elseif (isset($this->recur['nday'], $this->recur['weekdays'])) { // Nth [weekday] of every N months |
|
| 1787 | + // Sanitize input |
|
| 1788 | + if (0 == $this->recur['weekdays']) { |
|
| 1789 | + $this->recur['weekdays'] = 1; |
|
| 1790 | + } |
|
| 1800 | 1791 | |
| 1801 | - if ($this->recur['weekdays'] & (1 << $nowtime['tm_wday'])) { // Selected ? |
|
| 1802 | - ++$ndaycounter; |
|
| 1803 | - } |
|
| 1804 | - // check the selected pattern is same as asked Nth weekday,If so set the firstday |
|
| 1805 | - if ($this->recur['nday'] == $ndaycounter) { |
|
| 1806 | - $firstday = $day; |
|
| 1792 | + // If nday is not set to the last day in the month |
|
| 1793 | + if ($this->recur['nday'] < 5) { |
|
| 1794 | + // keep the track of no. of time correct selection pattern(like 2nd weekday, 4th fiday, etc.)is matched |
|
| 1795 | + $ndaycounter = 0; |
|
| 1796 | + // Find matching weekday in this month |
|
| 1797 | + for ($day = 0, $total = $this->daysInMonth($now, 1); $day < $total; ++$day) { |
|
| 1798 | + $daynow = $now + $day * 60 * 60 * 24; |
|
| 1799 | + $nowtime = $this->gmtime($daynow); // Get the weekday of the current day |
|
| 1800 | + |
|
| 1801 | + if ($this->recur['weekdays'] & (1 << $nowtime['tm_wday'])) { // Selected ? |
|
| 1802 | + ++$ndaycounter; |
|
| 1803 | + } |
|
| 1804 | + // check the selected pattern is same as asked Nth weekday,If so set the firstday |
|
| 1805 | + if ($this->recur['nday'] == $ndaycounter) { |
|
| 1806 | + $firstday = $day; |
|
| 1807 | 1807 | |
| 1808 | - break; |
|
| 1808 | + break; |
|
| 1809 | + } |
|
| 1809 | 1810 | } |
| 1810 | - } |
|
| 1811 | - // $firstday is the day of the month on which the asked pattern of nth weekday matches |
|
| 1812 | - $daynow = $now + $firstday * 60 * 60 * 24; |
|
| 1813 | - } else { |
|
| 1814 | - // Find last day in the month ($now is the firstday of the month) |
|
| 1815 | - $NumDaysInMonth = $this->daysInMonth($now, 1); |
|
| 1816 | - $daynow = $now + (($NumDaysInMonth - 1) * 24 * 60 * 60); |
|
| 1811 | + // $firstday is the day of the month on which the asked pattern of nth weekday matches |
|
| 1812 | + $daynow = $now + $firstday * 60 * 60 * 24; |
|
| 1813 | + } else { |
|
| 1814 | + // Find last day in the month ($now is the firstday of the month) |
|
| 1815 | + $NumDaysInMonth = $this->daysInMonth($now, 1); |
|
| 1816 | + $daynow = $now + (($NumDaysInMonth - 1) * 24 * 60 * 60); |
|
| 1817 | 1817 | |
| 1818 | - $nowtime = $this->gmtime($daynow); |
|
| 1819 | - while (($this->recur['weekdays'] & (1 << $nowtime['tm_wday'])) == 0) { |
|
| 1820 | - $daynow -= 86400; |
|
| 1821 | 1818 | $nowtime = $this->gmtime($daynow); |
| 1819 | + while (($this->recur['weekdays'] & (1 << $nowtime['tm_wday'])) == 0) { |
|
| 1820 | + $daynow -= 86400; |
|
| 1821 | + $nowtime = $this->gmtime($daynow); |
|
| 1822 | + } |
|
| 1822 | 1823 | } |
| 1823 | - } |
|
| 1824 | 1824 | |
| 1825 | - /* |
|
| 1825 | + /* |
|
| 1826 | 1826 | * checks weather the next coming day in recurrence pattern is less than or equal to end day of the * recurring item.Also check weather the coming day in recurrence pattern is greater than or equal to start * of recurring pattern, so that appointment that fall under the recurrence range are only displayed. |
| 1827 | 1827 | */ |
| 1828 | - if ($daynow <= $dayend && $daynow >= $daystart) { |
|
| 1829 | - $this->processOccurrenceItem($items, $start, $end, $daynow, $this->recur['startocc'], $this->recur['endocc'], $this->tz, $remindersonly); |
|
| 1830 | - } |
|
| 1831 | - } elseif ($this->recur['regen']) { |
|
| 1832 | - $next_month_start = $now + ($this->daysInMonth($now, 1) * 24 * 60 * 60); |
|
| 1833 | - $now = $daystart + ($this->daysInMonth($next_month_start, $this->recur['everyn']) * 24 * 60 * 60); |
|
| 1828 | + if ($daynow <= $dayend && $daynow >= $daystart) { |
|
| 1829 | + $this->processOccurrenceItem($items, $start, $end, $daynow, $this->recur['startocc'], $this->recur['endocc'], $this->tz, $remindersonly); |
|
| 1830 | + } |
|
| 1831 | + } elseif ($this->recur['regen']) { |
|
| 1832 | + $next_month_start = $now + ($this->daysInMonth($now, 1) * 24 * 60 * 60); |
|
| 1833 | + $now = $daystart + ($this->daysInMonth($next_month_start, $this->recur['everyn']) * 24 * 60 * 60); |
|
| 1834 | 1834 | |
| 1835 | - if ($now <= $dayend) { |
|
| 1836 | - $this->processOccurrenceItem($items, $daystart, $end, $now, $this->recur['startocc'], $this->recur['endocc'], $this->tz, $remindersonly); |
|
| 1835 | + if ($now <= $dayend) { |
|
| 1836 | + $this->processOccurrenceItem($items, $daystart, $end, $now, $this->recur['startocc'], $this->recur['endocc'], $this->tz, $remindersonly); |
|
| 1837 | + } |
|
| 1837 | 1838 | } |
| 1838 | 1839 | } |
| 1839 | - } |
|
| 1840 | 1840 | |
| 1841 | - break; |
|
| 1841 | + break; |
|
| 1842 | 1842 | |
| 1843 | - case 13: |
|
| 1844 | - // Yearly |
|
| 1845 | - if ($this->recur['everyn'] <= 0) { |
|
| 1846 | - $this->recur['everyn'] = 12; |
|
| 1847 | - } |
|
| 1843 | + case 13: |
|
| 1844 | + // Yearly |
|
| 1845 | + if ($this->recur['everyn'] <= 0) { |
|
| 1846 | + $this->recur['everyn'] = 12; |
|
| 1847 | + } |
|
| 1848 | 1848 | |
| 1849 | - for ($now = $this->yearStartOf($daystart); $now <= $dayend && (0 == $limit || count($items) < $limit); $now += $this->daysInMonth($now, $this->recur['everyn']) * 24 * 60 * 60) { |
|
| 1850 | - if (isset($this->recur['monthday']) && !$this->recur['regen']) { // same as monthly, but in a specific month |
|
| 1851 | - // recur["month"] is in minutes since the beginning of the year |
|
| 1852 | - $month = $this->monthOfYear($this->recur['month']); // $month is now month of year [0..11] |
|
| 1853 | - $monthday = $this->recur['monthday']; // $monthday is day of the month [1..31] |
|
| 1854 | - $monthstart = $now + $this->daysInMonth($now, $month) * 24 * 60 * 60; // $monthstart is the timestamp of the beginning of the month |
|
| 1855 | - if ($monthday > $this->daysInMonth($monthstart, 1)) { |
|
| 1856 | - $monthday = $this->daysInMonth($monthstart, 1); |
|
| 1857 | - } // Cap $monthday on month length (eg 28 feb instead of 29 feb) |
|
| 1858 | - $daynow = $monthstart + ($monthday - 1) * 24 * 60 * 60; |
|
| 1859 | - $this->processOccurrenceItem($items, $start, $end, $daynow, $this->recur['startocc'], $this->recur['endocc'], $this->tz, $remindersonly); |
|
| 1860 | - } elseif (isset($this->recur['nday'], $this->recur['weekdays'])) { // Nth [weekday] in month X of every N years |
|
| 1861 | - // Go the correct month |
|
| 1862 | - $monthnow = $now + $this->daysInMonth($now, $this->monthOfYear($this->recur['month'])) * 24 * 60 * 60; |
|
| 1863 | - |
|
| 1864 | - // Find first matching weekday in this month |
|
| 1865 | - for ($wday = 0; $wday < 7; ++$wday) { |
|
| 1866 | - $daynow = $monthnow + $wday * 60 * 60 * 24; |
|
| 1867 | - $nowtime = $this->gmtime($daynow); // Get the weekday of the current day |
|
| 1868 | - |
|
| 1869 | - if ($this->recur['weekdays'] & (1 << $nowtime['tm_wday'])) { // Selected ? |
|
| 1870 | - $firstday = $wday; |
|
| 1849 | + for ($now = $this->yearStartOf($daystart); $now <= $dayend && (0 == $limit || count($items) < $limit); $now += $this->daysInMonth($now, $this->recur['everyn']) * 24 * 60 * 60) { |
|
| 1850 | + if (isset($this->recur['monthday']) && !$this->recur['regen']) { // same as monthly, but in a specific month |
|
| 1851 | + // recur["month"] is in minutes since the beginning of the year |
|
| 1852 | + $month = $this->monthOfYear($this->recur['month']); // $month is now month of year [0..11] |
|
| 1853 | + $monthday = $this->recur['monthday']; // $monthday is day of the month [1..31] |
|
| 1854 | + $monthstart = $now + $this->daysInMonth($now, $month) * 24 * 60 * 60; // $monthstart is the timestamp of the beginning of the month |
|
| 1855 | + if ($monthday > $this->daysInMonth($monthstart, 1)) { |
|
| 1856 | + $monthday = $this->daysInMonth($monthstart, 1); |
|
| 1857 | + } // Cap $monthday on month length (eg 28 feb instead of 29 feb) |
|
| 1858 | + $daynow = $monthstart + ($monthday - 1) * 24 * 60 * 60; |
|
| 1859 | + $this->processOccurrenceItem($items, $start, $end, $daynow, $this->recur['startocc'], $this->recur['endocc'], $this->tz, $remindersonly); |
|
| 1860 | + } elseif (isset($this->recur['nday'], $this->recur['weekdays'])) { // Nth [weekday] in month X of every N years |
|
| 1861 | + // Go the correct month |
|
| 1862 | + $monthnow = $now + $this->daysInMonth($now, $this->monthOfYear($this->recur['month'])) * 24 * 60 * 60; |
|
| 1871 | 1863 | |
| 1872 | - break; |
|
| 1864 | + // Find first matching weekday in this month |
|
| 1865 | + for ($wday = 0; $wday < 7; ++$wday) { |
|
| 1866 | + $daynow = $monthnow + $wday * 60 * 60 * 24; |
|
| 1867 | + $nowtime = $this->gmtime($daynow); // Get the weekday of the current day |
|
| 1868 | + |
|
| 1869 | + if ($this->recur['weekdays'] & (1 << $nowtime['tm_wday'])) { // Selected ? |
|
| 1870 | + $firstday = $wday; |
|
| 1871 | + |
|
| 1872 | + break; |
|
| 1873 | + } |
|
| 1873 | 1874 | } |
| 1874 | - } |
|
| 1875 | 1875 | |
| 1876 | - // Same as above (monthly) |
|
| 1877 | - $daynow = $monthnow + ($firstday + ($this->recur['nday'] - 1) * 7) * 60 * 60 * 24; |
|
| 1876 | + // Same as above (monthly) |
|
| 1877 | + $daynow = $monthnow + ($firstday + ($this->recur['nday'] - 1) * 7) * 60 * 60 * 24; |
|
| 1878 | 1878 | |
| 1879 | - while ($this->monthStartOf($daynow) != $this->monthStartOf($monthnow)) { |
|
| 1880 | - $daynow -= 7 * 60 * 60 * 24; |
|
| 1881 | - } |
|
| 1879 | + while ($this->monthStartOf($daynow) != $this->monthStartOf($monthnow)) { |
|
| 1880 | + $daynow -= 7 * 60 * 60 * 24; |
|
| 1881 | + } |
|
| 1882 | 1882 | |
| 1883 | - $this->processOccurrenceItem($items, $start, $end, $daynow, $this->recur['startocc'], $this->recur['endocc'], $this->tz, $remindersonly); |
|
| 1884 | - } elseif ($this->recur['regen']) { |
|
| 1885 | - $year_starttime = $this->gmtime($now); |
|
| 1886 | - $is_next_leapyear = $this->isLeapYear($year_starttime['tm_year'] + 1900 + 1); // +1 next year |
|
| 1887 | - $now = $daystart + ($is_next_leapyear ? 31622400 /* Leap year in seconds */ : 31536000 /* year in seconds */); |
|
| 1883 | + $this->processOccurrenceItem($items, $start, $end, $daynow, $this->recur['startocc'], $this->recur['endocc'], $this->tz, $remindersonly); |
|
| 1884 | + } elseif ($this->recur['regen']) { |
|
| 1885 | + $year_starttime = $this->gmtime($now); |
|
| 1886 | + $is_next_leapyear = $this->isLeapYear($year_starttime['tm_year'] + 1900 + 1); // +1 next year |
|
| 1887 | + $now = $daystart + ($is_next_leapyear ? 31622400 /* Leap year in seconds */ : 31536000 /* year in seconds */); |
|
| 1888 | 1888 | |
| 1889 | - if ($now <= $dayend) { |
|
| 1890 | - $this->processOccurrenceItem($items, $daystart, $end, $now, $this->recur['startocc'], $this->recur['endocc'], $this->tz, $remindersonly); |
|
| 1889 | + if ($now <= $dayend) { |
|
| 1890 | + $this->processOccurrenceItem($items, $daystart, $end, $now, $this->recur['startocc'], $this->recur['endocc'], $this->tz, $remindersonly); |
|
| 1891 | + } |
|
| 1891 | 1892 | } |
| 1892 | 1893 | } |
| 1893 | - } |
|
| 1894 | 1894 | } |
| 1895 | 1895 | // to get all exception items |
| 1896 | 1896 | if (!empty($this->recur['changed_occurences'])) { |
@@ -570,14 +570,14 @@ discard block |
||
| 570 | 570 | return; |
| 571 | 571 | } |
| 572 | 572 | |
| 573 | - $rdata = pack('CCCCCCV', 0x04, 0x30, 0x04, 0x30, (int) $this->recur['type'], 0x20, (int) $this->recur['subtype']); |
|
| 573 | + $rdata = pack('CCCCCCV', 0x04, 0x30, 0x04, 0x30, (int)$this->recur['type'], 0x20, (int)$this->recur['subtype']); |
|
| 574 | 574 | |
| 575 | 575 | $weekstart = 1; // monday |
| 576 | 576 | $forwardcount = 0; |
| 577 | 577 | $restocc = 0; |
| 578 | - $dayofweek = (int) gmdate('w', (int) $this->recur['start']); // 0 (for Sunday) through 6 (for Saturday) |
|
| 578 | + $dayofweek = (int)gmdate('w', (int)$this->recur['start']); // 0 (for Sunday) through 6 (for Saturday) |
|
| 579 | 579 | |
| 580 | - $term = (int) $this->recur['type']; |
|
| 580 | + $term = (int)$this->recur['type']; |
|
| 581 | 581 | |
| 582 | 582 | switch ($term) { |
| 583 | 583 | case 0x0A: |
@@ -592,12 +592,12 @@ discard block |
||
| 592 | 592 | } else { |
| 593 | 593 | // Daily every N days (everyN in minutes) |
| 594 | 594 | |
| 595 | - $everyn = ((int) $this->recur['everyn']) / 1440; |
|
| 595 | + $everyn = ((int)$this->recur['everyn']) / 1440; |
|
| 596 | 596 | |
| 597 | 597 | // Calc first occ |
| 598 | - $firstocc = $this->unixDataToRecurData($this->recur['start']) % ((int) $this->recur['everyn']); |
|
| 598 | + $firstocc = $this->unixDataToRecurData($this->recur['start']) % ((int)$this->recur['everyn']); |
|
| 599 | 599 | |
| 600 | - $rdata .= pack('VVV', $firstocc, (int) $this->recur['everyn'], $this->recur['regen'] ? 1 : 0); |
|
| 600 | + $rdata .= pack('VVV', $firstocc, (int)$this->recur['everyn'], $this->recur['regen'] ? 1 : 0); |
|
| 601 | 601 | } |
| 602 | 602 | |
| 603 | 603 | break; |
@@ -620,7 +620,7 @@ discard block |
||
| 620 | 620 | $daycount = 0; |
| 621 | 621 | $dayskip = -1; |
| 622 | 622 | for ($j = 0; $j < 7; ++$j) { |
| 623 | - if (((int) $this->recur['weekdays']) & (1 << (($dayofweek + $j) % 7))) { |
|
| 623 | + if (((int)$this->recur['weekdays']) & (1 << (($dayofweek + $j) % 7))) { |
|
| 624 | 624 | if (-1 == $dayskip) { |
| 625 | 625 | $dayskip = $j; |
| 626 | 626 | } |
@@ -639,34 +639,34 @@ discard block |
||
| 639 | 639 | |
| 640 | 640 | // Check if the recurrence ends after a number of occurences, in that case we must calculate the |
| 641 | 641 | // remaining occurences based on the start of the recurrence. |
| 642 | - if (((int) $this->recur['term']) == 0x22) { |
|
| 642 | + if (((int)$this->recur['term']) == 0x22) { |
|
| 643 | 643 | // $weekskip is the amount of weeks to skip from the startdate before the first occurence |
| 644 | 644 | // $forwardcount is the maximum number of week occurrences we can go ahead after the first occurrence that |
| 645 | 645 | // is still inside the recurrence. We subtract one to make sure that the last week is never forwarded over |
| 646 | 646 | // (eg when numoccur = 2, and daycount = 1) |
| 647 | - $forwardcount = floor((int) ($this->recur['numoccur'] - 1) / $daycount); |
|
| 647 | + $forwardcount = floor((int)($this->recur['numoccur'] - 1) / $daycount); |
|
| 648 | 648 | |
| 649 | 649 | // $restocc is the number of occurrences left after $forwardcount whole weeks of occurrences, minus one |
| 650 | 650 | // for the occurrence on the first day |
| 651 | - $restocc = ((int) $this->recur['numoccur']) - ($forwardcount * $daycount) - 1; |
|
| 651 | + $restocc = ((int)$this->recur['numoccur']) - ($forwardcount * $daycount) - 1; |
|
| 652 | 652 | |
| 653 | 653 | // $forwardcount is now the number of weeks we can go forward and still be inside the recurrence |
| 654 | - $forwardcount *= (int) $this->recur['everyn']; |
|
| 654 | + $forwardcount *= (int)$this->recur['everyn']; |
|
| 655 | 655 | } |
| 656 | 656 | |
| 657 | 657 | // The real start is start + dayskip + weekskip-1 (since dayskip will already bring us into the next week) |
| 658 | - $this->recur['start'] = ((int) $this->recur['start']) + ($dayskip * 24 * 60 * 60) + ($weekskip * (((int) $this->recur['everyn']) - 1) * 7 * 24 * 60 * 60); |
|
| 658 | + $this->recur['start'] = ((int)$this->recur['start']) + ($dayskip * 24 * 60 * 60) + ($weekskip * (((int)$this->recur['everyn']) - 1) * 7 * 24 * 60 * 60); |
|
| 659 | 659 | } |
| 660 | 660 | |
| 661 | 661 | // Calc first occ |
| 662 | - $firstocc = ($this->unixDataToRecurData($this->recur['start'])) % (((int) $this->recur['everyn']) * 7 * 24 * 60); |
|
| 662 | + $firstocc = ($this->unixDataToRecurData($this->recur['start'])) % (((int)$this->recur['everyn']) * 7 * 24 * 60); |
|
| 663 | 663 | |
| 664 | - $firstocc -= (((int) gmdate('w', (int) $this->recur['start'])) - 1) * 24 * 60; |
|
| 664 | + $firstocc -= (((int)gmdate('w', (int)$this->recur['start'])) - 1) * 24 * 60; |
|
| 665 | 665 | |
| 666 | 666 | if ($this->recur['regen']) { |
| 667 | - $rdata .= pack('VVV', $firstocc, (int) $this->recur['everyn'], 1); |
|
| 667 | + $rdata .= pack('VVV', $firstocc, (int)$this->recur['everyn'], 1); |
|
| 668 | 668 | } else { |
| 669 | - $rdata .= pack('VVVV', $firstocc, (int) $this->recur['everyn'], 0, (int) $this->recur['weekdays']); |
|
| 669 | + $rdata .= pack('VVVV', $firstocc, (int)$this->recur['everyn'], 0, (int)$this->recur['weekdays']); |
|
| 670 | 670 | } |
| 671 | 671 | |
| 672 | 672 | break; |
@@ -683,30 +683,30 @@ discard block |
||
| 683 | 683 | } |
| 684 | 684 | |
| 685 | 685 | if (0x0C == $term /* monthly */) { |
| 686 | - $everyn = (int) $this->recur['everyn']; |
|
| 686 | + $everyn = (int)$this->recur['everyn']; |
|
| 687 | 687 | } else { |
| 688 | - $everyn = $this->recur['regen'] ? ((int) $this->recur['everyn']) * 12 : 12; |
|
| 688 | + $everyn = $this->recur['regen'] ? ((int)$this->recur['everyn']) * 12 : 12; |
|
| 689 | 689 | } |
| 690 | 690 | |
| 691 | 691 | // Get montday/month/year of original start |
| 692 | - $curmonthday = gmdate('j', (int) $this->recur['start']); |
|
| 693 | - $curyear = gmdate('Y', (int) $this->recur['start']); |
|
| 694 | - $curmonth = gmdate('n', (int) $this->recur['start']); |
|
| 692 | + $curmonthday = gmdate('j', (int)$this->recur['start']); |
|
| 693 | + $curyear = gmdate('Y', (int)$this->recur['start']); |
|
| 694 | + $curmonth = gmdate('n', (int)$this->recur['start']); |
|
| 695 | 695 | |
| 696 | 696 | // Check if the recurrence ends after a number of occurences, in that case we must calculate the |
| 697 | 697 | // remaining occurences based on the start of the recurrence. |
| 698 | - if (((int) $this->recur['term']) == 0x22) { |
|
| 698 | + if (((int)$this->recur['term']) == 0x22) { |
|
| 699 | 699 | // $forwardcount is the number of occurrences we can skip and still be inside the recurrence range (minus |
| 700 | 700 | // one to make sure there are always at least one occurrence left) |
| 701 | - $forwardcount = ((((int) $this->recur['numoccur']) - 1) * $everyn); |
|
| 701 | + $forwardcount = ((((int)$this->recur['numoccur']) - 1) * $everyn); |
|
| 702 | 702 | } |
| 703 | 703 | |
| 704 | 704 | // Get month for yearly on D'th day of month M |
| 705 | 705 | if (0x0D == $term /* yearly */) { |
| 706 | - $selmonth = floor(((int) $this->recur['month']) / (24 * 60 * 29)) + 1; // 1=jan, 2=feb, eg |
|
| 706 | + $selmonth = floor(((int)$this->recur['month']) / (24 * 60 * 29)) + 1; // 1=jan, 2=feb, eg |
|
| 707 | 707 | } |
| 708 | 708 | |
| 709 | - switch ((int) $this->recur['subtype']) { |
|
| 709 | + switch ((int)$this->recur['subtype']) { |
|
| 710 | 710 | // on D day of every M month |
| 711 | 711 | case 2: |
| 712 | 712 | if (!isset($this->recur['monthday'])) { |
@@ -719,11 +719,11 @@ discard block |
||
| 719 | 719 | // Go the beginning of the month |
| 720 | 720 | $this->recur['start'] -= ($curmonthday - 1) * 24 * 60 * 60; |
| 721 | 721 | // Go the the correct month day |
| 722 | - $this->recur['start'] += (((int) $this->recur['monthday']) - 1) * 24 * 60 * 60; |
|
| 722 | + $this->recur['start'] += (((int)$this->recur['monthday']) - 1) * 24 * 60 * 60; |
|
| 723 | 723 | |
| 724 | 724 | // If the previous calculation gave us a start date different than the original start date, then we need to skip to the first occurrence |
| 725 | - if ((0x0C == $term /* monthly */ && ((int) $this->recur['monthday']) < $curmonthday) |
|
| 726 | - || (0x0D == $term /* yearly */ && ($selmonth != $curmonth || ($selmonth == $curmonth && ((int) $this->recur['monthday']) < $curmonthday)))) { |
|
| 725 | + if ((0x0C == $term /* monthly */ && ((int)$this->recur['monthday']) < $curmonthday) |
|
| 726 | + || (0x0D == $term /* yearly */ && ($selmonth != $curmonth || ($selmonth == $curmonth && ((int)$this->recur['monthday']) < $curmonthday)))) { |
|
| 727 | 727 | if (0x0D == $term /* yearly */) { |
| 728 | 728 | if ($curmonth > $selmonth) {// go to next occurrence in 'everyn' months minus difference in first occurrence and original date |
| 729 | 729 | $count = $everyn - ($curmonth - $selmonth); |
@@ -731,7 +731,7 @@ discard block |
||
| 731 | 731 | $count = $selmonth - $curmonth; |
| 732 | 732 | } else { |
| 733 | 733 | // Go to next occurrence while recurrence start date is greater than occurrence date but within same month |
| 734 | - if (((int) $this->recur['monthday']) < $curmonthday) { |
|
| 734 | + if (((int)$this->recur['monthday']) < $curmonthday) { |
|
| 735 | 735 | $count = $everyn; |
| 736 | 736 | } |
| 737 | 737 | } |
@@ -756,32 +756,32 @@ discard block |
||
| 756 | 756 | // of each month will overshoot in february (29 days). We compensate for that by checking |
| 757 | 757 | // if the day of the month we got is wrong, and then back up to the last day of the previous |
| 758 | 758 | // month. |
| 759 | - if (((int) $this->recur['monthday']) >= 28 && ((int) $this->recur['monthday']) <= 31 |
|
| 760 | - && gmdate('j', ((int) $this->recur['start'])) < ((int) $this->recur['monthday'])) { |
|
| 761 | - $this->recur['start'] -= gmdate('j', ((int) $this->recur['start'])) * 24 * 60 * 60; |
|
| 759 | + if (((int)$this->recur['monthday']) >= 28 && ((int)$this->recur['monthday']) <= 31 |
|
| 760 | + && gmdate('j', ((int)$this->recur['start'])) < ((int)$this->recur['monthday'])) { |
|
| 761 | + $this->recur['start'] -= gmdate('j', ((int)$this->recur['start'])) * 24 * 60 * 60; |
|
| 762 | 762 | } |
| 763 | 763 | |
| 764 | 764 | // "start" is now the first occurrence |
| 765 | 765 | |
| 766 | 766 | if (0x0C == $term /* monthly */) { |
| 767 | 767 | // Calc first occ |
| 768 | - $monthIndex = ((((12 % $everyn) * ((((int) gmdate('Y', $this->recur['start'])) - 1601) % $everyn)) % $everyn) + (((int) gmdate('n', $this->recur['start'])) - 1)) % $everyn; |
|
| 768 | + $monthIndex = ((((12 % $everyn) * ((((int)gmdate('Y', $this->recur['start'])) - 1601) % $everyn)) % $everyn) + (((int)gmdate('n', $this->recur['start'])) - 1)) % $everyn; |
|
| 769 | 769 | |
| 770 | 770 | $firstocc = 0; |
| 771 | 771 | for ($i = 0; $i < $monthIndex; ++$i) { |
| 772 | 772 | $firstocc += $this->getMonthInSeconds(1601 + floor($i / 12), ($i % 12) + 1) / 60; |
| 773 | 773 | } |
| 774 | 774 | |
| 775 | - $rdata .= pack('VVVV', $firstocc, $everyn, $this->recur['regen'], (int) $this->recur['monthday']); |
|
| 775 | + $rdata .= pack('VVVV', $firstocc, $everyn, $this->recur['regen'], (int)$this->recur['monthday']); |
|
| 776 | 776 | } else { |
| 777 | 777 | // Calc first occ |
| 778 | 778 | $firstocc = 0; |
| 779 | - $monthIndex = (int) gmdate('n', $this->recur['start']); |
|
| 779 | + $monthIndex = (int)gmdate('n', $this->recur['start']); |
|
| 780 | 780 | for ($i = 1; $i < $monthIndex; ++$i) { |
| 781 | 781 | $firstocc += $this->getMonthInSeconds(1601 + floor($i / 12), $i) / 60; |
| 782 | 782 | } |
| 783 | 783 | |
| 784 | - $rdata .= pack('VVVV', $firstocc, $everyn, $this->recur['regen'], (int) $this->recur['monthday']); |
|
| 784 | + $rdata .= pack('VVVV', $firstocc, $everyn, $this->recur['regen'], (int)$this->recur['monthday']); |
|
| 785 | 785 | } |
| 786 | 786 | |
| 787 | 787 | break; |
@@ -793,11 +793,11 @@ discard block |
||
| 793 | 793 | return; |
| 794 | 794 | } |
| 795 | 795 | |
| 796 | - $weekdays = (int) $this->recur['weekdays']; |
|
| 797 | - $nday = (int) $this->recur['nday']; |
|
| 796 | + $weekdays = (int)$this->recur['weekdays']; |
|
| 797 | + $nday = (int)$this->recur['nday']; |
|
| 798 | 798 | |
| 799 | 799 | // Calc startdate |
| 800 | - $monthbegindow = (int) $this->recur['start']; |
|
| 800 | + $monthbegindow = (int)$this->recur['start']; |
|
| 801 | 801 | |
| 802 | 802 | if (5 == $nday) { |
| 803 | 803 | // Set date on the last day of the last month |
@@ -829,12 +829,12 @@ discard block |
||
| 829 | 829 | |
| 830 | 830 | $dayofweek = gmdate('w', $monthbegindow); |
| 831 | 831 | for ($i = 0; $i < 7; ++$i) { |
| 832 | - if (5 == $nday && (($dayofweek - $i) % 7 >= 0) && (1 << (($dayofweek - $i) % 7)) & $weekdays) { |
|
| 832 | + if (5 == $nday && (($dayofweek - $i) % 7 >= 0) && (1 << (($dayofweek - $i) % 7))&$weekdays) { |
|
| 833 | 833 | $day = gmdate('j', $monthbegindow) - $i; |
| 834 | 834 | |
| 835 | 835 | break; |
| 836 | 836 | } |
| 837 | - if (5 != $nday && (1 << (($dayofweek + $i) % 7)) & $weekdays) { |
|
| 837 | + if (5 != $nday && (1 << (($dayofweek + $i) % 7))&$weekdays) { |
|
| 838 | 838 | $day = (($nday - 1) * 7) + ($i + 1); |
| 839 | 839 | |
| 840 | 840 | break; |
@@ -842,7 +842,7 @@ discard block |
||
| 842 | 842 | } |
| 843 | 843 | |
| 844 | 844 | // Goto the next X month |
| 845 | - if (isset($day) && ($day < gmdate('j', (int) $this->recur['start']))) { |
|
| 845 | + if (isset($day) && ($day < gmdate('j', (int)$this->recur['start']))) { |
|
| 846 | 846 | if (5 == $nday) { |
| 847 | 847 | $monthbegindow += 24 * 60 * 60; |
| 848 | 848 | if (12 == $curmonth) { |
@@ -874,12 +874,12 @@ discard block |
||
| 874 | 874 | // Set start on the right day |
| 875 | 875 | $dayofweek = gmdate('w', $monthbegindow); |
| 876 | 876 | for ($i = 0; $i < 7; ++$i) { |
| 877 | - if (5 == $nday && (($dayofweek - $i) % 7) >= 0 && (1 << (($dayofweek - $i) % 7)) & $weekdays) { |
|
| 877 | + if (5 == $nday && (($dayofweek - $i) % 7) >= 0 && (1 << (($dayofweek - $i) % 7))&$weekdays) { |
|
| 878 | 878 | $day = $i; |
| 879 | 879 | |
| 880 | 880 | break; |
| 881 | 881 | } |
| 882 | - if (5 != $nday && (1 << (($dayofweek + $i) % 7)) & $weekdays) { |
|
| 882 | + if (5 != $nday && (1 << (($dayofweek + $i) % 7))&$weekdays) { |
|
| 883 | 883 | $day = ($nday - 1) * 7 + ($i + 1); |
| 884 | 884 | |
| 885 | 885 | break; |
@@ -895,7 +895,7 @@ discard block |
||
| 895 | 895 | |
| 896 | 896 | if (0x0C == $term /* monthly */) { |
| 897 | 897 | // Calc first occ |
| 898 | - $monthIndex = ((((12 % $everyn) * (((int) gmdate('Y', $this->recur['start']) - 1601) % $everyn)) % $everyn) + (((int) gmdate('n', $this->recur['start'])) - 1)) % $everyn; |
|
| 898 | + $monthIndex = ((((12 % $everyn) * (((int)gmdate('Y', $this->recur['start']) - 1601) % $everyn)) % $everyn) + (((int)gmdate('n', $this->recur['start'])) - 1)) % $everyn; |
|
| 899 | 899 | |
| 900 | 900 | for ($i = 0; $i < $monthIndex; ++$i) { |
| 901 | 901 | $firstocc += $this->getMonthInSeconds(1601 + floor($i / 12), ($i % 12) + 1) / 60; |
@@ -904,7 +904,7 @@ discard block |
||
| 904 | 904 | $rdata .= pack('VVVVV', $firstocc, $everyn, 0, $weekdays, $nday); |
| 905 | 905 | } else { |
| 906 | 906 | // Calc first occ |
| 907 | - $monthIndex = (int) gmdate('n', $this->recur['start']); |
|
| 907 | + $monthIndex = (int)gmdate('n', $this->recur['start']); |
|
| 908 | 908 | |
| 909 | 909 | for ($i = 1; $i < $monthIndex; ++$i) { |
| 910 | 910 | $firstocc += $this->getMonthInSeconds(1601 + floor($i / 12), $i) / 60; |
@@ -924,7 +924,7 @@ discard block |
||
| 924 | 924 | } |
| 925 | 925 | |
| 926 | 926 | // Terminate |
| 927 | - $term = (int) $this->recur['term']; |
|
| 927 | + $term = (int)$this->recur['term']; |
|
| 928 | 928 | $rdata .= pack('CCCC', $term, 0x20, 0x00, 0x00); |
| 929 | 929 | |
| 930 | 930 | switch ($term) { |
@@ -939,7 +939,7 @@ discard block |
||
| 939 | 939 | return; |
| 940 | 940 | } |
| 941 | 941 | |
| 942 | - $rdata .= pack('V', (int) $this->recur['numoccur']); |
|
| 942 | + $rdata .= pack('V', (int)$this->recur['numoccur']); |
|
| 943 | 943 | |
| 944 | 944 | break; |
| 945 | 945 | // Never ends |
@@ -950,7 +950,7 @@ discard block |
||
| 950 | 950 | } |
| 951 | 951 | |
| 952 | 952 | // Strange little thing for the recurrence type "every workday" |
| 953 | - if (((int) $this->recur['type']) == 0x0B && ((int) $this->recur['subtype']) == 1) { |
|
| 953 | + if (((int)$this->recur['type']) == 0x0B && ((int)$this->recur['subtype']) == 1) { |
|
| 954 | 954 | $rdata .= pack('V', 1); |
| 955 | 955 | } else { // Other recurrences |
| 956 | 956 | $rdata .= pack('V', 0); |
@@ -993,25 +993,25 @@ discard block |
||
| 993 | 993 | } |
| 994 | 994 | |
| 995 | 995 | // Set start date |
| 996 | - $rdata .= pack('V', $this->unixDataToRecurData((int) $this->recur['start'])); |
|
| 996 | + $rdata .= pack('V', $this->unixDataToRecurData((int)$this->recur['start'])); |
|
| 997 | 997 | |
| 998 | 998 | // Set enddate |
| 999 | 999 | switch ($term) { |
| 1000 | 1000 | // After the given enddate |
| 1001 | 1001 | case 0x21: |
| 1002 | - $rdata .= pack('V', $this->unixDataToRecurData((int) $this->recur['end'])); |
|
| 1002 | + $rdata .= pack('V', $this->unixDataToRecurData((int)$this->recur['end'])); |
|
| 1003 | 1003 | |
| 1004 | 1004 | break; |
| 1005 | 1005 | // After a number of times |
| 1006 | 1006 | case 0x22: |
| 1007 | 1007 | // @todo: calculate enddate with intval($this->recur["startocc"]) + intval($this->recur["duration"]) > 24 hour |
| 1008 | - $occenddate = (int) $this->recur['start']; |
|
| 1008 | + $occenddate = (int)$this->recur['start']; |
|
| 1009 | 1009 | |
| 1010 | - switch ((int) $this->recur['type']) { |
|
| 1010 | + switch ((int)$this->recur['type']) { |
|
| 1011 | 1011 | case 0x0A: // daily |
| 1012 | 1012 | if (1 == $this->recur['subtype']) { |
| 1013 | 1013 | // Daily every workday |
| 1014 | - $restocc = (int) $this->recur['numoccur']; |
|
| 1014 | + $restocc = (int)$this->recur['numoccur']; |
|
| 1015 | 1015 | |
| 1016 | 1016 | // Get starting weekday |
| 1017 | 1017 | $nowtime = $this->gmtime($occenddate); |
@@ -1032,7 +1032,7 @@ discard block |
||
| 1032 | 1032 | } |
| 1033 | 1033 | } else { |
| 1034 | 1034 | // -1 because the first day already counts (from 1-1-1980 to 1-1-1980 is 1 occurrence) |
| 1035 | - $occenddate += (((int) $this->recur['everyn']) * 60 * (((int) $this->recur['numoccur'] - 1))); |
|
| 1035 | + $occenddate += (((int)$this->recur['everyn']) * 60 * (((int)$this->recur['numoccur'] - 1))); |
|
| 1036 | 1036 | } |
| 1037 | 1037 | |
| 1038 | 1038 | break; |
@@ -1051,11 +1051,11 @@ discard block |
||
| 1051 | 1051 | for ($j = 1; $restocc > 0; ++$j) { |
| 1052 | 1052 | // Jump to the next week (which may be N weeks away) when going over the week boundary |
| 1053 | 1053 | if ((($dayofweek + $j) % 7) == $weekstart) { |
| 1054 | - $occenddate += (((int) $this->recur['everyn']) - 1) * 7 * 24 * 60 * 60; |
|
| 1054 | + $occenddate += (((int)$this->recur['everyn']) - 1) * 7 * 24 * 60 * 60; |
|
| 1055 | 1055 | } |
| 1056 | 1056 | |
| 1057 | 1057 | // If this is a matching day, once less occurrence to process |
| 1058 | - if (((int) $this->recur['weekdays']) & (1 << (($dayofweek + $j) % 7))) { |
|
| 1058 | + if (((int)$this->recur['weekdays']) & (1 << (($dayofweek + $j) % 7))) { |
|
| 1059 | 1059 | --$restocc; |
| 1060 | 1060 | } |
| 1061 | 1061 | |
@@ -1067,11 +1067,11 @@ discard block |
||
| 1067 | 1067 | |
| 1068 | 1068 | case 0x0C: // monthly |
| 1069 | 1069 | case 0x0D: // yearly |
| 1070 | - $curyear = gmdate('Y', (int) $this->recur['start']); |
|
| 1071 | - $curmonth = gmdate('n', (int) $this->recur['start']); |
|
| 1070 | + $curyear = gmdate('Y', (int)$this->recur['start']); |
|
| 1071 | + $curmonth = gmdate('n', (int)$this->recur['start']); |
|
| 1072 | 1072 | // $forwardcount = months |
| 1073 | 1073 | |
| 1074 | - switch ((int) $this->recur['subtype']) { |
|
| 1074 | + switch ((int)$this->recur['subtype']) { |
|
| 1075 | 1075 | case 2: // on D day of every M month |
| 1076 | 1076 | while ($forwardcount > 0) { |
| 1077 | 1077 | $occenddate += $this->getMonthInSeconds($curyear, $curmonth); |
@@ -1086,8 +1086,8 @@ discard block |
||
| 1086 | 1086 | } |
| 1087 | 1087 | |
| 1088 | 1088 | // compensation between 28 and 31 |
| 1089 | - if (((int) $this->recur['monthday']) >= 28 && ((int) $this->recur['monthday']) <= 31 |
|
| 1090 | - && gmdate('j', $occenddate) < ((int) $this->recur['monthday'])) { |
|
| 1089 | + if (((int)$this->recur['monthday']) >= 28 && ((int)$this->recur['monthday']) <= 31 |
|
| 1090 | + && gmdate('j', $occenddate) < ((int)$this->recur['monthday'])) { |
|
| 1091 | 1091 | if (gmdate('j', $occenddate) < 28) { |
| 1092 | 1092 | $occenddate -= gmdate('j', $occenddate) * 24 * 60 * 60; |
| 1093 | 1093 | } else { |
@@ -1098,8 +1098,8 @@ discard block |
||
| 1098 | 1098 | break; |
| 1099 | 1099 | |
| 1100 | 1100 | case 3: // on Nth weekday of every M month |
| 1101 | - $nday = (int) $this->recur['nday']; // 1 tot 5 |
|
| 1102 | - $weekdays = (int) $this->recur['weekdays']; |
|
| 1101 | + $nday = (int)$this->recur['nday']; // 1 tot 5 |
|
| 1102 | + $weekdays = (int)$this->recur['weekdays']; |
|
| 1103 | 1103 | |
| 1104 | 1104 | while ($forwardcount > 0) { |
| 1105 | 1105 | $occenddate += $this->getMonthInSeconds($curyear, $curmonth); |
@@ -1123,12 +1123,12 @@ discard block |
||
| 1123 | 1123 | |
| 1124 | 1124 | $dayofweek = gmdate('w', $occenddate); |
| 1125 | 1125 | for ($i = 0; $i < 7; ++$i) { |
| 1126 | - if (5 == $nday && (($dayofweek - $i) % 7) >= 0 && (1 << (($dayofweek - $i) % 7)) & $weekdays) { |
|
| 1126 | + if (5 == $nday && (($dayofweek - $i) % 7) >= 0 && (1 << (($dayofweek - $i) % 7))&$weekdays) { |
|
| 1127 | 1127 | $occenddate -= $i * 24 * 60 * 60; |
| 1128 | 1128 | |
| 1129 | 1129 | break; |
| 1130 | 1130 | } |
| 1131 | - if (5 != $nday && (1 << (($dayofweek + $i) % 7)) & $weekdays) { |
|
| 1131 | + if (5 != $nday && (1 << (($dayofweek + $i) % 7))&$weekdays) { |
|
| 1132 | 1132 | $occenddate += ($i + (($nday - 1) * 7)) * 24 * 60 * 60; |
| 1133 | 1133 | |
| 1134 | 1134 | break; |
@@ -1147,7 +1147,7 @@ discard block |
||
| 1147 | 1147 | |
| 1148 | 1148 | $this->recur['end'] = $occenddate; |
| 1149 | 1149 | |
| 1150 | - $rdata .= pack('V', $this->unixDataToRecurData((int) $this->recur['end'])); |
|
| 1150 | + $rdata .= pack('V', $this->unixDataToRecurData((int)$this->recur['end'])); |
|
| 1151 | 1151 | |
| 1152 | 1152 | break; |
| 1153 | 1153 | // Never ends |
@@ -1160,12 +1160,12 @@ discard block |
||
| 1160 | 1160 | } |
| 1161 | 1161 | |
| 1162 | 1162 | // UTC date |
| 1163 | - $utcstart = $this->toGMT($this->tz, (int) $this->recur['start']); |
|
| 1164 | - $utcend = $this->toGMT($this->tz, (int) $this->recur['end']); |
|
| 1163 | + $utcstart = $this->toGMT($this->tz, (int)$this->recur['start']); |
|
| 1164 | + $utcend = $this->toGMT($this->tz, (int)$this->recur['end']); |
|
| 1165 | 1165 | |
| 1166 | 1166 | // utc date+time |
| 1167 | - $utcfirstoccstartdatetime = (isset($this->recur['startocc'])) ? $utcstart + (((int) $this->recur['startocc']) * 60) : $utcstart; |
|
| 1168 | - $utcfirstoccenddatetime = (isset($this->recur['endocc'])) ? $utcstart + (((int) $this->recur['endocc']) * 60) : $utcstart; |
|
| 1167 | + $utcfirstoccstartdatetime = (isset($this->recur['startocc'])) ? $utcstart + (((int)$this->recur['startocc']) * 60) : $utcstart; |
|
| 1168 | + $utcfirstoccenddatetime = (isset($this->recur['endocc'])) ? $utcstart + (((int)$this->recur['endocc']) * 60) : $utcstart; |
|
| 1169 | 1169 | |
| 1170 | 1170 | $propsToSet = []; |
| 1171 | 1171 | // update reminder time |
@@ -1183,7 +1183,7 @@ discard block |
||
| 1183 | 1183 | |
| 1184 | 1184 | // recurrencetype |
| 1185 | 1185 | // Strange enough is the property recurrencetype, (type-0x9) and not the CDO recurrencetype |
| 1186 | - $propsToSet[$this->proptags['recurrencetype']] = ((int) $this->recur['type']) - 0x9; |
|
| 1186 | + $propsToSet[$this->proptags['recurrencetype']] = ((int)$this->recur['type']) - 0x9; |
|
| 1187 | 1187 | |
| 1188 | 1188 | // set named prop 'side_effects' to 369, needed for Outlook to ask for single or total recurrence when deleting |
| 1189 | 1189 | $propsToSet[$this->proptags['side_effects']] = 369; |
@@ -1230,7 +1230,7 @@ discard block |
||
| 1230 | 1230 | |
| 1231 | 1231 | if (isset($this->recur['startocc'], $this->recur['endocc'])) { |
| 1232 | 1232 | // Set start and endtime in minutes |
| 1233 | - $rdata .= pack('VV', (int) $this->recur['startocc'], (int) $this->recur['endocc']); |
|
| 1233 | + $rdata .= pack('VV', (int)$this->recur['startocc'], (int)$this->recur['endocc']); |
|
| 1234 | 1234 | } |
| 1235 | 1235 | |
| 1236 | 1236 | // Detailed exception data |
@@ -1285,7 +1285,7 @@ discard block |
||
| 1285 | 1285 | $subject = iconv('UTF-8', 'windows-1252//TRANSLIT', $changed_item['subject']); |
| 1286 | 1286 | $length = strlen($subject); |
| 1287 | 1287 | $rdata .= pack('vv', $length + 1, $length); |
| 1288 | - $rdata .= pack('a' . $length, $subject); |
|
| 1288 | + $rdata .= pack('a'.$length, $subject); |
|
| 1289 | 1289 | } |
| 1290 | 1290 | |
| 1291 | 1291 | if (isset($changed_item['remind_before'])) { |
@@ -1300,7 +1300,7 @@ discard block |
||
| 1300 | 1300 | $location = iconv('UTF-8', 'windows-1252//TRANSLIT', $changed_item['location']); |
| 1301 | 1301 | $length = strlen($location); |
| 1302 | 1302 | $rdata .= pack('vv', $length + 1, $length); |
| 1303 | - $rdata .= pack('a' . $length, $location); |
|
| 1303 | + $rdata .= pack('a'.$length, $location); |
|
| 1304 | 1304 | } |
| 1305 | 1305 | |
| 1306 | 1306 | if (isset($changed_item['busystatus'])) { |
@@ -1331,14 +1331,14 @@ discard block |
||
| 1331 | 1331 | $subject = iconv('UTF-8', 'UCS-2LE', $changed_item['subject']); |
| 1332 | 1332 | $length = iconv_strlen($subject, 'UCS-2LE'); |
| 1333 | 1333 | $rdata .= pack('v', $length); |
| 1334 | - $rdata .= pack('a' . $length * 2, $subject); |
|
| 1334 | + $rdata .= pack('a'.$length * 2, $subject); |
|
| 1335 | 1335 | } |
| 1336 | 1336 | |
| 1337 | 1337 | if (isset($changed_item['location'])) { |
| 1338 | 1338 | $location = iconv('UTF-8', 'UCS-2LE', $changed_item['location']); |
| 1339 | 1339 | $length = iconv_strlen($location, 'UCS-2LE'); |
| 1340 | 1340 | $rdata .= pack('v', $length); |
| 1341 | - $rdata .= pack('a' . $length * 2, $location); |
|
| 1341 | + $rdata .= pack('a'.$length * 2, $location); |
|
| 1342 | 1342 | } |
| 1343 | 1343 | |
| 1344 | 1344 | if (isset($changed_item['subject']) || isset($changed_item['location'])) { |
@@ -1883,7 +1883,7 @@ discard block |
||
| 1883 | 1883 | $this->processOccurrenceItem($items, $start, $end, $daynow, $this->recur['startocc'], $this->recur['endocc'], $this->tz, $remindersonly); |
| 1884 | 1884 | } elseif ($this->recur['regen']) { |
| 1885 | 1885 | $year_starttime = $this->gmtime($now); |
| 1886 | - $is_next_leapyear = $this->isLeapYear($year_starttime['tm_year'] + 1900 + 1); // +1 next year |
|
| 1886 | + $is_next_leapyear = $this->isLeapYear($year_starttime['tm_year'] + 1900 + 1); // +1 next year |
|
| 1887 | 1887 | $now = $daystart + ($is_next_leapyear ? 31622400 /* Leap year in seconds */ : 31536000 /* year in seconds */); |
| 1888 | 1888 | |
| 1889 | 1889 | if ($now <= $dayend) { |