本文整理汇总了PHP中Administration::retrieveSettings方法的典型用法代码示例。如果您正苦于以下问题:PHP Administration::retrieveSettings方法的具体用法?PHP Administration::retrieveSettings怎么用?PHP Administration::retrieveSettings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Administration
的用法示例。
在下文中一共展示了Administration::retrieveSettings方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testactivateAndDisableModuleFeed
public function testactivateAndDisableModuleFeed()
{
$admin = new Administration();
//test activateModuleFeed method
SugarFeed::activateModuleFeed('Accounts');
$admin->retrieveSettings('sugarfeed');
$this->assertEquals(1, $admin->settings['sugarfeed_module_Accounts']);
//test disableModuleFeed method
SugarFeed::disableModuleFeed('Accounts');
$admin->retrieveSettings('sugarfeed');
$this->assertEquals(0, $admin->settings['sugarfeed_module_Accounts']);
}
示例2: array
function zuckerreports_query($session, $sql)
{
global $current_user;
$util = new SugarWebServiceUtilv4_1();
if (!$util->validate_authenticated($session)) {
return array('result' => 'error', 'message' => 'ZuckerReports Query invalid session');
}
$admin = new Administration();
$admin->retrieveSettings();
$sugaruser = $admin->settings['zuckerreports2_ondemandsugaruser'];
if ($current_user->user_name != $sugaruser) {
return array('result' => 'error', 'message' => 'ZuckerReports Query invalid user (' . $current_user->user_name . ')');
}
$db = DBManagerFactory::getInstance();
$result = $db->query($sql);
$row_list = array();
$colnames_list = array();
while (($row = $db->fetchByAssoc($result)) != null) {
if (empty($colnames_list)) {
foreach ($row as $colname => $colval) {
$colnames_list[] = $colname;
}
}
$json_row = array();
foreach ($row as $colname => $colval) {
$json_row[] = $colval;
}
$row_list[] = $json_row;
}
return array('result' => 'ok', 'columnnames_list' => $colnames_list, 'rows_list' => $row_list);
}
示例3: getZendeskConnection
function getZendeskConnection()
{
global $current_user;
$read_only = true;
$zendesk_https = false;
$zendesk_helper = new ZendeskHelper();
$admin = new Administration();
$admin->retrieveSettings('system');
if ($admin->settings['system_zendesk_instance']) {
$zendesk_instance = $admin->settings['system_zendesk_instance'];
} else {
throw new Exception('Zendesk credentials not configured');
}
if ($admin->settings['system_zendesk_https']) {
$zendesk_https = true;
}
$personal_login = $zendesk_helper->getPersonalConfigValue('login');
if ($personal_login && $personal_login != '') {
$read_only = false;
$zendesk_login = $personal_login;
$zendesk_password = $zendesk_helper->getPersonalConfigValue('password');
} else {
$zendesk_login = $zendesk_helper->getGlobalConfigValue('login');
$zendesk_password = $zendesk_helper->getGlobalConfigValue('password');
}
$c = new Zendesk($zendesk_instance, $zendesk_login, $zendesk_password, true, $zendesk_https);
$c->read_only = $read_only;
return $c;
}
示例4: process
/**
* main method that runs reminding process
* @return boolean
*/
public function process()
{
$admin = new Administration();
$admin->retrieveSettings();
$meetings = $this->getMeetingsForRemind();
foreach ($meetings as $id) {
$recipients = $this->getRecipients($id, 'Meetings');
$bean = new Meeting();
$bean->retrieve($id);
if ($this->sendReminders($bean, $admin, $recipients)) {
$bean->email_reminder_sent = 1;
$bean->save();
}
}
$calls = $this->getCallsForRemind();
foreach ($calls as $id) {
$recipients = $this->getRecipients($id, 'Calls');
$bean = new Call();
$bean->retrieve($id);
if ($this->sendReminders($bean, $admin, $recipients)) {
$bean->email_reminder_sent = 1;
$bean->save();
}
}
return true;
}
示例5: __construct
/**
* BreadCrumbStack
* Constructor for BreadCrumbStack that builds list of breadcrumbs using tracker table
*
* @param $user_id String value of user id to get bread crumb items for
* @param $modules mixed value of module name(s) to provide extra filtering
*/
public function __construct($user_id, $modules = '')
{
$this->stack = array();
$this->stackMap = array();
$admin = new Administration();
$admin->retrieveSettings('tracker');
$this->deleteInvisible = !empty($admin->settings['tracker_Tracker']);
$db = DBManagerFactory::getInstance();
$module_query = '';
if (!empty($modules)) {
$history_max_viewed = 10;
$module_query = is_array($modules) ? ' AND module_name IN (\'' . implode("','", $modules) . '\')' : ' AND module_name = \'' . $modules . '\'';
} else {
$history_max_viewed = !empty($GLOBALS['sugar_config']['history_max_viewed']) ? $GLOBALS['sugar_config']['history_max_viewed'] : 50;
}
$query = 'SELECT distinct item_id AS item_id, id, item_summary, module_name, monitor_id, date_modified FROM tracker WHERE user_id = \'' . $user_id . '\' AND deleted = 0 AND visible = 1 ' . $module_query . ' ORDER BY date_modified DESC';
$result = $db->limitQuery($query, 0, $history_max_viewed);
$items = array();
while ($row = $db->fetchByAssoc($result)) {
$items[] = $row;
}
$items = array_reverse($items);
foreach ($items as $item) {
$this->push($item);
}
}
示例6: setupMailObject
/**
* filling the mail object with all the administrative settings and configurations
* @global type $sugar_version
* @global type $sugar_config
* @global type $app_list_strings
* @global type $current_user
* @param type $mailObject
*/
public function setupMailObject($mailObject)
{
$this->admin->retrieveSettings();
if ($this->admin->settings['mail_sendtype'] == "SMTP") {
$mailObject->Mailer = "smtp";
$mailObject->Host = $this->admin->settings['mail_smtpserver'];
$mailObject->Port = $this->admin->settings['mail_smtpport'];
$mailObject->SMTPSecure = '';
if ($this->admin->settings['mail_smtpssl'] == 1) {
$mailObject->SMTPSecure = 'ssl';
}
if ($this->admin->settings['mail_smtpssl'] == 2) {
$mailObject->SMTPSecure = 'tls';
}
if ($this->admin->settings['mail_smtpauth_req']) {
$mailObject->SMTPAuth = true;
$mailObject->Username = $this->admin->settings['mail_smtpuser'];
$mailObject->Password = $this->admin->settings['mail_smtppass'];
}
} else {
$mailObject->Mailer = 'sendmail';
}
$mailObject->From = $this->admin->settings['notify_fromaddress'];
$mailObject->FromName = empty($this->admin->settings['notify_fromname']) ? "" : $this->admin->settings['notify_fromname'];
}
示例7: display
/**
* @see SugarView::display()
*
* We are overridding the display method to manipulate the sectionPanels.
* If portal is not enabled then don't show the Portal Information panel.
*/
public function display()
{
$this->ev->process();
if (!empty($_REQUEST['contact_name']) && !empty($_REQUEST['contact_id']) && $this->ev->fieldDefs['report_to_name']['value'] == '' && $this->ev->fieldDefs['reports_to_id']['value'] == '') {
$this->ev->fieldDefs['report_to_name']['value'] = $_REQUEST['contact_name'];
$this->ev->fieldDefs['reports_to_id']['value'] = $_REQUEST['contact_id'];
}
$admin = new Administration();
$admin->retrieveSettings();
if (empty($admin->settings['portal_on']) || !$admin->settings['portal_on']) {
unset($this->ev->sectionPanels[strtoupper('lbl_portal_information')]);
} else {
if (isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') {
$this->ev->fieldDefs['portal_name']['value'] = '';
$this->ev->fieldDefs['portal_active']['value'] = '0';
$this->ev->fieldDefs['portal_password']['value'] = '';
$this->ev->fieldDefs['portal_password1']['value'] = '';
$this->ev->fieldDefs['portal_name_verified'] = '0';
$this->ev->focus->portal_name = '';
$this->ev->focus->portal_password = '';
$this->ev->focus->portal_acitve = 0;
} else {
$this->ev->fieldDefs['portal_password']['value'] = '';
$this->ev->fieldDefs['portal_password1']['value'] = '';
}
echo getVersionedScript('modules/Contacts/Contact.js');
echo '<script language="javascript">';
echo 'addToValidateComparison(\'EditView\', \'portal_password\', \'varchar\', false, SUGAR.language.get(\'app_strings\', \'ERR_SQS_NO_MATCH_FIELD\') + SUGAR.language.get(\'Contacts\', \'LBL_PORTAL_PASSWORD\'), \'portal_password1\');';
echo 'addToValidateVerified(\'EditView\', \'portal_name_verified\', \'bool\', false, SUGAR.language.get(\'app_strings\', \'ERR_EXISTING_PORTAL_USERNAME\'));';
echo 'YAHOO.util.Event.onDOMReady(function() {YAHOO.util.Event.on(\'portal_name\', \'blur\', validatePortalName);YAHOO.util.Event.on(\'portal_name\', \'keydown\', handleKeyDown);});';
echo '</script>';
}
echo $this->ev->display($this->showTitle);
}
示例8: getPortalEmailSettings
function getPortalEmailSettings()
{
global $sugar_config;
$settings = array('from_name' => '', 'from_address' => '');
if (array_key_exists("aop", $sugar_config)) {
if (array_key_exists('support_from_address', $sugar_config['aop'])) {
$settings['from_address'] = $sugar_config['aop']['support_from_address'];
}
if (array_key_exists('support_from_name', $sugar_config['aop'])) {
$settings['from_name'] = $sugar_config['aop']['support_from_name'];
}
}
if ($settings['from_name'] && $settings['from_address']) {
return $settings;
}
//Fallback to sugar settings
$admin = new Administration();
$admin->retrieveSettings();
if (!$settings['from_name']) {
$settings['from_name'] = $admin->settings['notify_fromname'];
}
if (!$settings['from_address']) {
$settings['from_address'] = $admin->settings['notify_fromaddress'];
}
return $settings;
}
示例9: SugarPHPMailer
/**
* Sole constructor
*/
function SugarPHPMailer()
{
global $locale;
global $current_user;
global $sugar_config;
$admin = new Administration();
$admin->retrieveSettings();
if (isset($admin->settings['disclosure_enable']) && !empty($admin->settings['disclosure_enable'])) {
$this->disclosureEnabled = true;
$this->disclosureText = $admin->settings['disclosure_text'];
}
$this->oe = new OutboundEmail();
$this->oe->getUserMailerSettings($current_user);
$this->SetLanguage('en', 'include/phpmailer/language/');
$this->PluginDir = 'include/phpmailer/';
$this->Mailer = 'sendmail';
// cn: i18n
$this->CharSet = $locale->getPrecedentPreference('default_email_charset');
$this->Encoding = 'quoted-printable';
$this->IsHTML(false);
// default to plain-text email
$this->Hostname = $sugar_config['host_name'];
$this->WordWrap = 996;
// cn: gmail fix
$this->protocol = $this->oe->mail_smtpssl == 1 ? "ssl://" : $this->protocol;
}
示例10: display
public function display()
{
echo $this->getModuleTitle();
$this->ss->assign("RETURN_MODULE", "Administration");
$this->ss->assign("RETURN_ACTION", "index");
$zendesk_helper = new ZendeskHelper();
$admin = new Administration();
$admin->retrieveSettings('zendesk');
$this->ss->assign('zendesk_instance', $admin->settings['system_zendesk_instance']);
$this->ss->assign('zendesk_https', $admin->settings['system_zendesk_https']);
$this->ss->assign("zendesk_https_checkbox", $admin->settings['system_zendesk_https'] ? "checked='checked'" : "");
$this->ss->assign('zendesk_login', $admin->settings['system_zendesk_login']);
$this->ss->assign('use_account_name', $zendesk_helper->getGlobalConfigValue('use_account_name'));
$this->ss->assign('per_page', $zendesk_helper->getGlobalConfigValue('per_page', '6'));
$this->ss->assign('sort', $zendesk_helper->getGlobalConfigValue('sort', '1'));
$this->ss->assign('order_by', $zendesk_helper->getGlobalConfigValue('order_by', 'priority'));
$this->ss->assign('status_filter', $zendesk_helper->getGlobalConfigValue('status_filter', 'lsolved'));
$this->ss->assign('priority_filter', $zendesk_helper->getGlobalConfigValue('priority_filter', 'any'));
$this->ss->assign('type_filter', $zendesk_helper->getGlobalConfigValue('type_filter', 'any'));
$this->ss->assign('statusoptions', $zendesk_helper->getStatusFilterOptions());
$this->ss->assign('priorityoptions', $zendesk_helper->getPriorityFilterOptions());
$this->ss->assign('typeoptions', $zendesk_helper->getTypeFilterOptions());
$this->ss->assign('columns', $zendesk_helper->getColumnOptions());
$this->ss->display('modules/zd_Tickets/tpls/config.tpl');
}
示例11: display
/**
* @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();
}
示例12: testsaveSetting
public function testsaveSetting()
{
$admin = new Administration();
//execute the method and verify that sets the correct config key
$result = $admin->saveSetting('category', 'key', 'test value');
$admin->retrieveSettings('category');
$actual = $admin->settings['category_key'];
$this->assertEquals($actual, 'test value');
}
示例13: display
/**
* @see SugarView::display()
*
* We are overridding the display method to manipulate the portal information.
* If portal is not enabled then don't show the portal fields.
*/
public function display()
{
$admin = new Administration();
$admin->retrieveSettings();
if (isset($admin->settings['portal_on']) && $admin->settings['portal_on']) {
$this->ss->assign("PORTAL_ENABLED", true);
}
parent::display();
}
示例14: display
public function display()
{
$admin = new Administration();
$admin->retrieveSettings();
if (isset($admin->settings['portal_on']) && $admin->settings['portal_on']) {
$this->ss->assign("PORTAL_ENABLED", true);
}
parent::display();
echo "<script src='custom/include/javascript/ajaxButton.js'></script>";
}
示例15: display
/**
* @see SugarView::display()
*
* We are overridding the display method to manipulate the sectionPanels.
* If portal is not enabled then don't show the Portal Information panel.
*/
public function display()
{
$this->ev->process();
$admin = new Administration();
$admin->retrieveSettings();
if (empty($admin->settings['portal_on']) || !$admin->settings['portal_on']) {
unset($this->ev->sectionPanels[strtoupper('lbl_portal_information')]);
}
echo $this->ev->display($this->showTitle);
}