3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
19 * Page for displaying list of Reminders.
21 class CRM_Admin_Page_ScheduleReminders
extends CRM_Core_Page_Basic
{
23 public $useLivePageJS = TRUE;
26 * The action links that we need to display for the browse screen.
30 public static $_links = NULL;
38 public function getBAOName() {
39 return 'CRM_Core_BAO_ActionSchedule';
46 * (reference) of action links
48 public function &links() {
49 if (!(self
::$_links)) {
50 // helper variable for nicer formatting
52 CRM_Core_Action
::UPDATE
=> [
54 'class' => 'no-popup',
55 'url' => 'civicrm/admin/scheduleReminders',
56 'qs' => 'action=update&id=%%id%%&reset=1',
57 'title' => ts('Edit Schedule Reminders'),
59 CRM_Core_Action
::ENABLE
=> [
60 'name' => ts('Enable'),
61 'ref' => 'crm-enable-disable',
62 'title' => ts('Enable Label Format'),
64 CRM_Core_Action
::DISABLE
=> [
65 'name' => ts('Disable'),
66 'ref' => 'crm-enable-disable',
67 'title' => ts('Disable Label Format'),
69 CRM_Core_Action
::DELETE
=> [
70 'name' => ts('Delete'),
71 'url' => 'civicrm/admin/scheduleReminders',
72 'qs' => 'action=delete&id=%%id%%',
73 'title' => ts('Delete Schedule Reminders'),
82 * Get name of edit form.
85 * Classname of edit form.
87 public function editForm() {
88 return 'CRM_Admin_Form_ScheduleReminders';
97 public function editName() {
98 return 'ScheduleReminders';
109 public function userContext($mode = NULL) {
110 return 'civicrm/admin/scheduleReminders';
114 * Browse all Scheduled Reminders settings.
116 * @param null $action
118 * @throws \CRM_Core_Exception
120 public function browse($action = NULL) {
121 //CRM-16777: Do not permit access to user, for page 'Administer->Communication->Schedule Reminder',
122 //when do not have 'administer CiviCRM' permission.
123 if (!CRM_Core_Permission
::check('administer CiviCRM')) {
124 CRM_Core_Error
::statusBounce(ts('You do not have permission to access this page.'));
127 // Get list of configured reminders
128 $reminderList = CRM_Core_BAO_ActionSchedule
::getList();
130 // Add action links to each of the reminders
131 foreach ($reminderList as & $format) {
132 $action = array_sum(array_keys($this->links()));
133 if ($format['is_active']) {
134 $action -= CRM_Core_Action
::ENABLE
;
137 $action -= CRM_Core_Action
::DISABLE
;
139 $format['action'] = CRM_Core_Action
::formLink(
142 ['id' => $format['id']],
145 'actionSchedule.manage.action',
151 $this->assign('rows', $reminderList);