From: unknown Date: Wed, 17 Sep 2014 12:22:45 +0000 (+0100) Subject: Update cascade for all related tabs in Manage events X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=a87e3fe098aeb85cf328bb36a00560a659f2855a;p=civicrm-core.git Update cascade for all related tabs in Manage events --- diff --git a/CRM/Core/Form/RecurringEntity.php b/CRM/Core/Form/RecurringEntity.php index 468877aeff..19151dbe81 100644 --- a/CRM/Core/Form/RecurringEntity.php +++ b/CRM/Core/Form/RecurringEntity.php @@ -295,7 +295,7 @@ class CRM_Core_Form_RecurringEntity { 'entity_table' => 'civicrm_event' ), 'linkedColumns' => array('entity_id'), - 'isRecurringEntityRecord' => FALSE, + 'isRecurringEntityRecord' => TRUE, ), array( 'table' => 'civicrm_uf_join', @@ -304,7 +304,7 @@ class CRM_Core_Form_RecurringEntity { 'entity_table' => 'civicrm_event' ), 'linkedColumns' => array('entity_id'), - 'isRecurringEntityRecord' => FALSE, + 'isRecurringEntityRecord' => TRUE, ), array( 'table' => 'civicrm_tell_friend', diff --git a/CRM/Event/BAO/Event.php b/CRM/Event/BAO/Event.php index 8b31dc0d1b..0b9bf753eb 100644 --- a/CRM/Event/BAO/Event.php +++ b/CRM/Event/BAO/Event.php @@ -2213,33 +2213,35 @@ LEFT JOIN civicrm_price_field_value value ON ( value.id = lineItem.price_field if( $entityId && $linkedEntityTable ){ switch ($linkedEntityTable) { case 'civicrm_tell_friend': - $params = array( - 'entity_id' => $entityId, - 'entity_table' => 'civicrm_event' - ); - $defaults = array(); - CRM_Core_DAO::commonRetrieve('CRM_Friend_DAO_Friend', $params, $defaults); - if(CRM_Utils_Array::value('id', $defaults)){ - $result['entityId'] = $defaults['id']; - $result['entityTable'] = 'civicrm_tell_friend'; - } + $dao = 'CRM_Friend_DAO_Friend'; + $entityTable = 'civicrm_tell_friend'; break; case 'civicrm_pcp_block': - $params = array( + $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('CRM_PCP_DAO_PCPBlock', $params, $defaults); - if(CRM_Utils_Array::value('id', $defaults)){ - $result['entityId'] = $defaults['id']; - $result['entityTable'] = 'civicrm_pcp_block'; - } - break; - - default: - break; + $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; diff --git a/templates/CRM/Event/Form/ManageEvent/ConfirmRepeatMode.tpl b/templates/CRM/Event/Form/ManageEvent/ConfirmRepeatMode.tpl index d10c44e262..84a3a9425e 100644 --- a/templates/CRM/Event/Form/ManageEvent/ConfirmRepeatMode.tpl +++ b/templates/CRM/Event/Form/ManageEvent/ConfirmRepeatMode.tpl @@ -69,26 +69,18 @@