Update cascade for all related tabs in Manage events
authorunknown <priyanka.karan26@gmail.com>
Wed, 17 Sep 2014 12:22:45 +0000 (13:22 +0100)
committerdeepak-srivastava <deepak.srivastava.0303@gmail.com>
Fri, 3 Oct 2014 09:08:26 +0000 (10:08 +0100)
CRM/Core/Form/RecurringEntity.php
CRM/Event/BAO/Event.php
templates/CRM/Event/Form/ManageEvent/ConfirmRepeatMode.tpl

index 468877aeff427ed593172a9a667ff2e6ab45e158..19151dbe8116fc85133ab26a160d65d2d270b1e5 100644 (file)
@@ -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',
index 8b31dc0d1bb20582eb8753f3b7ceab213da4bf2e..0b9bf753ebb021c42f50691f198e182b177f3c11 100644 (file)
@@ -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;
index d10c44e262755c184ce10da5a51a88388110ee0d..84a3a9425e37c9a0b42c1d6c0eebac0188d3ce18 100644 (file)
 <script>
   CRM.$(function($) {
     //Tab and table mapper
-    var mapper = {'CRM_Event_Form_ManageEvent_EventInfo': 'civicrm_event',
-                'CRM_Event_Form_ManageEvent_Location': 'civicrm_location',
-                'CRM_Event_Form_ManageEvent_Fee': 'civicrm_fee',
-                'CRM_Event_Form_ManageEvent_Registration': 'civicrm_registration',
+    var mapper = {'CRM_Event_Form_ManageEvent_EventInfo': '',
+                'CRM_Event_Form_ManageEvent_Location': '',
+                'CRM_Event_Form_ManageEvent_Fee': 'civicrm_price_set_entity',
+                'CRM_Event_Form_ManageEvent_Registration': 'civicrm_uf_join',
                 'CRM_Friend_Form_Event': 'civicrm_tell_friend',
                 'CRM_PCP_Form_Event': 'civicrm_pcp_block'
                 };
-    //var findTellAFriend = false;
+    
     var form = '';
     $('#crm-main-content-wrapper').on('click', 'div.crm-submit-buttons span.crm-button input[value="Save"], div.crm-submit-buttons span.crm-button input[value="Save and Done"]', function() {
         form = $(this).parents('form:first').attr('class');
-        if( form != "" && mapper.hasOwnProperty(form)){
-/*            var re = new RegExp("^CRM_Friend_", "i");
-            var match = re.test(form);
-            if (match == true){
-                findTellAFriend = true;
-            }else{
-                findTellAFriend = false;
-            }
-*/
+        if( form != "" && mapper.hasOwnProperty(form) ){
           $("#repeat-mode-dailog").dialog({
             title: 'How does this change affect other repeating events in the set?',
             modal: true,