X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FEvent%2FActionMapping.php;h=c474a8dba6aaf87b5afd7ffaf7a5533fd66bdebd;hb=e351d61a67dbdd1e1a3b24ed6c36997392934a81;hp=9c8aaae7a5070c7b28ba118b9cb23cfe76f7819d;hpb=eb13bcb96bf6b45256d496c4b40fe6456762e85b;p=civicrm-core.git diff --git a/CRM/Event/ActionMapping.php b/CRM/Event/ActionMapping.php index 9c8aaae7a5..c474a8dba6 100644 --- a/CRM/Event/ActionMapping.php +++ b/CRM/Event/ActionMapping.php @@ -74,10 +74,10 @@ class CRM_Event_ActionMapping extends \Civi\ActionSchedule\Mapping { */ public function getDateFields() { return [ - 'start_date' => ts('Event Start Date'), - 'end_date' => ts('Event End Date'), - 'registration_start_date' => ts('Registration Start Date'), - 'registration_end_date' => ts('Registration End Date'), + 'start_date' => ts('Event Start'), + 'end_date' => ts('Event End'), + 'registration_start_date' => ts('Registration Start'), + 'registration_end_date' => ts('Registration End'), ]; } @@ -140,7 +140,7 @@ class CRM_Event_ActionMapping extends \Civi\ActionSchedule\Mapping { $query['casContactIdField'] = 'e.contact_id'; $query['casEntityIdField'] = 'e.id'; $query['casContactTableAlias'] = NULL; - $query['casDateField'] = str_replace('event_', 'r.', $schedule->start_action_date); + $query['casDateField'] = str_replace('event_', 'r.', ($schedule->start_action_date ?? '')); if (empty($query['casDateField']) && $schedule->absolute_date) { $query['casDateField'] = "'" . CRM_Utils_Type::escape($schedule->absolute_date, 'String') . "'"; } @@ -149,8 +149,9 @@ class CRM_Event_ActionMapping extends \Civi\ActionSchedule\Mapping { if ($schedule->recipient_listing && $schedule->limit_to) { switch ($schedule->recipient) { case 'participant_role': - $query->where("e.role_id IN (#recipList)") - ->param('recipList', \CRM_Utils_Array::explodePadded($schedule->recipient_listing)); + $regex = "([[:cntrl:]]|^)" . implode('([[:cntrl:]]|$)|([[:cntrl:]]|^)', \CRM_Utils_Array::explodePadded($schedule->recipient_listing)) . "([[:cntrl:]]|$)"; + $query->where("e.role_id REGEXP (@regex)") + ->param('regex', $regex); break; default: