public function run()
 {
     if (!$this->toFlavor('ent')) {
         return;
     }
     // Grabs the portal config setting.
     $query = "SELECT value FROM config WHERE category='portal' AND name='on'";
     $portalEnabled = (bool) $this->db->getOne($query);
     // Remove `portal_on` with platform equals to NULL or platform equals to empty string
     $query = "DELETE FROM config WHERE category='portal' AND name='on' AND (platform IS NULL OR platform='')";
     $this->db->query($query);
     // only run this when coming from a version lower than 7.1.5
     if (version_compare($this->from_version, '7.1.5', '>=')) {
         return;
     }
     global $mod_strings;
     // Update portal setting name `displayModules` to `tab`
     $this->updatePortalTabsSetting();
     // Set portal setting `logLevel` to `ERROR`
     $fieldKey = 'logLevel';
     $fieldValue = 'ERROR';
     $admin = new Administration();
     if (!$admin->saveSetting('portal', $fieldKey, json_encode($fieldValue), 'support')) {
         $error = sprintf($this->mod_strings['ERROR_UW_PORTAL_CONFIG_DB'], 'portal', $fieldKey, $fieldValue);
         return $this->fail($error);
     }
     // Remove `fieldsToDisplay` (# of fields displayed in detail view - not used anymore in 7.0)
     $query = "DELETE FROM config WHERE category='portal' AND name='fieldsToDisplay' AND platform='support'";
     $this->db->query($query);
     // Enables portal if it is set to true.
     // TODO: category should be `support`, platform should be `portal`
     $admin->saveSetting('portal', 'on', $portalEnabled, 'support');
     // Sets up portal.
     if ($portalEnabled) {
         $parser = new ParserModifyPortalConfig();
         $parser->setUpPortal();
     }
 }
        $EmailTemp->deleted = 0;
        $EmailTemp->team_id = 1;
        $EmailTemp->published = 'off';
        $EmailTemp->text_only = 0;
        $id = $EmailTemp->save();
    }
}
echo '.';
//enable portal
$system_config = new Administration();
$system_config->retrieveSettings();
$GLOBALS['system_config'] = $system_config;
$installerStrings = $GLOBALS['mod_strings'];
$GLOBALS['mod_strings'] = return_module_language($GLOBALS['current_language'], 'ModuleBuilder');
include 'modules/ModuleBuilder/parsers/parser.portalconfig.php';
$portalConfig = new ParserModifyPortalConfig();
$_REQUEST['appStatus'] = 'true';
$_REQUEST['maxQueryResult'] = '20';
$portalConfig->handleSave();
$GLOBALS['mod_strings'] = $installerStrings;
include 'install/seed_data/products_SeedData.php';
include 'install/seed_data/quotes_SeedData.php';
require_once 'modules/Opportunities/OpportunitiesSeedData.php';
$opportunity_ids = OpportunitiesSeedData::populateSeedData($number_companies * 3, $app_list_strings, $accounts, $sugar_demodata['users']);
foreach ($contacts as $id) {
    $contact->retrieve($id);
    // This assumes that there will be one opportunity per company in the seed data.
    $opportunity_key = array_rand($opportunity_ids);
    $contact->set_relationship('opportunities_contacts', array('contact_id' => $contact->id, 'opportunity_id' => $opportunity_ids[$opportunity_key], 'contact_role' => $app_list_strings['opportunity_relationship_type_default_key']), false);
}
echo '.';
Exemple #3
0
 public function action_portalconfigsave()
 {
     $parser = new ParserModifyPortalConfig();
     $parser->handleSave();
     $this->view = 'portalconfig';
 }