/** * @static creates range of probability for the months * @param int $total_months - total count of months * @return mixed */ private static function getRanges($total_months = 12) { if (self::$_ranges === null) { self::$_ranges = array(); for ($i = $total_months; $i >= 0; $i--) { // define priority for month, self::$_ranges[$total_months - $i] = $total_months - $i > 6 ? self::$_ranges[$total_months - $i] = pow(6, 2) + $i : (self::$_ranges[$total_months - $i] = pow($i, 2) + 1); // increase probability for current quarters self::$_ranges[$total_months - $i] = $total_months - $i == 0 ? self::$_ranges[$total_months - $i] * 2.5 : self::$_ranges[$total_months - $i]; self::$_ranges[$total_months - $i] = $total_months - $i == 1 ? self::$_ranges[$total_months - $i] * 2 : self::$_ranges[$total_months - $i]; self::$_ranges[$total_months - $i] = $total_months - $i == 2 ? self::$_ranges[$total_months - $i] * 1.5 : self::$_ranges[$total_months - $i]; } } return self::$_ranges; }
} 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 '.'; require_once 'modules/Forecasts/ForecastsSeedData.php'; ForecastsSeedData::populateSeedData($timeperiods); echo '.'; include 'install/seed_data/entreport_SeedData.php'; //This is set to yes at the begininning of this file unset($_SESSION['disable_workflow']);