From 74affe5c5510a6f5e20f133402c9789a870e6a35 Mon Sep 17 00:00:00 2001 From: Deepak Srivastava Date: Mon, 21 Oct 2013 19:32:30 +0530 Subject: [PATCH] CRM-13619 - tab display based on configurations --- CRM/Event/Form/ManageEvent/TabHeader.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/CRM/Event/Form/ManageEvent/TabHeader.php b/CRM/Event/Form/ManageEvent/TabHeader.php index e9905a3fbb..57b93405e7 100644 --- a/CRM/Event/Form/ManageEvent/TabHeader.php +++ b/CRM/Event/Form/ManageEvent/TabHeader.php @@ -165,9 +165,12 @@ class CRM_Event_Form_ManageEvent_TabHeader { // retrieve info about paid event, tell a friend and online reg $sql = " -SELECT e.is_online_registration, e.is_monetary, taf.is_active +SELECT e.loc_block_id as is_location, e.is_online_registration, e.is_monetary, taf.is_active, pcp.id as is_pcp, sch.id as is_reminder FROM civicrm_event e LEFT JOIN civicrm_tell_friend taf ON ( taf.entity_table = 'civicrm_event' AND taf.entity_id = e.id ) +LEFT JOIN civicrm_pcp_block pcp ON ( pcp.entity_table = 'civicrm_event' AND pcp.entity_id = e.id ) +LEFT JOIN civicrm_action_mapping map ON ( map.entity_value = 'civicrm_event' ) +LEFT JOIN civicrm_action_schedule sch ON ( sch.mapping_id = map.id AND sch.entity_value = %1 ) WHERE e.id = %1 "; $params = array(1 => array($eventID, 'Integer')); @@ -176,6 +179,10 @@ WHERE e.id = %1 CRM_Core_Error::fatal(); } + if (!$dao->is_location) { + $tabs['location']['valid'] = FALSE; + } + if (!$dao->is_online_registration) { $tabs['registration']['valid'] = FALSE; } @@ -188,6 +195,13 @@ WHERE e.id = %1 $tabs['friend']['valid'] = FALSE; } + if (!$dao->is_pcp) { + $tabs['pcp']['valid'] = FALSE; + } + + if (!$dao->is_reminder) { + $tabs['reminder']['valid'] = FALSE; + } //calculate if the reminder has been configured for this event } -- 2.25.1