CRM-15536 fix - Scheduled reminders: Clarify "Limit to" and "Also include" UI to...
[civicrm-core.git] / CRM / Admin / Form / ScheduleReminders.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
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
32 * @copyright CiviCRM LLC (c) 2004-2014
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 * Build the form object
52 *
53 * @return void
54 */
55 public function buildQuickForm() {
56 parent::buildQuickForm();
57 $this->_mappingID = $mappingID = NULL;
58 $providersCount = CRM_SMS_BAO_Provider::activeProviderCount();
59 $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this);
60
61 if ($this->_action & (CRM_Core_Action::DELETE)) {
62 $reminderName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_ActionSchedule', $this->_id, 'title');
63 if ($this->_context == 'event') {
64 $this->_compId = CRM_Utils_Request::retrieve('compId', 'Integer', $this);
65 }
66 $this->assign('reminderName', $reminderName);
67 return;
68 }
69 elseif ($this->_action & (CRM_Core_Action::UPDATE)) {
70 $this->_mappingID = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_ActionSchedule', $this->_id, 'mapping_id');
71 if ($this->_context == 'event') {
72 $this->_compId = CRM_Utils_Request::retrieve('compId', 'Integer', $this);
73 }
74 }
75 elseif (!empty($this->_context)) {
76 if ($this->_context == 'event') {
77 $this->_compId = CRM_Utils_Request::retrieve('compId', 'Integer', $this);
78 $field = 'civicrm_event';
79 $isTemplate = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $this->_compId, 'is_template');
80 if ($isTemplate) {
81 $field = 'event_template';
82 }
83 $this->_mappingID = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_ActionMapping', $field, 'id', 'entity_value');
84 if (!$this->_mappingID) {
85 CRM_Core_Error::fatal('Could not find mapping for event scheduled reminders.');
86 }
87 }
88 }
89
90 if (!empty($_POST) && !empty($_POST['entity']) && empty($this->_context)) {
91 $mappingID = $_POST['entity'][0];
92 }
93 elseif ($this->_mappingID) {
94 $mappingID = $this->_mappingID;
95 }
96
97 $this->add(
98 'text',
99 'title',
100 ts('Title'),
101 array('size' => 45, 'maxlength' => 128),
102 TRUE
103 );
104
105 $selectionOptions = CRM_Core_BAO_ActionSchedule::getSelection($mappingID);
106 extract($selectionOptions);
107 $this->assign('entityMapping', json_encode($entityMapping));
108 $this->assign('recipientMapping', json_encode($recipientMapping));
109
110 if (empty($this->_context)) {
111 if (empty($sel1)) {
112 CRM_Core_Error::fatal('Could not find mapping for scheduled reminders.');
113 }
114
115 $sel = &$this->add(
116 'hierselect',
117 'entity',
118 ts('Entity'),
119 array(
120 'name' => 'entity[0]',
121 'style' => 'vertical-align: top;',
122 ),
123 TRUE
124 );
125 $sel->setOptions(array($sel1, $sel2, $sel3));
126
127 if (is_a($sel->_elements[1], 'HTML_QuickForm_select')) {
128 // make second selector a multi-select -
129 $sel->_elements[1]->setMultiple(TRUE);
130 $sel->_elements[1]->setSize(5);
131 }
132
133 if (is_a($sel->_elements[2], 'HTML_QuickForm_select')) {
134 // make third selector a multi-select -
135 $sel->_elements[2]->setMultiple(TRUE);
136 $sel->_elements[2]->setSize(5);
137 }
138 }
139 else {
140 $options = $sel3[$this->_mappingID][0];
141 $attributes = array('multiple' => 'multiple', 'class' => 'crm-select2 huge', 'placeholder' => $options[0]);
142 unset($options[0]);
143 $this->add('select', 'entity', ts('Recipient(s)'), $options, TRUE, $attributes);
144 $this->assign('context', $this->_context);
145 }
146
147 //get the frequency units.
148 $this->_freqUnits = CRM_Core_SelectValues::getScheduleReminderFrequencyUnits();
149
150 //pass the mapping ID in UPDATE mode
151 $mappings = CRM_Core_BAO_ActionSchedule::getMapping($mappingID);
152
153 $numericOptions = CRM_Core_SelectValues::getNumericOptions(0, 30);
154
155 //reminder_interval
156 $this->add('select', 'start_action_offset', ts('When'), $numericOptions);
157 $isActive = ts('Send email');
158 $recordActivity = ts('Record activity for automated email');
159 if ($providersCount) {
160 $this->assign('sms', $providersCount);
161 $isActive = ts('Send email or SMS');
162 $recordActivity = ts('Record activity for automated email or SMS');
163 $options = CRM_Core_OptionGroup::values('msg_mode');
164 $this->add('select', 'mode', ts('Send as'), $options);
165
166 $providers = CRM_SMS_BAO_Provider::getProviders(NULL, NULL, TRUE, 'is_default desc');
167
168 $providerSelect = array();
169 foreach ($providers as $provider) {
170 $providerSelect[$provider['id']] = $provider['title'];
171 }
172 $this->add('select', 'sms_provider_id', ts('SMS Provider'), $providerSelect, TRUE);
173 }
174
175 foreach ($this->_freqUnits as $val => $label) {
176 $freqUnitsDisplay[$val] = ts('%1(s)', array(1 => $label));
177 }
178
179 $this->addDate('absolute_date', ts('Start Date'), FALSE, array('formatType' => 'mailing'));
180
181 //reminder_frequency
182 $this->add('select', 'start_action_unit', ts('Frequency'), $freqUnitsDisplay, TRUE);
183
184 $condition = array(
185 'before' => ts('before'),
186 'after' => ts('after'),
187 );
188 //reminder_action
189 $this->add('select', 'start_action_condition', ts('Action Condition'), $condition);
190
191 $this->add('select', 'start_action_date', ts('Date Field'), $sel4, TRUE);
192
193 $this->addElement('checkbox', 'record_activity', $recordActivity);
194
195 $this->addElement('checkbox', 'is_repeat', ts('Repeat'),
196 NULL, array('onchange' => "return showHideByValue('is_repeat',true,'repeatFields','table-row','radio',false);")
197 );
198
199 $this->add('select', 'repetition_frequency_unit', ts('every'), $freqUnitsDisplay);
200 $this->add('select', 'repetition_frequency_interval', ts('every'), $numericOptions);
201 $this->add('select', 'end_frequency_unit', ts('until'), $freqUnitsDisplay);
202 $this->add('select', 'end_frequency_interval', ts('until'), $numericOptions);
203 $this->add('select', 'end_action', ts('Repetition Condition'), $condition, TRUE);
204 $this->add('select', 'end_date', ts('Date Field'), $sel4, TRUE);
205
206 $this->add('text', 'from_name', ts('From Name'));
207 $this->add('text', 'from_email', ts('From Email'));
208
209 $recipient = 'activity_contacts';
210 $recipientListingOptions = array();
211
212 if ($mappingID) {
213 $recipient = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_ActionMapping',
214 $mappingID,
215 'entity_recipient'
216 );
217 }
218
219 $limitOptions = array('' => '-neither-', 1 => ts('Limit to'), 0 => ts('Also include'));
220
221 $recipientLabels = array('activity' => ts('Recipients'), 'other' => ts('Limit or Add Recipients'));
222 $this->assign('recipientLabels', $recipientLabels);
223
224 $this->add('select', 'limit_to', ts('Limit Options'), $limitOptions, FALSE, array('onChange' => "showHideByValue('limit_to','','recipient', 'select','select',true);"));
225
226 $this->add('select', 'recipient', $recipientLabels['other'], $sel5[$recipient],
227 FALSE, array('onchange' => "showHideByValue('recipient','manual','recipientManual','table-row','select',false); showHideByValue('recipient','group','recipientGroup','table-row','select',false);")
228 );
229
230 if (!empty($this->_submitValues['recipient_listing'])) {
231 if (!empty($this->_context)) {
232 $recipientListingOptions = CRM_Core_BAO_ActionSchedule::getRecipientListing($this->_mappingID, $this->_submitValues['recipient']);
233 }
234 else {
235 $recipientListingOptions = CRM_Core_BAO_ActionSchedule::getRecipientListing($_POST['entity'][0], $_POST['recipient']);
236 }
237 }
238 elseif (!empty($this->_values['recipient_listing'])) {
239 $recipientListingOptions = CRM_Core_BAO_ActionSchedule::getRecipientListing($this->_values['mapping_id'], $this->_values['recipient']);
240 }
241
242 $this->add('select', 'recipient_listing', ts('Recipient Roles'), $recipientListingOptions, FALSE,
243 array('multiple' => TRUE, 'class' => 'crm-select2 huge', 'placeholder' => TRUE));
244
245 $this->addEntityRef('recipient_manual_id', ts('Manual Recipients'), array('multiple' => TRUE, 'create' => TRUE));
246
247 $this->add('select', 'group_id', ts('Group'),
248 CRM_Core_PseudoConstant::nestedGroup('Mailing'), FALSE, array('class' => 'crm-select2 huge')
249 );
250
251 CRM_Mailing_BAO_Mailing::commonCompose($this);
252
253 $this->add('text', 'subject', ts('Subject'),
254 CRM_Core_DAO::getAttribute('CRM_Core_DAO_ActionSchedule', 'subject')
255 );
256
257 $this->add('checkbox', 'is_active', $isActive);
258
259 $this->addFormRule(array('CRM_Admin_Form_ScheduleReminders', 'formRule'), $this);
260
261 $this->setPageTitle(ts('Scheduled Reminder'));
262 }
263
264 /**
265 * Global form rule
266 *
267 * @param array $fields
268 * The input form values.
269 *
270 * @return bool|array
271 * true if no errors, else array of errors
272 */
273 public static function formRule($fields, $files, $self) {
274 $errors = array();
275 if ((array_key_exists(1, $fields['entity']) && $fields['entity'][1][0] === 0) ||
276 (array_key_exists(2, $fields['entity']) && $fields['entity'][2][0] == 0)
277 ) {
278 $errors['entity'] = ts('Please select appropriate value');
279 }
280
281 if (array_key_exists(1, $fields['entity']) && !is_numeric($fields['entity'][1][0])) {
282 if (count($fields['entity'][1]) > 1) {
283 $errors['entity'] = ts('You may only select one contact field per reminder');
284 }
285 elseif (!(array_key_exists(2, $fields['entity']) && $fields['entity'][2][0] > 0)) {
286 $errors['entity'] = ts('Please select whether the reminder is sent each year.');
287 }
288 }
289
290 if (!empty($fields['is_active']) &&
291 CRM_Utils_Array::value('mode', $fields) == 'SMS' &&
292 CRM_Utils_System::isNull($fields['subject'])
293 ) {
294 $errors['subject'] = ts('Subject is a required field.');
295 }
296
297 if (empty($self->_context) && CRM_Utils_System::isNull(CRM_Utils_Array::value(1, $fields['entity']))) {
298 $errors['entity'] = ts('Please select entity value');
299 }
300
301 if (!CRM_Utils_System::isNull($fields['absolute_date'])) {
302 if (CRM_Utils_Date::format(CRM_Utils_Date::processDate($fields['absolute_date'], NULL)) < CRM_Utils_Date::format(date('Ymd'))) {
303 $errors['absolute_date'] = ts('Absolute date cannot be earlier than the current time.');
304 }
305 }
306
307 $recipientKind = array(
308 'participant_role' => array(
309 'name' => 'participant role',
310 'target_id' => 'recipient_listing',
311 ),
312 'manual' => array(
313 'name' => 'recipient',
314 'target_id' => 'recipient_manual_id',
315 ),
316 );
317 if ($fields['limit_to'] != '' && array_key_exists($fields['recipient'], $recipientKind) && empty($fields[$recipientKind[$fields['recipient']]['target_id']])) {
318 $errors[$recipientKind[$fields['recipient']]['target_id']] = ts('If "Also include" or "Limit to" are selected, you must specify at least one %1', array(1 => $recipientKind[$fields['recipient']]['name']));
319 }
320
321 if (!empty($errors)) {
322 return $errors;
323 }
324
325 return empty($errors) ? TRUE : $errors;
326 }
327
328 /**
329 * @return int
330 */
331 public function setDefaultValues() {
332 if ($this->_action & CRM_Core_Action::ADD) {
333 $defaults['is_active'] = 1;
334 $defaults['mode'] = 'Email';
335 $defaults['record_activity'] = 1;
336 }
337 else {
338 $defaults = $this->_values;
339 $entityValue = explode(CRM_Core_DAO::VALUE_SEPARATOR, CRM_Utils_Array::value('entity_value', $defaults));
340 $entityStatus = explode(CRM_Core_DAO::VALUE_SEPARATOR, CRM_Utils_Array::value('entity_status', $defaults));
341 if (empty($this->_context)) {
342 $defaults['entity'][0] = CRM_Utils_Array::value('mapping_id', $defaults);
343 $defaults['entity'][1] = $entityValue;
344 $defaults['entity'][2] = $entityStatus;
345 }
346 else {
347 $defaults['entity'] = $entityStatus;
348 }
349 if ($absoluteDate = CRM_Utils_Array::value('absolute_date', $defaults)) {
350 list($date, $time) = CRM_Utils_Date::setDateDefaults($absoluteDate);
351 $defaults['absolute_date'] = $date;
352 }
353
354 if ($recipientListing = CRM_Utils_Array::value('recipient_listing', $defaults)) {
355 $defaults['recipient_listing'] = explode(CRM_Core_DAO::VALUE_SEPARATOR,
356 $recipientListing
357 );
358 }
359 $defaults['text_message'] = CRM_Utils_Array::value('body_text', $defaults);
360 $defaults['html_message'] = CRM_Utils_Array::value('body_html', $defaults);
361 $defaults['sms_text_message'] = CRM_Utils_Array::value('sms_body_text', $defaults);
362 $defaults['template'] = CRM_Utils_Array::value('msg_template_id', $defaults);
363 $defaults['SMStemplate'] = CRM_Utils_Array::value('sms_template_id', $defaults);
364 if (!empty($defaults['group_id'])) {
365 $defaults['recipient'] = 'group';
366 }
367 elseif (!empty($defaults['recipient_manual'])) {
368 $defaults['recipient'] = 'manual';
369 $defaults['recipient_manual_id'] = $defaults['recipient_manual'];
370 }
371 }
372
373 return $defaults;
374 }
375
376 /**
377 * Process the form submission
378 *
379 *
380 * @return void
381 */
382 public function postProcess() {
383 if ($this->_action & CRM_Core_Action::DELETE) {
384 // delete reminder
385 CRM_Core_BAO_ActionSchedule::del($this->_id);
386 CRM_Core_Session::setStatus(ts('Selected Reminder has been deleted.'), ts('Record Deleted'), 'success');
387 if ($this->_context == 'event' && $this->_compId) {
388 $url = CRM_Utils_System::url('civicrm/event/manage/reminder',
389 "reset=1&action=browse&id={$this->_compId}&component={$this->_context}&setTab=1"
390 );
391 $session = CRM_Core_Session::singleton();
392 $session->pushUserContext($url);
393 }
394 return;
395 }
396 $values = $this->controller->exportValues($this->getName());
397
398 $keys = array(
399 'title',
400 'subject',
401 'absolute_date',
402 'group_id',
403 'record_activity',
404 'limit_to',
405 'mode',
406 'sms_provider_id',
407 'from_name',
408 'from_email',
409 );
410 foreach ($keys as $key) {
411 $params[$key] = CRM_Utils_Array::value($key, $values);
412 }
413
414 $params['is_repeat'] = CRM_Utils_Array::value('is_repeat', $values, 0);
415
416 $moreKeys = array(
417 'start_action_offset',
418 'start_action_unit',
419 'start_action_condition',
420 'start_action_date',
421 'repetition_frequency_unit',
422 'repetition_frequency_interval',
423 'end_frequency_unit',
424 'end_frequency_interval',
425 'end_action',
426 'end_date',
427 );
428
429 if ($absoluteDate = CRM_Utils_Array::value('absolute_date', $params)) {
430 $params['absolute_date'] = CRM_Utils_Date::processDate($absoluteDate);
431 $params['is_repeat'] = 0;
432 foreach ($moreKeys as $mkey) {
433 $params[$mkey] = 'null';
434 }
435 }
436 else {
437 $params['absolute_date'] = 'null';
438 foreach ($moreKeys as $mkey) {
439 $params[$mkey] = CRM_Utils_Array::value($mkey, $values);
440 }
441 }
442
443 $params['body_text'] = CRM_Utils_Array::value('text_message', $values);
444 $params['sms_body_text'] = CRM_Utils_Array::value('sms_text_message', $values);
445 $params['body_html'] = CRM_Utils_Array::value('html_message', $values);
446
447 if (CRM_Utils_Array::value('recipient', $values) == 'manual') {
448 $params['recipient_manual'] = CRM_Utils_Array::value('recipient_manual_id', $values);
449 $params['group_id'] = $params['recipient'] = $params['recipient_listing'] = 'null';
450 }
451 elseif (CRM_Utils_Array::value('recipient', $values) == 'group') {
452 $params['group_id'] = $values['group_id'];
453 $params['recipient_manual'] = $params['recipient'] = $params['recipient_listing'] = 'null';
454 }
455 elseif (!CRM_Utils_System::isNull($values['recipient_listing']) && !CRM_Utils_System::isNull($values['limit_to'])) {
456 $params['recipient'] = CRM_Utils_Array::value('recipient', $values);
457 $params['recipient_listing'] = implode(CRM_Core_DAO::VALUE_SEPARATOR,
458 CRM_Utils_Array::value('recipient_listing', $values)
459 );
460 $params['group_id'] = $params['recipient_manual'] = 'null';
461 }
462 else {
463 $params['recipient'] = CRM_Utils_Array::value('recipient', $values);
464 $params['group_id'] = $params['recipient_manual'] = $params['recipient_listing'] = 'null';
465 }
466
467 if (!empty($this->_mappingID) && !empty($this->_compId)) {
468 $params['mapping_id'] = $this->_mappingID;
469 $params['entity_value'] = $this->_compId;
470 $params['entity_status'] = implode(CRM_Core_DAO::VALUE_SEPARATOR, $values['entity']);
471 }
472 else {
473 $params['mapping_id'] = $values['entity'][0];
474 $entity_value = $values['entity'][1];
475 $entity_status = $values['entity'][2];
476 if ($params['mapping_id'] == 1) {
477 $params['limit_to'] = 1;
478 }
479
480 foreach (array('entity_value', 'entity_status') as $key) {
481 $params[$key] = implode(CRM_Core_DAO::VALUE_SEPARATOR, $$key);
482 }
483 }
484
485 $params['is_active'] = CRM_Utils_Array::value('is_active', $values, 0);
486
487 if (CRM_Utils_Array::value('is_repeat', $values) == 0) {
488 $params['repetition_frequency_unit'] = 'null';
489 $params['repetition_frequency_interval'] = 'null';
490 $params['end_frequency_unit'] = 'null';
491 $params['end_frequency_interval'] = 'null';
492 $params['end_action'] = 'null';
493 $params['end_date'] = 'null';
494 }
495
496 if ($this->_action & CRM_Core_Action::UPDATE) {
497 $params['id'] = $this->_id;
498 }
499 elseif ($this->_action & CRM_Core_Action::ADD) {
500 // we do this only once, so name never changes
501 $params['name'] = CRM_Utils_String::munge($params['title'], '_', 64);
502 }
503
504 $modePrefixes = array('Mail' => NULL, 'SMS' => 'SMS');
505
506 if ($params['mode'] == 'Email' || empty($params['sms_provider_id'])) {
507 unset($modePrefixes['SMS']);
508 }
509 elseif ($params['mode'] == 'SMS') {
510 unset($modePrefixes['Mail']);
511 }
512
513 //TODO: handle postprocessing of SMS and/or Email info based on $modePrefixes
514
515 $composeFields = array(
516 'template',
517 'saveTemplate',
518 'updateTemplate',
519 'saveTemplateName',
520 );
521 $msgTemplate = NULL;
522 //mail template is composed
523
524 foreach ($modePrefixes as $prefix) {
525 $composeParams = array();
526 foreach ($composeFields as $key) {
527 $key = $prefix . $key;
528 if (!empty($values[$key])) {
529 $composeParams[$key] = $values[$key];
530 }
531 }
532
533 if (!empty($composeParams[$prefix . 'updateTemplate'])) {
534 $templateParams = array('is_active' => TRUE);
535 if ($prefix == 'SMS') {
536 $templateParams += array(
537 'msg_text' => $params['sms_body_text'],
538 'is_sms' => TRUE,
539 );
540 }
541 else {
542 $templateParams += array(
543 'msg_text' => $params['body_text'],
544 'msg_html' => $params['body_html'],
545 'msg_subject' => $params['subject'],
546 );
547 }
548 $templateParams['id'] = $values[$prefix . 'template'];
549
550 $msgTemplate = CRM_Core_BAO_MessageTemplate::add($templateParams);
551 }
552
553 if (!empty($composeParams[$prefix . 'saveTemplate'])) {
554 $templateParams = array('is_active' => TRUE);
555 if ($prefix == 'SMS') {
556 $templateParams += array(
557 'msg_text' => $params['sms_body_text'],
558 'is_sms' => TRUE,
559 );
560 }
561 else {
562 $templateParams += array(
563 'msg_text' => $params['body_text'],
564 'msg_html' => $params['body_html'],
565 'msg_subject' => $params['subject'],
566 );
567 }
568 $templateParams['msg_title'] = $composeParams[$prefix . 'saveTemplateName'];
569
570 $msgTemplate = CRM_Core_BAO_MessageTemplate::add($templateParams);
571 }
572
573 if ($prefix == 'SMS') {
574 if (isset($msgTemplate->id)) {
575 $params['sms_template_id'] = $msgTemplate->id;
576 }
577 else {
578 $params['sms_template_id'] = CRM_Utils_Array::value('SMStemplate', $values);
579 }
580 }
581 else {
582 if (isset($msgTemplate->id)) {
583 $params['msg_template_id'] = $msgTemplate->id;
584 }
585 else {
586 $params['msg_template_id'] = CRM_Utils_Array::value('template', $values);
587 }
588 }
589 }
590
591 $bao = CRM_Core_BAO_ActionSchedule::add($params);
592 // we need to set this on the form so that hooks can identify the created entity
593 $this->set('id', $bao->id);
594 $bao->free();
595
596 $status = ts("Your new Reminder titled %1 has been saved.",
597 array(1 => "<strong>{$values['title']}</strong>")
598 );
599
600 if ($this->_action) {
601 if ($this->_action & CRM_Core_Action::UPDATE) {
602 $status = ts("Your Reminder titled %1 has been updated.",
603 array(1 => "<strong>{$values['title']}</strong>")
604 );
605 }
606
607 if ($this->_context == 'event' && $this->_compId) {
608 $url = CRM_Utils_System::url('civicrm/event/manage/reminder', "reset=1&action=browse&id={$this->_compId}&component={$this->_context}&setTab=1");
609 $session = CRM_Core_Session::singleton();
610 $session->pushUserContext($url);
611 }
612 }
613 CRM_Core_Session::setStatus($status, ts('Saved'), 'success');
614 }
615
616 }