'entity_table' => 'civicrm_event'
),
'linkedColumns' => array('entity_id'),
- 'isRecurringEntityRecord' => FALSE,
+ 'isRecurringEntityRecord' => TRUE,
),
array(
'table' => 'civicrm_uf_join',
'entity_table' => 'civicrm_event'
),
'linkedColumns' => array('entity_id'),
- 'isRecurringEntityRecord' => FALSE,
+ 'isRecurringEntityRecord' => TRUE,
),
array(
'table' => 'civicrm_tell_friend',
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;
<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,