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');
 }
 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');
 }
Exemple #3
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");
 }
Exemple #4
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");
     }
 }
         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();
         $db =& DBManagerFactory::getInstance();
         if ($ce_to_pro_ent) {
             //Also set license information
             $admin = new Administration();
             $category = 'license';
             $value = 0;
$enabled_tabs[] = 'Leads';
$enabled_tabs[] = 'Calendar';
$enabled_tabs[] = 'Documents';
$enabled_tabs[] = 'Emails';
$enabled_tabs[] = 'Campaigns';
$enabled_tabs[] = 'Calls';
$enabled_tabs[] = 'Meetings';
$enabled_tabs[] = 'Tasks';
$enabled_tabs[] = 'Notes';
$enabled_tabs[] = 'Cases';
$enabled_tabs[] = 'Prospects';
$enabled_tabs[] = 'ProspectLists';
installerHook('pre_setSystemTabs');
require_once 'modules/MySettings/TabController.php';
$tabs = new TabController();
$tabs->set_system_tabs($enabled_tabs);
installerHook('post_setSystemTabs');
post_install_modules();
//Call rebuildSprites
if (function_exists('imagecreatetruecolor')) {
    require_once 'modules/UpgradeWizard/uw_utils.php';
    rebuildSprites(true);
}
if (count($bottle) > 0) {
    foreach ($bottle as $bottle_message) {
        $bottleMsg .= "{$bottle_message}\n";
    }
} else {
    $bottleMsg = $mod_strings['LBL_PERFORM_SUCCESS'];
}
installerHook('post_installModules');
Exemple #7
0
/**
 * upgradeDisplayedTabsAndSubpanels
 *
 * @param $version String value of current system version (pre upgrade)
 */
function upgradeDisplayedTabsAndSubpanels($version)
{
    if ($version < '620') {
        logThis('start upgrading system displayed tabs and subpanels');
        require_once 'modules/MySettings/TabController.php';
        $tc = new TabController();
        //grab the existing system tabs
        $tabs = $tc->get_tabs_system();
        //add Calls, Meetings, Tasks, Notes, Prospects (Targets) and ProspectLists (Target Lists)
        //to displayed tabs unless explicitly set to hidden
        $modules_to_add = array('Calls', 'Meetings', 'Tasks', 'Notes', 'Prospects', 'ProspectLists');
        $added_tabs = array();
        foreach ($modules_to_add as $module) {
            $tabs[0][$module] = $module;
            $added_tabs[] = $module;
        }
        logThis('calling set_system_tabs on TabController to add tabs: ' . var_export($added_tabs, true));
        $tc->set_system_tabs($tabs[0]);
        logThis('finish upgrading system displayed tabs and subpanels');
    }
}
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;
        }
    }
}
Exemple #9
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);
        //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);
    }
}
 * for the specific language governing rights and limitations under the
 * License.
 *
 * All copies of the Covered Code must include on each user interface screen:
 *    (i) the "Powered by SugarCRM" logo and
 *    (ii) the SugarCRM copyright notice
 * in the same form as they appear in the distribution.  See full license for
 * requirements.
 *
 * The Original Code is: SugarCRM Open Source
 * The Initial Developer of the Original Code is SugarCRM, Inc.
 * Portions created by SugarCRM are Copyright (C) 2004-2006 SugarCRM, Inc.;
 * All Rights Reserved.
 * Contributor(s): ______________________________________.
 ********************************************************************************/
/*********************************************************************************
 * Description:  TODO: To be written.
 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
 * All Rights Reserved.
 * Contributor(s): ______________________________________..
 ********************************************************************************/
require_once "modules/Administration/Administration.php";
global $current_user;
if (!is_admin($current_user)) {
    sugar_die("Unauthorized access to administration.");
}
require_once 'modules/MySettings/TabController.php';
$tabs = new TabController();
$tabs->set_system_tabs($_POST['group_0']);
$tabs->set_users_can_edit(isset($_REQUEST['user_edit_tabs']) && $_REQUEST['user_edit_tabs'] == 1);
header("Location: index.php?action=index&module=Administration");
 /**
  * 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'];
         }
     }
 }
 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);
 }