From: Jagadedes Date: Wed, 17 Sep 2014 13:08:49 +0000 (+0530) Subject: #29749 added WCI menu X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=51fa85d72c6338fad6fc22830ef9ec37250d7274;p=com.zyxware.civiwci.git #29749 added WCI menu --- diff --git a/wci.php b/wci.php index c7cf938..ba5cd46 100644 --- a/wci.php +++ b/wci.php @@ -106,3 +106,86 @@ function wci_civicrm_caseTypes(&$caseTypes) { function wci_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) { _wci_civix_civicrm_alterSettingsFolders($metaDataFolders); } + +function wci_civicrm_navigationMenu( &$params ) { + echo "test"; + + // Check that our item doesn't already exist + $menu_item_search = array('url' => 'civicrm/trends'); + $menu_items = array(); + CRM_Core_BAO_Navigation::retrieve($menu_item_search, $menu_items); + + if ( ! empty($menu_items) ) { + return; + } + + $navId = CRM_Core_DAO::singleValueQuery("SELECT max(id) FROM civicrm_navigation"); + if (is_integer($navId)) { + $navId++; + } + // Find the Help menu + $helpID = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Navigation', 'Help', 'id', 'name'); + $params[$navId] = $params[$helpID]; + // inserting WCI menu at the place of old help location + $params[$helpID] = array ( + 'attributes' => array ( + 'label' => ts('WCI'), + 'name' => 'WCI', + 'url' => null, + 'permission' => 'access CiviReport,access CiviContribute', + 'operator' => 'OR', + 'separator' => 0, + 'parentID' => 0, + 'navID' => $navId, + 'active' => 1), + 'child' => array ( + '1' => array ( + 'attributes' => array ( + 'label' => ts('New widget'), + 'name' => 'new_widget', + 'url' => 'civicrm/wci/widget/add', + 'permission' => 'access CiviReport,access CiviContribute', + 'operator' => 'OR', + 'separator' => 1, + 'parentID' => navId, + 'navID' => $navId+1, + 'active' => 1)), + + '2' => array ( + 'attributes' => array ( + 'label' => ts('Manage widget'), + 'name' => 'manage_widget', + 'url' => 'civicrm/wci/widget', + 'permission' => 'access CiviReport,access CiviContribute', + 'operator' => 'OR', + 'separator' => 1, + 'parentID' => navId, + 'navID' => $navId+2, + 'active' => 1)), + + '3' => array ( + 'attributes' => array ( + 'label' => ts('New Progress bar'), + 'name' => 'new_progress_bar', + 'url' => 'civicrm/wci/progress-bar/add', + 'permission' => 'access CiviReport,access CiviContribute', + 'operator' => 'OR', + 'separator' => 1, + 'parentID' => navId, + 'navID' => $navId+3, + 'active' => 1)), + + '4' => array ( + 'attributes' => array ( + 'label' => ts('Manage Progress bar'), + 'name' => 'manage_progress_bar', + 'url' => 'civicrm/wci/progress-bar', + 'permission' => 'access CiviReport,access CiviContribute', + 'operator' => 'OR', + 'separator' => 1, + 'parentID' => navId, + 'navID' => $navId+4, + 'active' => 1)), + ) + ); +}