3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.4 |
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. |
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. |
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. |
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 +--------------------------------------------------------------------+
32 * @copyright CiviCRM LLC (c) 2004-2013
38 * Page for displaying list of Reminders
40 class CRM_Admin_Page_ScheduleReminders
extends CRM_Core_Page_Basic
{
43 * The action links that we need to display for the browse screen
48 static $_links = NULL;
53 * @return string Classname of BAO.
55 function getBAOName() {
56 return 'CRM_Core_BAO_ActionSchedule';
62 * @return array (reference) of action links
65 if (!(self
::$_links)) {
66 // helper variable for nicer formatting
67 self
::$_links = array(
68 CRM_Core_Action
::UPDATE
=> array(
70 'url' => 'civicrm/admin/scheduleReminders',
71 'qs' => 'action=update&id=%%id%%&reset=1',
72 'title' => ts('Edit Schedule Reminders'),
74 CRM_Core_Action
::ENABLE
=> array(
75 'name' => ts('Enable'),
76 'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Core_BAO_ActionSchedule' . '\',\'' . 'disable-enable' . '\' );"',
77 'ref' => 'enable-action',
78 'title' => ts('Enable Label Format'),
80 CRM_Core_Action
::DISABLE
=> array(
81 'name' => ts('Disable'),
82 'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Core_BAO_ActionSchedule' . '\',\'' . 'enable-disable' . '\' );"',
83 'ref' => 'disable-action',
84 'title' => ts('Disable Label Format'),
86 CRM_Core_Action
::DELETE
=> array(
87 'name' => ts('Delete'),
88 'url' => 'civicrm/admin/scheduleReminders',
89 'qs' => 'action=delete&id=%%id%%',
90 'title' => ts('Delete Schedule Reminders'),
99 * Get name of edit form
101 * @return string Classname of edit form.
103 function editForm() {
104 return 'CRM_Admin_Form_ScheduleReminders';
110 * @return string name of this page.
112 function editName() {
113 return 'ScheduleReminders';
119 * @return string user context.
121 function userContext($mode = NULL) {
122 return 'civicrm/admin/scheduleReminders';
126 * Browse all Scheduled Reminders settings.
132 function browse($action = NULL) {
133 // Get list of configured reminders
134 $reminderList = CRM_Core_BAO_ActionSchedule
::getList();
136 if (is_array($reminderList)) {
137 // Add action links to each of the reminders
138 foreach ($reminderList as & $format) {
139 $action = array_sum(array_keys($this->links()));
140 if ($format['is_active']) {
141 $action -= CRM_Core_Action
::ENABLE
;
144 $action -= CRM_Core_Action
::DISABLE
;
146 $format['action'] = CRM_Core_Action
::formLink(
149 array('id' => $format['id']),
152 'actionSchedule.manage.action',
159 $this->assign('rows', $reminderList);