From: unknown Date: Mon, 29 Sep 2014 17:36:54 +0000 (+0100) Subject: Moved function updateModeRecurringEntityForEvent to ManageEvent/Repeat.php X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=b9503f8cbdfc399b34d9a3bce35fcf2eabad02e0;p=civicrm-core.git Moved function updateModeRecurringEntityForEvent to ManageEvent/Repeat.php --- diff --git a/CRM/Core/Page/AJAX/RecurringEntity.php b/CRM/Core/Page/AJAX/RecurringEntity.php index 26b4b5ecd3..1bdc309356 100644 --- a/CRM/Core/Page/AJAX/RecurringEntity.php +++ b/CRM/Core/Page/AJAX/RecurringEntity.php @@ -24,7 +24,7 @@ class CRM_Core_Page_AJAX_RecurringEntity { if(CRM_Utils_Array::value('linkedEntityTable', $_REQUEST)){ $result = array(); - $result = CRM_Event_BAO_Event::updateModeRecurringEntityForEvent($entityId, $_REQUEST['linkedEntityTable']); + $result = CRM_Event_Form_ManageEvent_Repeat::updateModeRecurringEntityForEvent($entityId, $_REQUEST['linkedEntityTable']); } $dao = new CRM_Core_DAO_RecurringEntity(); diff --git a/CRM/Event/BAO/Event.php b/CRM/Event/BAO/Event.php index 375debdc75..a427b5a4dd 100644 --- a/CRM/Event/BAO/Event.php +++ b/CRM/Event/BAO/Event.php @@ -2201,49 +2201,4 @@ LEFT JOIN civicrm_price_field_value value ON ( value.id = lineItem.price_field return CRM_Core_PseudoConstant::get(__CLASS__, $fieldName, $params, $context); } - /** - * Update mode column in civicrm_recurring_entity table for event related tabs - * - * @params int $entityId event id - * @params string $linkedEntityTable Linked entity table name for this event - * @return array - */ - public static function updateModeRecurringEntityForEvent($entityId, $linkedEntityTable){ - $result = array(); - if( $entityId && $linkedEntityTable ){ - switch ($linkedEntityTable) { - case 'civicrm_tell_friend': - $dao = 'CRM_Friend_DAO_Friend'; - $entityTable = 'civicrm_tell_friend'; - break; - - case 'civicrm_pcp_block': - $dao = 'CRM_PCP_DAO_PCPBlock'; - $entityTable = 'civicrm_pcp_block'; - break; - - case 'civicrm_price_set_entity': - $dao = 'CRM_Price_DAO_PriceSetEntity'; - $entityTable = 'civicrm_price_set_entity'; - break; - - case 'civicrm_uf_join': - $dao = 'CRM_Core_DAO_UFJoin'; - $entityTable = 'civicrm_uf_join'; - break; - } - $params = array( - 'entity_id' => $entityId, - 'entity_table' => 'civicrm_event' - ); - $defaults = array(); - CRM_Core_DAO::commonRetrieve($dao, $params, $defaults); - if(CRM_Utils_Array::value('id', $defaults)){ - $result['entityId'] = $defaults['id']; - $result['entityTable'] = $entityTable; - } - } - return $result; - } -} - +} \ No newline at end of file diff --git a/CRM/Event/Form/ManageEvent/Repeat.php b/CRM/Event/Form/ManageEvent/Repeat.php index a70258c816..58b1245357 100644 --- a/CRM/Event/Form/ManageEvent/Repeat.php +++ b/CRM/Event/Form/ManageEvent/Repeat.php @@ -253,6 +253,50 @@ class CRM_Event_Form_ManageEvent_Repeat extends CRM_Event_Form_ManageEvent { $dao->fetch(); } return $dao; - } + } + /** + * Update mode column in civicrm_recurring_entity table for event related tabs + * + * @params int $entityId event id + * @params string $linkedEntityTable Linked entity table name for this event + * @return array + */ + public static function updateModeRecurringEntityForEvent($entityId, $linkedEntityTable){ + $result = array(); + if( $entityId && $linkedEntityTable ){ + switch ($linkedEntityTable) { + case 'civicrm_tell_friend': + $dao = 'CRM_Friend_DAO_Friend'; + $entityTable = 'civicrm_tell_friend'; + break; + + case 'civicrm_pcp_block': + $dao = 'CRM_PCP_DAO_PCPBlock'; + $entityTable = 'civicrm_pcp_block'; + break; + + case 'civicrm_price_set_entity': + $dao = 'CRM_Price_DAO_PriceSetEntity'; + $entityTable = 'civicrm_price_set_entity'; + break; + + case 'civicrm_uf_join': + $dao = 'CRM_Core_DAO_UFJoin'; + $entityTable = 'civicrm_uf_join'; + break; + } + $params = array( + 'entity_id' => $entityId, + 'entity_table' => 'civicrm_event' + ); + $defaults = array(); + CRM_Core_DAO::commonRetrieve($dao, $params, $defaults); + if(CRM_Utils_Array::value('id', $defaults)){ + $result['entityId'] = $defaults['id']; + $result['entityTable'] = $entityTable; + } + } + return $result; + } }