X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FMember%2FActionMapping.php;h=13c5053fda02df9c468b0ad28a425c5d60819cb6;hb=f68ee4ec5e94cc51d5e4a6aa9335d913cb497ed6;hp=3546c48f90863aef8b8e459772efb1a8a9902a0d;hpb=3b1e452b9449056fef9e225e7b6988322bc1229f;p=civicrm-core.git diff --git a/CRM/Member/ActionMapping.php b/CRM/Member/ActionMapping.php index 3546c48f90..13c5053fda 100644 --- a/CRM/Member/ActionMapping.php +++ b/CRM/Member/ActionMapping.php @@ -25,7 +25,6 @@ +--------------------------------------------------------------------+ */ -use Civi\ActionSchedule\RecipientBuilder; /** * Class CRM_Member_ActionMapping @@ -146,11 +145,6 @@ class CRM_Member_ActionMapping extends \Civi\ActionSchedule\Mapping { $query->where("e.status_id IN (#memberStatus)") ->param('memberStatus', \CRM_Member_PseudoConstant::membershipStatus(NULL, "(is_current_member = 1 OR name = 'Expired')", 'id')); - // Why is this only for civicrm_membership? - if ($schedule->start_action_date && $schedule->is_repeat == FALSE) { - $query['casUseReferenceDate'] = TRUE; - } - return $query; } @@ -173,4 +167,21 @@ class CRM_Member_ActionMapping extends \Civi\ActionSchedule\Mapping { ->where('!( e.owner_membership_id IS NOT NULL AND rela.id IS NULL and relb.id IS NULL )'); } + /** + * Determine whether a schedule based on this mapping should + * reset the reminder state if the trigger date changes. + * + * @return bool + * + * @param \CRM_Core_DAO_ActionSchedule $schedule + */ + public function resetOnTriggerDateChange($schedule) { + if ($schedule->absolute_date !== NULL) { + return FALSE; + } + else { + return TRUE; + } + } + }