CRM-13776 limit the reminder to 'administer CiviCRM' permission
authoryashodha <yashodha.chaku@webaccess.co.in>
Wed, 7 May 2014 01:15:02 +0000 (06:45 +0530)
committeryashodha <yashodha.chaku@webaccess.co.in>
Wed, 7 May 2014 01:15:02 +0000 (06:45 +0530)
CRM/Event/Form/ManageEvent/TabHeader.php
CRM/Event/Page/ManageEvent.php
templates/CRM/Event/Page/EventInfo.tpl

index d5927f0ef24271df7d3d527cac91e88f14fb5aee..a22c87ae4d551281555653b0222730b4395ca198 100644 (file)
@@ -75,16 +75,18 @@ class CRM_Event_Form_ManageEvent_TabHeader {
       'class' => 'ajaxForm',
     );
 
-    $tabs = array(
-      'settings' => array('title' => ts('Info and Settings'), 'class' => 'ajaxForm livePage') + $default,
-      'location' => array('title' => ts('Event Location')) + $default,
-      'fee' => array('title' => ts('Fees')) + $default,
-      'registration' => array('title' => ts('Online Registration')) + $default,
-      'reminder' => array('title' => ts('Schedule Reminders'), 'class' => 'livePage') + $default,
-      'conference' => array('title' => ts('Conference Slots')) + $default,
-      'friend' => array('title' => ts('Tell a Friend')) + $default,
-      'pcp' => array('title' => ts('Personal Campaigns')) + $default,
-    );
+    $tabs = array();
+    $tabs['settings'] = array('title' => ts('Info and Settings'), 'class' => 'ajaxForm livePage') + $default;
+    $tabs['location'] = array('title' => ts('Event Location')) + $default;
+    $tabs['fee'] = array('title' => ts('Fees')) + $default;
+    $tabs['registration'] = array('title' => ts('Online Registration')) + $default;
+    if (CRM_Core_Permission::check('administer CiviCRM')) {
+      $tabs['reminder'] = array('title' => ts('Schedule Reminders'), 'class' => 'livePage') + $default;
+    }
+    $tabs['conference'] = array('title' => ts('Conference Slots')) + $default;
+    $tabs['friend'] = array('title' => ts('Tell a Friend')) + $default;
+    $tabs['pcp'] = array('title' => ts('Personal Campaigns')) + $default;
+
 
     // check if we're in shopping cart mode for events
     $enableCart = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::EVENT_PREFERENCES_NAME,
