Пример #1
0
 public function run()
 {
     if (!($this->from_flavor == 'ce' && $this->toFlavor('pro'))) {
         return;
     }
     //check to see if there are any new files that need to be added to systems tab
     //retrieve old modules list
     $this->log('check to see if new modules exist');
     if (empty($this->state['old_modules'])) {
         $this->log('No old modules info, skipping it');
         return;
     } else {
         $oldModuleList = $this->state['old_modules'];
     }
     $newModuleList = array();
     include 'include/modules.php';
     $newModuleList = $moduleList;
     //include tab controller
     require_once 'modules/MySettings/TabController.php';
     $newTB = new TabController();
     //make sure new modules list has a key we can reference directly
     $newModuleList = $newTB->get_key_array($newModuleList);
     $oldModuleList = $newTB->get_key_array($oldModuleList);
     //iterate through list and remove commonalities to get new modules
     foreach ($newModuleList as $remove_mod) {
         if (in_array($remove_mod, $oldModuleList)) {
             unset($newModuleList[$remove_mod]);
         }
     }
     $must_have_modules = array('Activities' => 'Activities', 'Calendar' => 'Calendar', 'Reports' => 'Reports', 'Quotes' => 'Quotes', 'Products' => 'Products', 'Forecasts' => 'Forecasts', 'Contracts' => 'Contracts', 'KBDocuments' => 'KBDocuments');
     $newModuleList = array_merge($newModuleList, $must_have_modules);
     //new modules list now has left over modules which are new to this install, so lets add them to the system tabs
     $this->log('new modules to add are ' . var_export($newModuleList, true));
     //grab the existing system tabs
     $tabs = $newTB->get_system_tabs();
     //add the new tabs to the array
     foreach ($newModuleList as $nm) {
         $tabs[$nm] = $nm;
     }
     //now assign the modules to system tabs
     $newTB->set_system_tabs($tabs);
     $this->log('module tabs updated');
 }
Пример #2
0
 public function run()
 {
     if ($this->fromFlavor('ent') && version_compare($this->from_version, '7.6.0', '>=')) {
         return;
     }
     //include tab controller
     require_once 'modules/MySettings/TabController.php';
     $newTB = new TabController();
     $must_have_modules = array('pmse_Project', 'pmse_Inbox', 'pmse_Business_Rules', 'pmse_Emails_Templates');
     //grab the existing system tabs
     $tabs = $newTB->get_system_tabs();
     //add the new tabs to the array
     foreach ($must_have_modules as $nm) {
         $tabs[$nm] = $nm;
     }
     //now assign the modules to system tabs
     $newTB->set_system_tabs($tabs);
     $this->log('module tabs updated with pmse');
 }
