本文整理汇总了PHP中get_user_array函数的典型用法代码示例。如果您正苦于以下问题:PHP get_user_array函数的具体用法?PHP get_user_array怎么用?PHP get_user_array使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_user_array函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: displayOptions
public function displayOptions()
{
if (!isset($this->v_ids) || count($this->v_ids) == 0) {
$this->_searchFields['v_ids']['input_name0'] = array_keys(get_user_array(false));
}
return parent::displayOptions();
}
示例2: view
public function view($id)
{
$uploads = array('report' => array(), 'account_list' => '');
if ($this->input->post('update_project')) {
$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'gif|jpg|png|pdf|doc|docx|txt';
$this->load->library('upload', $config);
foreach ($this->dates as $key => $value) {
$tmp = array();
if ($_FILES['report_' . $value]['size'] > 0) {
$this->upload->do_upload('report_' . $value);
$tmp = $this->upload->data();
$uploads['report'][][$key] = @$tmp['file_name'];
}
}
if ($_FILES['account_list']['size'] > 0) {
$this->upload->do_upload('account_list');
$tmp = array();
$tmp = $this->upload->data();
$uploads['account_list'] = $tmp['file_name'];
}
$this->projects_model->update_project($id, $this->input->post(), $uploads);
$this->session->set_flashdata('projects', 'The project has been updated');
redirect('projects/view/' . $id);
}
$data = array();
$data['staff'] = get_user_array();
$data['data'] = $this->projects_model->get_project_data($id);
$this->load->view('projects/view', $data);
}
示例3: template_reports_request_vars_js
function template_reports_request_vars_js(&$smarty, &$reporter, &$args)
{
$field_defs = $reporter->focus->field_defs;
$table_columns = array();
$hidden_columns = array();
if (!isset($reporter->report_def['report_type'])) {
$report_type = 'tabular';
} else {
$report_type = $reporter->report_def['report_type'];
}
// else
$allowed_modules_arr = array();
global $report_modules;
foreach ($report_modules as $module => $name) {
array_push($allowed_modules_arr, "\"{$module}\":1");
}
// foreach
$allowed_modules_js = implode(",", $allowed_modules_arr);
$smarty->assign('allowed_modules_js', "{" . $allowed_modules_js . "}");
$smarty->assign('reporter_report_def_str1', $reporter->report_def_str);
if (isset($reporter->report_def['goto_anchor'])) {
$goto_anchor = $reporter->report_def['goto_anchor'];
} else {
$goto_anchor = "\"\"";
}
// else
$smarty->assign('goto_anchor', $goto_anchor);
$user_array = get_user_array(FALSE);
$smarty->assign('user_array', $user_array);
}
示例4: testGetUserArray
public function testGetUserArray()
{
$users1 = get_user_array(false, '');
$users2 = get_user_array(false, '', '', true, "{$this->user->user_name}");
$users3 = get_user_array(false, '', '', true, "{$this->user2->user_name}");
$this->assertNotEquals(count($users1), count($users2), 'get_user_array does not filter correctly on cache');
$this->assertEquals(1, count($users2), 'get_user_array does not filter correctly on cache');
$this->assertEquals(1, count($users3), 'get_user_array does not filter correctly on cache');
}
示例5: getSearchViewSmarty
function getSearchViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex)
{
$vardef['options'] = get_user_array(false);
if (!empty($vardef['function']['returns']) && $vardef['function']['returns'] == 'html') {
$this->setup($parentFieldArray, $vardef, $displayParams, $tabindex);
return $this->fetch('include/SugarFields/Fields/Multienum/EditViewFunction.tpl');
} else {
$this->setup($parentFieldArray, $vardef, $displayParams, $tabindex);
return $this->fetch('include/SugarFields/Fields/Assigned_user_name/SearchView.tpl');
}
}
示例6: getSearchViewSmarty
function getSearchViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex)
{
$vardef['options'] = get_user_array(false);
if (!empty($vardef['function']['returns']) && $vardef['function']['returns'] == 'html') {
$this->setup($parentFieldArray, $vardef, $displayParams, $tabindex);
return $this->fetch($this->findTemplate('EditViewFunction'));
} else {
$this->setup($parentFieldArray, $vardef, $displayParams, $tabindex);
return $this->fetch($this->findTemplate('SearchView'));
}
}
示例7: get_assigned_user_name
/** Function returns the user array
* @param $assigned_user_id -- assigned_user_id:: Type string
* @returns $user_list -- user list:: Type array
*
*/
function get_assigned_user_name(&$assigned_user_id)
{
global $log;
$log->debug("Entering get_assigned_user_name() method ...");
$user_list =& get_user_array(false, "");
if (isset($user_list[$assigned_user_id])) {
$log->debug("Exiting get_assigned_user_name method ...");
return $user_list[$assigned_user_id];
}
$log->debug("Exiting get_assigned_user_name method ...");
return "";
}
示例8: vtJsonOwnersList
function vtJsonOwnersList($adb)
{
$ownersList = array();
$activeUsersList = get_user_array(false);
$allGroupsList = get_group_array(false);
foreach ($activeUsersList as $userId => $userName) {
$ownersList[] = array('label' => $userName, 'value' => getUserName($userId), 'id' => $userId);
}
foreach ($allGroupsList as $groupId => $groupName) {
$ownersList[] = array('label' => $groupName, 'value' => $groupName, 'id' => $groupId);
}
echo Zend_Json::encode($ownersList);
}
示例9: profile
public function profile($id)
{
if ($this->input->post('update_caller')) {
$this->helpline_model->update_caller($this->input->post());
$this->session->set_flashdata('helpline', 'The profile has been updated.');
redirect('helpline/profile/' . $id);
}
$data['reference_agencies'] = get_option_for_dropdown('reference_agencies');
$data['staff'] = get_user_array();
$data['caller'] = $this->helpline_model->get_caller($id);
$data['ethnicity'] = $this->config->item('ethnicity');
$data['relationship'] = $this->config->item('relationship');
$data['gender'] = $this->config->item('gender');
$data['education'] = $this->config->item('education');
$this->load->view('helpline/profile', $data);
}
示例10: displayOptions
/**
* @see DashletGenericChart::displayOptions()
*/
public function displayOptions()
{
global $app_list_strings;
$selected_datax = array();
if (!empty($this->lsbo_lead_sources) && sizeof($this->lsbo_lead_sources) > 0) {
foreach ($this->lsbo_lead_sources as $key) {
$selected_datax[] = $key;
}
} else {
$selected_datax = array_keys($app_list_strings['lead_source_dom']);
}
$this->_searchFields['lsbo_lead_sources']['options'] = array_filter($app_list_strings['lead_source_dom']);
$this->_searchFields['lsbo_lead_sources']['input_name0'] = $selected_datax;
if (!isset($this->lsbo_ids) || count($this->lsbo_ids) == 0) {
$this->_searchFields['lsbo_ids']['input_name0'] = array_keys(get_user_array(false));
}
return parent::displayOptions();
}
示例11: display
/**
* This function loads portal config vars from db and sets them for the view
* @see SugarView::display() for more info
*/
function display()
{
$portalFields = array('appStatus' => 'offline', 'logoURL' => '', 'maxQueryResult' => '20', 'maxSearchQueryResult' => '5', 'defaultUser' => '');
$userList = get_user_array();
$userList[''] = '';
require_once "modules/MySettings/TabController.php";
$controller = new TabController();
$disabledModulesFlag = false;
$disabledModules = array_diff($controller->getAllPortalTabs(), $controller->getPortalTabs());
if (!empty($disabledModules)) {
$disabledModulesFlag = true;
array_walk($disabledModules, function (&$item) {
$item = translate($item);
});
}
$admin = Administration::getSettings();
$portalConfig = $admin->getConfigForModule('portal', 'support', true);
$portalConfig['appStatus'] = !empty($portalConfig['on']) ? 'online' : 'offline';
$smarty = new Sugar_Smarty();
$smarty->assign('disabledDisplayModulesList', $disabledModules);
$smarty->assign('disabledDisplayModules', $disabledModulesFlag);
foreach ($portalFields as $fieldName => $fieldDefault) {
if (isset($portalConfig[$fieldName])) {
$smarty->assign($fieldName, html_entity_decode($portalConfig[$fieldName]));
} else {
$smarty->assign($fieldName, $fieldDefault);
}
}
$smarty->assign('userList', $userList);
$smarty->assign('welcome', $GLOBALS['mod_strings']['LBL_SYNCP_WELCOME']);
$smarty->assign('mod', $GLOBALS['mod_strings']);
$smarty->assign('siteURL', $GLOBALS['sugar_config']['site_url']);
if (isset($_REQUEST['label'])) {
$smarty->assign('label', $_REQUEST['label']);
}
$options = !empty($GLOBALS['system_config']->settings['system_portal_url']) ? $GLOBALS['system_config']->settings['system_portal_url'] : 'https://';
$smarty->assign('options', $options);
$ajax = new AjaxCompose();
$ajax->addCrumb(translate('LBL_SUGARPORTAL', 'ModuleBuilder'), 'ModuleBuilder.main("sugarportal")');
$ajax->addCrumb(ucwords(translate('LBL_PORTAL_CONFIGURE')), '');
$ajax->addSection('center', translate('LBL_SUGARPORTAL', 'ModuleBuilder'), $smarty->fetch('modules/ModuleBuilder/tpls/portalconfig.tpl'));
$GLOBALS['log']->debug($smarty->fetch('modules/ModuleBuilder/tpls/portalconfig.tpl'));
echo $ajax->getJavascript();
}
示例12: run
/**
* Run the Upgrade Task
*
* Set the user preference for email link type to 'mailto' if the system configuration is not properly set
*/
public function run()
{
if (!version_compare($this->from_version, '7.2.0', "<")) {
return;
}
$user = BeanFactory::getBean('Users');
$users = get_user_array(false);
foreach ($users as $userId => $userName) {
$user->retrieve($userId);
$emailClientPreference = $user->getPreference('email_link_type');
if ($emailClientPreference == 'sugar') {
$mailerPreferenceStatus = OutboundEmailConfigurationPeer::getMailConfigurationStatusForUser($user, 'sugar');
if ($mailerPreferenceStatus != OutboundEmailConfigurationPeer::STATUS_VALID_CONFIG) {
$user->setPreference('email_link_type', 'mailto');
}
$user->savePreferencesToDB();
}
}
}
示例13: get_new_record_form
function get_new_record_form()
{
if (!ACLController::checkAccess('ProjectTask', 'edit', true)) {
return '';
}
global $app_strings;
global $mod_strings;
global $currentModule;
global $current_user;
global $sugar_version, $sugar_config;
$the_form = get_left_form_header($mod_strings['LBL_NEW_FORM_TITLE']);
$form = new XTemplate('modules/ProjectTask/Forms.html');
$module_select = empty($_REQUEST['module_select']) ? '' : $_REQUEST['module_select'];
$form->assign('mod', $mod_strings);
$form->assign('app', $app_strings);
$form->assign('module', $currentModule);
$options = get_select_options_with_id(get_user_array(), $current_user->id);
$form->assign('ASSIGNED_USER_OPTIONS', $options);
///////////////////////////////////////
///
/// SETUP ACCOUNT POPUP
$popup_request_data = array('call_back_function' => 'set_return', 'form_name' => "quick_save", 'field_to_name_array' => array('id' => 'parent_id', 'name' => 'project_name'));
$json = getJSONobj();
$encoded_popup_request_data = $json->encode($popup_request_data);
//
///////////////////////////////////////
$form->assign('encoded_popup_request_data', $encoded_popup_request_data);
$form->parse('main');
$the_form .= $form->text('main');
require_once 'modules/ProjectTask/ProjectTask.php';
$focus = new ProjectTask();
require_once 'include/javascript/javascript.php';
$javascript = new javascript();
$javascript->setFormName('quick_save');
$javascript->setSugarBean($focus);
$javascript->addRequiredFields('');
$jscript = $javascript->getScript();
$the_form .= $jscript . get_left_form_footer();
return $the_form;
}
示例14: _edit
public function _edit($model, $view, $id)
{
$this->load->model($model);
if ($this->input->post('do_action')) {
$this->{$model}->update($this->input->post(), $id);
redirect('lasrmetrics/' . $view . '/edit/' . $id);
}
$data = array();
$data = (array) $this->{$model}->fetch($id);
$data['staff'] = get_user_array();
$data['locations'] = get_option_for_dropdown('office_locations');
$data['presenter_types'] = get_option_for_dropdown('presenter_types');
$data['program_types'] = get_option_for_dropdown('program_types');
$data['group_types'] = get_option_for_dropdown('group_types');
$data['event_types'] = get_option_for_dropdown('event_types');
$data['education_programs'] = get_option_for_dropdown('education_programs');
$data['target_audiences'] = get_option_for_dropdown('target_audiences');
$data['SPA'] = get_option_for_dropdown('SPA');
$data['grant_programs'] = get_option_for_dropdown('grant_programs');
$data['engagement_types'] = get_option_for_dropdown('engagement_types');
$data['counties'] = get_option_for_dropdown('counties');
$this->load->view('lasrmetrics/' . $view . '/edit', $data);
}
示例15: draw
function draw($extra_tools)
{
require_once 'include/utils.php';
global $app_list_strings, $current_language, $ids, $sugar_config, $theme;
$current_module_strings = return_module_language($current_language, 'Charts');
if (isset($_REQUEST['pbls_refresh'])) {
$refresh = $_REQUEST['pbls_refresh'];
} else {
$refresh = false;
}
$tempx = array();
$datax = array();
$selected_datax = array();
//get list of sales stage keys to display
global $current_user;
$user_tempx = $current_user->getPreference('pbls_lead_sources');
if (!empty($user_tempx) && count($user_tempx) > 0 && !isset($_REQUEST['pbls_lead_sources'])) {
$tempx = $user_tempx;
$GLOBALS['log']->debug("USER PREFERENCES['pbls_lead_sources'] is:");
$GLOBALS['log']->debug($user_tempx);
} elseif (isset($_REQUEST['pbls_lead_sources']) && count($_REQUEST['pbls_lead_sources']) > 0) {
$tempx = $_REQUEST['pbls_lead_sources'];
$current_user->setPreference('pbls_lead_sources', $_REQUEST['pbls_lead_sources']);
$GLOBALS['log']->debug("_REQUEST['pbls_lead_sources'] is:");
$GLOBALS['log']->debug($_REQUEST['pbls_lead_sources']);
$GLOBALS['log']->debug("USER PREFERENCES['pbls_lead_sources'] is:");
$GLOBALS['log']->debug($current_user->getPreference('pbls_lead_sources'));
}
//set $datax using selected sales stage keys
if (count($tempx) > 0) {
foreach ($tempx as $key) {
$datax[$key] = $app_list_strings['lead_source_dom'][$key];
array_push($selected_datax, $key);
}
} else {
$datax = $app_list_strings['lead_source_dom'];
$selected_datax = array_keys($app_list_strings['lead_source_dom']);
}
$GLOBALS['log']->debug("datax is:");
$GLOBALS['log']->debug($datax);
$ids = array();
$user_ids = $current_user->getPreference('pbls_ids');
//get list of user ids for which to display data
if (!empty($user_ids) && count($user_ids) != 0 && !isset($_REQUEST['pbls_ids'])) {
if (isset($_SESSION['pbls_ids'])) {
$ids = $_SESSION['pbls_ids'];
}
$GLOBALS['log']->debug("USER PREFERENCES['pbls_ids'] is:");
$GLOBALS['log']->debug($user_ids);
} elseif (isset($_REQUEST['pbls_ids']) && count($_REQUEST['pbls_ids']) > 0) {
$ids = $_REQUEST['pbls_ids'];
$current_user->setPreference('pbls_ids', $ids);
$GLOBALS['log']->debug("_REQUEST['pbls_ids'] is:");
$GLOBALS['log']->debug($_REQUEST['pbls_ids']);
$GLOBALS['log']->debug("USER PREFERENCES['pbls_ids'] is:");
$GLOBALS['log']->debug($current_user->getPreference('pbls_ids'));
} else {
$ids = get_user_array(false);
$ids = array_keys($ids);
}
//create unique prefix based on selected users for image files
$id_hash = '1';
if (isset($ids) && is_array($ids)) {
sort($ids);
$id_hash = crc32(implode('', $ids));
if ($id_hash < 0) {
$id_hash = $id_hash * -1;
}
}
$GLOBALS['log']->debug("ids is:");
$GLOBALS['log']->debug($ids);
$id_md5 = substr(md5($current_user->id), 0, 9);
$seps = array("-", "/");
$dates = array(date('Y-m-d'), date('Y-m-d'));
$dateFileNameSafe = str_replace($seps, "_", $dates);
$cache_file_name = $current_user->getUserPrivGuid() . "_pipeline_by_lead_source_" . $dateFileNameSafe[0] . "_" . $dateFileNameSafe[1] . ".xml";
$GLOBALS['log']->debug("cache file name is: {$cache_file_name}");
global $currentModule, $action, $image_path;
$tools = '<div align="right"><a href="index.php?module=' . $currentModule . '&action=' . $action . '&pbls_refresh=true" class="chartToolsLink">' . get_image($image_path . 'refresh', 'alt="Refresh" border="0" align="absmiddle"') . ' ' . $current_module_strings['LBL_REFRESH'] . '</a> <a href="javascript: toggleDisplay(\'pbls_edit\');" class="chartToolsLink">' . get_image($image_path . 'edit', 'alt="Edit" border="0" align="absmiddle"') . ' ' . $current_module_strings['LBL_EDIT'] . '</a> ' . $extra_tools . '</div>';
?>
<?php
echo '<span onmouseover="this.style.cursor=\'move\'" id="chart_handle_' . $this->order . '">' . get_form_header($current_module_strings['LBL_LEAD_SOURCE_FORM_TITLE'], $tools, false) . '</span>';
if (empty($_SESSION['pbls_lead_sources'])) {
$_SESSION['pbls_lead_sources'] = "";
}
if (empty($_SESSION['pbls_ids'])) {
$_SESSION['pbls_ids'] = "";
}
?>
<p>
<div id='pbls_edit' style='display: none;'>
<form action="index.php" method="post" >
<input type="hidden" name="module" value="<?php
echo $currentModule;
?>
">
<input type="hidden" name="action" value="<?php
echo $action;
//.........这里部分代码省略.........