本文整理汇总了PHP中showFullName函数的典型用法代码示例。如果您正苦于以下问题:PHP showFullName函数的具体用法?PHP showFullName怎么用?PHP showFullName使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了showFullName函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bpminbox_get_username_by_id
function bpminbox_get_username_by_id($userid)
{
if (empty($userid)) {
return false;
}
$user = SugarModule::get('Users')->loadBean();
$user->retrieve($userid);
if ($userid != $user->id) {
return false;
}
if (showFullName()) {
return $user->full_name;
} else {
return $user->user_name;
}
}
示例2: displayHeader
//.........这里部分代码省略.........
//key value for first element.
continue;
}
foreach ($value as $linkattribute => $attributevalue) {
// get the main link info
if ($linkattribute == 'linkinfo') {
$gcls[$key] = array("LABEL" => key($attributevalue), "URL" => current($attributevalue), "SUBMENU" => array());
if (substr($gcls[$key]["URL"], 0, 11) == "javascript:") {
$gcls[$key]["ONCLICK"] = substr($gcls[$key]["URL"], 11);
$gcls[$key]["URL"] = "javascript:void(0)";
}
}
// and now the sublinks
if ($linkattribute == 'submenu' && is_array($attributevalue)) {
foreach ($attributevalue as $submenulinkkey => $submenulinkinfo) {
$gcls[$key]['SUBMENU'][$submenulinkkey] = array("LABEL" => key($submenulinkinfo), "URL" => current($submenulinkinfo));
}
if (substr($gcls[$key]['SUBMENU'][$submenulinkkey]["URL"], 0, 11) == "javascript:") {
$gcls[$key]['SUBMENU'][$submenulinkkey]["ONCLICK"] = substr($gcls[$key]['SUBMENU'][$submenulinkkey]["URL"], 11);
$gcls[$key]['SUBMENU'][$submenulinkkey]["URL"] = "javascript:void(0)";
}
}
}
}
$ss->assign("GCLS", $gcls);
$ss->assign("SEARCH", isset($_REQUEST['query_string']) ? $_REQUEST['query_string'] : '');
if ($this->action == "EditView" || $this->action == "Login") {
$ss->assign("ONLOAD", 'onload="set_focus()"');
}
$ss->assign("AUTHENTICATED", isset($_SESSION["authenticated_user_id"]));
// get other things needed for page style popup
if (isset($_SESSION["authenticated_user_id"])) {
// get the current user name and id
$ss->assign("CURRENT_USER", $current_user->full_name == '' || !showFullName() ? $current_user->user_name : $current_user->full_name);
$ss->assign("CURRENT_USER_ID", $current_user->id);
// get the last viewed records
$tracker = new Tracker();
$history = $tracker->get_recently_viewed($current_user->id);
$ss->assign("recentRecords", $this->processRecentRecords($history));
}
$bakModStrings = $mod_strings;
if (isset($_SESSION["authenticated_user_id"])) {
// get the module list
$moduleTopMenu = array();
$max_tabs = $current_user->getPreference('max_tabs');
// Attempt to correct if max tabs count is extremely high.
if (!isset($max_tabs) || $max_tabs <= 0 || $max_tabs > 10) {
$max_tabs = $GLOBALS['sugar_config']['default_max_tabs'];
$current_user->setPreference('max_tabs', $max_tabs, 0, 'global');
}
/*$moduleTab = $this->_getModuleTab();
$ss->assign('MODULE_TAB',$moduleTab);*/
// See if they are using grouped tabs or not (removed in 6.0, returned in 6.1)
$user_navigation_paradigm = $current_user->getPreference('navigation_paradigm');
if (!isset($user_navigation_paradigm)) {
$user_navigation_paradigm = $GLOBALS['sugar_config']['default_navigation_paradigm'];
}
// Get the full module list for later use
foreach (query_module_access_list($current_user) as $module) {
// Bug 25948 - Check for the module being in the moduleList
if (isset($app_list_strings['moduleList'][$module])) {
$fullModuleList[$module] = $app_list_strings['moduleList'][$module];
}
}
if (!should_hide_iframes()) {
$iFrame = new iFrame();
示例3: addUserName
/**
* Add a generic widget to lookup Users.
* @param displayname Name to display in the popup window
* @param varname name of the variable
* @param id_name name of the id in vardef
* @param mod_type name of the module, either "Contact" or "Releases" currently
*/
function addUserName($displayname, $varname, $id_name = '', $mod_type)
{
global $app_strings;
if (empty($id_name)) {
$id_name = strtolower($mod_type) . "_id";
}
///////////////////////////////////////
///
/// SETUP POPUP
$reportsDisplayName = showFullName() ? 'name' : 'user_name';
$popup_request_data = array('call_back_function' => 'set_return', 'form_name' => 'MassUpdate', 'field_to_name_array' => array('id' => "{$id_name}", "{$reportsDisplayName}" => "{$varname}"));
$json = getJSONobj();
$encoded_popup_request_data = $json->encode($popup_request_data);
$qsName = array('form' => 'MassUpdate', 'method' => 'get_user_array', 'modules' => array("{$mod_type}"), 'group' => 'or', 'field_list' => array('user_name', 'id'), 'populate_list' => array("mass_{$varname}", "mass_{$id_name}"), 'conditions' => array(array('name' => 'name', 'op' => 'like_custom', 'end' => '%', 'value' => '')), 'limit' => '30', 'no_match_text' => $app_strings['ERR_SQS_NO_MATCH']);
$qsName = $json->encode($qsName);
//
///////////////////////////////////////
return <<<EOHTML
<td width='15%' scope='row' class='dataLabel'>{$displayname}</td>
<td width='35%' class='dataField'>
<input name='{$varname}' id='mass_{$varname}' class='sqsEnabled' autocomplete='off' type='text' value=''>
<input name='{$id_name}' id='mass_{$id_name}' type='hidden' value=''>
<input title='{$app_strings['LBL_SELECT_BUTTON_TITLE']}'
accessKey='{$app_strings['LBL_SELECT_BUTTON_KEY']}'
type='button' class='button' value='{$app_strings['LBL_SELECT_BUTTON_LABEL']}' name='button'
onclick='open_popup("{$mod_type}", 600, 400, "", true, false, {$encoded_popup_request_data});'
/>
</td>
<script type="text/javascript">
<!--
if(typeof sqs_objects == 'undefined'){
var sqs_objects = new Array;
}
sqs_objects['MassUpdate_{$varname}'] = {$qsName};
registerSingleSmartInputListener(document.getElementById('mass_{$varname}'));
addToValidateBinaryDependency('MassUpdate', '{$varname}', 'alpha', false, '{$app_strings['ERR_SQS_NO_MATCH_FIELD']} {$app_strings['LBL_ASSIGNED_TO']}','{$id_name}');
-->
</script>
EOHTML;
}
示例4: display
function display($end = true)
{
global $app_strings;
if (!is_file(sugar_cached("jsLanguage/{$GLOBALS['current_language']}.js"))) {
require_once 'include/language/jsLanguage.php';
jsLanguage::createAppStringsCache($GLOBALS['current_language']);
}
$jsLang = getVersionedScript("cache/jsLanguage/{$GLOBALS['current_language']}.js", $GLOBALS['sugar_config']['js_lang_version']);
$this->th->ss->assign('data', $this->data['data']);
$this->data['pageData']['offsets']['lastOffsetOnPage'] = $this->data['pageData']['offsets']['current'] + count($this->data['data']);
$this->th->ss->assign('pageData', $this->data['pageData']);
$navStrings = array('next' => $GLOBALS['app_strings']['LNK_LIST_NEXT'], 'previous' => $GLOBALS['app_strings']['LNK_LIST_PREVIOUS'], 'end' => $GLOBALS['app_strings']['LNK_LIST_END'], 'start' => $GLOBALS['app_strings']['LNK_LIST_START'], 'of' => $GLOBALS['app_strings']['LBL_LIST_OF']);
$this->th->ss->assign('navStrings', $navStrings);
$associated_row_data = array();
//C.L. - Bug 44324 - Override the NAME entry to not display salutation so that the data returned from the popup can be searched on correctly
$searchNameOverride = !empty($this->seed) && $this->seed instanceof Person && (isset($this->data['data'][0]['FIRST_NAME']) && isset($this->data['data'][0]['LAST_NAME'])) ? true : false;
global $locale;
foreach ($this->data['data'] as $val) {
$associated_row_data[$val['ID']] = $val;
if ($searchNameOverride) {
$associated_row_data[$val['ID']]['NAME'] = $locale->getLocaleFormattedName($val['FIRST_NAME'], $val['LAST_NAME']);
}
}
$is_show_fullname = showFullName() ? 1 : 0;
$json = getJSONobj();
$this->th->ss->assign('jsLang', $jsLang);
$this->th->ss->assign('lang', substr($GLOBALS['current_language'], 0, 2));
$this->th->ss->assign('headerTpl', $this->headerTpl);
$this->th->ss->assign('footerTpl', $this->footerTpl);
$this->th->ss->assign('ASSOCIATED_JAVASCRIPT_DATA', 'var associated_javascript_data = ' . $json->encode($associated_row_data) . '; var is_show_fullname = ' . $is_show_fullname . ';');
$this->th->ss->assign('module', $this->seed->module_dir);
$request_data = empty($_REQUEST['request_data']) ? '' : $_REQUEST['request_data'];
$this->th->ss->assign('request_data', $request_data);
$this->th->ss->assign('fields', $this->fieldDefs);
$this->th->ss->assign('formData', $this->formData);
$this->th->ss->assign('APP', $GLOBALS['app_strings']);
$this->th->ss->assign('MOD', $GLOBALS['mod_strings']);
if (isset($this->_popupMeta['create']['createButton'])) {
$this->_popupMeta['create']['createButton'] = translate($this->_popupMeta['create']['createButton']);
}
$this->th->ss->assign('popupMeta', $this->_popupMeta);
$this->th->ss->assign('current_query', base64_encode(serialize($_REQUEST)));
$this->th->ss->assign('customFields', $this->customFieldDefs);
$this->th->ss->assign('numCols', NUM_COLS);
$this->th->ss->assign('massUpdateData', $this->massUpdateData);
$this->th->ss->assign('sugarVersion', $GLOBALS['sugar_version']);
$this->th->ss->assign('should_process', $this->should_process);
if ($this->_create) {
$this->th->ss->assign('ADDFORM', $this->getQuickCreate());
//$this->_getAddForm());
$this->th->ss->assign('ADDFORMHEADER', $this->_getAddFormHeader());
$this->th->ss->assign('object_name', $this->seed->object_name);
}
$this->th->ss->assign('LIST_HEADER', get_form_header($GLOBALS['mod_strings']['LBL_LIST_FORM_TITLE'], '', false));
$this->th->ss->assign('SEARCH_FORM_HEADER', get_form_header($GLOBALS['mod_strings']['LBL_SEARCH_FORM_TITLE'], '', false));
$str = $this->th->displayTemplate($this->seed->module_dir, $this->view, $this->tpl);
return $str;
}
示例5: processListRows
//.........这里部分代码省略.........
//add item id to merge list, if the button is clicked
$mergeList[] = $aItem->id;
if (empty($module)) {
$module = $aItem->module_dir;
}
}
//ADD OFFSET TO ARRAY
$fields['OFFSET'] = $offset + $count + 1;
$fields['STAMP'] = $timeStamp;
if ($this->shouldProcess) {
$prerow = '';
if (!isset($this->data_array)) {
$prerow .= "<input onclick='sListView.check_item(this, document.MassUpdate)' type='checkbox' class='checkbox' name='mass[]' value='" . $fields['ID'] . "'>";
}
$this->xTemplate->assign('PREROW', $prerow);
$this->xTemplate->assign('CHECKALL', "<input type='checkbox' class='checkbox' name='massall' id='massall' value='' onclick='sListView.check_all(document.MassUpdate, \"mass[]\", this.checked)'>");
}
if (!isset($this->data_array)) {
$tag = $aItem->listviewACLHelper();
$this->xTemplate->assign('TAG', $tag);
}
if ($oddRow) {
$ROW_COLOR = 'oddListRow';
$BG_COLOR = $odd_bg;
} else {
$ROW_COLOR = 'evenListRow';
$BG_COLOR = $even_bg;
}
$oddRow = !$oddRow;
$this->xTemplate->assign('ROW_COLOR', $ROW_COLOR);
$this->xTemplate->assign('BG_COLOR', $BG_COLOR);
if (isset($this->data_array)) {
$this->xTemplate->assign('KEY', $aVal);
$this->xTemplate->assign('VALUE', $aItem);
$this->xTemplate->assign('INDEX', $count);
} else {
//AED -- some modules do not have their additionalDetails.php established. Add a check to ensure require_once does not fail
// Bug #2786
if ($this->_additionalDetails && $aItem->ACLAccess('DetailView') && (file_exists('modules/' . $aItem->module_dir . '/metadata/additionalDetails.php') || file_exists('custom/modules/' . $aItem->module_dir . '/metadata/additionalDetails.php'))) {
$additionalDetailsFile = 'modules/' . $aItem->module_dir . '/metadata/additionalDetails.php';
if (file_exists('custom/modules/' . $aItem->module_dir . '/metadata/additionalDetails.php')) {
$additionalDetailsFile = 'custom/modules/' . $aItem->module_dir . '/metadata/additionalDetails.php';
}
require_once $additionalDetailsFile;
$ad_function = (empty($this->additionalDetailsFunction) ? 'additionalDetails' : $this->additionalDetailsFunction) . $aItem->object_name;
$results = $ad_function($fields);
$results['string'] = str_replace(array("'", "'"), '\\'', $results['string']);
// no xss!
if (trim($results['string']) == '') {
$results['string'] = $app_strings['LBL_NONE'];
}
$fields[$results['fieldToAddTo']] = $fields[$results['fieldToAddTo']] . '</a>';
}
//fixes bug for IE where empty list view rows causes IE to not display bottom border
if (isset($fields['DESCRIPTION']) && empty($fields['DESCRIPTION'])) {
$fields['DESCRIPTION'] = " ";
}
if (isset($fields['LIST_ORDER']) && empty($fields['LIST_ORDER'])) {
$fields['LIST_ORDER'] = " ";
}
$this->xTemplate->assign($html_varName, $fields);
$aItem->setupCustomFields($aItem->module_dir);
$aItem->custom_fields->populateAllXTPL($this->xTemplate, 'detail', $html_varName, $fields);
}
if (!isset($this->data_array) && $aItem->ACLAccess('DetailView')) {
$count++;
}
if (isset($this->data_array)) {
$count++;
}
if (!isset($this->data_array)) {
$aItem->list_view_parse_additional_sections($this->xTemplate, $xtemplateSection);
if ($this->xTemplate->exists($xtemplateSection . '.row.pro')) {
$this->xTemplate->parse($xtemplateSection . '.row.pro');
}
}
$this->xTemplate->parse($xtemplateSection . '.row');
if (isset($fields['ID'])) {
$associated_row_data[$fields['ID']] = $fields;
// Bug 38908: cleanup data for JS to avoid having shuffled around
foreach ($fields as $key => $value) {
if ($value == ' ') {
$associated_row_data[$fields['ID']][$key] = '';
}
}
}
}
$_SESSION['MAILMERGE_RECORDS'] = $mergeList;
$_SESSION['MAILMERGE_MODULE_FROM_LISTVIEW'] = $module;
if (empty($_REQUEST['action']) || $_REQUEST['action'] != 'Popup') {
$_SESSION['MAILMERGE_MODULE'] = $module;
}
if ($this->process_for_popups) {
$json = getJSONobj();
$is_show_fullname = showFullName() ? 1 : 0;
$associated_javascript_data = '<script type="text/javascript">' . "\n" . 'var associated_javascript_data = ' . $json->encode($associated_row_data) . ";\n" . 'var is_show_fullname = ' . $is_show_fullname . ";\n" . '</script>';
$this->xTemplate->assign('ASSOCIATED_JAVASCRIPT_DATA', $associated_javascript_data);
}
$this->xTemplate->parse($xtemplateSection);
}
示例6: createDinamicHtmlTags
/* Функции без параметри / аргументи
======================================*/
function createDinamicHtmlTags()
{
// функция за изграждане на динамично съдържание.
echo "<header>" . "<h1>" . "Заглавие" . "</h1>" . "</header>";
}
createDinamicHtmlTags();
// извикване на функция/изпълнение.
/* Функции с параметри / аргументи
======================================*/
function showFullName($firstname, $lastName)
{
echo "My full name is: " . $firstname . " " . $lastName;
}
showFullName("Svetoslav", "Toshkin");
/* Капсолиране на имената на променливите като ги дефинираме в тялото на функцията
===================================================================================*/
function fooArguments()
{
$a = 5;
$b = 10;
$result = $a + $b;
echo $result;
}
//echo $result; ако се опитаме да изведем $result ще получим грешка undefinded variable / недефинирана променлива.
// Единствения начин да достъпим променливата е като извикаме функцията.
echo fooArguments();
/* Оператор return
======================================*/
function fooReturn($myCar, $myByke)
示例7: get_user_array
/**
* get_user_array
*
* This is a helper function to return an Array of users depending on the parameters passed into the function.
* This function uses the get_register_value function by default to use a caching layer where supported.
* This function has been updated return the array sorted by user preference of name display (bug 62712)
*
* @param bool $add_blank Boolean value to add a blank entry to the array results, true by default
* @param string $status String value indicating the status to filter users by, "Active" by default
* @param string $user_id String value to specify a particular user id value (searches the id column of users table), blank by default
* @param bool $use_real_name Boolean value indicating whether or not results should include the full name or just user_name, false by default
* @param String $user_name_filter String value indicating the user_name filter (searches the user_name column of users table) to optionally search with, blank by default
* @param string $portal_filter String query filter for portal users (defaults to searching non-portal users), change to blank if you wish to search for all users including portal users
* @param bool $from_cache Boolean value indicating whether or not to use the get_register_value function for caching, true by default
* @return array Array of users matching the filter criteria that may be from cache (if similar search was previously run)
*/
function get_user_array($add_blank = true, $status = "Active", $user_id = '', $use_real_name = false, $user_name_filter = '', $portal_filter = ' AND portal_only=0 ', $from_cache = true)
{
global $locale, $sugar_config, $current_user;
if (empty($locale)) {
$locale = new Localization();
}
if ($from_cache) {
$key_name = $add_blank . $status . $user_id . $use_real_name . $user_name_filter . $portal_filter;
$user_array = get_register_value('user_array', $key_name);
}
if (empty($user_array)) {
$db = DBManagerFactory::getInstance();
$temp_result = array();
// Including deleted users for now.
if (empty($status)) {
$query = "SELECT id, first_name, last_name, user_name from users WHERE 1=1" . $portal_filter;
} else {
$query = "SELECT id, first_name, last_name, user_name from users WHERE status='{$status}'" . $portal_filter;
}
/* BEGIN - SECURITY GROUPS */
global $current_user, $sugar_config;
if (!is_admin($current_user) && isset($sugar_config['securitysuite_filter_user_list']) && $sugar_config['securitysuite_filter_user_list'] == true && (empty($_REQUEST['module']) || $_REQUEST['module'] != 'Home') && (empty($_REQUEST['action']) || $_REQUEST['action'] != 'DynamicAction')) {
require_once 'modules/SecurityGroups/SecurityGroup.php';
global $current_user;
$group_where = SecurityGroup::getGroupUsersWhere($current_user->id);
$query .= " AND (" . $group_where . ") ";
}
/* END - SECURITY GROUPS */
if (!empty($user_name_filter)) {
$user_name_filter = $db->quote($user_name_filter);
$query .= " AND user_name LIKE '{$user_name_filter}%' ";
}
if (!empty($user_id)) {
$query .= " OR id='{$user_id}'";
}
//get the user preference for name formatting, to be used in order by
$order_by_string = ' user_name ASC ';
if (!empty($current_user) && !empty($current_user->id)) {
$formatString = $current_user->getPreference('default_locale_name_format');
//create the order by string based on position of first and last name in format string
$order_by_string = ' user_name ASC ';
$firstNamePos = strpos($formatString, 'f');
$lastNamePos = strpos($formatString, 'l');
if ($firstNamePos !== false || $lastNamePos !== false) {
//its possible for first name to be skipped, check for this
if ($firstNamePos === false) {
$order_by_string = 'last_name ASC';
} else {
$order_by_string = $lastNamePos < $firstNamePos ? "last_name, first_name ASC" : "first_name, last_name ASC";
}
}
}
$query = $query . ' ORDER BY ' . $order_by_string;
$GLOBALS['log']->debug("get_user_array query: {$query}");
$result = $db->query($query, true, "Error filling in user array: ");
if ($add_blank == true) {
// Add in a blank row
$temp_result[''] = '';
}
// Get the id and the name.
while ($row = $db->fetchByAssoc($result)) {
if ($use_real_name == true || showFullName()) {
if (isset($row['last_name'])) {
// cn: we will ALWAYS have both first_name and last_name (empty value if blank in db)
$temp_result[$row['id']] = $locale->getLocaleFormattedName($row['first_name'], $row['last_name']);
} else {
$temp_result[$row['id']] = $row['user_name'];
}
} else {
$temp_result[$row['id']] = $row['user_name'];
}
}
$user_array = $temp_result;
if ($from_cache) {
set_register_value('user_array', $key_name, $temp_result);
}
}
return $user_array;
}
示例8: display
function display($end = true)
{
global $app_strings;
if (!is_file($GLOBALS['sugar_config']['cache_dir'] . 'jsLanguage/' . $GLOBALS['current_language'] . '.js')) {
require_once 'include/language/jsLanguage.php';
jsLanguage::createAppStringsCache($GLOBALS['current_language']);
}
$jsLang = '<script type="text/javascript" src="' . $GLOBALS['sugar_config']['cache_dir'] . 'jsLanguage/' . $GLOBALS['current_language'] . '.js?s=' . $GLOBALS['sugar_version'] . '&c=' . $GLOBALS['sugar_config']['js_custom_version'] . '&j=' . $GLOBALS['sugar_config']['js_lang_version'] . '"></script>';
$this->th->ss->assign('data', $this->data['data']);
$this->data['pageData']['offsets']['lastOffsetOnPage'] = $this->data['pageData']['offsets']['current'] + count($this->data['data']);
$this->th->ss->assign('pageData', $this->data['pageData']);
$navStrings = array('next' => $GLOBALS['app_strings']['LNK_LIST_NEXT'], 'previous' => $GLOBALS['app_strings']['LNK_LIST_PREVIOUS'], 'end' => $GLOBALS['app_strings']['LNK_LIST_END'], 'start' => $GLOBALS['app_strings']['LNK_LIST_START'], 'of' => $GLOBALS['app_strings']['LBL_LIST_OF']);
$this->th->ss->assign('navStrings', $navStrings);
$associated_row_data = array();
foreach ($this->data['data'] as $val) {
$associated_row_data[$val['ID']] = $val;
}
$is_show_fullname = showFullName() ? 1 : 0;
$json = getJSONobj();
$this->th->ss->assign('jsLang', $jsLang);
$this->th->ss->assign('lang', substr($GLOBALS['current_language'], 0, 2));
$this->th->ss->assign('headerTpl', 'include/Popups/tpls/header.tpl');
$this->th->ss->assign('footerTpl', 'include/Popups/tpls/footer.tpl');
$this->th->ss->assign('ASSOCIATED_JAVASCRIPT_DATA', 'var associated_javascript_data = ' . $json->encode($associated_row_data) . '; var is_show_fullname = ' . $is_show_fullname . ';');
$this->th->ss->assign('module', $this->seed->module_dir);
$request_data = empty($_REQUEST['request_data']) ? '' : $_REQUEST['request_data'];
$this->th->ss->assign('request_data', $request_data);
$this->th->ss->assign('fields', $this->fieldDefs);
$this->th->ss->assign('formData', $this->formData);
$this->th->ss->assign('APP', $GLOBALS['app_strings']);
$this->th->ss->assign('MOD', $GLOBALS['mod_strings']);
$this->th->ss->assign('popupMeta', $this->_popupMeta);
$this->th->ss->assign('current_query', base64_encode(serialize($_REQUEST)));
$this->th->ss->assign('customFields', $this->customFieldDefs);
$this->th->ss->assign('numCols', NUM_COLS);
$this->th->ss->assign('massUpdateData', $this->massUpdateData);
$this->th->ss->assign('jsCustomVersion', $GLOBALS['sugar_config']['js_custom_version']);
$this->th->ss->assign('sugarVersion', $GLOBALS['sugar_version']);
$this->th->ss->assign('should_process', $this->should_process);
if ($this->_create) {
$this->th->ss->assign('ADDFORM', $this->getQuickCreate());
//$this->_getAddForm());
$this->th->ss->assign('ADDFORMHEADER', $this->_getAddFormHeader());
$this->th->ss->assign('object_name', $this->seed->object_name);
}
$this->th->ss->assign('LIST_HEADER', get_form_header($GLOBALS['mod_strings']['LBL_LIST_FORM_TITLE'], '', false));
$this->th->ss->assign('SEARCH_FORM_HEADER', get_form_header($GLOBALS['mod_strings']['LBL_SEARCH_FORM_TITLE'], '', false));
$str = $this->th->displayTemplate($this->seed->module_dir, $this->view, $this->tpl);
return $str;
}
示例9: get_user_array
/**
* Returns the list of users, faster than using query method for Users module
*
* @param array $args arguments used to construct query, see query() for example
*
* @return array list of users returned
*/
function get_user_array($args)
{
global $json;
$json = getJSONobj();
$response = array();
if (showFullName()) {
// utils.php, if system is configured to show full name
$user_array = getUserArrayFromFullName($args['conditions'][0]['value'], true);
} else {
$user_array = get_user_array(false, "Active", '', false, $args['conditions'][0]['value'], ' AND portal_only=0 ', false);
}
$response['totalCount'] = count($user_array);
$response['fields'] = array();
$i = 0;
foreach ($user_array as $id => $name) {
array_push($response['fields'], array('id' => (string) $id, 'user_name' => $name, 'module' => 'Users'));
$i++;
}
return $json->encodeReal($response);
}
示例10: json_get_user_array
/**
* retrieves Users matching passed criteria
*/
function json_get_user_array($request_id, &$params)
{
global $json;
$args = $params[0];
//decode condition parameter values..
if (is_array($args['conditions'])) {
foreach ($args['conditions'] as $key => $condition) {
if (!empty($condition['value'])) {
$args['conditions'][$key]['value'] = $json->decode($condition['value']);
}
}
}
$response = array();
$response['id'] = $request_id;
$response['result'] = array();
$response['result']['list'] = array();
if (showFullName()) {
$user_array = getUserArrayFromFullName($args['conditions'][0]['value']);
} else {
$user_array = get_user_array(false, "Active", $focus->assigned_user_id, false, $args['conditions'][0]['value']);
}
foreach ($user_array as $id => $name) {
array_push($response['result']['list'], array('fields' => array('id' => $id, 'user_name' => $name), 'module' => 'Users'));
}
print $json->encode($response);
exit;
}
示例11: empty
$sugar_smarty->assign("mail_smtpdisplay", $mail_smtpdisplay);
$sugar_smarty->assign("mail_smtpserver", $mail_smtpserver);
$sugar_smarty->assign("mail_smtpuser", $mail_smtpuser);
$sugar_smarty->assign("mail_smtppass", "");
$sugar_smarty->assign("mail_haspass", empty($systemOutboundEmail->mail_smtppass) ? 0 : 1);
$sugar_smarty->assign("mail_smtpauth_req", $mail_smtpauth_req);
$sugar_smarty->assign('MAIL_SMTPPORT', $mail_smtpport);
$sugar_smarty->assign('MAIL_SMTPSSL', $mail_smtpssl);
}
$sugar_smarty->assign('HIDE_IF_CAN_USE_DEFAULT_OUTBOUND', $hide_if_can_use_default);
$reports_to_change_button_html = '';
if ($is_current_admin) {
//////////////////////////////////////
///
/// SETUP USER POPUP
$reportsDisplayName = showFullName() ? 'name' : 'user_name';
$popup_request_data = array('call_back_function' => 'set_return', 'form_name' => 'EditView', 'field_to_name_array' => array('id' => 'reports_to_id', "{$reportsDisplayName}" => 'reports_to_name'));
$json = getJSONobj();
$encoded_popup_request_data = $json->encode($popup_request_data);
$sugar_smarty->assign('encoded_popup_request_data', $encoded_popup_request_data);
//
///////////////////////////////////////
$reports_to_change_button_html = '<input type="button"' . " title=\"{$app_strings['LBL_SELECT_BUTTON_TITLE']}\"" . " accesskey=\"{$app_strings['LBL_SELECT_BUTTON_KEY']}\"" . " value=\"{$app_strings['LBL_SELECT_BUTTON_LABEL']}\"" . ' tabindex="5" class="button" name="btn1"' . " onclick='open_popup(\"Users\", 600, 400, \"\", true, false, {$encoded_popup_request_data});'" . "' />";
} else {
$sugar_smarty->assign('IS_ADMIN_DISABLED', 'disabled="disabled"');
}
$sugar_smarty->assign('REPORTS_TO_CHANGE_BUTTON', $reports_to_change_button_html);
/* Module Tab Chooser */
require_once 'include/templates/TemplateGroupChooser.php';
require_once 'modules/MySettings/TabController.php';
$chooser = new TemplateGroupChooser();
示例12: display
public function display()
{
global $current_user, $app_strings, $sugar_config, $currentModule, $sugar_version;
//load license validation config
require_once 'modules/' . $currentModule . '/license/config.php';
echo $this->getModuleTitle();
$GLOBALS['log']->info("License Configuration");
//$this->ss->assign("MOD", $mod_strings);
//$this->ss->assign("APP", $app_strings);
//todo: redirect appropriately
$this->ss->assign("RETURN_MODULE", "Administration");
$this->ss->assign("RETURN_ACTION", "index");
$this->ss->assign("MODULE", $currentModule);
$license_strings = ViewLicense::loadLicenseStrings();
$this->ss->assign("LICENSE", $license_strings);
if (!empty($sugar_config['outfitters_licenses']) && !empty($sugar_config['outfitters_licenses'][$outfitters_config['shortname']])) {
$this->ss->assign("license_key", $sugar_config['outfitters_licenses'][$outfitters_config['shortname']]);
}
$this->ss->assign("continue_url", $outfitters_config['continue_url']);
$this->ss->assign("file_path", getJSPath("modules/" . $currentModule . "/license/lib/jquery-1.7.1.min.js"));
if (preg_match("/^6.*/", $sugar_version)) {
$this->ss->assign("IS_SUGAR_6", true);
} else {
$this->ss->assign("IS_SUGAR_6", false);
}
if (!function_exists('curl_init')) {
global $current_language;
$admin_mod_strings = return_module_language($current_language, 'Administration');
$curl_not_enabled = $admin_mod_strings['ERR_ENABLE_CURL'];
$this->ss->assign("CURL_NOT_ENABLED", $curl_not_enabled);
}
if (isset($outfitters_config['validate_users']) && $outfitters_config['validate_users'] == true) {
$this->ss->assign("validate_users", true);
//get user count for all active, non-portal, non-group users
$active_users = get_user_array(FALSE, 'Active', '', false, '', ' AND portal_only=0 AND is_group=0');
$this->ss->assign("current_users", count($active_users));
$this->ss->assign("user_count_param", "user_count: '" . count($active_users) . "'");
} else {
$this->ss->assign("validate_users", false);
$this->ss->assign("current_users", '');
$this->ss->assign("user_count_param", '');
}
if (isset($outfitters_config['manage_licensed_users']) && $outfitters_config['manage_licensed_users'] == true) {
$this->ss->assign("manage_licensed_users", true);
$this->ss->assign("validation_required", true);
//check if here is a key already...if so then validate to ensure latest licensed user count is pulled in
require_once 'modules/Administration/Administration.php';
$administration = new Administration();
$administration->retrieveSettings();
$last_validation = $administration->settings['SugarOutfitters_' . $outfitters_config['shortname']];
$trimmed_last = trim($last_validation);
//only run a license check if one has been done in the past
if (!empty($trimmed_last)) {
//if new then don't do
require_once 'modules/' . $currentModule . '/license/OutfittersLicense.php';
$validated = OutfittersLicense::doValidate($currentModule);
$store = array('last_ran' => time(), 'last_result' => $validated);
$serialized = base64_encode(serialize($store));
$administration->saveSetting('SugarOutfitters', $outfitters_config['shortname'], $serialized);
$licensed_users = 0;
//check last validation
if (!empty($validated['result'])) {
$licensed_users = $validated['result']['licensed_user_count'];
if (!is_numeric($licensed_users)) {
$licensed_users = 0;
}
$this->ss->assign("validation_required", false);
}
}
$this->ss->assign("licensed_users", $licensed_users);
require_once 'include/templates/TemplateGroupChooser.php';
$chooser = new TemplateGroupChooser();
$chooser->args['id'] = 'edit_licensed_users';
$chooser->args['values_array'] = array();
$chooser->args['values_array'][0] = get_user_array(false, 'Active', '', false, '', " AND is_group=0");
$chooser->args['values_array'][1] = array();
$used_licenses = 0;
global $db, $locale;
$result = $db->query("SELECT users.id, users.user_name, users.first_name, users.last_name FROM so_users INNER JOIN users ON so_users.user_id = users.id WHERE shortname = '" . $db->quote($outfitters_config['shortname']) . "'", false);
while ($row = $db->fetchByAssoc($result)) {
$used_licenses++;
$display_name = $row['user_name'];
if (showFullName()) {
if (isset($row['last_name'])) {
// cn: we will ALWAYS have both first_name and last_name (empty value if blank in db)
$display_name = $locale->getLocaleFormattedName($row['first_name'], $row['last_name']);
}
}
$chooser->args['values_array'][1][$row['id']] = $display_name;
unset($chooser->args['values_array'][0][$row['id']]);
}
$this->ss->assign("available_licensed_users", $licensed_users - $used_licenses);
$chooser->args['left_name'] = 'unlicensed_users';
$chooser->args['right_name'] = 'licensed_users';
$chooser->args['left_label'] = $license_strings['LBL_UNLICENSED_USER_LIST'];
$chooser->args['right_label'] = $license_strings['LBL_LICENSED_USER_LIST'];
$chooser->args['title'] = '';
$this->ss->assign('USER_CHOOSER', $chooser->display());
$this->ss->assign('CHOOSER_SCRIPT', 'set_chooser();');
$this->ss->assign('CHOOSE_WHICH', '');
//.........这里部分代码省略.........
示例13: get_user_array
/**
* get_user_array
*
* This is a helper function to return an Array of users depending on the parameters passed into the function.
* This function uses the get_register_value function by default to use a caching layer where supported.
*
* @param bool $add_blank Boolean value to add a blank entry to the array results, true by default
* @param string $status String value indicating the status to filter users by, "Active" by default
* @param string $user_id String value to specify a particular user id value (searches the id column of users table), blank by default
* @param bool $use_real_name Boolean value indicating whether or not results should include the full name or just user_name, false by default
* @param String $user_name_filter String value indicating the user_name filter (searches the user_name column of users table) to optionally search with, blank by default
* @param string $portal_filter String query filter for portal users (defaults to searching non-portal users), change to blank if you wish to search for all users including portal users
* @param bool $from_cache Boolean value indicating whether or not to use the get_register_value function for caching, true by default
* @return array Array of users matching the filter criteria that may be from cache (if similar search was previously run)
*/
function get_user_array($add_blank = true, $status = "Active", $user_id = '', $use_real_name = false, $user_name_filter = '', $portal_filter = ' AND portal_only=0 ', $from_cache = true)
{
global $locale, $current_user;
if (empty($locale)) {
$locale = Localization::getObject();
}
$db = DBManagerFactory::getInstance();
// Pre-build query for use as cache key
// Including deleted users for now.
if (empty($status)) {
$query = "SELECT id, first_name, last_name, user_name FROM users ";
$where = "1=1" . $portal_filter;
} else {
$query = "SELECT id, first_name, last_name, user_name FROM users ";
$where = "status='{$status}'" . $portal_filter;
}
$user = BeanFactory::getBean('Users');
$user->addVisibilityFrom($query);
$query .= " WHERE {$where} ";
$user->addVisibilityWhere($query);
if (!empty($user_name_filter)) {
$user_name_filter = $db->quote($user_name_filter);
$query .= " AND user_name LIKE '{$user_name_filter}%' ";
}
if (!empty($user_id)) {
$query .= " OR id='{$user_id}'";
}
//get the user preference for name formatting, to be used in order by
$order_by_string = ' user_name ASC ';
if (!empty($current_user) && !empty($current_user->id)) {
$formatString = $current_user->getPreference('default_locale_name_format');
//create the order by string based on position of first and last name in format string
$firstNamePos = strpos($formatString, 'f');
$lastNamePos = strpos($formatString, 'l');
if ($firstNamePos !== false || $lastNamePos !== false) {
//its possible for first name to be skipped, check for this
if ($firstNamePos === false) {
$order_by_string = 'last_name ASC';
} else {
$order_by_string = $lastNamePos < $firstNamePos ? "last_name, first_name ASC" : "first_name, last_name ASC";
}
}
}
$query = $query . ' ORDER BY ' . $order_by_string;
if ($from_cache) {
$key_name = $query . $status . $user_id . $use_real_name . $user_name_filter . $portal_filter;
$key_name = md5($key_name);
$user_array = get_register_value('user_array', $key_name);
}
if (empty($user_array)) {
$temp_result = array();
$GLOBALS['log']->debug("get_user_array query: {$query}");
$result = $db->query($query, true, "Error filling in user array: ");
// Get the id and the name.
while ($row = $db->fetchByAssoc($result)) {
if ($use_real_name == true || showFullName()) {
if (isset($row['last_name'])) {
// cn: we will ALWAYS have both first_name and last_name (empty value if blank in db)
$temp_result[$row['id']] = $locale->formatName('Users', $row);
} else {
$temp_result[$row['id']] = $row['user_name'];
}
} else {
$temp_result[$row['id']] = $row['user_name'];
}
}
$user_array = $temp_result;
if ($from_cache) {
set_register_value('user_array', $key_name, $temp_result);
}
}
if ($add_blank) {
$user_array[''] = '';
}
return $user_array;
}
示例14: displayHeader
//.........这里部分代码省略.........
$ss->assign("LOGOUT_LABEL", key($value['linkinfo']));
//key value for first element.
continue;
}
foreach ($value as $linkattribute => $attributevalue) {
// get the main link info
if ($linkattribute == 'linkinfo') {
$gcls[$key] = array("LABEL" => key($attributevalue), "URL" => current($attributevalue), "SUBMENU" => array());
if (substr($gcls[$key]["URL"], 0, 11) == "javascript:") {
$gcls[$key]["ONCLICK"] = substr($gcls[$key]["URL"], 11);
$gcls[$key]["URL"] = "javascript:void(0)";
}
}
// and now the sublinks
if ($linkattribute == 'submenu' && is_array($attributevalue)) {
foreach ($attributevalue as $submenulinkkey => $submenulinkinfo) {
$gcls[$key]['SUBMENU'][$submenulinkkey] = array("LABEL" => key($submenulinkinfo), "URL" => current($submenulinkinfo));
}
if (substr($gcls[$key]['SUBMENU'][$submenulinkkey]["URL"], 0, 11) == "javascript:") {
$gcls[$key]['SUBMENU'][$submenulinkkey]["ONCLICK"] = substr($gcls[$key]['SUBMENU'][$submenulinkkey]["URL"], 11);
$gcls[$key]['SUBMENU'][$submenulinkkey]["URL"] = "javascript:void(0)";
}
}
}
}
$ss->assign("GCLS", $gcls);
$ss->assign("SEARCH", isset($_REQUEST['query_string']) ? $_REQUEST['query_string'] : '');
if ($this->action == "EditView" || $this->action == "Login") {
$ss->assign("ONLOAD", 'onload="set_focus()"');
}
$ss->assign("AUTHENTICATED", isset($_SESSION["authenticated_user_id"]));
$ss->assign("ISPRINT", isset($_REQUEST['print']));
//this will be used by header.tpl to hide the megamenu bar when its 'print' view
// get other things needed for page style popup
if (isset($_SESSION["authenticated_user_id"])) {
// get the current user name and id
$ss->assign("CURRENT_USER", $current_user->full_name == '' || !showFullName() ? $current_user->user_name : $current_user->full_name);
$ss->assign("CURRENT_USER_ID", $current_user->id);
// get the last viewed records
$tracker = BeanFactory::getBean('Trackers');
$history = $tracker->get_recently_viewed($current_user->id);
$ss->assign("recentRecords", $this->processRecentRecords($history));
}
$bakModStrings = $mod_strings;
$imageURL = SugarThemeRegistry::current()->getImageURL("dashboard.png");
$homeImage = "<img src='{$imageURL}'>";
$ss->assign("homeImage", $homeImage);
global $mod_strings;
$mod_strings = $bakModStrings;
/******************DC MENU*********************/
// DEPRECATED since 7.0, will be removed from 7.2
// if(!empty($current_user->id) && !$this->_getOption('view_print')){
// require_once('include/DashletContainer/DCFactory.php');
// require_once('include/SugarSearchEngine/SugarSearchEngineFactory.php');
// $dcm = DCFactory::getContainer(null, 'DCMenu');
// $notifData = $dcm->getNotifications();
// $dcjs = getVersionedScript('include/DashletContainer/Containers/DCMenu.js');
// $ss->assign('NOTIFCLASS', $notifData['class']);
// $ss->assign('NOTIFCODE', $notifData['code']);
// $ss->assign('NOTIFICON', $notifData['icon']);
// $ss->assign('DCSCRIPT', $dcm->getScript());
// $ss->assign('ICONSEARCH', $dcm->getSearchIcon());
// $ss->assign('DCACTIONS',$dcm->getMenus());
// $ss->assign('PICTURE', $current_user->picture);
// $ftsAutocompleteEnable = TRUE;
// $searchEngine = SugarSearchEngineFactory::getInstance();
// if( ($searchEngine instanceOf SugarSearchEngine) || (isset($GLOBALS['sugar_config']['full_text_engine'])
// && isset($GLOBALS['sugar_config']['full_text_engine']['disable_autocomplete']) && $GLOBALS['sugar_config']['full_text_engine']['disable_autocomplete'] )
// )
// $ftsAutocompleteEnable = FALSE;
//
// if (SugarSearchEngineAbstractBase::isSearchEngineDown()) {
// $ftsAutocompleteEnable = false;
// }
// $ss->assign('FTS_AUTOCOMPLETE_ENABLE', $ftsAutocompleteEnable);
// $ss->assign('AJAX', isset($_REQUEST['ajax_load'])?$_REQUEST['ajax_load']:"0");
// $ss->assign('ACTION', isset($_REQUEST['action'])?$_REQUEST['action']:"");
// $ss->assign('FULL', isset($_REQUEST['full'])?$_REQUEST['full']:"false");
// if(is_admin($GLOBALS['current_user'])){
// $ss->assign('ISADMIN', true);
// } else {
// $ss->assign('ISADMIN', false);
// }
// $ss->assign('SUGAR_DCJS', $dcjs);
// //$ss->assign('SUGAR_DCMENU', $data['html']);
// }
/******************END DC MENU*********************/
$headerTpl = $themeObject->getTemplate('header.tpl');
if (inDeveloperMode()) {
$ss->clear_compiled_tpl($headerTpl);
}
$ss->display($headerTpl);
$this->includeClassicFile('modules/Administration/DisplayWarnings.php');
$errorMessages = SugarApplication::getErrorMessages();
if (!empty($errorMessages)) {
foreach ($errorMessages as $error_message) {
echo '<p class="error">' . $error_message . '</p>';
}
}
}
示例15: getUserArray
/**
* Returns user array
*
* @param string $condition
* @return array
*/
protected function getUserArray($condition)
{
return showFullName() ? getUserArrayFromFullName($condition, true) : get_user_array(false, 'Active', '', false, $condition, ' AND portal_only=0 ', false);
}