Пример #3
0
     $newTB = new TabController();
     //make sure new modules list has a key we can reference directly
     $newModuleList = $newTB->get_key_array($newModuleList);
     $oldModuleList = $newTB->get_key_array($oldModuleList);
     //iterate through list and remove commonalities to get new modules
     foreach ($newModuleList as $remove_mod) {
         if (in_array($remove_mod, $oldModuleList)) {
             unset($newModuleList[$remove_mod]);
         }
     }
     $must_have_modules = array('Activities' => 'Activities', 'Calendar' => 'Calendar', 'Reports' => 'Reports', 'Quotes' => 'Quotes', 'Products' => 'Products', 'Forecasts' => 'Forecasts', 'Contracts' => 'Contracts', 'KBDocuments' => 'KBDocuments');
     $newModuleList = array_merge($newModuleList, $must_have_modules);
     //new modules list now has left over modules which are new to this install, so lets add them to the system tabs
     logThis('new modules to add are ' . var_export($newModuleList, true), $path);
     //grab the existing system tabs
     $tabs = $newTB->get_system_tabs();
     //add the new tabs to the array
     foreach ($newModuleList as $nm) {
         $tabs[$nm] = $nm;
     }
     //now assign the modules to system tabs
     $newTB->set_system_tabs($tabs);
     logThis('module tabs updated', $path);
 }
 //Also set the tracker settings if  flavor conversion ce->pro or ce->ent
 if (isset($_SESSION['current_db_version']) && isset($_SESSION['target_db_version'])) {
     if ($_SESSION['current_db_version'] == $_SESSION['target_db_version']) {
         $_REQUEST['upgradeWizard'] = true;
         ob_start();
         include 'include/Smarty/internals/core.write_file.php';
         ob_end_clean();
Пример #4
0
function addNewSystemTabsFromUpgrade($from_dir)
{
    global $path;
    if (isset($_SESSION['upgrade_from_flavor'])) {
        //check to see if there are any new files that need to be added to systems tab
        //retrieve old modules list
        logThis('check to see if new modules exist', $path);
        $oldModuleList = array();
        $newModuleList = array();
        include $from_dir . '/include/modules.php';
        $oldModuleList = $moduleList;
        include 'include/modules.php';
        $newModuleList = $moduleList;
        //include tab controller
        require_once 'modules/MySettings/TabController.php';
        $newTB = new TabController();
        //make sure new modules list has a key we can reference directly
        $newModuleList = $newTB->get_key_array($newModuleList);
        $oldModuleList = $newTB->get_key_array($oldModuleList);
        //iterate through list and remove commonalities to get new modules
        foreach ($newModuleList as $remove_mod) {
            if (in_array($remove_mod, $oldModuleList)) {
                unset($newModuleList[$remove_mod]);
            }
        }
        //new modules list now has left over modules which are new to this install, so lets add them to the system tabs
        logThis('new modules to add are ' . var_export($newModuleList, true), $path);
        if (!empty($newModuleList)) {
            //grab the existing system tabs
            $tabs = $newTB->get_system_tabs();
            //add the new tabs to the array
            foreach ($newModuleList as $nm) {
                $tabs[$nm] = $nm;
            }
            $newTB->set_system_tabs($tabs);
        }
        logThis('module tabs updated', $path);
    }
}
Пример #5
0
function UpdateSystemTabs($action, $installed_modules)
{
    require_once "modules/MySettings/TabController.php";
    $controller = new TabController();
    $isSystemTabsInDB = $controller->is_system_tabs_in_db();
    if ($isSystemTabsInDB && !empty($installed_modules)) {
        global $moduleList;
        switch ($action) {
            case 'Restore':
                $currentTabs = $controller->get_system_tabs();
                foreach ($installed_modules as $module) {
                    if (in_array($module, $currentTabs)) {
                        unset($currentTabs[$module]);
                    }
                }
                $controller->set_system_tabs($currentTabs);
                break;
            case 'Add':
                $currentTabs = $controller->get_system_tabs();
                foreach ($installed_modules as $module) {
                    if (!in_array($module, $currentTabs)) {
                        $currentTabs[$module] = $module;
                    }
                }
                $controller->set_system_tabs($currentTabs);
            default:
                break;
        }
    }
}
Пример #6
0
 /**
  * Get tabs for the navigation bar of this application
  *
  * @return array An array of module names
  */
 public function getTabList()
 {
     $controller = new TabController();
     return array_keys($controller->get_system_tabs());
 }
Пример #7
0
 /**
  * Updates systems tabs
  *
  * @param string $action The action to take
  * @param array $installed_modules The list of modules to add for this action
  */
 protected function updateSystemTabs($action, $installed_modules)
 {
     global $moduleList;
     $controller = new TabController();
     $isSystemTabsInDB = $controller->is_system_tabs_in_db();
     if ($isSystemTabsInDB && !empty($installed_modules)) {
         switch ($action) {
             case 'Restore':
                 $currentTabs = $controller->get_system_tabs();
                 foreach ($installed_modules as $module) {
                     if (in_array($module, $currentTabs)) {
                         unset($currentTabs[$module]);
                     }
                 }
                 $controller->set_system_tabs($currentTabs);
                 break;
             case 'Add':
                 $currentTabs = $controller->get_system_tabs();
                 foreach ($installed_modules as $module) {
                     if (!in_array($module, $currentTabs)) {
                         $currentTabs[$module] = $module;
                     }
                 }
                 $controller->set_system_tabs($currentTabs);
                 break;
         }
         if (isset($_SESSION['get_workflow_admin_modules_for_user'])) {
             return $_SESSION['get_workflow_admin_modules_for_user'];
         }
     }
 }
Пример #8
0
 protected function setRevenueLineItemTab($show)
 {
     SugarAutoLoader::load('modules/MySettings/TabController.php');
     $newTB = new TabController();
     //grab the existing system tabs
     $tabs = $newTB->get_system_tabs();
     if ($show) {
         $tabs['RevenueLineItems'] = 'RevenueLineItems';
     } else {
         unset($tabs['RevenueLineItems']);
     }
     //now assign the modules to system tabs
     $newTB->set_system_tabs($tabs);
 }