@@ -24,10 +24,10 @@ |
||
24 | 24 | */ |
25 | 25 | class Item implements ExtendedCacheItemInterface |
26 | 26 | { |
27 | - use TaggableCacheItemTrait; |
|
27 | + use TaggableCacheItemTrait; |
|
28 | 28 | |
29 | - protected function getDriverClass(): string |
|
30 | - { |
|
31 | - return Driver::class; |
|
32 | - } |
|
29 | + protected function getDriverClass(): string |
|
30 | + { |
|
31 | + return Driver::class; |
|
32 | + } |
|
33 | 33 | } |
@@ -21,10 +21,10 @@ |
||
21 | 21 | |
22 | 22 | class Item implements ExtendedCacheItemInterface |
23 | 23 | { |
24 | - use TaggableCacheItemTrait; |
|
24 | + use TaggableCacheItemTrait; |
|
25 | 25 | |
26 | - protected function getDriverClass(): string |
|
27 | - { |
|
28 | - return Driver::class; |
|
29 | - } |
|
26 | + protected function getDriverClass(): string |
|
27 | + { |
|
28 | + return Driver::class; |
|
29 | + } |
|
30 | 30 | } |
@@ -21,10 +21,10 @@ |
||
21 | 21 | |
22 | 22 | class Item implements ExtendedCacheItemInterface |
23 | 23 | { |
24 | - use TaggableCacheItemTrait; |
|
24 | + use TaggableCacheItemTrait; |
|
25 | 25 | |
26 | - protected function getDriverClass(): string |
|
27 | - { |
|
28 | - return Driver::class; |
|
29 | - } |
|
26 | + protected function getDriverClass(): string |
|
27 | + { |
|
28 | + return Driver::class; |
|
29 | + } |
|
30 | 30 | } |
@@ -247,14 +247,14 @@ discard block |
||
247 | 247 | $properties["reminderset"] = "PT_BOOLEAN:PSETID_Common:" . PidLidReminderSet; |
248 | 248 | $properties["flag_request"] = "PT_STRING8:PSETID_Common:" . PidLidFlagRequest; |
249 | 249 | $properties["flag_due_by"] = "PT_SYSTIME:PSETID_Common:" . PidLidReminderSignalTime; |
250 | - $properties["updatecounter"] = "PT_LONG:PSETID_Appointment:" . PidLidAppointmentSequence; // AppointmentSequenceNumber |
|
251 | - $properties["last_updatecounter"] = "PT_LONG:PSETID_Appointment:0x8203"; // AppointmentLastSequence |
|
250 | + $properties["updatecounter"] = "PT_LONG:PSETID_Appointment:" . PidLidAppointmentSequence; // AppointmentSequenceNumber |
|
251 | + $properties["last_updatecounter"] = "PT_LONG:PSETID_Appointment:0x8203"; // AppointmentLastSequence |
|
252 | 252 | $properties["busystatus"] = "PT_LONG:PSETID_Appointment:" . PidLidBusyStatus; |
253 | 253 | $properties["intendedbusystatus"] = "PT_LONG:PSETID_Appointment:" . PidLidIntendedBusyStatus; |
254 | 254 | $properties["start"] = "PT_SYSTIME:PSETID_Appointment:" . PidLidAppointmentStartWhole; |
255 | 255 | $properties["responselocation"] = "PT_STRING8:PSETID_Meeting:0x2"; |
256 | 256 | $properties["location"] = "PT_STRING8:PSETID_Appointment:" . PidLidLocation; |
257 | - $properties["requestsent"] = "PT_BOOLEAN:PSETID_Appointment:0x8229"; // PidLidFInvited, MeetingRequestWasSent |
|
257 | + $properties["requestsent"] = "PT_BOOLEAN:PSETID_Appointment:0x8229"; // PidLidFInvited, MeetingRequestWasSent |
|
258 | 258 | $properties["startdate"] = "PT_SYSTIME:PSETID_Appointment:" . PidLidAppointmentStartWhole; |
259 | 259 | $properties["duedate"] = "PT_SYSTIME:PSETID_Appointment:" . PidLidAppointmentEndWhole; |
260 | 260 | $properties["commonstart"] = "PT_SYSTIME:PSETID_Common:0x8516"; |
@@ -262,11 +262,11 @@ discard block |
||
262 | 262 | $properties["recurring"] = "PT_BOOLEAN:PSETID_Appointment:" . PidLidRecurring; |
263 | 263 | $properties["clipstart"] = "PT_SYSTIME:PSETID_Appointment:" . PidLidClipStart; |
264 | 264 | $properties["clipend"] = "PT_SYSTIME:PSETID_Appointment:" . PidLidClipEnd; |
265 | - $properties["start_recur_date"] = "PT_LONG:PSETID_Meeting:0xD"; // StartRecurTime |
|
266 | - $properties["start_recur_time"] = "PT_LONG:PSETID_Meeting:0xE"; // StartRecurTime |
|
267 | - $properties["end_recur_date"] = "PT_LONG:PSETID_Meeting:0xF"; // EndRecurDate |
|
268 | - $properties["end_recur_time"] = "PT_LONG:PSETID_Meeting:0x10"; // EndRecurTime |
|
269 | - $properties["is_exception"] = "PT_BOOLEAN:PSETID_Meeting:0xA"; // LID_IS_EXCEPTION |
|
265 | + $properties["start_recur_date"] = "PT_LONG:PSETID_Meeting:0xD"; // StartRecurTime |
|
266 | + $properties["start_recur_time"] = "PT_LONG:PSETID_Meeting:0xE"; // StartRecurTime |
|
267 | + $properties["end_recur_date"] = "PT_LONG:PSETID_Meeting:0xF"; // EndRecurDate |
|
268 | + $properties["end_recur_time"] = "PT_LONG:PSETID_Meeting:0x10"; // EndRecurTime |
|
269 | + $properties["is_exception"] = "PT_BOOLEAN:PSETID_Meeting:0xA"; // LID_IS_EXCEPTION |
|
270 | 270 | // Propose new time properties |
271 | 271 | $properties["proposed_start_whole"] = "PT_SYSTIME:PSETID_Appointment:" . PidLidAppointmentProposedStartWhole; |
272 | 272 | $properties["proposed_end_whole"] = "PT_SYSTIME:PSETID_Appointment:" . PidLidAppointmentProposedEndWhole; |
@@ -645,7 +645,7 @@ discard block |
||
645 | 645 | $properties = []; |
646 | 646 | $properties["entryid"] = PR_ENTRYID; |
647 | 647 | $properties["parent_entryid"] = PR_PARENT_ENTRYID; |
648 | - $properties["store_entryid"] = PR_STORE_ENTRYID; // is this required ??? |
|
648 | + $properties["store_entryid"] = PR_STORE_ENTRYID; // is this required ??? |
|
649 | 649 | $properties["icon_index"] = PR_ICON_INDEX; |
650 | 650 | $properties["message_class"] = PR_MESSAGE_CLASS; |
651 | 651 | $properties["message_flags"] = PR_MESSAGE_FLAGS; |
@@ -961,9 +961,9 @@ discard block |
||
961 | 961 | $properties["appointment_location"] = "PT_STRING8:PSETID_Appointment:" . PidLidLocation; |
962 | 962 | $properties["appointment_recurring_pattern"] = "PT_STRING8:PSETID_Appointment:0x8232"; |
963 | 963 | $properties["appointment_recurring"] = "PT_BOOLEAN:PSETID_Appointment:" . PidLidRecurring; |
964 | - $properties["appointment_startdate_recurring"] = "PT_SYSTIME:PSETID_Appointment:" . PidLidClipStart; // ClipStart |
|
965 | - $properties["appointment_enddate_recurring"] = "PT_SYSTIME:PSETID_Appointment:" . PidLidClipEnd; // ClipEnd |
|
966 | - $properties["appointment_exception"] = "PT_BOOLEAN:PSETID_Meeting:0xA"; // LID_IS_EXCEPTION |
|
964 | + $properties["appointment_startdate_recurring"] = "PT_SYSTIME:PSETID_Appointment:" . PidLidClipStart; // ClipStart |
|
965 | + $properties["appointment_enddate_recurring"] = "PT_SYSTIME:PSETID_Appointment:" . PidLidClipEnd; // ClipEnd |
|
966 | + $properties["appointment_exception"] = "PT_BOOLEAN:PSETID_Meeting:0xA"; // LID_IS_EXCEPTION |
|
967 | 967 | $properties["appointment_location"] = "PT_STRING8:PSETID_Appointment:" . PidLidLocation; |
968 | 968 | // Propose new time properties |
969 | 969 | $properties["proposed_start_date"] = "PT_SYSTIME:PSETID_Appointment:" . PidLidAppointmentProposedStartWhole; |
@@ -1250,18 +1250,18 @@ discard block |
||
1250 | 1250 | $properties["object_type"] = PR_OBJECT_TYPE; |
1251 | 1251 | |
1252 | 1252 | $properties["recurring"] = "PT_BOOLEAN:PSETID_Appointment:" . PidLidRecurring; |
1253 | - $properties["reminder"] = "PT_BOOLEAN:PSETID_Common:" . PidLidReminderSet; // PidLidReminderSet |
|
1254 | - $properties["reminder_minutes"] = "PT_LONG:PSETID_Common:" . PidLidReminderDelta; // PidLidReminderDelta |
|
1255 | - $properties["reminder_time"] = "PT_SYSTIME:PSETID_Common:" . PidLidReminderTime; // PidLidReminderTime |
|
1256 | - $properties["flagdueby"] = "PT_SYSTIME:PSETID_Common:" . PidLidReminderSignalTime; // PidLidReminderSignalTime |
|
1257 | - |
|
1258 | - $properties["task_duedate"] = "PT_SYSTIME:PSETID_Task:" . PidLidTaskDueDate; // PidLidTaskDueDate |
|
1259 | - $properties["task_startdate"] = "PT_SYSTIME:PSETID_Task:" . PidLidTaskStartDate; // PidLidTaskStartDate |
|
1260 | - $properties["task_resetreminder"] = "PT_BOOLEAN:PSETID_Task:0x8107"; // PidLidTaskResetReminder |
|
1261 | - $properties["task_recurring"] = "PT_BOOLEAN:PSETID_Task:0x8126"; // PidLidTaskFRecurring |
|
1253 | + $properties["reminder"] = "PT_BOOLEAN:PSETID_Common:" . PidLidReminderSet; // PidLidReminderSet |
|
1254 | + $properties["reminder_minutes"] = "PT_LONG:PSETID_Common:" . PidLidReminderDelta; // PidLidReminderDelta |
|
1255 | + $properties["reminder_time"] = "PT_SYSTIME:PSETID_Common:" . PidLidReminderTime; // PidLidReminderTime |
|
1256 | + $properties["flagdueby"] = "PT_SYSTIME:PSETID_Common:" . PidLidReminderSignalTime; // PidLidReminderSignalTime |
|
1257 | + |
|
1258 | + $properties["task_duedate"] = "PT_SYSTIME:PSETID_Task:" . PidLidTaskDueDate; // PidLidTaskDueDate |
|
1259 | + $properties["task_startdate"] = "PT_SYSTIME:PSETID_Task:" . PidLidTaskStartDate; // PidLidTaskStartDate |
|
1260 | + $properties["task_resetreminder"] = "PT_BOOLEAN:PSETID_Task:0x8107"; // PidLidTaskResetReminder |
|
1261 | + $properties["task_recurring"] = "PT_BOOLEAN:PSETID_Task:0x8126"; // PidLidTaskFRecurring |
|
1262 | 1262 | $properties["taskmode"] = "PT_LONG:PSETID_Common:0x8518"; |
1263 | 1263 | |
1264 | - $properties["appointment_recurring"] = "PT_BOOLEAN:PSETID_Appointment:" . PidLidRecurring; // PidLidRecurring |
|
1264 | + $properties["appointment_recurring"] = "PT_BOOLEAN:PSETID_Appointment:" . PidLidRecurring; // PidLidRecurring |
|
1265 | 1265 | $properties["appointment_startdate"] = "PT_SYSTIME:PSETID_Appointment:" . PidLidAppointmentStartWhole; |
1266 | 1266 | $properties["appointment_enddate"] = "PT_SYSTIME:PSETID_Appointment:" . PidLidAppointmentEndWhole; |
1267 | 1267 | $properties["appointment_startdate_recurring"] = "PT_SYSTIME:PSETID_Appointment:" . PidLidClipStart; |
@@ -50,240 +50,240 @@ |
||
50 | 50 | $entryid = $this->getActionEntryID($action); |
51 | 51 | |
52 | 52 | switch ($actionType) { |
53 | - case "open": |
|
54 | - $this->open($store, $entryid, $action); |
|
55 | - break; |
|
53 | + case "open": |
|
54 | + $this->open($store, $entryid, $action); |
|
55 | + break; |
|
56 | 56 | |
57 | - case "save": |
|
58 | - if (!$store || !$parententryid) { |
|
59 | - /* |
|
57 | + case "save": |
|
58 | + if (!$store || !$parententryid) { |
|
59 | + /* |
|
60 | 60 | * if parententryid or storeentryid is not passed then we can take a guess that |
61 | 61 | * it would be a save operation but instead of depending on server to get default |
62 | 62 | * parent and store client should always send parententryid and storeentryid |
63 | 63 | * |
64 | 64 | * we can also assume that user has permission to right in his own store |
65 | 65 | */ |
66 | - $this->save($store, $parententryid, $entryid, $action); |
|
67 | - break; |
|
68 | - } |
|
69 | - /* |
|
66 | + $this->save($store, $parententryid, $entryid, $action); |
|
67 | + break; |
|
68 | + } |
|
69 | + /* |
|
70 | 70 | * The "message_action" object has been set, check the action_type field for |
71 | 71 | * the exact action which must be taken. |
72 | 72 | * Supported actions: |
73 | 73 | * - acceptmeetingrequest: attendee has accepted mr |
74 | 74 | * - declineMeetingRequest: attendee has declined mr |
75 | 75 | */ |
76 | - if (!isset($action["message_action"], $action["message_action"]["action_type"])) { |
|
77 | - $this->save($store, $parententryid, $entryid, $action); |
|
78 | - break; |
|
79 | - } |
|
80 | - switch ($action["message_action"]["action_type"]) { |
|
81 | - case "declineMeetingRequest": |
|
82 | - case "acceptMeetingRequest": |
|
83 | - $message = $GLOBALS["operations"]->openMessage($store, $entryid); |
|
84 | - $basedate = (isset($action['basedate']) ? $action['basedate'] : false); |
|
85 | - $delete = false; |
|
86 | - |
|
87 | - if ($basedate) { |
|
88 | - $recurrence = new Recurrence($store, $message); |
|
89 | - $exceptionatt = $recurrence->getExceptionAttachment($basedate); |
|
90 | - if ($exceptionatt) { |
|
91 | - // get properties of existing exception. |
|
92 | - $exceptionattProps = mapi_getprops($exceptionatt, [PR_ATTACH_NUM]); |
|
93 | - $attach_num = $exceptionattProps[PR_ATTACH_NUM]; |
|
94 | - } |
|
76 | + if (!isset($action["message_action"], $action["message_action"]["action_type"])) { |
|
77 | + $this->save($store, $parententryid, $entryid, $action); |
|
78 | + break; |
|
95 | 79 | } |
80 | + switch ($action["message_action"]["action_type"]) { |
|
81 | + case "declineMeetingRequest": |
|
82 | + case "acceptMeetingRequest": |
|
83 | + $message = $GLOBALS["operations"]->openMessage($store, $entryid); |
|
84 | + $basedate = (isset($action['basedate']) ? $action['basedate'] : false); |
|
85 | + $delete = false; |
|
86 | + |
|
87 | + if ($basedate) { |
|
88 | + $recurrence = new Recurrence($store, $message); |
|
89 | + $exceptionatt = $recurrence->getExceptionAttachment($basedate); |
|
90 | + if ($exceptionatt) { |
|
91 | + // get properties of existing exception. |
|
92 | + $exceptionattProps = mapi_getprops($exceptionatt, [PR_ATTACH_NUM]); |
|
93 | + $attach_num = $exceptionattProps[PR_ATTACH_NUM]; |
|
94 | + } |
|
95 | + } |
|
96 | 96 | |
97 | - /** |
|
97 | + /** |
|
98 | 98 | * Get message class from original message. This can be changed to |
99 | 99 | * IPM.Appointment if the item is a Meeting Request in the maillist. |
100 | 100 | * After Accepting/Declining the message is moved and changed. |
101 | 101 | */ |
102 | - $originalMessageProps = mapi_getprops($message, [PR_MESSAGE_CLASS]); |
|
103 | - $req = new Meetingrequest($store, $message, $GLOBALS["mapisession"]->getSession(), $this->directBookingMeetingRequest); |
|
102 | + $originalMessageProps = mapi_getprops($message, [PR_MESSAGE_CLASS]); |
|
103 | + $req = new Meetingrequest($store, $message, $GLOBALS["mapisession"]->getSession(), $this->directBookingMeetingRequest); |
|
104 | 104 | |
105 | - // Update extra body information |
|
106 | - if (isset($action["message_action"]['meetingTimeInfo']) && !empty($action["message_action"]['meetingTimeInfo'])) { |
|
107 | - $req->setMeetingTimeInfo($action["message_action"]['meetingTimeInfo']); |
|
108 | - unset($action["message_action"]['meetingTimeInfo']); |
|
109 | - } |
|
105 | + // Update extra body information |
|
106 | + if (isset($action["message_action"]['meetingTimeInfo']) && !empty($action["message_action"]['meetingTimeInfo'])) { |
|
107 | + $req->setMeetingTimeInfo($action["message_action"]['meetingTimeInfo']); |
|
108 | + unset($action["message_action"]['meetingTimeInfo']); |
|
109 | + } |
|
110 | 110 | |
111 | - // sendResponse flag if it is set then send the mail response to the organzer. |
|
112 | - $sendResponse = true; |
|
113 | - if (isset($action["message_action"]["sendResponse"]) && $action["message_action"]["sendResponse"] == false) { |
|
114 | - $sendResponse = false; |
|
115 | - } |
|
111 | + // sendResponse flag if it is set then send the mail response to the organzer. |
|
112 | + $sendResponse = true; |
|
113 | + if (isset($action["message_action"]["sendResponse"]) && $action["message_action"]["sendResponse"] == false) { |
|
114 | + $sendResponse = false; |
|
115 | + } |
|
116 | 116 | |
117 | - // @FIXME: fix body |
|
118 | - $body = false; |
|
119 | - if (isset($action["props"]["isHTML"]) && $action["props"]["isHTML"] === true) { |
|
120 | - $body = isset($action["props"]["html_body"]) ? $action["props"]["html_body"] : false; |
|
121 | - } |
|
122 | - else { |
|
123 | - $body = isset($action["props"]["body"]) ? $action["props"]["body"] : false; |
|
124 | - } |
|
117 | + // @FIXME: fix body |
|
118 | + $body = false; |
|
119 | + if (isset($action["props"]["isHTML"]) && $action["props"]["isHTML"] === true) { |
|
120 | + $body = isset($action["props"]["html_body"]) ? $action["props"]["html_body"] : false; |
|
121 | + } |
|
122 | + else { |
|
123 | + $body = isset($action["props"]["body"]) ? $action["props"]["body"] : false; |
|
124 | + } |
|
125 | 125 | |
126 | - if ($action["message_action"]["action_type"] == "acceptMeetingRequest") { |
|
127 | - $tentative = $action["message_action"]["responseType"] === olResponseTentative; |
|
128 | - $newProposedStartTime = isset($action["message_action"]["proposed_starttime"]) ? $action["message_action"]["proposed_starttime"] : false; |
|
129 | - $newProposedEndTime = isset($action["message_action"]["proposed_endtime"]) ? $action["message_action"]["proposed_endtime"] : false; |
|
126 | + if ($action["message_action"]["action_type"] == "acceptMeetingRequest") { |
|
127 | + $tentative = $action["message_action"]["responseType"] === olResponseTentative; |
|
128 | + $newProposedStartTime = isset($action["message_action"]["proposed_starttime"]) ? $action["message_action"]["proposed_starttime"] : false; |
|
129 | + $newProposedEndTime = isset($action["message_action"]["proposed_endtime"]) ? $action["message_action"]["proposed_endtime"] : false; |
|
130 | 130 | |
131 | - // We are accepting MR from preview-read-mail so set delete the actual mail flag. |
|
132 | - $delete = $req->isMeetingRequest($originalMessageProps[PR_MESSAGE_CLASS]); |
|
131 | + // We are accepting MR from preview-read-mail so set delete the actual mail flag. |
|
132 | + $delete = $req->isMeetingRequest($originalMessageProps[PR_MESSAGE_CLASS]); |
|
133 | 133 | |
134 | - $req->doAccept($tentative, $sendResponse, $delete, $newProposedStartTime, $newProposedEndTime, $body, true, $store, $basedate); |
|
135 | - } |
|
136 | - else { |
|
137 | - $delete = $req->doDecline($sendResponse, $basedate, $body); |
|
138 | - } |
|
134 | + $req->doAccept($tentative, $sendResponse, $delete, $newProposedStartTime, $newProposedEndTime, $body, true, $store, $basedate); |
|
135 | + } |
|
136 | + else { |
|
137 | + $delete = $req->doDecline($sendResponse, $basedate, $body); |
|
138 | + } |
|
139 | 139 | |
140 | - /** |
|
140 | + /** |
|
141 | 141 | * Now if the item is the Meeting Request that was sent to the attendee |
142 | 142 | * it is removed when the user has clicked on Accept/Decline. If the |
143 | 143 | * item is the appointment in the calendar it will not be moved. To only |
144 | 144 | * notify the bus when the item is a Meeting Request we are going to |
145 | 145 | * check the PR_MESSAGE_CLASS and see if it is "IPM.Meeting*". |
146 | 146 | */ |
147 | - $messageProps = mapi_getprops($message, [PR_ENTRYID, PR_STORE_ENTRYID, PR_PARENT_ENTRYID]); |
|
147 | + $messageProps = mapi_getprops($message, [PR_ENTRYID, PR_STORE_ENTRYID, PR_PARENT_ENTRYID]); |
|
148 | 148 | |
149 | - // if opened appointment is exception then it will add |
|
150 | - // the attach_num and basedate in messageProps. |
|
151 | - if (isset($attach_num)) { |
|
152 | - $messageProps[PR_ATTACH_NUM] = [$attach_num]; |
|
153 | - $messageProps[$properties["basedate"]] = $basedate; |
|
154 | - } |
|
149 | + // if opened appointment is exception then it will add |
|
150 | + // the attach_num and basedate in messageProps. |
|
151 | + if (isset($attach_num)) { |
|
152 | + $messageProps[PR_ATTACH_NUM] = [$attach_num]; |
|
153 | + $messageProps[$properties["basedate"]] = $basedate; |
|
154 | + } |
|
155 | 155 | |
156 | - if ($delete) { |
|
157 | - // send TABLE_DELETE event because the message has moved |
|
158 | - $this->sendFeedback(true); |
|
159 | - $GLOBALS["bus"]->notify(bin2hex($messageProps[PR_PARENT_ENTRYID]), TABLE_DELETE, $messageProps); |
|
160 | - } |
|
161 | - else { |
|
162 | - $this->addActionData("update", ["item" => Conversion::mapMAPI2XML($this->properties, $messageProps)]); |
|
163 | - $GLOBALS["bus"]->addData($this->getResponseData()); |
|
156 | + if ($delete) { |
|
157 | + // send TABLE_DELETE event because the message has moved |
|
158 | + $this->sendFeedback(true); |
|
159 | + $GLOBALS["bus"]->notify(bin2hex($messageProps[PR_PARENT_ENTRYID]), TABLE_DELETE, $messageProps); |
|
160 | + } |
|
161 | + else { |
|
162 | + $this->addActionData("update", ["item" => Conversion::mapMAPI2XML($this->properties, $messageProps)]); |
|
163 | + $GLOBALS["bus"]->addData($this->getResponseData()); |
|
164 | 164 | |
165 | - // send TABLE_SAVE event because an occurrence is deleted |
|
166 | - $GLOBALS["bus"]->notify(bin2hex($messageProps[PR_PARENT_ENTRYID]), TABLE_SAVE, $messageProps); |
|
167 | - } |
|
165 | + // send TABLE_SAVE event because an occurrence is deleted |
|
166 | + $GLOBALS["bus"]->notify(bin2hex($messageProps[PR_PARENT_ENTRYID]), TABLE_SAVE, $messageProps); |
|
167 | + } |
|
168 | 168 | |
169 | - break; |
|
169 | + break; |
|
170 | 170 | |
171 | - case "acceptTaskRequest": |
|
172 | - case "declineTaskRequest": |
|
173 | - $message = $GLOBALS["operations"]->openMessage($store, $entryid); |
|
171 | + case "acceptTaskRequest": |
|
172 | + case "declineTaskRequest": |
|
173 | + $message = $GLOBALS["operations"]->openMessage($store, $entryid); |
|
174 | 174 | |
175 | - if (isset($action["props"]) && !empty($action["props"])) { |
|
176 | - $properties = $GLOBALS["properties"]->getTaskProperties(); |
|
177 | - mapi_setprops($message, Conversion::mapXML2MAPI($properties, $action["props"])); |
|
178 | - mapi_savechanges($message); |
|
179 | - } |
|
180 | - // The task may be a delegated task, do an update if needed (will fail for non-delegated tasks) |
|
181 | - $tr = new TaskRequest($store, $message, $GLOBALS["mapisession"]->getSession()); |
|
182 | - $isAccept = $action["message_action"]["action_type"] == "acceptTaskRequest"; |
|
183 | - if (isset($action["message_action"]["task_comments_info"]) && !empty($action["message_action"]["task_comments_info"])) { |
|
184 | - $tr->setTaskCommentsInfo($action["message_action"]["task_comments_info"]); |
|
185 | - } |
|
186 | - if ($isAccept) { |
|
187 | - $result = $tr->doAccept(); |
|
188 | - } |
|
189 | - else { |
|
190 | - $result = $tr->doDecline(); |
|
191 | - } |
|
175 | + if (isset($action["props"]) && !empty($action["props"])) { |
|
176 | + $properties = $GLOBALS["properties"]->getTaskProperties(); |
|
177 | + mapi_setprops($message, Conversion::mapXML2MAPI($properties, $action["props"])); |
|
178 | + mapi_savechanges($message); |
|
179 | + } |
|
180 | + // The task may be a delegated task, do an update if needed (will fail for non-delegated tasks) |
|
181 | + $tr = new TaskRequest($store, $message, $GLOBALS["mapisession"]->getSession()); |
|
182 | + $isAccept = $action["message_action"]["action_type"] == "acceptTaskRequest"; |
|
183 | + if (isset($action["message_action"]["task_comments_info"]) && !empty($action["message_action"]["task_comments_info"])) { |
|
184 | + $tr->setTaskCommentsInfo($action["message_action"]["task_comments_info"]); |
|
185 | + } |
|
186 | + if ($isAccept) { |
|
187 | + $result = $tr->doAccept(); |
|
188 | + } |
|
189 | + else { |
|
190 | + $result = $tr->doDecline(); |
|
191 | + } |
|
192 | 192 | |
193 | - $this->sendFeedback(true); |
|
194 | - if ($result !== false) { |
|
195 | - $GLOBALS["bus"]->notify(bin2hex($result[PR_PARENT_ENTRYID]), TABLE_DELETE, $result); |
|
196 | - } |
|
193 | + $this->sendFeedback(true); |
|
194 | + if ($result !== false) { |
|
195 | + $GLOBALS["bus"]->notify(bin2hex($result[PR_PARENT_ENTRYID]), TABLE_DELETE, $result); |
|
196 | + } |
|
197 | 197 | |
198 | - $props = mapi_getprops($message, [PR_ENTRYID, PR_STORE_ENTRYID, PR_PARENT_ENTRYID]); |
|
199 | - if (!$tr->isTaskRequest()) { |
|
200 | - unset($props[PR_MESSAGE_CLASS]); |
|
201 | - $GLOBALS["bus"]->notify(bin2hex($props[PR_PARENT_ENTRYID]), $isAccept ? TABLE_SAVE : TABLE_DELETE, $props); |
|
198 | + $props = mapi_getprops($message, [PR_ENTRYID, PR_STORE_ENTRYID, PR_PARENT_ENTRYID]); |
|
199 | + if (!$tr->isTaskRequest()) { |
|
200 | + unset($props[PR_MESSAGE_CLASS]); |
|
201 | + $GLOBALS["bus"]->notify(bin2hex($props[PR_PARENT_ENTRYID]), $isAccept ? TABLE_SAVE : TABLE_DELETE, $props); |
|
202 | + } |
|
203 | + break; |
|
204 | + |
|
205 | + case "copy": |
|
206 | + case "move": |
|
207 | + $this->copy($store, $parententryid, $entryid, $action); |
|
208 | + break; |
|
209 | + |
|
210 | + case "reply": |
|
211 | + case "replyall": |
|
212 | + case "forward": |
|
213 | + default: |
|
214 | + $this->save($store, $parententryid, $entryid, $action); |
|
202 | 215 | } |
203 | - break; |
|
204 | - |
|
205 | - case "copy": |
|
206 | - case "move": |
|
207 | - $this->copy($store, $parententryid, $entryid, $action); |
|
208 | - break; |
|
209 | - |
|
210 | - case "reply": |
|
211 | - case "replyall": |
|
212 | - case "forward": |
|
213 | - default: |
|
214 | - $this->save($store, $parententryid, $entryid, $action); |
|
215 | - } |
|
216 | 216 | break; |
217 | 217 | |
218 | - case "delete": |
|
219 | - $subActionType = false; |
|
220 | - if (isset($action["message_action"], $action["message_action"]["action_type"])) { |
|
221 | - $subActionType = $action["message_action"]["action_type"]; |
|
222 | - } |
|
218 | + case "delete": |
|
219 | + $subActionType = false; |
|
220 | + if (isset($action["message_action"], $action["message_action"]["action_type"])) { |
|
221 | + $subActionType = $action["message_action"]["action_type"]; |
|
222 | + } |
|
223 | 223 | |
224 | - /* |
|
224 | + /* |
|
225 | 225 | * The "message_action" object has been set, check the action_type field for |
226 | 226 | * the exact action which must be taken. |
227 | 227 | * Supported actions: |
228 | 228 | * - cancelInvitation: organizer cancels already scheduled meeting |
229 | 229 | * - removeFromCalendar: attendee receives meeting cancellation and wants to remove item from calendar |
230 | 230 | */ |
231 | - switch ($subActionType) { |
|
232 | - case "removeFromCalendar": |
|
233 | - $basedate = (isset($action['basedate']) && !empty($action['basedate'])) ? $action['basedate'] : false; |
|
234 | - |
|
235 | - $this->removeFromCalendar($store, $entryid, $basedate, $this->directBookingMeetingRequest); |
|
236 | - $this->sendFeedback(true); |
|
237 | - break; |
|
238 | - |
|
239 | - case "cancelInvitation": |
|
240 | - $this->cancelInvitation($store, $entryid, $action, $this->directBookingMeetingRequest); |
|
241 | - $this->sendFeedback(true); |
|
242 | - break; |
|
243 | - |
|
244 | - case "declineMeeting": |
|
245 | - // @FIXME can we somehow merge declineMeeting and declineMeetingRequest sub actions? |
|
246 | - $message = $GLOBALS["operations"]->openMessage($store, $entryid); |
|
247 | - $basedate = (isset($action['basedate']) && !empty($action['basedate'])) ? $action['basedate'] : false; |
|
248 | - |
|
249 | - $req = new Meetingrequest($store, $message, $GLOBALS["mapisession"]->getSession(), $this->directBookingMeetingRequest); |
|
250 | - |
|
251 | - // @FIXME: may be we can remove this body check any get it while declining meeting 'body' |
|
252 | - $body = false; |
|
253 | - if (isset($action["props"]["isHTML"]) && $action["props"]["isHTML"] === true) { |
|
254 | - $body = isset($action["props"]["html_body"]) ? $action["props"]["html_body"] : false; |
|
255 | - } |
|
256 | - else { |
|
257 | - $body = isset($action["props"]["body"]) ? $action["props"]["body"] : false; |
|
258 | - } |
|
259 | - $req->doDecline(true, $basedate, $body); |
|
231 | + switch ($subActionType) { |
|
232 | + case "removeFromCalendar": |
|
233 | + $basedate = (isset($action['basedate']) && !empty($action['basedate'])) ? $action['basedate'] : false; |
|
234 | + |
|
235 | + $this->removeFromCalendar($store, $entryid, $basedate, $this->directBookingMeetingRequest); |
|
236 | + $this->sendFeedback(true); |
|
237 | + break; |
|
238 | + |
|
239 | + case "cancelInvitation": |
|
240 | + $this->cancelInvitation($store, $entryid, $action, $this->directBookingMeetingRequest); |
|
241 | + $this->sendFeedback(true); |
|
242 | + break; |
|
243 | + |
|
244 | + case "declineMeeting": |
|
245 | + // @FIXME can we somehow merge declineMeeting and declineMeetingRequest sub actions? |
|
246 | + $message = $GLOBALS["operations"]->openMessage($store, $entryid); |
|
247 | + $basedate = (isset($action['basedate']) && !empty($action['basedate'])) ? $action['basedate'] : false; |
|
248 | + |
|
249 | + $req = new Meetingrequest($store, $message, $GLOBALS["mapisession"]->getSession(), $this->directBookingMeetingRequest); |
|
250 | + |
|
251 | + // @FIXME: may be we can remove this body check any get it while declining meeting 'body' |
|
252 | + $body = false; |
|
253 | + if (isset($action["props"]["isHTML"]) && $action["props"]["isHTML"] === true) { |
|
254 | + $body = isset($action["props"]["html_body"]) ? $action["props"]["html_body"] : false; |
|
255 | + } |
|
256 | + else { |
|
257 | + $body = isset($action["props"]["body"]) ? $action["props"]["body"] : false; |
|
258 | + } |
|
259 | + $req->doDecline(true, $basedate, $body); |
|
260 | 260 | |
261 | - $messageProps = mapi_getprops($message, [PR_ENTRYID, PR_STORE_ENTRYID, PR_PARENT_ENTRYID]); |
|
262 | - $GLOBALS["bus"]->notify(bin2hex($messageProps[PR_PARENT_ENTRYID]), $basedate ? TABLE_SAVE : TABLE_DELETE, $messageProps); |
|
261 | + $messageProps = mapi_getprops($message, [PR_ENTRYID, PR_STORE_ENTRYID, PR_PARENT_ENTRYID]); |
|
262 | + $GLOBALS["bus"]->notify(bin2hex($messageProps[PR_PARENT_ENTRYID]), $basedate ? TABLE_SAVE : TABLE_DELETE, $messageProps); |
|
263 | 263 | |
264 | - break; |
|
264 | + break; |
|
265 | 265 | |
266 | - case "snooze": |
|
267 | - case "dismiss": |
|
268 | - $this->delete($store, $parententryid, $entryid, $action); |
|
269 | - break; |
|
266 | + case "snooze": |
|
267 | + case "dismiss": |
|
268 | + $this->delete($store, $parententryid, $entryid, $action); |
|
269 | + break; |
|
270 | 270 | |
271 | - default: |
|
272 | - // Deleting an occurrence means that we have to save the message to |
|
273 | - // generate an exception. So when the basedate is provided, we actually |
|
274 | - // perform a save rather then delete. |
|
275 | - if (isset($action['basedate']) && !empty($action['basedate'])) { |
|
276 | - $this->save($store, $parententryid, $entryid, $action, "delete"); |
|
277 | - } |
|
278 | - else { |
|
279 | - $this->delete($store, $parententryid, $entryid, $action); |
|
271 | + default: |
|
272 | + // Deleting an occurrence means that we have to save the message to |
|
273 | + // generate an exception. So when the basedate is provided, we actually |
|
274 | + // perform a save rather then delete. |
|
275 | + if (isset($action['basedate']) && !empty($action['basedate'])) { |
|
276 | + $this->save($store, $parententryid, $entryid, $action, "delete"); |
|
277 | + } |
|
278 | + else { |
|
279 | + $this->delete($store, $parententryid, $entryid, $action); |
|
280 | + } |
|
281 | + break; |
|
280 | 282 | } |
281 | - break; |
|
282 | - } |
|
283 | 283 | break; |
284 | 284 | |
285 | - default: |
|
286 | - $this->handleUnknownActionType($actionType); |
|
285 | + default: |
|
286 | + $this->handleUnknownActionType($actionType); |
|
287 | 287 | } |
288 | 288 | } |
289 | 289 | catch (MAPIException $e) { |
@@ -42,8 +42,9 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public function execute() { |
44 | 44 | foreach ($this->data as $actionType => $action) { |
45 | - if (!isset($actionType)) |
|
46 | - continue; |
|
45 | + if (!isset($actionType)) { |
|
46 | + continue; |
|
47 | + } |
|
47 | 48 | try { |
48 | 49 | $store = $this->getActionStore($action); |
49 | 50 | $parententryid = $this->getActionParentEntryID($action); |
@@ -644,8 +645,9 @@ discard block |
||
644 | 645 | * @return bool true on success or false on failure |
645 | 646 | */ |
646 | 647 | public function delete($store, $parententryid, $entryid, $action) { |
647 | - if (!$store || !$parententryid || !$entryid) |
|
648 | - return; |
|
648 | + if (!$store || !$parententryid || !$entryid) { |
|
649 | + return; |
|
650 | + } |
|
649 | 651 | $props = []; |
650 | 652 | $props[PR_PARENT_ENTRYID] = $parententryid; |
651 | 653 | $props[PR_ENTRYID] = $entryid; |