3 +--------------------------------------------------------------------+
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2019 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
32 * @copyright CiviCRM LLC (c) 2004-2019
38 * This class generates form components for scheduling reminders for Event
41 class CRM_Event_Form_ManageEvent_ScheduleReminders
extends CRM_Event_Form_ManageEvent
{
44 * Set variables up before form is built.
48 public function preProcess() {
50 $this->setSelectedChild('reminder');
51 $setTab = CRM_Utils_Request
::retrieve('setTab', 'Int', $this, FALSE, 0);
53 $mapping = CRM_Utils_Array
::first(CRM_Core_BAO_ActionSchedule
::getMappings([
54 'id' => ($this->_isTemplate ? CRM_Event_ActionMapping
::EVENT_TPL_MAPPING_ID
: CRM_Event_ActionMapping
::EVENT_NAME_MAPPING_ID
),
56 $reminderList = CRM_Core_BAO_ActionSchedule
::getList(FALSE, $mapping, $this->_id
);
57 if ($reminderList && is_array($reminderList)) {
58 // Add action links to each of the reminders
59 foreach ($reminderList as & $format) {
60 $action = CRM_Core_Action
::UPDATE + CRM_Core_Action
::DELETE
;
61 if ($format['is_active']) {
62 $action +
= CRM_Core_Action
::DISABLE
;
65 $action +
= CRM_Core_Action
::ENABLE
;
67 $scheduleReminder = new CRM_Admin_Page_ScheduleReminders();
68 $links = $scheduleReminder->links();
69 $links[CRM_Core_Action
::DELETE
]['qs'] .= "&context=event&compId={$this->_id}";
70 $links[CRM_Core_Action
::UPDATE
]['qs'] .= "&context=event&compId={$this->_id}";
71 $format['action'] = CRM_Core_Action
::formLink(
74 ['id' => $format['id']],
77 'actionSchedule.manage.action',
84 $this->assign('rows', $reminderList);
85 $this->assign('setTab', $setTab);
86 $this->assign('component', 'event');
88 // Update tab "disabled" css class
89 $this->ajaxResponse
['tabValid'] = is_array($reminderList) && (count($reminderList) > 0);
90 $this->setPageTitle(ts('Scheduled Reminder'));
96 public function getTemplateFileName() {
97 return 'CRM/Admin/Page/ScheduleReminders.tpl';