Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
06b69b18 | 4 | | CiviCRM version 4.5 | |
6a488035 TO |
5 | +--------------------------------------------------------------------+ |
6 | | Copyright (C) 2011 Marty Wright | | |
7 | | Licensed to CiviCRM under the Academic Free License version 3.0. | | |
8 | +--------------------------------------------------------------------+ | |
9 | | This file is a part of CiviCRM. | | |
10 | | | | |
11 | | CiviCRM is free software; you can copy, modify, and distribute it | | |
12 | | under the terms of the GNU Affero General Public License | | |
13 | | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | | |
14 | | | | |
15 | | CiviCRM is distributed in the hope that it will be useful, but | | |
16 | | WITHOUT ANY WARRANTY; without even the implied warranty of | | |
17 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | | |
18 | | See the GNU Affero General Public License for more details. | | |
19 | | | | |
20 | | You should have received a copy of the GNU Affero General Public | | |
21 | | License and the CiviCRM Licensing Exception along | | |
22 | | with this program; if not, contact CiviCRM LLC | | |
23 | | at info[AT]civicrm[DOT]org. If you have questions about the | | |
24 | | GNU Affero General Public License or the licensing of CiviCRM, | | |
25 | | see the CiviCRM license FAQ at http://civicrm.org/licensing | | |
26 | +--------------------------------------------------------------------+ | |
27 | */ | |
28 | ||
29 | /** | |
30 | * | |
31 | * @package CRM | |
06b69b18 | 32 | * @copyright CiviCRM LLC (c) 2004-2014 |
6a488035 TO |
33 | * $Id$ |
34 | * | |
35 | */ | |
36 | ||
37 | /** | |
38 | * This class generates form components for Scheduling Reminders | |
39 | * | |
40 | */ | |
41 | class CRM_Admin_Form_ScheduleReminders extends CRM_Admin_Form { | |
42 | ||
43 | /** | |
44 | * Scheduled Reminder ID | |
45 | */ | |
46 | protected $_id = NULL; | |
47 | ||
48 | public $_freqUnits; | |
49 | ||
50 | /** | |
51 | * Function to build the form | |
52 | * | |
355ba699 | 53 | * @return void |
6a488035 TO |
54 | * @access public |
55 | */ | |
56 | public function buildQuickForm() { | |
57 | parent::buildQuickForm(); | |
58 | $this->_mappingID = $mappingID = NULL; | |
a3e3eea1 | 59 | $providersCount = CRM_SMS_BAO_Provider::activeProviderCount(); |
6a488035 TO |
60 | |
61 | if ($this->_action & (CRM_Core_Action::DELETE)) { | |
62 | $reminderName = | |
63 | CRM_Core_DAO::getFieldValue('CRM_Core_DAO_ActionSchedule', $this->_id, 'title'); | |
64 | $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this); | |
65 | if ($this->_context == 'event') { | |
66 | $this->_eventId = CRM_Utils_Request::retrieve('eventId', 'Integer', $this); | |
67 | } | |
68 | $this->assign('reminderName', $reminderName); | |
69 | return; | |
70 | } | |
71 | elseif ($this->_action & (CRM_Core_Action::UPDATE)) { | |
72 | $this->_mappingID = | |
73 | CRM_Core_DAO::getFieldValue('CRM_Core_DAO_ActionSchedule', $this->_id, 'mapping_id'); | |
74 | $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this); | |
75 | if ($this->_context == 'event') { | |
76 | $this->_eventId = CRM_Utils_Request::retrieve('eventId', 'Integer', $this); | |
77 | } | |
78 | } | |
79 | ||
8cc574cf | 80 | if (!empty($_POST) && !empty($_POST['entity'])) { |
6a488035 TO |
81 | $mappingID = $_POST['entity'][0]; |
82 | } | |
83 | elseif ($this->_mappingID) { | |
84 | $mappingID = $this->_mappingID; | |
85 | } | |
86 | ||
87 | $this->add( | |
88 | 'text', | |
89 | 'title', | |
90 | ts('Title'), | |
91 | array('size' => 45, 'maxlength' => 128), | |
92 | TRUE | |
93 | ); | |
94 | ||
95 | $selectionOptions = CRM_Core_BAO_ActionSchedule::getSelection($mappingID); | |
96 | extract($selectionOptions); | |
97 | ||
98 | if (empty($sel1)) { | |
99 | CRM_Core_Error::fatal('Could not find mapping for scheduled reminders.'); | |
100 | } | |
101 | $this->assign('entityMapping', json_encode($entityMapping)); | |
102 | $this->assign('recipientMapping', json_encode($recipientMapping)); | |
103 | ||
3e315abc | 104 | $sel = & $this->add( |
6a488035 TO |
105 | 'hierselect', |
106 | 'entity', | |
107 | ts('Entity'), | |
108 | array( | |
109 | 'name' => 'entity[0]', | |
110 | 'style' => 'vertical-align: top;', | |
111 | ), | |
112 | TRUE | |
113 | ); | |
114 | $sel->setOptions(array($sel1, $sel2, $sel3)); | |
115 | ||
116 | if (is_a($sel->_elements[1], 'HTML_QuickForm_select')) { | |
117 | // make second selector a multi-select - | |
118 | $sel->_elements[1]->setMultiple(TRUE); | |
119 | $sel->_elements[1]->setSize(5); | |
120 | } | |
121 | ||
122 | if (is_a($sel->_elements[2], 'HTML_QuickForm_select')) { | |
123 | // make third selector a multi-select - | |
124 | $sel->_elements[2]->setMultiple(TRUE); | |
125 | $sel->_elements[2]->setSize(5); | |
126 | } | |
127 | ||
128 | //get the frequency units. | |
9775f926 | 129 | $this->_freqUnits = CRM_Core_SelectValues::getScheduleReminderFrequencyUnits(); |
6a488035 TO |
130 | |
131 | //pass the mapping ID in UPDATE mode | |
132 | $mappings = CRM_Core_BAO_ActionSchedule::getMapping($mappingID); | |
133 | ||
134 | $numericOptions = CRM_Core_SelectValues::getNumericOptions(0, 30); | |
135 | ||
136 | //reminder_interval | |
137 | $this->add('select', 'start_action_offset', ts('When'), $numericOptions); | |
a3e3eea1 | 138 | $title = ts('Email'); |
139 | $isActive = ts('Send email'); | |
140 | $recordActivity = ts('Record activity for automated email'); | |
141 | if ($providersCount) { | |
142 | $title = ts('Email or SMS'); | |
143 | $isActive = ts('Send email or SMS'); | |
144 | $recordActivity = ts('Record activity for automated email or SMS'); | |
145 | $options = CRM_Core_OptionGroup::values('msg_mode'); | |
146 | $this->add('select', 'mode', ts('Send as'), $options); | |
147 | ||
148 | $providers = CRM_SMS_BAO_Provider::getProviders(NULL, NULL, TRUE, 'is_default desc'); | |
149 | ||
150 | $providerSelect = array(); | |
151 | foreach ($providers as $provider) { | |
152 | $providerSelect[$provider['id']] = $provider['title']; | |
153 | } | |
154 | $this->add('select', 'sms_provider_id', ts('From'), $providerSelect, TRUE); | |
155 | } | |
6a488035 | 156 | |
a3e3eea1 | 157 | $this->assign('title', $title); |
6a488035 TO |
158 | foreach ($this->_freqUnits as $val => $label) { |
159 | $freqUnitsDisplay[$val] = ts('%1(s)', array(1 => $label)); | |
160 | } | |
161 | ||
162 | $this->addDate('absolute_date', ts('Start Date'), FALSE, array('formatType' => 'mailing')); | |
163 | ||
164 | //reminder_frequency | |
165 | $this->add('select', 'start_action_unit', ts('Frequency'), $freqUnitsDisplay, TRUE); | |
166 | ||
167 | $condition = array('before' => ts('before'), | |
168 | 'after' => ts('after'), | |
169 | ); | |
170 | //reminder_action | |
171 | $this->add('select', 'start_action_condition', ts('Action Condition'), $condition); | |
172 | ||
173 | $this->add('select', 'start_action_date', ts('Date Field'), $sel4, TRUE); | |
174 | ||
a3e3eea1 | 175 | $this->addElement('checkbox', 'record_activity', $recordActivity); |
6a488035 TO |
176 | |
177 | $this->addElement('checkbox', 'is_repeat', ts('Repeat'), | |
178 | NULL, array('onclick' => "return showHideByValue('is_repeat',true,'repeatFields','table-row','radio',false);") | |
179 | ); | |
180 | ||
181 | $this->add('select', 'repetition_frequency_unit', ts('every'), $freqUnitsDisplay); | |
182 | $this->add('select', 'repetition_frequency_interval', ts('every'), $numericOptions); | |
183 | $this->add('select', 'end_frequency_unit', ts('until'), $freqUnitsDisplay); | |
184 | $this->add('select', 'end_frequency_interval', ts('until'), $numericOptions); | |
185 | $this->add('select', 'end_action', ts('Repetition Condition'), $condition, TRUE); | |
186 | $this->add('select', 'end_date', ts('Date Field'), $sel4, TRUE); | |
187 | ||
188 | $recipient = 'activity_contacts'; | |
189 | $recipientListingOptions = array(); | |
190 | ||
191 | if ($mappingID) { | |
192 | $recipient = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_ActionMapping', | |
193 | $mappingID, | |
194 | 'entity_recipient' | |
195 | ); | |
196 | } | |
197 | ||
3e315abc | 198 | $limitOptions = array(1 => ts('Limit to'), 0 => ts('Addition to')); |
199 | $this->add('select', 'limit_to', ts('Limit Options'), $limitOptions); | |
8ef12e64 | 200 | |
3e315abc | 201 | $this->add('select', 'recipient', ts('Recipients'), $sel5[$recipient], |
6a488035 TO |
202 | FALSE, array('onClick' => "showHideByValue('recipient','manual','recipientManual','table-row','select',false); showHideByValue('recipient','group','recipientGroup','table-row','select',false);") |
203 | ); | |
204 | ||
a7488080 | 205 | if (!empty($_POST['is_recipient_listing'])) { |
6a488035 TO |
206 | $recipientListingOptions = CRM_Core_BAO_ActionSchedule::getRecipientListing($_POST['entity'][0], $_POST['recipient']); |
207 | } | |
a7488080 | 208 | elseif (!empty($this->_values['recipient_listing'])) { |
6a488035 TO |
209 | $recipientListingOptions = CRM_Core_BAO_ActionSchedule::getRecipientListing($this->_values['mapping_id'], $this->_values['recipient']); |
210 | } | |
211 | $recipientListing = $this->add('select', 'recipient_listing', ts('Recipient Listing'), $recipientListingOptions); | |
212 | $recipientListing->setMultiple(TRUE); | |
213 | $this->add('hidden', 'is_recipient_listing', empty($recipientListingOptions) ? FALSE : TRUE, array('id' => 'is_recipient_listing')); | |
214 | ||
92f4a0b1 | 215 | $this->addEntityRef('recipient_manual_id', ts('Manual Recipients'), array('multiple' => TRUE, 'create' => TRUE)); |
6a488035 | 216 | |
f10c69fa DL |
217 | $this->addElement( |
218 | 'select', | |
219 | 'group_id', | |
220 | ts('Group'), | |
221 | // CRM-13577 | |
222 | CRM_Core_PseudoConstant::group() | |
6a488035 TO |
223 | ); |
224 | ||
225 | CRM_Mailing_BAO_Mailing::commonCompose($this); | |
226 | ||
227 | $this->add('text', 'subject', ts('Subject'), | |
228 | CRM_Core_DAO::getAttribute('CRM_Core_DAO_ActionSchedule', 'subject') | |
229 | ); | |
230 | ||
a3e3eea1 | 231 | $this->add('checkbox', 'is_active', $isActive); |
6a488035 TO |
232 | |
233 | $this->addFormRule(array('CRM_Admin_Form_ScheduleReminders', 'formRule')); | |
234 | } | |
235 | /** | |
236 | * global form rule | |
237 | * | |
238 | * @param array $fields the input form values | |
239 | * | |
240 | * @return true if no errors, else array of errors | |
241 | * @access public | |
242 | * @static | |
243 | */ | |
244 | static function formRule($fields) { | |
245 | $errors = array(); | |
246 | if ((array_key_exists(1, $fields['entity']) && $fields['entity'][1][0] == 0) || | |
247 | (array_key_exists(2, $fields['entity']) && $fields['entity'][2][0] == 0) | |
248 | ) { | |
249 | $errors['entity'] = ts('Please select appropriate value'); | |
250 | } | |
251 | ||
a7488080 | 252 | if (!empty($fields['is_active']) && |
6a488035 TO |
253 | CRM_Utils_System::isNull($fields['subject']) |
254 | ) { | |
255 | $errors['subject'] = ts('Subject is a required field.'); | |
256 | } | |
257 | ||
258 | if (CRM_Utils_System::isNull(CRM_Utils_Array::value(1, $fields['entity']))) { | |
259 | $errors['entity'] = ts('Please select entity value'); | |
260 | } | |
261 | ||
262 | if (!CRM_Utils_System::isNull($fields['absolute_date'])) { | |
2ea4f315 | 263 | if (CRM_Utils_Date::format(CRM_Utils_Date::processDate($fields['absolute_date'], NULL)) < CRM_Utils_Date::format(date('Ymd'))) { |
6a488035 TO |
264 | $errors['absolute_date'] = ts('Absolute date cannot be earlier than the current time.'); |
265 | } | |
266 | } | |
267 | ||
268 | if (!empty($errors)) { | |
269 | return $errors; | |
270 | } | |
271 | ||
272 | return empty($errors) ? TRUE : $errors; | |
273 | } | |
274 | ||
275 | function setDefaultValues() { | |
276 | if ($this->_action & CRM_Core_Action::ADD) { | |
277 | $defaults['is_active'] = 1; | |
a3e3eea1 | 278 | $defaults['mode'] = 'Email'; |
6a488035 TO |
279 | $defaults['record_activity'] = 1; |
280 | } | |
281 | else { | |
282 | $defaults = $this->_values; | |
283 | $entityValue = explode(CRM_Core_DAO::VALUE_SEPARATOR, | |
284 | CRM_Utils_Array::value('entity_value', $defaults) | |
285 | ); | |
286 | $entityStatus = explode(CRM_Core_DAO::VALUE_SEPARATOR, | |
287 | CRM_Utils_Array::value('entity_status', $defaults) | |
288 | ); | |
289 | $defaults['entity'][0] = CRM_Utils_Array::value('mapping_id', $defaults); | |
290 | $defaults['entity'][1] = $entityValue; | |
291 | $defaults['entity'][2] = $entityStatus; | |
292 | if ($absoluteDate = CRM_Utils_Array::value('absolute_date', $defaults)) { | |
293 | list($date, $time) = CRM_Utils_Date::setDateDefaults($absoluteDate); | |
294 | $defaults['absolute_date'] = $date; | |
295 | } | |
296 | ||
297 | if ($recipientListing = CRM_Utils_Array::value('recipient_listing', $defaults)) { | |
298 | $defaults['recipient_listing'] = explode(CRM_Core_DAO::VALUE_SEPARATOR, | |
299 | $recipientListing | |
300 | ); | |
301 | } | |
302 | $defaults['text_message'] = CRM_Utils_Array::value('body_text', $defaults); | |
303 | $defaults['html_message'] = CRM_Utils_Array::value('body_html', $defaults); | |
304 | $defaults['template'] = CRM_Utils_Array::value('msg_template_id', $defaults); | |
a7488080 | 305 | if (!empty($defaults['group_id'])) { |
6a488035 TO |
306 | $defaults['recipient'] = 'group'; |
307 | } | |
a7488080 | 308 | elseif (!empty($defaults['recipient_manual'])) { |
6a488035 | 309 | $defaults['recipient'] = 'manual'; |
92f4a0b1 | 310 | $defaults['recipient_manual_id'] = $defaults['recipient_manual']; |
6a488035 TO |
311 | } |
312 | } | |
313 | ||
314 | return $defaults; | |
315 | } | |
316 | ||
317 | /** | |
318 | * Function to process the form | |
319 | * | |
320 | * @access public | |
321 | * | |
355ba699 | 322 | * @return void |
6a488035 TO |
323 | */ |
324 | public function postProcess() { | |
325 | if ($this->_action & CRM_Core_Action::DELETE) { | |
326 | // delete reminder | |
327 | CRM_Core_BAO_ActionSchedule::del($this->_id); | |
328 | CRM_Core_Session::setStatus(ts('Selected Reminder has been deleted.'), ts('Record Deleted'), 'success'); | |
329 | if ($this->_context == 'event' && $this->_eventId) { | |
330 | $url = CRM_Utils_System::url('civicrm/event/manage/reminder', | |
331 | "reset=1&action=update&id={$this->_eventId}" | |
332 | ); | |
333 | $session = CRM_Core_Session::singleton(); | |
334 | $session->pushUserContext($url); | |
335 | } | |
336 | return; | |
337 | } | |
338 | $values = $this->controller->exportValues($this->getName()); | |
339 | ||
340 | $keys = array( | |
341 | 'title', | |
342 | 'subject', | |
343 | 'absolute_date', | |
344 | 'group_id', | |
3e315abc | 345 | 'record_activity', |
a3e3eea1 | 346 | 'limit_to', |
347 | 'mode', | |
348 | 'sms_provider_id' | |
6a488035 TO |
349 | ); |
350 | foreach ($keys as $key) { | |
351 | $params[$key] = CRM_Utils_Array::value($key, $values); | |
352 | } | |
353 | ||
354 | $moreKeys = array( | |
3e315abc | 355 | 'start_action_offset', |
356 | 'start_action_unit', | |
357 | 'start_action_condition', | |
358 | 'start_action_date', | |
6a488035 TO |
359 | 'repetition_frequency_unit', |
360 | 'repetition_frequency_interval', | |
361 | 'end_frequency_unit', | |
362 | 'end_frequency_interval', | |
3e315abc | 363 | 'end_action', |
364 | 'end_date', | |
6a488035 TO |
365 | ); |
366 | ||
367 | if ($absoluteDate = CRM_Utils_Array::value('absolute_date', $params)) { | |
368 | $params['absolute_date'] = CRM_Utils_Date::processDate($absoluteDate); | |
369 | foreach ($moreKeys as $mkey) { | |
370 | $params[$mkey] = 'null'; | |
371 | } | |
372 | } | |
373 | else { | |
374 | $params['absolute_date'] = 'null'; | |
375 | foreach ($moreKeys as $mkey) { | |
376 | $params[$mkey] = CRM_Utils_Array::value($mkey, $values); | |
377 | } | |
378 | } | |
379 | ||
380 | $params['body_text'] = CRM_Utils_Array::value('text_message', $values); | |
381 | $params['body_html'] = CRM_Utils_Array::value('html_message', $values); | |
382 | ||
383 | if (CRM_Utils_Array::value('recipient', $values) == 'manual') { | |
384 | $params['recipient_manual'] = CRM_Utils_Array::value('recipient_manual_id', $values); | |
385 | $params['group_id'] = $params['recipient'] = $params['recipient_listing'] = 'null'; | |
386 | } | |
387 | elseif (CRM_Utils_Array::value('recipient', $values) == 'group') { | |
388 | $params['group_id'] = $values['group_id']; | |
389 | $params['recipient_manual'] = $params['recipient'] = $params['recipient_listing'] = 'null'; | |
390 | } | |
391 | elseif (!CRM_Utils_System::isNull($values['recipient_listing'])) { | |
392 | $params['recipient'] = CRM_Utils_Array::value('recipient', $values); | |
393 | $params['recipient_listing'] = implode(CRM_Core_DAO::VALUE_SEPARATOR, | |
394 | CRM_Utils_Array::value('recipient_listing', $values) | |
395 | ); | |
396 | $params['group_id'] = $params['recipient_manual'] = 'null'; | |
397 | } | |
398 | else { | |
399 | $params['recipient'] = CRM_Utils_Array::value('recipient', $values); | |
400 | $params['group_id'] = $params['recipient_manual'] = $params['recipient_listing'] = 'null'; | |
401 | } | |
402 | ||
403 | $params['mapping_id'] = $values['entity'][0]; | |
404 | $entity_value = $values['entity'][1]; | |
405 | $entity_status = $values['entity'][2]; | |
406 | ||
407 | foreach (array( | |
408 | 'entity_value', 'entity_status') as $key) { | |
409 | $params[$key] = implode(CRM_Core_DAO::VALUE_SEPARATOR, $$key); | |
410 | } | |
411 | ||
412 | $params['is_active'] = CRM_Utils_Array::value('is_active', $values, 0); | |
413 | $params['is_repeat'] = CRM_Utils_Array::value('is_repeat', $values, 0); | |
414 | ||
415 | if (CRM_Utils_Array::value('is_repeat', $values) == 0) { | |
416 | $params['repetition_frequency_unit'] = 'null'; | |
417 | $params['repetition_frequency_interval'] = 'null'; | |
418 | $params['end_frequency_unit'] = 'null'; | |
419 | $params['end_frequency_interval'] = 'null'; | |
420 | $params['end_action'] = 'null'; | |
421 | $params['end_date'] = 'null'; | |
422 | } | |
423 | ||
424 | if ($this->_action & CRM_Core_Action::UPDATE) { | |
425 | $params['id'] = $this->_id; | |
426 | } | |
427 | elseif ($this->_action & CRM_Core_Action::ADD) { | |
428 | // we do this only once, so name never changes | |
429 | $params['name'] = CRM_Utils_String::munge($params['title'], '_', 64); | |
430 | } | |
431 | ||
432 | $composeFields = array( | |
433 | 'template', 'saveTemplate', | |
434 | 'updateTemplate', 'saveTemplateName', | |
435 | ); | |
436 | $msgTemplate = NULL; | |
437 | //mail template is composed | |
438 | ||
439 | $composeParams = array(); | |
440 | foreach ($composeFields as $key) { | |
a7488080 | 441 | if (!empty($values[$key])) { |
6a488035 TO |
442 | $composeParams[$key] = $values[$key]; |
443 | } | |
444 | } | |
445 | ||
a7488080 | 446 | if (!empty($composeParams['updateTemplate'])) { |
6a488035 TO |
447 | $templateParams = array( |
448 | 'msg_text' => $params['body_text'], | |
449 | 'msg_html' => $params['body_html'], | |
450 | 'msg_subject' => $params['subject'], | |
451 | 'is_active' => TRUE, | |
452 | ); | |
453 | ||
454 | $templateParams['id'] = $values['template']; | |
455 | ||
c6327d7d | 456 | $msgTemplate = CRM_Core_BAO_MessageTemplate::add($templateParams); |
6a488035 TO |
457 | } |
458 | ||
a7488080 | 459 | if (!empty($composeParams['saveTemplate'])) { |
6a488035 TO |
460 | $templateParams = array( |
461 | 'msg_text' => $params['body_text'], | |
462 | 'msg_html' => $params['body_html'], | |
463 | 'msg_subject' => $params['subject'], | |
464 | 'is_active' => TRUE, | |
465 | ); | |
466 | ||
467 | $templateParams['msg_title'] = $composeParams['saveTemplateName']; | |
468 | ||
c6327d7d | 469 | $msgTemplate = CRM_Core_BAO_MessageTemplate::add($templateParams); |
6a488035 TO |
470 | } |
471 | ||
472 | if (isset($msgTemplate->id)) { | |
473 | $params['msg_template_id'] = $msgTemplate->id; | |
474 | } | |
475 | else { | |
476 | $params['msg_template_id'] = CRM_Utils_Array::value('template', $values); | |
477 | } | |
478 | ||
24f14405 E |
479 | $bao = CRM_Core_BAO_ActionSchedule::add($params); |
480 | // we need to set this on the form so that hooks can identify the created entity | |
481 | $this->set('id', $bao->id); | |
482 | $bao->free(); | |
6a488035 TO |
483 | |
484 | $status = ts("Your new Reminder titled %1 has been saved.", | |
485 | array(1 => "<strong>{$values['title']}</strong>") | |
486 | ); | |
487 | if ($this->_action & CRM_Core_Action::UPDATE) { | |
488 | $status = ts("Your Reminder titled %1 has been updated.", | |
489 | array(1 => "<strong>{$values['title']}</strong>") | |
490 | ); | |
491 | ||
492 | if ($this->_context == 'event' && $this->_eventId) { | |
493 | $url = CRM_Utils_System::url('civicrm/event/manage/reminder', | |
494 | "reset=1&action=update&id={$this->_eventId}" | |
495 | ); | |
496 | $session = CRM_Core_Session::singleton(); | |
497 | $session->pushUserContext($url); | |
498 | } | |
499 | } | |
500 | CRM_Core_Session::setStatus($status, ts('Saved'), 'success'); | |
501 | } | |
502 | } | |
503 |