Пример #1
0
 /**
  * @see SugarView::display()
  */
 public function display()
 {
     global $beanFiles, $mod_strings;
     // the user admin (MLA) cannot edit any administrator holidays
     global $current_user;
     if (isset($_REQUEST['record'])) {
         $result = $GLOBALS['db']->query("SELECT is_admin FROM users WHERE id=(SELECT person_id FROM holidays WHERE id='{$_REQUEST['record']}')");
         $row = $GLOBALS['db']->fetchByAssoc($result);
         if (!is_admin($current_user) && $current_user->isAdminForModule('Users') && $row['is_admin'] == 1) {
             sugar_die('Unauthorized access');
         }
     }
     $this->ev->process();
     if ($_REQUEST['return_module'] == 'Project') {
         $projectBean = BeanFactory::getBean('Project', $_REQUEST['return_id']);
         $userBean = BeanFactory::getBean('Users');
         $contactBean = BeanFactory::getBean('Contacts');
         $projectBean->load_relationship("user_resources");
         $userResources = $projectBean->user_resources->getBeans($userBean);
         $projectBean->load_relationship("contact_resources");
         $contactResources = $projectBean->contact_resources->getBeans($contactBean);
         ksort($userResources);
         ksort($contactResources);
         $this->ss->assign("PROJECT", true);
         $this->ss->assign("USER_RESOURCES", $userResources);
         $this->ss->assign("CONTACT_RESOURCES", $contactResources);
         $this->ss->assign("MOD", $mod_strings);
         $holiday_js = "<script type='text/javascript'>\n";
         $holiday_js .= $projectBean->resourceSelectJS();
         $holiday_js .= "\n</script>";
         echo $holiday_js;
     }
     echo $this->ev->display();
     //echo the javascript that will validate the form
     $javascript = new javascript();
     $javascript->setFormName("EditView");
     $javascript->addFieldGeneric('holiday_date', '', 'LBL_HOLIDAY_DATE', 'true');
     $javascript->addFieldGeneric('person_type', '', 'LBL_PERSON_TYPE', 'true');
     //note that the person type and person id labels are use the resource name label on purpose for a clearer UI
     $javascript->addToValidateBinaryDependency('person_id', 'alpha', 'LBL_RESOURCE_NAME', 'true', '', 'person_type');
     echo $javascript->getScript();
 }
