diff --git a/CRM/Event/Form/ManageEvent/Repeat.php b/CRM/Event/Form/ManageEvent/Repeat.php index 2012c6c9d313..591060786284 100644 --- a/CRM/Event/Form/ManageEvent/Repeat.php +++ b/CRM/Event/Form/ManageEvent/Repeat.php @@ -1,14 +1,16 @@ _id; + } + public function preProcess() { parent::preProcess(); $this->setSelectedChild('repeat'); - $this->assign('currentEventId', $this->_id); + $this->assign('currentEventId', $this->getEventId()); - $checkParentExistsForThisId = CRM_Core_BAO_RecurringEntity::getParentFor($this->_id, 'civicrm_event'); + $checkParentExistsForThisId = CRM_Core_BAO_RecurringEntity::getParentFor($this->getEventId(), 'civicrm_event'); //If this ID has parent, send parent id if ($checkParentExistsForThisId) { /** @@ -64,7 +73,7 @@ public function preProcess() { } } - $parentEventParams = ['id' => $this->_id]; + $parentEventParams = ['id' => $this->getEventId()]; $parentEventValues = []; $parentEventReturnProperties = ['start_date', 'end_date']; $parentEventAttributes = CRM_Core_DAO::commonRetrieve('CRM_Event_DAO_Event', $parentEventParams, $parentEventValues, $parentEventReturnProperties); @@ -83,7 +92,7 @@ public function setDefaultValues() { $defaults = []; //Always pass current event's start date by default - $defaults['repetition_start_date'] = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $this->_id, 'start_date', 'id'); + $defaults['repetition_start_date'] = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $this->getEventId(), 'start_date', 'id'); $recurringEntityDefaults = CRM_Core_Form_RecurringEntity::setDefaultValues(); return array_merge($defaults, $recurringEntityDefaults); } @@ -93,7 +102,7 @@ public function buildQuickForm() { } public function postProcess() { - if ($this->_id) { + if ($this->getEventId()) { $params = $this->controller->exportValues($this->_name); if ($this->_parentEventStartDate && $this->_parentEventEndDate) { $interval = CRM_Core_BAO_RecurringEntity::getInterval($this->_parentEventStartDate, $this->_parentEventEndDate); @@ -102,22 +111,22 @@ public function postProcess() { $params['dateColumns'] = ['start_date']; $params['excludeDateRangeColumns'] = ['start_date', 'end_date']; $params['entity_table'] = 'civicrm_event'; - $params['entity_id'] = $this->_id; + $params['entity_id'] = $this->getEventId(); // CRM-16568 - check if parent exist for the event. - $parentId = CRM_Core_BAO_RecurringEntity::getParentFor($this->_id, 'civicrm_event'); + $parentId = CRM_Core_BAO_RecurringEntity::getParentFor($this->getEventId(), 'civicrm_event'); $params['parent_entity_id'] = !empty($parentId) ? $parentId : $params['entity_id']; //Unset event id unset($params['id']); $url = 'civicrm/event/manage/repeat'; - $urlParams = "action=update&reset=1&id={$this->_id}&selectedChild=repeat"; + $urlParams = "action=update&reset=1&id={$this->getEventId()}&selectedChild=repeat"; $linkedEntities = [ [ 'table' => 'civicrm_price_set_entity', 'findCriteria' => [ - 'entity_id' => $this->_id, + 'entity_id' => $this->getEventId(), 'entity_table' => 'civicrm_event', ], 'linkedColumns' => ['entity_id'], @@ -126,7 +135,7 @@ public function postProcess() { [ 'table' => 'civicrm_uf_join', 'findCriteria' => [ - 'entity_id' => $this->_id, + 'entity_id' => $this->getEventId(), 'entity_table' => 'civicrm_event', ], 'linkedColumns' => ['entity_id'], @@ -135,7 +144,7 @@ public function postProcess() { [ 'table' => 'civicrm_tell_friend', 'findCriteria' => [ - 'entity_id' => $this->_id, + 'entity_id' => $this->getEventId(), 'entity_table' => 'civicrm_event', ], 'linkedColumns' => ['entity_id'], @@ -144,7 +153,7 @@ public function postProcess() { [ 'table' => 'civicrm_pcp_block', 'findCriteria' => [ - 'entity_id' => $this->_id, + 'entity_id' => $this->getEventId(), 'entity_table' => 'civicrm_event', ], 'linkedColumns' => ['entity_id'], @@ -155,7 +164,7 @@ public function postProcess() { CRM_Utils_System::redirect(CRM_Utils_System::url($url, $urlParams)); } else { - CRM_Core_Error::statusBounce("Could not find Event ID"); + CRM_Core_Error::statusBounce(ts('Could not find Event ID')); } parent::endPostProcess(); } diff --git a/templates/CRM/Event/Page/ManageEvent.tpl b/templates/CRM/Event/Page/ManageEvent.tpl index 0adfb8893eee..b634902a124c 100644 --- a/templates/CRM/Event/Page/ManageEvent.tpl +++ b/templates/CRM/Event/Page/ManageEvent.tpl @@ -94,14 +94,14 @@