From: Jitendra Purohit Date: Fri, 11 May 2018 10:58:30 +0000 (+0530) Subject: membership/issues/2 - Add membership start date and registration start/end date to... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=9f1cadcef6cbd1078b680a02957634b94329ea7b;p=civicrm-core.git membership/issues/2 - Add membership start date and registration start/end date to schedule reminder --- diff --git a/CRM/Event/ActionMapping.php b/CRM/Event/ActionMapping.php index c58591407b..6f50a0b444 100644 --- a/CRM/Event/ActionMapping.php +++ b/CRM/Event/ActionMapping.php @@ -61,8 +61,6 @@ class CRM_Event_ActionMapping extends \Civi\ActionSchedule\Mapping { 'entity_value_label' => ts('Event Type'), 'entity_status' => 'civicrm_participant_status_type', 'entity_status_label' => ts('Participant Status'), - 'entity_date_start' => 'event_start_date', - 'entity_date_end' => 'event_end_date', ))); $registrations->register(CRM_Event_ActionMapping::create(array( 'id' => CRM_Event_ActionMapping::EVENT_NAME_MAPPING_ID, @@ -72,8 +70,6 @@ class CRM_Event_ActionMapping extends \Civi\ActionSchedule\Mapping { 'entity_value_label' => ts('Event Name'), 'entity_status' => 'civicrm_participant_status_type', 'entity_status_label' => ts('Participant Status'), - 'entity_date_start' => 'event_start_date', - 'entity_date_end' => 'event_end_date', ))); $registrations->register(CRM_Event_ActionMapping::create(array( 'id' => CRM_Event_ActionMapping::EVENT_TPL_MAPPING_ID, @@ -83,11 +79,24 @@ class CRM_Event_ActionMapping extends \Civi\ActionSchedule\Mapping { 'entity_value_label' => ts('Event Template'), 'entity_status' => 'civicrm_participant_status_type', 'entity_status_label' => ts('Participant Status'), - 'entity_date_start' => 'event_start_date', - 'entity_date_end' => 'event_end_date', ))); } + /** + * Get a list of available date fields. + * + * @return array + * Array(string $fieldName => string $fieldLabel). + */ + public function getDateFields() { + return array( + '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'), + ); + } + /** * Get a list of recipient types. * diff --git a/CRM/Member/ActionMapping.php b/CRM/Member/ActionMapping.php index 59429f80b9..069577e9da 100644 --- a/CRM/Member/ActionMapping.php +++ b/CRM/Member/ActionMapping.php @@ -58,11 +58,23 @@ class CRM_Member_ActionMapping extends \Civi\ActionSchedule\Mapping { 'entity_value_label' => ts('Membership Type'), 'entity_status' => 'auto_renew_options', 'entity_status_label' => ts('Auto Renew Options'), - 'entity_date_start' => 'membership_join_date', - 'entity_date_end' => 'membership_end_date', ))); } + /** + * Get a list of available date fields. + * + * @return array + * Array(string $fieldName => string $fieldLabel). + */ + public function getDateFields() { + return array( + 'join_date' => ts('Membership Join Date'), + 'start_date' => ts('Membership Start Date'), + 'end_date' => ts('Membership End Date'), + ); + } + /** * Generate a query to locate recipients who match the given * schedule.