// Get list of configured reminders
$reminderList = CRM_Core_BAO_ActionSchedule::getList();
- if (is_array($reminderList)) {
- // Add action links to each of the reminders
- foreach ($reminderList as & $format) {
- $action = array_sum(array_keys($this->links()));
- if ($format['is_active']) {
- $action -= CRM_Core_Action::ENABLE;
- }
- else {
- $action -= CRM_Core_Action::DISABLE;
- }
- $format['action'] = CRM_Core_Action::formLink(
- self::links(),
- $action,
- ['id' => $format['id']],
- ts('more'),
- FALSE,
- 'actionSchedule.manage.action',
- 'ActionSchedule',
- $format['id']
- );
+ // Add action links to each of the reminders
+ foreach ($reminderList as & $format) {
+ $action = array_sum(array_keys($this->links()));
+ if ($format['is_active']) {
+ $action -= CRM_Core_Action::ENABLE;
}
+ else {
+ $action -= CRM_Core_Action::DISABLE;
+ }
+ $format['action'] = CRM_Core_Action::formLink(
+ self::links(),
+ $action,
+ ['id' => $format['id']],
+ ts('more'),
+ FALSE,
+ 'actionSchedule.manage.action',
+ 'ActionSchedule',
+ $format['id']
+ );
}
$this->assign('rows', $reminderList);
/**
* Retrieve list of Scheduled Reminders.
*
- * @param bool $namesOnly
- * Return simple list of names.
- *
* @param \Civi\ActionSchedule\Mapping|null $filterMapping
* Filter by the schedule's mapping type.
* @param int $filterValue
* (reference) reminder list
* @throws \CRM_Core_Exception
*/
- public static function &getList($namesOnly = FALSE, $filterMapping = NULL, $filterValue = NULL) {
+ public static function getList($filterMapping = NULL, $filterValue = NULL): array {
+ $list = [];
$query = "
SELECT
title,
$mapping = CRM_Utils_Array::first(CRM_Core_BAO_ActionSchedule::getMappings([
'id' => ($this->_isTemplate ? CRM_Event_ActionMapping::EVENT_TPL_MAPPING_ID : CRM_Event_ActionMapping::EVENT_NAME_MAPPING_ID),
]));
- $reminderList = CRM_Core_BAO_ActionSchedule::getList(FALSE, $mapping, $this->_id);
- if ($reminderList && is_array($reminderList)) {
- // Add action links to each of the reminders
- foreach ($reminderList as & $format) {
- $action = CRM_Core_Action::UPDATE + CRM_Core_Action::DELETE;
- if ($format['is_active']) {
- $action += CRM_Core_Action::DISABLE;
- }
- else {
- $action += CRM_Core_Action::ENABLE;
- }
- $scheduleReminder = new CRM_Admin_Page_ScheduleReminders();
- $links = $scheduleReminder->links();
- $links[CRM_Core_Action::DELETE]['qs'] .= "&context=event&compId={$this->_id}";
- $links[CRM_Core_Action::UPDATE]['qs'] .= "&context=event&compId={$this->_id}";
- $format['action'] = CRM_Core_Action::formLink(
- $links,
- $action,
- ['id' => $format['id']],
- ts('more'),
- FALSE,
- 'actionSchedule.manage.action',
- 'ActionSchedule',
- $this->_id
- );
+ $reminderList = CRM_Core_BAO_ActionSchedule::getList($mapping, $this->_id);
+ // Add action links to each of the reminders
+ foreach ($reminderList as & $format) {
+ $action = CRM_Core_Action::UPDATE + CRM_Core_Action::DELETE;
+ if ($format['is_active']) {
+ $action += CRM_Core_Action::DISABLE;
}
+ else {
+ $action += CRM_Core_Action::ENABLE;
+ }
+ $scheduleReminder = new CRM_Admin_Page_ScheduleReminders();
+ $links = $scheduleReminder->links();
+ $links[CRM_Core_Action::DELETE]['qs'] .= "&context=event&compId={$this->_id}";
+ $links[CRM_Core_Action::UPDATE]['qs'] .= "&context=event&compId={$this->_id}";
+ $format['action'] = CRM_Core_Action::formLink(
+ $links,
+ $action,
+ ['id' => $format['id']],
+ ts('more'),
+ FALSE,
+ 'actionSchedule.manage.action',
+ 'ActionSchedule',
+ $this->_id
+ );
}
$this->assign('rows', $reminderList);