/** * @see SugarView::display() */ public function display() { global $current_user, $mod_strings, $app_strings, $app_list_strings, $sugar_config, $locale; $configurator = new Configurator(); $sugarConfig = SugarConfig::getInstance(); $focus = new Administration(); $configurator->parseLoggerSettings(); $focus->retrieveSettings(); if (!empty($_POST['restore'])) { $configurator->restoreConfig(); } $this->ss->assign('MOD', $mod_strings); $this->ss->assign('APP', $app_strings); $this->ss->assign('APP_LIST', $app_list_strings); $this->ss->assign('config', $configurator->config); $this->ss->assign('error', $configurator->errors); $this->ss->assign("AUTO_REFRESH_INTERVAL_OPTIONS", get_select_options_with_id($app_list_strings['dashlet_auto_refresh_options_admin'], isset($configurator->config['dashlet_auto_refresh_min']) ? $configurator->config['dashlet_auto_refresh_min'] : 30)); $this->ss->assign('LANGUAGES', get_languages()); $this->ss->assign("JAVASCRIPT", get_set_focus_js() . get_configsettings_js()); $this->ss->assign('company_logo', SugarThemeRegistry::current()->getImageURL('company_logo.png')); $this->ss->assign("settings", $focus->settings); $this->ss->assign("mail_sendtype_options", get_select_options_with_id($app_list_strings['notifymail_sendtype'], $focus->settings['mail_sendtype'])); if (!empty($focus->settings['proxy_on'])) { $this->ss->assign("PROXY_CONFIG_DISPLAY", 'inline'); } else { $this->ss->assign("PROXY_CONFIG_DISPLAY", 'none'); } if (!empty($focus->settings['proxy_auth'])) { $this->ss->assign("PROXY_AUTH_DISPLAY", 'inline'); } else { $this->ss->assign("PROXY_AUTH_DISPLAY", 'none'); } if (!empty($configurator->config['logger']['level'])) { $this->ss->assign('log_levels', get_select_options_with_id(LoggerManager::getLoggerLevels(), $configurator->config['logger']['level'])); } else { $this->ss->assign('log_levels', get_select_options_with_id(LoggerManager::getLoggerLevels(), '')); } if (!empty($configurator->config['lead_conv_activity_opt'])) { $this->ss->assign('lead_conv_activities', get_select_options_with_id(Lead::getActivitiesOptions(), $configurator->config['lead_conv_activity_opt'])); } else { $this->ss->assign('lead_conv_activities', get_select_options_with_id(Lead::getActivitiesOptions(), '')); } if (!empty($configurator->config['logger']['file']['suffix'])) { $this->ss->assign('filename_suffix', get_select_options_with_id(SugarLogger::$filename_suffix, $configurator->config['logger']['file']['suffix'])); } else { $this->ss->assign('filename_suffix', get_select_options_with_id(SugarLogger::$filename_suffix, '')); } echo $this->getModuleTitle(false); $this->ss->display('modules/Configurator/tpls/EditView.tpl'); $javascript = new javascript(); $javascript->setFormName("ConfigureSettings"); $javascript->addFieldGeneric("notify_fromaddress", "email", $mod_strings['LBL_NOTIFY_FROMADDRESS'], TRUE, ""); $javascript->addFieldGeneric("notify_subject", "varchar", $mod_strings['LBL_NOTIFY_SUBJECT'], TRUE, ""); $javascript->addFieldGeneric("proxy_host", "varchar", $mod_strings['LBL_PROXY_HOST'], TRUE, ""); $javascript->addFieldGeneric("proxy_port", "int", $mod_strings['LBL_PROXY_PORT'], TRUE, ""); $javascript->addFieldGeneric("proxy_password", "varchar", $mod_strings['LBL_PROXY_PASSWORD'], TRUE, ""); $javascript->addFieldGeneric("proxy_username", "varchar", $mod_strings['LBL_PROXY_USERNAME'], TRUE, ""); echo $javascript->getScript(); }
$configurator = new Configurator(); $focus = new Administration(); if (!empty($_POST['save'])) { //set defaults for saving foreach ($asterisk_config as $key => $value) { if (isset($_REQUEST[$key]) && $_REQUEST[$key] == '') { $_REQUEST[$key] = $value; } } $configurator->saveConfig(); $focus->saveConfig(); header('Location: index.php?module=Administration&action=index'); } $focus->retrieveSettings(); if (!empty($_POST['restore'])) { $configurator->restoreConfig(); } require_once 'include/Sugar_Smarty.php'; $sugar_smarty = new Sugar_Smarty(); $sugar_smarty->assign('MOD', $mod_strings); $sugar_smarty->assign('APP', $app_strings); $sugar_smarty->assign('APP_LIST', $app_list_strings); $sugar_smarty->assign('config', $configurator->config); $sugar_smarty->assign('asterisk_config', $asterisk_config); $sugar_smarty->assign('error', $configurator->errors); $sugar_smarty->display('custom/modules/Configurator/asterisk_configurator.tpl'); require_once "include/javascript/javascript.php"; $javascript = new javascript(); $javascript->setFormName("ConfigureSettings"); $javascript->addFieldGeneric("asterisk_host", "varchar", $mod_strings['LBL_ASTERISK_HOST'], TRUE, ""); $javascript->addFieldGeneric("asterisk_port", "int", $mod_strings['LBL_ASTERISK_PORT'], TRUE, "");
/** * @see SugarView::display() */ public function display() { global $current_user, $mod_strings, $app_strings, $app_list_strings, $sugar_config, $locale; $configurator = new Configurator(); $sugarConfig = SugarConfig::getInstance(); $focus = new Administration(); $configurator->parseLoggerSettings(); $focus->retrieveSettings(); if (!empty($_POST['restore'])) { $configurator->restoreConfig(); } $this->ss->assign('MOD', $mod_strings); $this->ss->assign('APP', $app_strings); $this->ss->assign('APP_LIST', $app_list_strings); $this->ss->assign('config', $configurator->config); $this->ss->assign('error', $configurator->errors); $this->ss->assign("AUTO_REFRESH_INTERVAL_OPTIONS", get_select_options_with_id($app_list_strings['dashlet_auto_refresh_options_admin'], isset($configurator->config['dashlet_auto_refresh_min']) ? $configurator->config['dashlet_auto_refresh_min'] : 30)); $this->ss->assign('LANGUAGES', get_languages()); $this->ss->assign("JAVASCRIPT", get_set_focus_js() . get_configsettings_js()); $this->ss->assign('company_logo', SugarThemeRegistry::current()->getImageURL('company_logo.png')); $this->ss->assign("settings", $focus->settings); $this->ss->assign("mail_sendtype_options", get_select_options_with_id($app_list_strings['notifymail_sendtype'], $focus->settings['mail_sendtype'])); if (!empty($focus->settings['proxy_on'])) { $this->ss->assign("PROXY_CONFIG_DISPLAY", 'inline'); } else { $this->ss->assign("PROXY_CONFIG_DISPLAY", 'none'); } if (!empty($focus->settings['proxy_auth'])) { $this->ss->assign("PROXY_AUTH_DISPLAY", 'inline'); } else { $this->ss->assign("PROXY_AUTH_DISPLAY", 'none'); } if (!empty($configurator->config['logger']['level'])) { $this->ss->assign('log_levels', get_select_options_with_id(LoggerManager::getLoggerLevels(), $configurator->config['logger']['level'])); } else { $this->ss->assign('log_levels', get_select_options_with_id(LoggerManager::getLoggerLevels(), '')); } if (!empty($configurator->config['lead_conv_activity_opt'])) { $this->ss->assign('lead_conv_activities', get_select_options_with_id(Lead::getActivitiesOptions(), $configurator->config['lead_conv_activity_opt'])); } else { $this->ss->assign('lead_conv_activities', get_select_options_with_id(Lead::getActivitiesOptions(), '')); } if (!empty($configurator->config['logger']['file']['suffix'])) { $this->ss->assign('filename_suffix', get_select_options_with_id(SugarLogger::$filename_suffix, $configurator->config['logger']['file']['suffix'])); } else { $this->ss->assign('filename_suffix', get_select_options_with_id(SugarLogger::$filename_suffix, '')); } if (isset($configurator->config['logger_visible'])) { $this->ss->assign('logger_visible', $configurator->config['logger_visible']); } else { $this->ss->assign('logger_visible', true); } $ebay_site_ids = array('0' => 'eBay United States', '2' => 'eBay Canada (English)', '3' => 'eBay UK', '15' => 'eBay Australia', '16' => 'eBay Austria', '23' => 'eBay Belgium (French)', '71' => 'eBay France', '77' => 'eBay Germany', '100' => 'eBay Motors', '101' => 'eBay Italy', '123' => 'eBay Belgium (Dutch)', '146' => 'eBay Netherlands', '186' => 'eBay Spain', '193' => 'eBay Switzerland', '201' => 'eBay Hong Kong', '203' => 'eBay India', '205' => 'eBay Ireland', '207' => 'eBay Malaysia', '210' => 'eBay Canada (French)', '211' => 'eBay Philippines', '212' => 'eBay Poland', '216' => 'eBay Singapore'); $this->ss->assign("EBAY_SITE_ID_OPTIONS", get_select_options_with_id($ebay_site_ids, isset($configurator->config['ebay_primary_site_id']) ? $configurator->config['ebay_primary_site_id'] : 0)); require_once 'modules/xeBayOrders/xeBayOrder.php'; $this->ss->assign("EBAY_SHIPPING_SERVICE_OPTIONS", get_select_options_with_id(getShippingServiceDropDown(), isset($configurator->config['ebay_shipping_service']) ? $configurator->config['ebay_shipping_service'] : 'HKBAM')); $this->ss->assign("EBAY_EXPRESS_CARRIER_OPTIONS", get_select_options_with_id(getExpressCarrierDropDown(), isset($configurator->config['ebay_express_carrier']) ? $configurator->config['ebay_express_carrier'] : 'default')); echo $this->getModuleTitle(false); $this->ss->display('modules/Configurator/tpls/EditView.tpl'); $javascript = new javascript(); $javascript->setFormName("ConfigureSettings"); $javascript->addFieldGeneric("notify_fromaddress", "email", $mod_strings['LBL_NOTIFY_FROMADDRESS'], TRUE, ""); $javascript->addFieldGeneric("notify_subject", "varchar", $mod_strings['LBL_NOTIFY_SUBJECT'], TRUE, ""); $javascript->addFieldGeneric("proxy_host", "varchar", $mod_strings['LBL_PROXY_HOST'], TRUE, ""); $javascript->addFieldGeneric("proxy_port", "int", $mod_strings['LBL_PROXY_PORT'], TRUE, ""); $javascript->addFieldGeneric("proxy_password", "varchar", $mod_strings['LBL_PROXY_PASSWORD'], TRUE, ""); $javascript->addFieldGeneric("proxy_username", "varchar", $mod_strings['LBL_PROXY_USERNAME'], TRUE, ""); echo $javascript->getScript(); }