Пример #2
0
$params[] = "<a href='index.php?module=Schedulers&action=index'>{$mod_strings['LBL_MODULE_TITLE']}</a>";
if (empty($focus->id)) {
    $params[] = $GLOBALS['app_strings']['LBL_CREATE_BUTTON_LABEL'];
} else {
    $params[] = "<a href='index.php?module=Schedulers&action=DetailView&record={$focus->id}'>{$focus->name}</a>";
    $params[] = $GLOBALS['app_strings']['LBL_EDIT_BUTTON_LABEL'];
}
echo getClassicModuleTitle("Schedulers", $params, true);
Log::info("Scheduler Edit View");
/* End standard EditView setup logic */
// javascript calls
$javascript = new javascript();
$javascript->setSugarBean($focus);
$javascript->setFormName('EditView');
$javascript->addAllFields('');
$javascript->addFieldGeneric('mins', 'alpha', 'Mins', true, $prefix = '');
$javascript->addFieldGeneric('day_of_month', 'alpha', 'Days of Month', true, $prefix = '');
$javascript->addFieldGeneric('months', 'alpha', 'Months', true, $prefix = '');
$javascript->addFieldGeneric('day_of_week', 'alpha', 'Days of Week', true, $prefix = '');
$javascript->addFieldGeneric('date_start', 'date', 'Start Date', true, $prefix = '');
//$javascript->addFieldDateBeforeAllowBlank('date_start', 'date', 'Date End', 'false', $prefix='', 'date_end', 'true'); // cn: disabled because it does not handle user-pref date format
$javascript->addToValidateBinaryDependency('time_hour_from', 'alpha', 'Active From (hr) must be set with Active To (hr) ', 'false', $prefix = '', 'time_hour_to');
$javascript->addToValidateBinaryDependency('time_minute_from', 'alpha', 'Active From (min) must be set with Active To (min) ', 'false', $prefix = '', 'time_minute_to');
//($field, $type,$displayName, $required, $prefix='',$compareTo)
// split the date/time of start/end
$dtStart = $focus->date_time_start;
$dtEnd = $focus->date_time_end;
if (!empty($dtStart)) {
    $exStart = explode(" ", $dtStart);
    $date_start = $exStart[0];
    $time_start = $exStart[1];
Пример #3
0
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, "");
$javascript->addFieldGeneric("asterisk_user", "varchar", $mod_strings['LBL_ASTERISK_USER'], TRUE, "");
$javascript->addFieldGeneric("asterisk_secret", "varchar", $mod_strings['LBL_ASTERISK_SECRET'], TRUE, "");
$javascript->addFieldGeneric("asterisk_prefix", "varchar", $mod_strings['LBL_ASTERISK_PREFIX'], TRUE, "");
$javascript->addFieldGeneric("asterisk_context", "varchar", $mod_strings['LBL_ASTERISK_CONTEXT'], TRUE, "");
$javascript->addFieldGeneric("asterisk_expr", "varchar", $mod_strings['LBL_ASTERISK_EXPR'], TRUE, "");
$javascript->addFieldGeneric("asterisk_soapuser", "varchar", $mod_strings['LBL_ASTERISK_SOAPUSER'], TRUE, "");
// Added in yaii-2.0
$javascript->addFieldGeneric("asterisk_dialinPrefix", "varchar", $mod_strings['LBL_ASTERISK_DIALINPREFIX'], TRUE, "");
$javascript->addFieldGeneric('asterisk_log_file', "varchar", $mod_strings['LBL_ASTERISK_LOG_FILE'], TRUE, "");
$javascript->addFieldGeneric('asterisk_dialout_channel', "varchar", $mod_strings['LBL_ASTERISK_DIALOUT_CHANNEL'], TRUE, "");
$javascript->addFieldGeneric('asterisk_dialin_ext_match', "varchar", $mod_strings['LBL_ASTERISK_DIALIN_EXT_MATCH'], TRUE, "");
$javascript->addFieldGeneric('asterisk_call_subject_inbound_abbr', "varchar", $mod_strings['LBL_ASTERISK_CALL_SUBJECT_INBOUND_ABBR'], TRUE, "");
$javascript->addFieldGeneric('asterisk_call_subject_outbound_abbr', "varchar", $mod_strings['LBL_ASTERISK_CALL_SUBJECT_OUTBOUND_ABBR'], TRUE, "");
$javascript->addFieldGeneric('asterisk_call_subject_max_length', "varchar", $mod_strings['LBL_ASTERISK_CALL_SUBJECT_MAX_LENGTH'], TRUE, "");
Пример #4
0
}
if (empty($focus->assigned_name) && empty($focus->id)) {
    $focus->assigned_user_name = $current_user->user_name;
}
$assigned_user = get_user_array(TRUE, "Active", $focus->assigned_user_id);
asort($assigned_user);
$xtpl->assign("ASSIGNED_USER_OPTIONS", get_select_options_with_id($assigned_user, $focus->assigned_user_id));
$xtpl->assign("ASSIGNED_USER_NAME", $focus->assigned_user_name);
$xtpl->assign("ASSIGNED_USER_ID", $focus->assigned_user_id);
/// Users Popup
$popup_request_data = array('call_back_function' => 'set_return', 'form_name' => 'EditView', 'field_to_name_array' => array('id' => 'assigned_user_id', 'user_name' => 'assigned_user_name'));
$xtpl->assign('encoded_users_popup_request_data', $json->encode($popup_request_data));
require_once 'modules/ZuckerReports/SimpleTeams.php';
$xtpl->assign("TEAM_SELECTION", SimpleTeams::xtplGetTeamSelection($xtpl, $focus));
if (!empty($_REQUEST["ZR_ERROR_MSG"])) {
    $xtpl->assign("ERROR_MSG", $_REQUEST["ZR_ERROR_MSG"]);
    $xtpl->parse("main.error");
}
$checkboxes = $focus->get_export_checkbox_array();
$xtpl->assign("EXPORT_TYPES", join("<br/>", $checkboxes));
$xtpl->parse("main");
$xtpl->out("main");
require_once 'include/javascript/javascript.php';
$javascript = new javascript();
$javascript->setFormName('EditView');
$javascript->setSugarBean($focus);
$javascript->addAllFields('');
$javascript->addFieldGeneric('team_name', 'varchar', $app_strings['LBL_TEAM'], 'true');
$javascript->addToValidateBinaryDependency('team_name', 'alpha', $app_strings['ERR_SQS_NO_MATCH_FIELD'] . $app_strings['LBL_TEAM'], 'false', '', 'team_id');
$javascript->addToValidateBinaryDependency('assigned_user_name', 'alpha', $app_strings['ERR_SQS_NO_MATCH_FIELD'] . $app_strings['LBL_ASSIGNED_TO'], 'false', '', 'assigned_user_id');
echo $javascript->getScript();
Пример #5
0
 /**
  * @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();
     $configurator->parseLoggerSettings();
     $focus = Administration::getSettings();
     /*
     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', true, true));
     $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');
     }
     $ini_session_val = ini_get('session.gc_maxlifetime');
     if (!empty($focus->settings['system_session_timeout'])) {
         $this->ss->assign("SESSION_TIMEOUT", $focus->settings['system_session_timeout']);
     } else {
         $this->ss->assign("SESSION_TIMEOUT", $ini_session_val);
     }
     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);
     }
     $this->ss->assign('list_entries_per_listview_help', str_replace('{{listEntriesNum}}', '50', $mod_strings['TPL_LIST_ENTRIES_PER_LISTVIEW_HELP']));
     $this->ss->assign('list_entries_per_subpanel_help', str_replace('{{subpanelEntriesNum}}', '25', $mod_strings['TPL_LIST_ENTRIES_PER_SUBPANEL_HELP']));
     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, "");
     $javascript->addFieldRange("system_session_timeout", "int", $mod_strings['SESSION_TIMEOUT'], TRUE, "", 0, $ini_session_val);
     echo $javascript->getScript();
 }
} else {
    $sugar_smarty->assign("PROXY_AUTH_DISPLAY", 'none');
}
if (!function_exists('mcrypt_cbc')) {
    $sugar_smarty->assign("LDAP_ENC_KEY_READONLY", 'readonly');
    $sugar_smarty->assign("LDAP_ENC_KEY_DESC", $mod_strings['LDAP_ENC_KEY_NO_FUNC_DESC']);
} else {
    $sugar_smarty->assign("LDAP_ENC_KEY_DESC", $mod_strings['LBL_LDAP_ENC_KEY_DESC']);
}
if (!empty($configurator->config['logger']['level'])) {
    $sugar_smarty->assign('log_levels', get_select_options_with_id(SugarLogger::$log_levels, $configurator->config['logger']['level']));
} else {
    $sugar_smarty->assign('log_levels', get_select_options_with_id(SugarLogger::$log_levels, ''));
}
if (!empty($configurator->config['logger']['file']['suffix'])) {
    $sugar_smarty->assign('filename_suffix', get_select_options_with_id(SugarLogger::$filename_suffix, $configurator->config['logger']['file']['suffix']));
} else {
    $sugar_smarty->assign('filename_suffix', get_select_options_with_id(SugarLogger::$filename_suffix, ''));
}
//nsingh- moved to locale.php , bug 18064.
//$sugar_smarty->assign("exportCharsets", get_select_options_with_id($locale->getCharsetSelect(), $sugar_config['default_export_charset']));*/
$sugar_smarty->display('modules/Configurator/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();
Пример #7
0
 /**
  * @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('THEMES', SugarThemeRegistry::availableThemes());
     $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['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();
     $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->parseLoggerSettings();
    $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', $focus->settings);
$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, "");
$javascript->addFieldGeneric("asterisk_user", "varchar", $mod_strings['LBL_ASTERISK_USER'], TRUE, "");
$javascript->addFieldGeneric("asterisk_secret", "varchar", $mod_strings['LBL_ASTERISK_SECRET'], TRUE, "");
$javascript->addFieldGeneric("asterisk_prefix", "varchar", $mod_strings['LBL_ASTERISK_PREFIX'], TRUE, "");
$javascript->addFieldGeneric("asterisk_context", "varchar", $mod_strings['LBL_ASTERISK_CONTEXT'], TRUE, "");
$javascript->addFieldGeneric("asterisk_expr", "varchar", $mod_strings['LBL_ASTERISK_EXPR'], TRUE, "");
$javascript->addFieldGeneric("asterisk_soapuser", "varchar", $mod_strings['LBL_ASTERISK_SOAPUSER'], TRUE, "");
$javascript->addFieldGeneric("asterisk_recordings", "varchar", $mod_strings['LBL_ASTERISK_RECORDINGS'], TRUE, "");
echo $javascript->getScript();
Пример #9
0
 /**
  * @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();
 }
Пример #10
0
//$javascript->addAllFields('');
//add custom fields to validation
foreach ($javascript->sugarbean->field_name_map as $field => $value) {
    if (isset($value['custom_type'])) {
        if ($value['custom_type'] != 'link') {
            //pass in required flag if set to required
            if (isset($value['required']) && $value['required']) {
                $javascript->addField($field, true);
            } else {
                //if not required, then just pass in to validate
                $javascript->addField($field, false);
            }
        }
    }
}
$javascript->addFieldGeneric('kbdocument_name', '', 'LBL_ARTICLE_TITLE', 'true');
$javascript->addFieldGeneric('assigned_user_name', 'varchar', $mod_strings['LBL_ARTICLE_AUTHOR'], 'true');
$javascript->addToValidateBinaryDependency('assigned_user_name', 'alpha', $app_strings['ERR_SQS_NO_MATCH_FIELD'] . $mod_strings['LBL_ARTICLE_AUTHOR'], 'false', '', 'assigned_user_id');
$javascript->addToValidateBinaryDependency('kbdoc_approver_name', 'alpha', $app_strings['ERR_SQS_NO_MATCH_FIELD'] . $mod_strings['LBL_ARTICLE_APPROVED_BY'], 'false', '', 'kbdoc_approver_id');
$javascript->addFieldGeneric('kbdocument_revision_number', '', 'LBL_DOC_VERSION', 'true');
$javascript->addFieldGeneric('team_name', 'varchar', $app_strings['LBL_TEAM'], 'true');
$javascript->addToValidateBinaryDependency('team_name', 'alpha', $app_strings['ERR_SQS_NO_MATCH_FIELD'] . $app_strings['LBL_TEAM'], 'false', '', 'team_id');
$javascript->addFieldGeneric('tiny_vals', '', 'LBL_ARTICLE_BODY', 'true');
echo $javascript->getScript();
//Add Custom Fields
require_once 'modules/DynamicFields/templates/Files/EditView.php';
$xtpl->parse("main");
$xtpl->out("main");
$savedSearch = BeanFactory::getBean('SavedSearch');
$json = getJSONobj();
$savedSearchSelects = $json->encode(array($GLOBALS['app_strings']['LBL_SAVED_SEARCH_SHORTCUT'] . '<br>' . $savedSearch->getSelect('KBDocuments')));
Пример #11
0
        $xtpl->assign('GROUP', $parts['group']);
    }
    $xtpl->assign('ASSIGNED_USER_ID', $current_user->id);
    $xtpl->assign('MYINBOX', 'this.form.type.value=\'inbound\';');
}
////	END SPECIAL INBOUND LANDING SCREEN ASSIGNS
///////////////////////////////////////
echo '<script>var disabledModules=' . $json->encode($disabled_parent_types) . ';</script>';
$jsVars = 'var lbl_send_anyways = "' . $mod_strings['LBL_SEND_ANYWAYS'] . '";';
$xtpl->assign('JS_VARS', $jsVars);
$xtpl->parse("main");
$xtpl->out("main");
////	END XTEMPLATE ASSIGNMENT
///////////////////////////////////////////////////////////////////////////////
require_once 'include/javascript/javascript.php';
$javascript = new javascript();
$javascript->setFormName('EditView');
$javascript->setSugarBean($focus);
$skip_fields = array();
if ($email_type == 'out') {
    $skip_fields['name'] = 1;
    $skip_fields['date_start'] = 1;
}
$javascript->addAllFields('', $skip_fields);
$javascript->addToValidateBinaryDependency('parent_name', 'alpha', $app_strings['ERR_SQS_NO_MATCH_FIELD'] . $mod_strings['LBL_MEMBER_OF'], 'false', '', 'parent_id');
$javascript->addToValidateBinaryDependency('user_name', 'alpha', $app_strings['ERR_SQS_NO_MATCH_FIELD'] . $app_strings['LBL_ASSIGNED_TO'], 'false', '', 'assigned_user_id');
if ($email_type == 'archived') {
    $javascript->addFieldGeneric('date_start', 'alpha', $mod_strings['ERR_DATE_START'], true);
    $javascript->addFieldGeneric('time_start', 'alpha', $mod_strings['ERR_TIME_START'], true);
}
echo $javascript->getScript();
Пример #12
0
}
if (empty($lead->assigned_name) && empty($lead->id)) {
    $lead->assigned_user_name = $current_user->user_name;
}
$xtpl->assign("ASSIGNED_USER_OPTIONS", get_select_options_with_id(get_user_array(TRUE, "Active", $lead->assigned_user_id), $lead->assigned_user_id));
$xtpl->assign("ASSIGNED_USER_NAME", $lead->assigned_user_name);
$xtpl->assign("ASSIGNED_USER_ID", $lead->assigned_user_id);
$xtpl->assign("REDIRECT_URL_DEFAULT", 'http://');
//required fields on Webtolead form
$campaign = BeanFactory::getBean('Campaigns');
$javascript = new javascript();
$javascript->setFormName('WebToLeadCreation');
$javascript->setSugarBean($lead);
$javascript->addAllFields('');
//$javascript->addFieldGeneric('redirect_url', '', 'LBL_REDIRECT_URL' ,'true');
$javascript->addFieldGeneric('campaign_name', '', 'LBL_RELATED_CAMPAIGN', 'true');
$javascript->addFieldGeneric('assigned_user_name', '', 'LBL_ASSIGNED_TO', 'true');
$javascript->addToValidateBinaryDependency('campaign_name', 'alpha', $app_strings['ERR_SQS_NO_MATCH_FIELD'] . $mod_strings['LBL_LEAD_NOTIFY_CAMPAIGN'], 'false', '', 'campaign_id');
$javascript->addToValidateBinaryDependency('assigned_user_name', 'alpha', $app_strings['ERR_SQS_NO_MATCH_FIELD'] . $app_strings['LBL_ASSIGNED_TO'], 'false', '', 'assigned_user_id');
$javascript->addFieldGeneric('team_name', 'varchar', $app_strings['LBL_TEAM'], 'true');
$javascript->addToValidateBinaryDependency('team_name', 'alpha', $app_strings['ERR_SQS_NO_MATCH_FIELD'] . $app_strings['LBL_TEAM'], 'false', '', 'team_id');
echo $javascript->getScript();
$json = getJSONobj();
$lead_fields = $json->encode($fields);
$xtpl->assign("LEAD_FIELDS", $lead_fields);
$classname = "SUGAR_GRID";
$xtpl->assign("CLASSNAME", $classname);
$xtpl->assign("DRAG_DROP_CHOOSER_WEB_TO_LEAD", constructDDWebToLeadFields($fields, $classname));
$xtpl->parse("main");
$xtpl->out("main");
/*
$sugar_smarty->assign("SugarpdfSettings", $SugarpdfSettings);
$sugar_smarty->assign("pdf_class", $pdf_class);
$sugar_smarty->assign("selected_pdf_class", PDF_CLASS);
if (!empty($error)) {
    $sugar_smarty->assign("error", $mod_strings[$error]);
}
if (!function_exists('imagecreatefrompng')) {
    $sugar_smarty->assign("GD_WARNING", $mod_strings['PDF_GD_WARNING']);
}
$sugar_smarty->display('modules/Configurator/tpls/SugarpdfSettings.tpl');
require_once "include/javascript/javascript.php";
$javascript = new javascript();
$javascript->setFormName("ConfigureSugarpdfSettings");
foreach ($SugarpdfSettings as $k => $v) {
    if (isset($v["required"]) && $v["required"] == true) {
        $javascript->addFieldGeneric($k, "varchar", $v['label'], TRUE, "");
    }
}
echo $javascript->getScript();
function checkUploadImage()
{
    $error = "";
    if (isset($_FILES['new_header_logo']) && !empty($_FILES['new_header_logo']['name'])) {
        $file_name = K_PATH_IMAGES . '/pdf_header_logo_' . basename($_FILES['new_header_logo']['name']);
        if (file_exists($file_name)) {
            rmdir_recursive($file_name);
        }
        if (!empty($_FILES['new_header_logo']['error'])) {
            $error = 'ERR_ALERT_FILE_UPLOAD';
        }
        if (empty($error)) {
Пример #14
0
$return_action = isset($_REQUEST['return_action']) ? $_REQUEST['return_action'] : '';
if (empty($return_id)) {
    $return_action = 'index';
}
if (isset($_REQUEST['error_string'])) {
    $xtpl->assign("ERROR_STRING", "<span class='error'>Error: " . $_REQUEST['error_string'] . "</span>");
}
$xtpl->assign("RETURN_MODULE", $return_module);
$xtpl->assign("RETURN_ID", $return_id);
$xtpl->assign("RETURN_ACTION", $return_action);
if (isset($_REQUEST['isDuplicate'])) {
    $xtpl->assign("IS_DUPLICATE", $_REQUEST['isDuplicate']);
}
$xtpl->assign("PRINT_URL", "index.php?" . $GLOBALS['request_string']);
$xtpl->assign("ID", $focus->id);
$xtpl->assign("NAME", Team::getDisplayName($focus->name, $focus->name_2));
$xtpl->assign("DESCRIPTION", $focus->description);
global $current_user;
if ($current_user->isAdminForModule('Users') && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])) {
    $record = '';
    if (!empty($_REQUEST['record'])) {
        $record = $_REQUEST['record'];
    }
    $xtpl->assign("ADMIN_EDIT", "<a href='index.php?action=index&module=DynamicLayout&from_action=" . $_REQUEST['action'] . "&from_module=" . $_REQUEST['module'] . "&record=" . $record . "'>" . SugarThemeRegistry::current()->getImage("EditLayout", "border='0' align='bottom'", null, null, '.gif', $mod_strings['LBL_EDITLAYOUT']) . "</a>");
}
$javascript = new javascript();
$javascript->setFormName("EditView");
$javascript->addFieldGeneric("name", "varchar", $mod_strings['LBL_NAME'], TRUE, "");
$xtpl->parse("main");
$xtpl->out("main");
echo $javascript->getScript();
Пример #15
0
}
if (empty($focus->assigned_name) && empty($focus->id)) {
    $focus->assigned_user_name = $current_user->user_name;
}
$xtpl->assign("ASSIGNED_USER_OPTIONS", get_select_options_with_id(get_user_array(TRUE, "Active", $focus->assigned_user_id), $focus->assigned_user_id));
$xtpl->assign("ASSIGNED_USER_NAME", $focus->assigned_user_name);
$xtpl->assign("ASSIGNED_USER_ID", $focus->assigned_user_id);
$xtpl->assign("REDIRECT_URL_DEFAULT", 'http://');
//required fields on Webtolead form
$campaign = new Campaign();
$javascript = new javascript();
$javascript->setFormName('WebToLeadCreation');
$javascript->setSugarBean($lead);
$javascript->addAllFields('');
//$javascript->addFieldGeneric('redirect_url', '', 'LBL_REDIRECT_URL' ,'true');
$javascript->addFieldGeneric('campaign_name', '', 'LBL_RELATED_CAMPAIGN', 'true');
$javascript->addFieldGeneric('assigned_user_name', '', 'LBL_ASSIGNED_TO', 'true');
$javascript->addToValidateBinaryDependency('campaign_name', 'alpha', $app_strings['ERR_SQS_NO_MATCH_FIELD'] . $mod_strings['LBL_LEAD_NOTIFY_CAMPAIGN'], 'false', '', 'campaign_id');
$javascript->addToValidateBinaryDependency('assigned_user_name', 'alpha', $app_strings['ERR_SQS_NO_MATCH_FIELD'] . $app_strings['LBL_ASSIGNED_TO'], 'false', '', 'assigned_user_id');
echo $javascript->getScript();
$json = getJSONobj();
$lead_fields = $json->encode($fields);
$xtpl->assign("LEAD_FIELDS", $lead_fields);
$classname = "SUGAR_GRID";
$xtpl->assign("CLASSNAME", $classname);
$xtpl->assign("DRAG_DROP_CHOOSER_WEB_TO_LEAD", constructDDWebToLeadFields($fields, $classname));
$xtpl->parse("main");
$xtpl->out("main");
/*
$str = "<script>
WebToLeadForm.lead_fields = {$lead_fields};
Пример #16
0
}
// Build the $asterisk_config array which stores all the default values used in smart template below if
// they aren't already set
$asterisk_config = array();
foreach ($config_meta as $key => $value) {
    $asterisk_config[$key] = $value['default'];
}
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");
foreach ($config_meta as $key => $value) {
    $type = "varchar";
    $required = TRUE;
    if (isset($value['required'])) {
        $required = $value['required'];
    }
    if (isset($value['type'])) {
        $type = $value['type'];
    }
    $javascript->addFieldGeneric($key, $type, $mod_strings['LBL_' . strtoupper($key)], $required, "");
}
echo $javascript->getScript();
Пример #17
0
 /**
  * @see SugarView::display()
  */
 public function display()
 {
     global $mod_strings, $app_strings, $app_list_strings;
     require_once "modules/Configurator/metadata/SugarpdfSettingsdefs.php";
     if (file_exists('custom/modules/Configurator/metadata/SugarpdfSettingsdefs.php')) {
         require_once 'custom/modules/Configurator/metadata/SugarpdfSettingsdefs.php';
     }
     if (!empty($_POST['save'])) {
         // Save the logos
         $error = $this->checkUploadImage();
         if (empty($error)) {
             $focus = new Administration();
             foreach ($SugarpdfSettings as $k => $v) {
                 if ($v['type'] == 'password') {
                     if (isset($_POST[$k])) {
                         $_POST[$k] = blowfishEncode(blowfishGetKey($k), $_POST[$k]);
                     }
                 }
             }
             if (!empty($_POST["sugarpdf_pdf_class"]) && $_POST["sugarpdf_pdf_class"] != PDF_CLASS) {
                 // clear the cache for quotes detailview in order to switch the pdf class.
                 if (is_file($cachedfile = sugar_cached('modules/Quotes/DetailView.tpl'))) {
                     unlink($cachedfile);
                 }
             }
             $focus->saveConfig();
             header('Location: index.php?module=Administration&action=index');
         }
     }
     if (!empty($_POST['restore'])) {
         $focus = new Administration();
         foreach ($_POST as $key => $val) {
             $prefix = $focus->get_config_prefix($key);
             if (in_array($prefix[0], $focus->config_categories)) {
                 $result = $focus->db->query("SELECT count(*) AS the_count FROM config WHERE category = '{$prefix[0]}' AND name = '{$prefix[1]}'");
                 $row = $focus->db->fetchByAssoc($result);
                 if ($row['the_count'] != 0) {
                     $focus->db->query("DELETE FROM config WHERE category = '{$prefix[0]}' AND name = '{$prefix[1]}'");
                 }
             }
         }
         header('Location: index.php?module=Configurator&action=SugarpdfSettings');
     }
     echo getClassicModuleTitle("Administration", array("<a href='index.php?module=Administration&action=index'>" . translate('LBL_MODULE_NAME', 'Administration') . "</a>", $mod_strings['LBL_PDFMODULE_NAME']), false);
     $pdf_class = array("TCPDF" => "TCPDF", "EZPDF" => "EZPDF");
     $this->ss->assign('APP_LIST', $app_list_strings);
     $this->ss->assign("JAVASCRIPT", get_set_focus_js());
     $this->ss->assign("SugarpdfSettings", $SugarpdfSettings);
     $this->ss->assign("pdf_enable_ezpdf", PDF_ENABLE_EZPDF);
     if (PDF_ENABLE_EZPDF == "0" && PDF_CLASS == "EZPDF") {
         $error = "ERR_EZPDF_DISABLE";
         $this->ss->assign("selected_pdf_class", "TCPDF");
     } else {
         $this->ss->assign("selected_pdf_class", PDF_CLASS);
     }
     $this->ss->assign("pdf_class", $pdf_class);
     if (!empty($error)) {
         $this->ss->assign("error", $mod_strings[$error]);
     }
     if (!function_exists('imagecreatefrompng')) {
         $this->ss->assign("GD_WARNING", 1);
     } else {
         $this->ss->assign("GD_WARNING", 0);
     }
     $this->ss->display('modules/Configurator/tpls/SugarpdfSettings.tpl');
     require_once "include/javascript/javascript.php";
     $javascript = new javascript();
     $javascript->setFormName("ConfigureSugarpdfSettings");
     foreach ($SugarpdfSettings as $k => $v) {
         if (isset($v["required"]) && $v["required"] == true) {
             $javascript->addFieldGeneric($k, "varchar", $v['label'], TRUE, "");
         }
     }
     echo $javascript->getScript();
 }
Пример #18
0
    }
}
// awu: Bug 11820 - date entered was not conforming to correct date in Oracle
$focus->fetched_row['estimated_start_date'] = $focus->estimated_start_date;
$focus->fetched_row['estimated_end_date'] = $focus->estimated_end_date;
$focus->fetched_row['date_entered'] = $timedate->nowDbDate();
$focus->fetched_row['date_modified'] = $timedate->nowDbDate();
// populate form with project's data
$sugar_smarty->assign('PROJECT_FORM', $focus->fetched_row);
if ($focus->is_template) {
    $sugar_smarty->assign('SAVE_TYPE', "TemplateToProject");
    $sugar_smarty->assign('SAVE_TO', "project");
    $sugar_smarty->assign('SAVE_TO_LBL', $mod_strings['LBL_PROJECT_NAME']);
    $sugar_smarty->assign('SAVE_BUTTON', $mod_strings['LBL_SAVE_AS_NEW_PROJECT_BUTTON']);
} else {
    $sugar_smarty->assign('SAVE_TYPE', "ProjectToTemplate");
    $sugar_smarty->assign('SAVE_TO', "template");
    $sugar_smarty->assign('SAVE_TO_LBL', $mod_strings['LBL_TEMPLATE_NAME']);
    $sugar_smarty->assign('SAVE_BUTTON', $mod_strings['LBL_SAVE_AS_NEW_TEMPLATE_BUTTON']);
}
echo $sugar_smarty->fetch('modules/Project/Convert.tpl');
$javascript = new javascript();
$javascript->setFormName('EditView');
$javascript->setSugarBean($focus);
$javascript->addAllFields('');
if ($focus->is_template) {
    $javascript->addFieldGeneric('project_name', 'varchar', $mod_strings['LBL_PROJECT_NAME'], 'true');
} else {
    $javascript->addFieldGeneric('template_name', 'varchar', $mod_strings['LBL_TEMPLATE_NAME'], 'true');
}
echo $javascript->getScript();