Exemplo n.º 1
0
 public function action_savetabs()
 {
     require_once 'include/SubPanel/SubPanelDefinitions.php';
     require_once 'modules/MySettings/TabController.php';
     global $current_user, $app_strings;
     if (!is_admin($current_user)) {
         sugar_die($app_strings['ERR_NOT_ADMIN']);
     }
     // handle the tabs listing
     $toDecode = html_entity_decode($_REQUEST['enabled_tabs'], ENT_QUOTES);
     $enabled_tabs = json_decode($toDecode);
     $tabs = new TabController();
     $tabs->set_system_tabs($enabled_tabs);
     $tabs->set_users_can_edit(isset($_REQUEST['user_edit_tabs']) && $_REQUEST['user_edit_tabs'] == 1);
     // handle the subpanels
     if (isset($_REQUEST['disabled_tabs'])) {
         $disabledTabs = json_decode(html_entity_decode($_REQUEST['disabled_tabs'], ENT_QUOTES));
         $disabledTabsKeyArray = TabController::get_key_array($disabledTabs);
         SubPanelDefinitions::set_hidden_subpanels($disabledTabsKeyArray);
     }
     header("Location: index.php?module=Administration&action=ConfigureTabs");
 }
Exemplo n.º 2
0
 public function action_savetabs()
 {
     require_once 'include/SubPanel/SubPanelDefinitions.php';
     require_once 'modules/MySettings/TabController.php';
     global $current_user, $app_strings, $modInvisList;
     if (!is_admin($current_user)) {
         sugar_die($app_strings['ERR_NOT_ADMIN']);
     }
     // handle the tabs listing
     $toDecode = html_entity_decode($_REQUEST['enabled_tabs'], ENT_QUOTES);
     $enabled_tabs = json_decode($toDecode);
     // Add Home back in so that it always appears first in Sugar 7
     array_unshift($enabled_tabs, 'Home');
     $tabs = new TabController();
     $tabs->set_system_tabs($enabled_tabs);
     $tabs->setPortalTabs(array_values(array_intersect($enabled_tabs, $tabs->getAllPortalTabs())));
     $tabs->set_users_can_edit(isset($_REQUEST['user_edit_tabs']) && $_REQUEST['user_edit_tabs'] == 1);
     // handle the subpanels
     if (isset($_REQUEST['disabled_tabs'])) {
         $disabledTabs = json_decode(html_entity_decode($_REQUEST['disabled_tabs'], ENT_QUOTES));
         $disabledTabsKeyArray = TabController::get_key_array($disabledTabs);
         //Never show Project subpanels if Project module is hidden
         if (!in_array('project', $disabledTabsKeyArray) && in_array('Project', $modInvisList)) {
             $disabledTabsKeyArray[] = 'project';
         }
         // if RLI is hidden, always hide the RLI subpanel.
         if (!in_array('revenuelineitems', $disabledTabsKeyArray) && in_array('RevenueLineItems', $modInvisList)) {
             $disabledTabsKeyArray[] = 'revenuelineitems';
         }
         SubPanelDefinitions::set_hidden_subpanels($disabledTabsKeyArray);
     }
     // Only rebuild the relevent metadata sections.
     MetaDataManager::refreshSectionCache(MetaDataManager::MM_MODULESINFO, array('base'));
     MetaDataManager::refreshSectionCache(MetaDataManager::MM_HIDDENSUBPANELS, array('base'));
     if (!headers_sent()) {
         header("Location: index.php?module=Administration&action=ConfigureTabs");
     }
 }
Exemplo n.º 3
0
$defaultTrackerRoles = array('Tracker' => array('Trackers' => array('admin' => 1, 'access' => 89, 'view' => 90, 'list' => 90, 'edit' => 90, 'delete' => 90, 'import' => 90, 'export' => 90), 'TrackerQueries' => array('admin' => 1, 'access' => 89, 'view' => 90, 'list' => 90, 'edit' => 90, 'delete' => 90, 'import' => 90, 'export' => 90), 'TrackerPerfs' => array('admin' => 1, 'access' => 89, 'view' => 90, 'list' => 90, 'edit' => 90, 'delete' => 90, 'import' => 90, 'export' => 90), 'TrackerSessions' => array('admin' => 1, 'access' => 89, 'view' => 90, 'list' => 90, 'edit' => 90, 'delete' => 90, 'import' => 90, 'export' => 90)));
installerHook('pre_addDefaultRolesTracker');
addDefaultRoles($defaultTrackerRoles);
installerHook('post_addDefaultRolesTracker');
// Adding MLA Roles
installerHook('pre_addDefaultRoles');
require_once 'modules/ACLRoles/SeedRoles.php';
create_default_roles();
installerHook('post_addDefaultRoles');
// Hide certain subpanels by default
require_once 'include/SubPanel/SubPanelDefinitions.php';
require_once 'modules/MySettings/TabController.php';
$disabledTabs = array("project", "bugs", "products", "contracts", "revenuelineitems");
installerHook('pre_setHiddenSubpanels');
$disabledTabsKeyArray = TabController::get_key_array($disabledTabs);
SubPanelDefinitions::set_hidden_subpanels($disabledTabsKeyArray);
installerHook('post_setHiddenSubpanels');
// Create the user that will be used by Snip
require_once 'install/createSnipUser.php';
/**
 * SP-1071 disable unsupported legacy connectors for 7.0
// Enable the InsideView connector and add all modules
installLog("Enable InsideView Connector");
enableInsideViewConnector();
**/
///////////////////////////////////////////////////////////////////////////////
////    START DEMO DATA
/*
 * Enable asynchronous index mode before adding demo data. At this point
 * the ES idex has not been initialized yet. The demo data loader uses
 * SugarBean->save() which automatically triggers an inline index of each
Exemplo n.º 4
0
if (!is_admin($current_user)) {
    sugar_die("Unauthorized access to administration.");
}
//////////////////  Processing Save
//if coming from save, iterate through array and save into user preferences
$panels_to_show = '';
$panels_to_hide = '';
if (isset($_REQUEST['Save_or_Cancel']) && $_REQUEST['Save_or_Cancel'] == 'save') {
    if (isset($_REQUEST['disabled_panels'])) {
        $panels_to_hide = $_REQUEST['disabled_panels'];
    }
    //turn list  into array
    $hidpanels_arr = split(',', $panels_to_hide);
    $hidpanels_arr = TabController::get_key_array($hidpanels_arr);
    //save list of subpanels to hide
    SubPanelDefinitions::set_hidden_subpanels($hidpanels_arr);
    //redirect to same page to refresh panel list
    header("Location: index.php?module=Administration&action=ConfigureSubPanels");
}
//////////////////  Processing UI
//create title for form
$title = get_module_title($mod_strings['LBL_MODULE_NAME'], $mod_strings['LBL_CONFIGURE_SUBPANELS'] . ":", true);
//get list of all subpanels and panels to hide
$panels_arr = SubPanelDefinitions::get_all_subpanels();
$hidpanels_arr = SubPanelDefinitions::get_hidden_subpanels();
if (!$hidpanels_arr || !is_array($hidpanels_arr)) {
    $hidpanels_arr = array();
}
//create array of subpanels to show, used to create Drag and Drop widget
$groups = array();
$groups[$mod_strings['LBL_VISIBLE_PANELS']] = array();