Function to delete relation from recurringentity, xml path correction for ajax calls
authorunknown <priyanka.karan26@gmail.com>
Sat, 6 Sep 2014 19:47:12 +0000 (20:47 +0100)
committerdeepak-srivastava <deepak.srivastava.0303@gmail.com>
Fri, 3 Oct 2014 08:55:16 +0000 (09:55 +0100)
CRM/Core/BAO/RecurringEntity.php
CRM/Core/xml/Menu/Misc.xml
CRM/Event/xml/Menu/Event.xml

index 5fd14605b1b145c2d551b17316f0bba35231cacd..3622a4b0cb5d4a8d98e4ea928aeecbb14b20a2f1 100644 (file)
@@ -488,5 +488,17 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity {
       }
     }
   }
+  
+  static public function delEntityRelations($entityId, $entityTable){
+    if(!$entityId && !$entityTable){
+      return FALSE;
+    }
+    $parentID = self::getParentFor($entityId, $entityTable);
+    if($parentID){
+      $dao = new CRM_Core_DAO_RecurringEntity();
+      $dao->parent_id = $parentID;
+      return $dao->delete();
+    }
+  }
     
 }
index e1f4a1d11d43694c01890bdc8514851933ac1a95..bd681ea47b34fb325bd24d4dc5e69949a5622b4f 100644 (file)
     <page_callback>CRM_Core_Page_Angular</page_callback>
     <access_arguments>access CiviCRM</access_arguments>
   </item>
+  <item>
+     <path>civicrm/ajax/recurringEntity/update_cascade_type</path>
+     <page_callback>CRM_Core_Page_AJAX_RecurringEntity::updateCascadeType</page_callback>
+     <access_arguments>access CiviCRM,access CiviEvent</access_arguments>
+  </item>
+  <item>
+     <path>civicrm/ajax/recurringEntity/generate_preview</path>
+     <page_callback>CRM_Core_Page_AJAX_RecurringEntity::generatePreview</page_callback>
+     <access_arguments>access CiviCRM,access CiviEvent</access_arguments>
+  </item>
 </menu>
index 64ffc375ba2a951b469e49ee1dd46d51ef44bd1c..bac9d23024d3cfbf9fb3e14a42e0aa5d1142011b 100644 (file)
     <page_callback>CRM_Event_Form_ParticipantFeeSelection</page_callback>
     <access_arguments>access CiviEvent</access_arguments>
   </item>
-  <item>
-     <path>civicrm/ajax/recurringEntity/update_cascade_type</path>
-     <page_callback>CRM_Core_Page_AJAX_RecurringEntity::updateCascadeType</page_callback>
-     <access_arguments>access CiviCRM,access CiviEvent</access_arguments>
-  </item>
-  <item>
-     <path>civicrm/ajax/recurringEntity/generate_preview</path>
-     <page_callback>CRM_Core_Page_AJAX_RecurringEntity::generatePreview</page_callback>
-     <access_arguments>access CiviCRM,access CiviEvent</access_arguments>
-  </item>
 </menu>