index 026dc185b5e000674508feec28aadc197abeeef2..31d46c50ffdd5c0bbe04209a10c184b0c289cf89 100644 (file)
@@ -108,48 +108,58 @@ class CRM_Event_Page_ManageEvent extends CRM_Core_Page {
       self::$_tabLinks = array();
     }
     if (!isset(self::$_tabLinks[$cacheKey])) {
-      self::$_tabLinks[$cacheKey] = array(
-        'settings' => array(
+      self::$_tabLinks[$cacheKey]['settings'] =
+        array(
           'title' => ts('Info and Settings'),
           'url' => 'civicrm/event/manage/settings',
           'field' => 'id'
-        ),
-        'location' => array(
+        );
+      self::$_tabLinks[$cacheKey]['location'] =
+        array(
           'title' => ts('Location'),
           'url' => 'civicrm/event/manage/location',
           'field' => 'loc_block_id',
-        ),
-        'fee' => array(
+        );
+
+      self::$_tabLinks[$cacheKey]['fee'] =
+        array(
           'title' => ts('Fees'),
           'url' => 'civicrm/event/manage/fee',
           'field' => 'is_monetary',
-        ),
-        'registration' => array(
+        );
+      self::$_tabLinks[$cacheKey]['registration'] =
+        array(
           'title' => ts('Online Registration'),
           'url' => 'civicrm/event/manage/registration',
           'field' => 'is_online_registration',
-        ),
-        'reminder' => array(
+        );
+      if (CRM_Core_Permission::check('administer CiviCRM')) {
+      self::$_tabLinks[$cacheKey]['reminder'] =
+        array(
           'title' => ts('Schedule Reminders'),
           'url' => 'civicrm/event/manage/reminder',
           'field' => 'reminder',
-        ),
-        'conference' => array(
+        );
+      }
+      self::$_tabLinks[$cacheKey]['conference'] =
+        array(
           'title' => ts('Conference Slots'),
           'url' => 'civicrm/event/manage/conference',
           'field' => 'slot_label_id',
-        ),
-        'friend' => array(
+        );
+      self::$_tabLinks[$cacheKey]['friend'] =
+        array(
           'title' => ts('Tell a Friend'),
           'url' => 'civicrm/event/manage/friend',
           'field' => 'friend',
-        ),
-        'pcp' => array(
+        );
+      self::$_tabLinks[$cacheKey]['pcp'] =
+        array(
           'title' => ts('Personal Campaign Pages'),
           'url' => 'civicrm/event/manage/pcp',
           'field' => 'is_pcp_enabled',
-        ),
-      );
+        );
+
     }
 
     if (!$enableCart) {
index 86a9c0de244979cda0030d568b0de11569af8126..2e2a77082fdefa03cc16012ce4ff1d2caadefaf6 100644 (file)
 <div class="crm-actions-ribbon crm-event-manage-tab-actions-ribbon">
   <ul id="actions">
 {if call_user_func(array('CRM_Core_Permission','check'), 'edit all events')}
-
-  <li><div id="crm-event-links-wrapper">
-        <div id="crm-event-configure-link"><span title="{ts}Configure this event.{/ts}"><div class="icon settings-icon"></div></span></div>
-        <div class="ac_results" id="crm-event-links-list" style="margin-left: -25px;">
-             <div class="crm-event-links-list-inner">
-               <ul>
-                <li><a title="{ts}Info and Settings{/ts}" href="{crmURL p='civicrm/event/manage/settings' q="reset=1&action=update&id=`$event.id`"}">{ts}Info and Settings{/ts}</a></li>
-                <li><a title="{ts}Location{/ts}" href="{crmURL p='civicrm/event/manage/location' q="reset=1&action=update&id=`$event.id`"}">{ts}Location{/ts}</a></li>
-                <li><a title="{ts}Fees{/ts}" href="{crmURL p='civicrm/event/manage/fee' q="reset=1&action=update&id=`$event.id`"}">{ts}Fees{/ts}</a></li>
-                <li><a title="{ts}Online Registration{/ts}" href="{crmURL p='civicrm/event/manage/registration' q="reset=1&action=update&id=`$event.id`"}">{ts}Online Registration{/ts}</a></li>
-                <li><a title="{ts}Schedule Reminders{/ts}" href="{crmURL p='civicrm/event/manage/reminder' q="reset=1&action=update&id=`$event.id`"}">{ts}Schedule Reminders{/ts}</a></li>
-                    {if $eventCartEnabled}
-                    <li><a title="{ts}Conference Slots{/ts}" href="{crmURL p='civicrm/event/manage/conference' q="reset=1&action=update&id=`$event.id`"}">{ts}Conference Slots{/ts}</a></li>
-                    {/if}
-                    <li><a title="{ts}Tell a Friend{/ts}" href="{crmURL p='civicrm/event/manage/friend' q="reset=1&action=update&id=`$event.id`"}">{ts}Tell a Friend{/ts}</a></li>
-                    <li><a title="{ts}Personal Campaign Pages{/ts}" href="{crmURL p='civicrm/event/manage/pcp' q="reset=1&action=update&id=`$event.id`"}">{ts}Personal Campaign Pages{/ts}</a></li>
-                </ul>
-             </div>
+  <li>
+    <div id="crm-event-links-wrapper">
+      <div id="crm-event-configure-link"><span title="{ts}Configure this event.{/ts}"><div
+            class="icon settings-icon"></div></span></div>
+      <div class="ac_results" id="crm-event-links-list" style="margin-left: -25px;">
+        <div class="crm-event-links-list-inner">
+          <ul>
+            <li><a title="{ts}Info and Settings{/ts}"
+                   href="{crmURL p='civicrm/event/manage/settings' q="reset=1&action=update&id=`$event.id`"}">{ts}Info and Settings{/ts}</a>
+            </li>
+            <li><a title="{ts}Location{/ts}"
+                   href="{crmURL p='civicrm/event/manage/location' q="reset=1&action=update&id=`$event.id`"}">{ts}Location{/ts}</a>
+            </li>
+            <li><a title="{ts}Fees{/ts}"
+                   href="{crmURL p='civicrm/event/manage/fee' q="reset=1&action=update&id=`$event.id`"}">{ts}Fees{/ts}</a>
+            </li>
+            <li><a title="{ts}Online Registration{/ts}"
+                   href="{crmURL p='civicrm/event/manage/registration' q="reset=1&action=update&id=`$event.id`"}">{ts}Online Registration{/ts}</a>
+            </li>
+            {if call_user_func(array('CRM_Core_Permission','check'), 'administer CiviCRM') }
+              <li><a title="{ts}11Schedule Reminders{/ts}"
+                     href="{crmURL p='civicrm/event/manage/reminder' q="reset=1&action=update&id=`$event.id`"}">{ts}Schedule Reminders{/ts}</a>
+              </li>
+            {/if}
+            {if $eventCartEnabled}
+              <li><a title="{ts}Conference Slots{/ts}"
+                     href="{crmURL p='civicrm/event/manage/conference' q="reset=1&action=update&id=`$event.id`"}">{ts}Conference Slots{/ts}</a>
+              </li>
+            {/if}
+            <li><a title="{ts}Tell a Friend{/ts}"
+                   href="{crmURL p='civicrm/event/manage/friend' q="reset=1&action=update&id=`$event.id`"}">{ts}Tell a Friend{/ts}</a>
+            </li>
+            <li><a title="{ts}Personal Campaign Pages{/ts}"
+                   href="{crmURL p='civicrm/event/manage/pcp' q="reset=1&action=update&id=`$event.id`"}">{ts}Personal Campaign Pages{/ts}</a>
+            </li>
+          </ul>
         </div>
-    </div></li>
-
+      </div>
+    </div>
+  </li>
 {/if}
 <li><div id="crm-participant-wrapper">
         <div id="crm-participant-links"><span title="{ts}Participant listing links.{/ts}"><div class="icon search-icon"></div></div>