本文整理汇总了PHP中Administration类的典型用法代码示例。如果您正苦于以下问题:PHP Administration类的具体用法?PHP Administration怎么用?PHP Administration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Administration类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: zuckerreports_query
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);
}
示例2: __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);
}
}
示例3: 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);
}
示例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: 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');
}
示例6: 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;
}
示例7: 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;
}
示例8: 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;
}
示例9: 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();
}
示例10: 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();
}
示例11: 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);
}
示例12: 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>";
}
示例13: setUp
public function setUp()
{
$startTime = microtime();
$system_config = new Administration();
$system_config->retrieveSettings();
$GLOBALS['system_config'] = $system_config;
$this->_app = new SugarApplicationMock();
if (isset($_SESSION['authenticated_user_theme'])) {
unset($_SESSION['authenticated_user_theme']);
}
}
示例14: display
/**
* @see SugarView::display()
*/
public function display()
{
global $current_user, $mod_strings, $app_list_strings, $sugar_config, $locale, $sugar_version;
if (!is_admin($current_user)) {
sugar_die($GLOBALS['app_strings']['ERR_NOT_ADMIN']);
}
$themeObject = SugarThemeRegistry::current();
$configurator = new Configurator();
$sugarConfig = SugarConfig::getInstance();
$focus = new Administration();
$focus->retrieveSettings();
$ut = $GLOBALS['current_user']->getPreference('ut');
if (empty($ut)) {
$this->ss->assign('SKIP_URL', 'index.php?module=Users&action=Wizard&skipwelcome=1');
} else {
$this->ss->assign('SKIP_URL', 'index.php?module=Home&action=index');
}
// Always mark that we have got past this point
$focus->saveSetting('system', 'adminwizard', 1);
$css = $themeObject->getCSS();
$favicon = $themeObject->getImageURL('sugar_icon.ico', false);
$this->ss->assign('FAVICON_URL', getJSPath($favicon));
$this->ss->assign('SUGAR_CSS', $css);
$this->ss->assign('MOD_USERS', return_module_language($GLOBALS['current_language'], 'Users'));
$this->ss->assign('CSS', '<link rel="stylesheet" type="text/css" href="' . SugarThemeRegistry::current()->getCSSURL('wizard.css') . '" />');
$this->ss->assign('LANGUAGES', get_languages());
$this->ss->assign('config', $sugar_config);
$this->ss->assign('SUGAR_VERSION', $sugar_version);
$this->ss->assign('settings', $focus->settings);
$this->ss->assign('exportCharsets', get_select_options_with_id($locale->getCharsetSelect(), $sugar_config['default_export_charset']));
$this->ss->assign('getNameJs', $locale->getNameJs());
$this->ss->assign('NAMEFORMATS', $locale->getUsableLocaleNameOptions($sugar_config['name_formats']));
$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('mail_smtptype', $focus->settings['mail_smtptype']);
$this->ss->assign('mail_smtpserver', $focus->settings['mail_smtpserver']);
$this->ss->assign('mail_smtpport', $focus->settings['mail_smtpport']);
$this->ss->assign('mail_smtpuser', $focus->settings['mail_smtpuser']);
$this->ss->assign('mail_smtppass', $focus->settings['mail_smtppass']);
$this->ss->assign('mail_smtpauth_req', $focus->settings['mail_smtpauth_req'] ? "checked='checked'" : '');
$this->ss->assign('MAIL_SSL_OPTIONS', get_select_options_with_id($app_list_strings['email_settings_for_ssl'], $focus->settings['mail_smtpssl']));
$this->ss->assign('notify_allow_default_outbound_on', !empty($focus->settings['notify_allow_default_outbound']) && $focus->settings['notify_allow_default_outbound'] == 2 ? 'CHECKED' : '');
$this->ss->assign('THEME', SugarThemeRegistry::current()->__toString());
// get javascript
ob_start();
$this->options['show_javascript'] = true;
$this->renderJavascript();
$this->options['show_javascript'] = false;
$this->ss->assign("SUGAR_JS", ob_get_contents() . $themeObject->getJS());
ob_end_clean();
$this->ss->assign('langHeader', get_language_header());
$this->ss->assign('START_PAGE', !empty($_REQUEST['page']) ? $_REQUEST['page'] : 'welcome');
$this->ss->display('modules/Configurator/tpls/adminwizard.tpl');
}
示例15: action_display
public function action_display()
{
require_once 'modules/Administration/Administration.php';
$administration = new Administration();
$administration->retrieveSettings();
$api_key = $administration->settings['Nexmo_api_key'];
echo $administration->settings['Nexmo_api_key'] . '<br>';
echo $administration->settings['Nexmo_api_secret'] . '<br>';
echo $administration->settings['Nexmo_budget'] . '<br>';
echo $administration->settings['Nexmo_send_msg'] . '<br>';
}