From: colemanw Date: Sun, 6 Aug 2023 15:21:03 +0000 (-0400) Subject: ActionMapping - Allow getDateFields to filter by entity_value X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=97c2a2cb6a6480d33673a1c8697f629f4c8cc90e;p=civicrm-core.git ActionMapping - Allow getDateFields to filter by entity_value --- diff --git a/CRM/Activity/ActionMapping.php b/CRM/Activity/ActionMapping.php index 6d9800e379..04a0a41f86 100644 --- a/CRM/Activity/ActionMapping.php +++ b/CRM/Activity/ActionMapping.php @@ -60,7 +60,7 @@ class CRM_Activity_ActionMapping extends \Civi\ActionSchedule\MappingBase { return CRM_Core_PseudoConstant::activityStatus(); } - public function getDateFields(): array { + public function getDateFields(?array $entityValue = NULL): array { return [ 'activity_date_time' => ts('Activity Date'), ]; diff --git a/CRM/Contact/ActionMapping.php b/CRM/Contact/ActionMapping.php index 52dea49e97..440d9fdde0 100644 --- a/CRM/Contact/ActionMapping.php +++ b/CRM/Contact/ActionMapping.php @@ -65,7 +65,7 @@ class CRM_Contact_ActionMapping extends \Civi\ActionSchedule\MappingBase { return CRM_Core_OptionGroup::values('contact_date_reminder_options'); } - public function getDateFields(): array { + public function getDateFields(?array $entityValue = NULL): array { return [ 'date_field' => ts('Date Field'), ]; diff --git a/CRM/Contribute/ActionMapping.php b/CRM/Contribute/ActionMapping.php index c986a14051..625fc1af58 100644 --- a/CRM/Contribute/ActionMapping.php +++ b/CRM/Contribute/ActionMapping.php @@ -40,7 +40,7 @@ abstract class CRM_Contribute_ActionMapping extends \Civi\ActionSchedule\Mapping return CRM_Contribute_BAO_Contribution::buildOptions('contribution_status_id', 'get', []); } - public function getDateFields(): array { + public function getDateFields(?array $entityValue = NULL): array { return [ 'receive_date' => ts('Receive Date'), 'cancel_date' => ts('Cancel Date'), diff --git a/CRM/Event/ActionMapping.php b/CRM/Event/ActionMapping.php index 7e9acad3ba..8049942cfb 100644 --- a/CRM/Event/ActionMapping.php +++ b/CRM/Event/ActionMapping.php @@ -43,13 +43,7 @@ abstract class CRM_Event_ActionMapping extends \Civi\ActionSchedule\MappingBase return CRM_Event_PseudoConstant::participantStatus(NULL, NULL, 'label'); } - /** - * Get a list of available date fields. - * - * @return array - * Array(string $fieldName => string $fieldLabel). - */ - public function getDateFields(): array { + public function getDateFields(?array $entityValue = NULL): array { return [ 'start_date' => ts('Event Start'), 'end_date' => ts('Event End'), diff --git a/CRM/Member/ActionMapping.php b/CRM/Member/ActionMapping.php index 1d5a50aaa8..9377861305 100644 --- a/CRM/Member/ActionMapping.php +++ b/CRM/Member/ActionMapping.php @@ -55,13 +55,7 @@ class CRM_Member_ActionMapping extends \Civi\ActionSchedule\MappingBase { return []; } - /** - * Get a list of available date fields. - * - * @return array - * Array(string $fieldName => string $fieldLabel). - */ - public function getDateFields(): array { + public function getDateFields(?array $entityValue = NULL): array { return [ 'join_date' => ts('Member Since'), 'start_date' => ts('Membership Start Date'), diff --git a/Civi/ActionSchedule/MappingBase.php b/Civi/ActionSchedule/MappingBase.php index cf68b80e2b..76c37839a5 100644 --- a/Civi/ActionSchedule/MappingBase.php +++ b/Civi/ActionSchedule/MappingBase.php @@ -89,7 +89,7 @@ abstract class MappingBase extends AutoSubscriber implements MappingInterface { return FALSE; } - public function getDateFields(): array { + public function getDateFields(?array $entityValue = NULL): array { return []; } diff --git a/Civi/ActionSchedule/MappingInterface.php b/Civi/ActionSchedule/MappingInterface.php index 2f6f75b721..610e14598c 100644 --- a/Civi/ActionSchedule/MappingInterface.php +++ b/Civi/ActionSchedule/MappingInterface.php @@ -68,12 +68,13 @@ interface MappingInterface extends SpecProviderInterface { public function getStatusLabels(?array $entityValue): array; /** - * Get a list of available date fields. + * Get option list for `start_action_date` & `end_date` fields. * + * @param array|null $entityValue + * Selected value(s) of the `entity_value` field. * @return array - * Array(string $fieldName => string $fieldLabel). */ - public function getDateFields(): array; + public function getDateFields(?array $entityValue = NULL): array; /** * Get the option list for `limit_to` (non-associative format)