Merge pull request #15045 from mattwire/detaillogging_viewdelete
[civicrm-core.git] / CRM / Member / ActionMapping.php
index ee9c1b81707651629bed3111988a34e0113a4713..13c5053fda02df9c468b0ad28a425c5d60819cb6 100644 (file)
@@ -145,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;
   }
 
@@ -172,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;
+    }
+  }
+
 }