public function build() {
$this->buildRelFirstPass();
- if ($this->prepareAddlFilter('c.id') && $this->notTemplate()) {
+ if ($this->prepareAddlFilter('c.id') && $this->mapping->sendToAdditional($this->actionSchedule->entity_value)) {
$this->buildAddlFirstPass();
}
$this->buildRelRepeatPass();
}
- if ($this->actionSchedule->is_repeat && $this->prepareAddlFilter('c.id')) {
+ if ($this->actionSchedule->is_repeat && $this->prepareAddlFilter('c.id') && $this->mapping->sendToAdditional($this->actionSchedule->entity_value)) {
$this->buildAddlRepeatPass();
}
}
return $this->mapping->resetOnTriggerDateChange($this->actionSchedule);
}
- /**
- * Confirm this object isn't attached to a template.
- * Returns TRUE if this action schedule isn't attached to a template.
- * Templates are (currently) unique to events, so we only evaluate those.
- *
- * @return bool;
- */
- private function notTemplate() {
- if ($this->mapping->getEntity() === 'civicrm_participant') {
- $entityId = $this->actionSchedule->entity_value;
- $query = new \CRM_Utils_SQL_Select('civicrm_event e');
- $sql = $query
- ->select('is_template')
- ->where("e.id = {$entityId}")
- ->toSQL();
- $dao = \CRM_Core_DAO::executeQuery($sql);
- return !(bool) $dao->fetchValue();
- }
- return TRUE;
- }
-
}