本文整理汇总了PHP中ACLAction::getUserAccessLevel方法的典型用法代码示例。如果您正苦于以下问题:PHP ACLAction::getUserAccessLevel方法的具体用法?PHP ACLAction::getUserAccessLevel怎么用?PHP ACLAction::getUserAccessLevel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ACLAction
的用法示例。
在下文中一共展示了ACLAction::getUserAccessLevel方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: template_pagination
function template_pagination(&$args)
{
$smarty = new Sugar_Smarty();
$reporter = $args['reporter'];
global $mod_strings;
// disable export if configured to
global $current_user, $sugar_config, $app_strings;
$smarty->assign('mod_strings', $mod_strings);
$smarty->assign('app_strings', $app_strings);
$is_owner = true;
if (isset($args['reporter']->saved_report) && $args['reporter']->saved_report->assigned_user_id != $current_user->id) {
$is_owner = false;
}
// if
$isExportAccess = false;
if (!ACLController::checkAccess('Reports', 'export', $is_owner) || $sugar_config['disable_export'] || !empty($sugar_config['admin_export_only']) && !(is_admin($current_user) || ACLController::moduleSupportsACL($reporter->module) && ACLAction::getUserAccessLevel($current_user->id, $reporter->module, 'access') == ACL_ALLOW_ENABLED && ACLAction::getUserAccessLevel($current_user->id, $reporter->module, 'admin') == ACL_ALLOW_ADMIN)) {
// no op
} else {
$smarty->assign('exportImagePath', SugarThemeRegistry::current()->getImage('export', " border='0' align='absmiddle'", null, null, '.gif', translate('LBL_EXPORT')));
$isExportAccess = true;
}
// else
$smarty->assign('isExportAccess', $isExportAccess);
$smarty->assign('start_link_ImagePath', SugarThemeRegistry::current()->getImage("start_off", " border='0' align='absmiddle'", null, null, '.gif', $app_strings['LNK_LIST_START']));
$smarty->assign('prev_link_ImagePath', SugarThemeRegistry::current()->getImage("previous_off", "border='0' align='absmiddle'", null, null, '.gif', $app_strings['LNK_LIST_PREVIOUS']));
$smarty->assign('end_link_ImagePath', SugarThemeRegistry::current()->getImage("end_off", "border='0' align='absmiddle'", null, null, '.gif', $app_strings['LNK_LIST_END']));
$smarty->assign('next_link_ImagePath', SugarThemeRegistry::current()->getImage("next_off", "border='0' align='absmiddle'", null, null, '.gif', $app_strings['LNK_LIST_NEXT']));
$smarty->assign('start_link_disabled', true);
$smarty->assign('prev_link_disabled', true);
$smarty->assign('end_link_disabled', true);
$smarty->assign('next_link_disabled', true);
$next = $reporter->row_end + $reporter->report_offset;
if ($reporter->report_offset > 0) {
$prev = $reporter->report_offset - $reporter->report_max;
$smarty->assign('start_link_ImagePath', SugarThemeRegistry::current()->getImage("start", " border='0' align='absmiddle'", null, null, '.gif', $app_strings['LNK_LIST_START']));
$smarty->assign('start_link_onclick', "onClick=javascript:set_offset(0);");
$smarty->assign('start_link_disabled', false);
$smarty->assign('prev_link_ImagePath', SugarThemeRegistry::current()->getImage("previous", "border='0' align='absmiddle'", null, null, '.gif', $app_strings['LNK_LIST_PREVIOUS']));
$smarty->assign('prev_link_onclick', "onClick=javascript:set_offset({$prev});");
$smarty->assign('prev_link_disabled', false);
}
// if
if ($next < $reporter->total_count) {
$end = ceil($reporter->total_count / $reporter->report_max - 1) * $reporter->report_max;
$smarty->assign('end_link_ImagePath', SugarThemeRegistry::current()->getImage("end", " border='0' align='absmiddle'", null, null, '.gif', $app_strings['LNK_LIST_END']));
$smarty->assign('end_link_disabled', false);
$smarty->assign('end_link_onclick', "onClick=javascript:set_offset({$end});");
$smarty->assign('next_link_ImagePath', SugarThemeRegistry::current()->getImage("next", " border='0' align='absmiddle'", null, null, '.gif', $app_strings['LNK_LIST_NEXT']));
$smarty->assign('next_link_disabled', false);
$smarty->assign('next_link_onclick', "onClick=javascript:set_offset({$next});");
}
// if
$start_range = $reporter->report_offset > 0 ? $reporter->row_start + $reporter->report_offset : ($reporter->total_count == 0 ? 0 : 1);
$end_range = $reporter->row_end + $reporter->report_offset;
$smarty->assign('start_range', $start_range);
$smarty->assign('end_range', $end_range);
$smarty->assign('total_count', $reporter->total_count);
return $smarty->fetch("modules/Reports/templates/_template_pagination.tpl");
}
示例2: checkAccess
/**
* (non-PHPdoc)
* @see SugarACLStrategy::checkAccess()
*/
public function checkAccess($module, $action, $context)
{
// Check if we have to apply team security based on ACLs
// If user had admin rights then team security is disabled
if ($action == "team_security") {
if (isset($context['bean']) && $context['bean']->bean_implements('ACL')) {
$user_id = $this->getUserID($context);
if (ACLAction::getUserAccessLevel($user_id, $module, 'access') != ACL_ALLOW_ENABLED) {
return true;
}
if (ACLAction::getUserAccessLevel($user_id, $module, 'admin') == ACL_ALLOW_ADMIN || ACLAction::getUserAccessLevel($user_id, $module, 'admin') == ACL_ALLOW_ADMIN_DEV) {
// disable team security for admins
return false;
}
return true;
} else {
// True means team security is enabled and it's the default
return true;
}
}
$user = $this->getCurrentUser($context);
if ($user && $user->isAdmin()) {
return true;
}
// make sure we have the correct action name
$action = !empty($_REQUEST['bwcFrame']) ? strtolower($action) : $this->fixUpActionName($action);
if ($action == "field") {
return $this->fieldACL($module, $context['action'], $context);
}
if (!empty($context['bean'])) {
return $this->beanACL($module, $action, $context);
}
if (empty($action)) {
return true;
}
if ($module == 'Trackers') {
return ACLController::checkAccessInternal($module, $action, true, 'Tracker');
}
// if we're editing and we do not have the bean, if owner is allowed then action is allowed
if (empty($context['bean']) && !empty(self::$edit_actions[$action]) && !isset($context['owner_override'])) {
$context['owner_override'] = true;
}
return ACLController::checkAccessInternal($module, $action, !empty($context['owner_override']));
}
示例3: export
/**
* Export API
*
* @param $api ServiceBase The API class of the request, used in cases where the API changes how the fields are pulled from the args array.
* @param $args array The arguments array passed in from the API
* @return String
*/
public function export(ServiceBase $api, array $args)
{
$seed = BeanFactory::newBean($args['module']);
if (!$seed->ACLAccess('export')) {
throw new SugarApiExceptionNotAuthorized($GLOBALS['app_strings']['ERR_EXPORT_DISABLED']);
}
ob_start();
global $sugar_config;
global $current_user;
global $app_list_strings;
$theModule = clean_string($args['module']);
if ($sugar_config['disable_export'] || !empty($sugar_config['admin_export_only']) && !(is_admin($current_user) || ACLController::moduleSupportsACL($theModule) && ACLAction::getUserAccessLevel($current_user->id, $theModule, 'access') == ACL_ALLOW_ENABLED && (ACLAction::getUserAccessLevel($current_user->id, $theModule, 'admin') == ACL_ALLOW_ADMIN || ACLAction::getUserAccessLevel($current_user->id, $theModule, 'admin') == ACL_ALLOW_ADMIN_DEV))) {
throw new SugarApiExceptionNotAuthorized($GLOBALS['app_strings']['ERR_EXPORT_DISABLED']);
}
//check to see if this is a request for a sample or for a regular export
if (!empty($args['sample'])) {
//call special method that will create dummy data for bean as well as insert standard help message.
$content = exportSampleFromApi($args);
} else {
$content = exportFromApi($args);
}
$filename = $args['module'];
//use label if one is defined
if (!empty($app_list_strings['moduleList'][$args['module']])) {
$filename = $app_list_strings['moduleList'][$args['module']];
}
//strip away any blank spaces
$filename = str_replace(' ', '', $filename);
if (isset($args['members']) && $args['members'] == true) {
$filename .= '_' . 'members';
}
///////////////////////////////////////////////////////////////////////////////
//// BUILD THE EXPORT FILE
ob_end_clean();
return $this->doExport($api, $filename, $content);
}
示例4: userHasAccess
/**
public static function userHasAccess($user_id, $category, $action,$type='module', $is_owner = false){
*/
public static function userHasAccess($user_id, $category, $action, $type = 'module', $is_owner = false, $in_group = false)
{
global $current_user;
if ($current_user->isAdminForModule($category) && !isset($_SESSION['ACL'][$user_id][$category][$type][$action]['aclaccess'])) {
return true;
}
//check if we don't have it set in the cache if not lets reload the cache
if (ACLAction::getUserAccessLevel($user_id, $category, 'access', $type) < ACL_ALLOW_ENABLED) {
return false;
}
if (empty($_SESSION['ACL'][$user_id][$category][$type][$action])) {
ACLAction::getUserActions($user_id, false);
}
if (!empty($_SESSION['ACL'][$user_id][$category][$type][$action])) {
/**
return ACLAction::hasAccess($is_owner, $_SESSION['ACL'][$user_id][$category][$type][$action]['aclaccess']);
*/
return ACLAction::hasAccess($is_owner, $in_group, $_SESSION['ACL'][$user_id][$category][$type][$action]['aclaccess']);
}
return false;
}
示例5: process
function process($lvsParams = array())
{
global $current_user;
$currentSearchFields = array();
$configureView = true;
// configure view or regular view
$query = false;
$whereArray = array();
$lvsParams['massupdate'] = false;
// apply filters
if (isset($this->filters) || $this->myItemsOnly) {
$whereArray = $this->buildWhere();
}
$this->lvs->export = false;
$this->lvs->multiSelect = false;
$this->lvs->quickViewLinks = false;
// columns
foreach ($this->columns as $name => $val) {
if (!empty($val['default']) && $val['default']) {
$displayColumns[strtoupper($name)] = $val;
$displayColumns[strtoupper($name)]['label'] = trim($displayColumns[strtoupper($name)]['label'], ':');
}
}
$this->lvs->displayColumns = $displayColumns;
$this->lvs->lvd->setVariableName($this->seedBean->object_name, array());
$lvsParams['overrideOrder'] = true;
$lvsParams['orderBy'] = 'date_entered';
$lvsParams['sortOrder'] = 'DESC';
$lvsParams['custom_from'] = '';
// Get the real module list
if (empty($this->selectedCategories)) {
$mod_list = $this->categories;
} else {
$mod_list = array_flip($this->selectedCategories);
//27949, here the key of $this->selectedCategories is not module name, the value is module name, so array_flip it.
}
$external_modules = array();
$admin_modules = array();
$owner_modules = array();
$regular_modules = array();
foreach ($mod_list as $module => $ignore) {
// Handle the UserFeed differently
if ($module == 'UserFeed') {
$regular_modules[] = 'UserFeed';
continue;
}
if (in_array($module, $this->externalAPIList)) {
$external_modules[] = $module;
}
if (ACLAction::getUserAccessLevel($current_user->id, $module, 'view') <= ACL_ALLOW_NONE) {
// Not enough access to view any records, don't add it to any lists
continue;
}
if (ACLAction::getUserAccessLevel($current_user->id, $module, 'view') == ACL_ALLOW_OWNER) {
$owner_modules[] = $module;
} else {
$regular_modules[] = $module;
}
}
if (!empty($this->displayTpl)) {
//MFH BUG #14296
$where = '';
if (!empty($whereArray)) {
$where = '(' . implode(') AND (', $whereArray) . ')';
}
$additional_where = '';
$module_limiter = " sugarfeed.related_module in ('" . implode("','", $regular_modules) . "')";
if (is_admin($GLOBALS['current_user'])) {
$all_modules = array_merge($regular_modules, $owner_modules, $admin_modules);
$module_limiter = " sugarfeed.related_module in ('" . implode("','", $all_modules) . "')";
} else {
if (count($owner_modules) > 0) {
$module_limiter = " ((sugarfeed.related_module IN ('" . implode("','", $regular_modules) . "') " . ") ";
if (count($owner_modules) > 0) {
$module_limiter .= "OR (sugarfeed.related_module IN('" . implode("','", $owner_modules) . "') AND sugarfeed.assigned_user_id = '" . $current_user->id . "' " . ") ";
}
$module_limiter .= ")";
}
}
if (!empty($where)) {
$where .= ' AND ';
}
$where .= $module_limiter;
$this->lvs->setup($this->seedBean, $this->displayTpl, $where, $lvsParams, 0, $this->displayRows, array('name', 'description', 'date_entered', 'created_by', 'related_module', 'link_url', 'link_type'));
foreach ($this->lvs->data['data'] as $row => $data) {
$this->lvs->data['data'][$row]['NAME'] = str_replace("{this.CREATED_BY}", get_assigned_user_name($this->lvs->data['data'][$row]['CREATED_BY']), $data['NAME']);
//Translate the SugarFeeds labels if necessary.
preg_match('/\\{([^\\^ }]+)\\.([^\\}]+)\\}/', $this->lvs->data['data'][$row]['NAME'], $modStringMatches);
if (count($modStringMatches) == 3 && $modStringMatches[1] == 'SugarFeed' && !empty($data['RELATED_MODULE'])) {
$modKey = $modStringMatches[2];
$modString = translate($modKey, $modStringMatches[1]);
if (strpos($modString, '{0}') === FALSE || !isset($GLOBALS['app_list_strings']['moduleListSingular'][$data['RELATED_MODULE']])) {
continue;
}
$modStringSingular = $GLOBALS['app_list_strings']['moduleListSingular'][$data['RELATED_MODULE']];
$modString = string_format($modString, array($modStringSingular));
$this->lvs->data['data'][$row]['NAME'] = preg_replace('/' . $modStringMatches[0] . '/', strtolower($modString), $this->lvs->data['data'][$row]['NAME']);
}
}
// assign a baseURL w/ the action set as DisplayDashlet
//.........这里部分代码省略.........
示例6: mass_assign
function mass_assign($event, $arguments)
{
$action = $_REQUEST['action'];
$module = $_REQUEST['module'];
$no_mass_assign_list = array("Emails" => "Emails", "ACLRoles" => "ACLRoles");
//,"Users"=>"Users");
//check if security suite enabled
$action = strtolower($action);
if (isset($module) && ($action == "list" || $action == "index" || $action == "listview") && (!isset($_REQUEST['search_form_only']) || $_REQUEST['search_form_only'] != true) && !array_key_exists($module, $no_mass_assign_list)) {
global $current_user;
if (is_admin($current_user) || ACLAction::getUserAccessLevel($current_user->id, "SecurityGroups", 'access') == ACL_ALLOW_ENABLED) {
require_once 'modules/SecurityGroups/SecurityGroup.php';
$groupFocus = new SecurityGroup();
$security_modules = $groupFocus->getSecurityModules();
//if(in_array($module,$security_modules)) {
if (in_array($module, array_keys($security_modules))) {
global $app_strings;
global $current_language;
$current_module_strings = return_module_language($current_language, 'SecurityGroups');
$form_header = get_form_header($current_module_strings['LBL_MASS_ASSIGN'], '', false);
$groups = $groupFocus->get_list("name", "", 0, -99, -99);
$options = array("" => "");
foreach ($groups['list'] as $group) {
$options[$group->id] = $group->name;
}
$group_options = get_select_options_with_id($options, "");
$mass_assign = <<<EOQ
<script type="text/javascript" language="javascript">
function confirm_massassign(del,start_string, end_string) {
\tif (del == 1) {
\t\treturn confirm( start_string + sugarListView.get_num_selected() + end_string);
\t}
\telse {
\t\treturn confirm( start_string + sugarListView.get_num_selected() + end_string);
\t}
}
function send_massassign(mode, no_record_txt, start_string, end_string, del) {
\tif(!sugarListView.confirm_action(del, start_string, end_string))
\t\treturn false;
\tif(document.MassAssign_SecurityGroups.massassign_group.selectedIndex == 0) {
\t\talert("Please select a group and try again.");
\t\treturn false;\t
\t}
\t
\tif (document.MassUpdate.select_entire_list &&
\t\tdocument.MassUpdate.select_entire_list.value == 1)
\t\tmode = 'entire';
\telse if (document.MassUpdate.massall.checked == true)
\t\tmode = 'page';
\telse
\t\tmode = 'selected';
\tvar ar = new Array();
\tif(del == 1) {
\t\tvar deleteInput = document.createElement('input');
\t\tdeleteInput.name = 'Delete';
\t\tdeleteInput.type = 'hidden';
\t\tdeleteInput.value = true;
\t\tdocument.MassAssign_SecurityGroups.appendChild(deleteInput);
\t}
\tswitch(mode) {
\t\tcase 'page':
\t\t\tdocument.MassAssign_SecurityGroups.uid.value = '';
\t\t\tfor(wp = 0; wp < document.MassUpdate.elements.length; wp++) {
\t\t\t\tif(typeof document.MassUpdate.elements[wp].name != 'undefined'
\t\t\t\t\t&& document.MassUpdate.elements[wp].name == 'mass[]' && document.MassUpdate.elements[wp].checked) {
\t\t\t\t\t\t\tar.push(document.MassUpdate.elements[wp].value);
\t\t\t\t}
\t\t\t}
\t\t\tdocument.MassAssign_SecurityGroups.uid.value = ar.join(',');
\t\t\tif(document.MassAssign_SecurityGroups.uid.value == '') {
\t\t\t\talert(no_record_txt);
\t\t\t\treturn false;
\t\t\t}
\t\t\tbreak;
\t\tcase 'selected':
\t\t\tfor(wp = 0; wp < document.MassUpdate.elements.length; wp++) {
\t\t\t\tif(typeof document.MassUpdate.elements[wp].name != 'undefined'
\t\t\t\t\t&& document.MassUpdate.elements[wp].name == 'mass[]'
\t\t\t\t\t\t&& document.MassUpdate.elements[wp].checked) {
\t\t\t\t\t\t\tar.push(document.MassUpdate.elements[wp].value);
\t\t\t\t}
\t\t\t}
\t\t\tif(document.MassAssign_SecurityGroups.uid.value != '') document.MassAssign_SecurityGroups.uid.value += ',';
\t\t\tdocument.MassAssign_SecurityGroups.uid.value += ar.join(',');
\t\t\tif(document.MassAssign_SecurityGroups.uid.value == '') {
\t\t\t\talert(no_record_txt);
\t\t\t\treturn false;
\t\t\t}
\t\t\tbreak;
\t\tcase 'entire':
\t\t\tvar entireInput = document.createElement('input');
\t\t\tentireInput.name = 'entire';
\t\t\tentireInput.type = 'hidden';
\t\t\tentireInput.value = 'index';
//.........这里部分代码省略.........
示例7: processListNavigation
//.........这里部分代码省略.........
$onClick = '';
if (0 != preg_match('/javascript.*/', $end_URL)) {
$onClick = "\"{$end_URL};\"";
} else {
$onClick = "'location.href=\"{$end_URL}\";'";
}
$end_link = "<button type='button' name='listViewEndButton' class='button' title='{$this->local_app_strings['LNK_LIST_END']}' onClick=" . $onClick . ">" . SugarThemeRegistry::current()->getImage("end", "alt='" . $this->local_app_strings['LNK_LIST_END'] . "' border='0' align='absmiddle'") . "</button>";
}
}
$GLOBALS['log']->info("Offset (next, current, prev)({$next_offset}, {$current_offset}, {$previous_offset})");
$GLOBALS['log']->info("Start/end records ({$start_record}, {$end_record})");
$end_record = $end_record - 1;
echo "<script>\n function select_overlib() {\n return overlib('<a style=\\'width: 150px\\' name=\"thispage\" class=\\'menuItem\\' onmouseover=\\'hiliteItem(this,\"yes\");\\' onmouseout=\\'unhiliteItem(this);\\' onclick=\\'if (document.MassUpdate.select_entire_list.value==1){document.MassUpdate.select_entire_list.value=0;sListView.check_all(document.MassUpdate, \"mass[]\", true, {$this->records_per_page})}else {sListView.check_all(document.MassUpdate, \"mass[]\", true)};\\' href=\\'#\\'>{$this->local_app_strings['LBL_LISTVIEW_OPTION_CURRENT']} ({$this->records_per_page})‎</a>" . "<a style=\\'width: 150px\\' name=\"selectall\" class=\\'menuItem\\' onmouseover=\\'hiliteItem(this,\"yes\");\\' onmouseout=\\'unhiliteItem(this);\\' onclick=\\'sListView.check_entire_list(document.MassUpdate, \"mass[]\",true,{$row_count});\\' href=\\'#\\'>{$this->local_app_strings['LBL_LISTVIEW_OPTION_ENTIRE']} ({$row_count})‎</a>" . "<a style=\\'width: 150px\\' name=\"deselect\" class=\\'menuItem\\' onmouseover=\\'hiliteItem(this,\"yes\");\\' onmouseout=\\'unhiliteItem(this);\\' onclick=\\'sListView.clear_all(document.MassUpdate, \"mass[]\", false);\\' href=\\'#\\'>{$this->local_app_strings['LBL_LISTVIEW_NONE']}</a>" . "', CENTER, '" . "', STICKY, MOUSEOFF, 3000, CLOSETEXT, '<img border=0 src=" . SugarThemeRegistry::current()->getImageURL('close_inline.gif') . ">', WIDTH, 150, CLOSETITLE, '" . $this->local_app_strings['LBL_ADDITIONAL_DETAILS_CLOSE_TITLE'] . "', CLOSECLICK, FGCLASS, 'olOptionsFgClass', " . "CGCLASS, 'olOptionsCgClass', BGCLASS, 'olBgClass', TEXTFONTCLASS, 'olFontClass', CAPTIONFONTCLASS, 'olOptionsCapFontClass', CLOSEFONTCLASS, 'olOptionsCloseFontClass');\n }\n </script>";
if ($this->show_select_menu) {
$select_link = "<a id='select_link' onclick='return select_overlib();' href=\"#\">" . $this->local_app_strings['LBL_LINK_SELECT'] . " <img src='" . SugarThemeRegistry::current()->getImageURL('MoreDetail.png') . "' width='11' height='7' border='0''>" . "</a>";
} else {
$select_link = " ";
}
// put overlib strings into functions to avoid backslash plague!
/*echo "<script>
function export_overlib() {
return overlib('<a style=\'width: 150px\' class=\'menuItem\' onmouseover=\'hiliteItem(this,\"yes\");\' onmouseout=\'unhiliteItem(this);\' onclick=\'return sListView.send_form(true, \"{$_REQUEST['module']}\", \"export.php\", \"{$this->local_app_strings['LBL_LISTVIEW_NO_SELECTED']}\")\' href=\'#\'>{$this->local_app_strings['LBL_LISTVIEW_OPTION_SELECTED']}</a>"
. "<a style=\'width: 150px\' class=\'menuItem\' onmouseover=\'hiliteItem(this,\"yes\");\' onmouseout=\'unhiliteItem(this);\' onclick=\'return sListView.send_form(false, \"{$_REQUEST['module']}\", \"export.php\", \"{$this->local_app_strings['LBL_LISTVIEW_NO_SELECTED']}\")\' href=\'#\'>{$this->local_app_strings['LBL_LISTVIEW_OPTION_CURRENT']}</a>"
. "<a style=\'width: 150px\' class=\'menuItem\' onmouseover=\'hiliteItem(this,\"yes\");\' onmouseout=\'unhiliteItem(this);\' href=\'export.php?module={$_REQUEST['module']}\'>{$this->local_app_strings['LBL_LISTVIEW_OPTION_ENTIRE']}</a>"
. "', CAPTION, '" . $this->local_app_strings['LBL_EXPORT']
. "', STICKY, MOUSEOFF, 3000, CLOSETEXT, '<img border=0 style=\'margin-left:2px; margin-right: 2px;\' src=" . $this->local_image_path
. "close.gif>', WIDTH, 150, CLOSETITLE, '" . $this->local_app_strings['LBL_ADDITIONAL_DETAILS_CLOSE_TITLE'] . "', CLOSECLICK, FGCLASS, 'olOptionsFgClass', "
. "CGCLASS, 'olOptionsCgClass', BGCLASS, 'olBgClass', TEXTFONTCLASS, 'olFontClass', CAPTIONFONTCLASS, 'olOptionsCapFontClass', CLOSEFONTCLASS, 'olOptionsCloseFontClass');
}
</script>";
*/
//$export_link = "<a id='export_link' onclick='return export_overlib();' href=\"#\">".SugarThemeRegistry::current()->getImage("export","alt='".$this->local_app_strings['LBL_EXPORT']."' border='0' align='absmiddle'")." ".$this->local_app_strings['LBL_EXPORT']."</a>";
$export_link = '<input class="button" type="button" value="' . $this->local_app_strings['LBL_EXPORT'] . '" ' . 'onclick="return sListView.send_form(true, \'' . $_REQUEST['module'] . '\', \'index.php?entryPoint=export\',\'' . $this->local_app_strings['LBL_LISTVIEW_NO_SELECTED'] . '\')">';
if ($this->show_delete_button) {
$delete_link = '<input class="button" type="button" name="Delete" value="' . $this->local_app_strings['LBL_DELETE_BUTTON_LABEL'] . '" onclick="return sListView.send_mass_update(\'selected\',\'' . $this->local_app_strings['LBL_LISTVIEW_NO_SELECTED'] . '\', 1)">';
} else {
$delete_link = ' ';
}
$admin = new Administration();
$admin->retrieveSettings('system');
$user_merge = $current_user->getPreference('mailmerge_on');
if ($user_merge == 'on' && isset($admin->settings['system_mailmerge_on']) && $admin->settings['system_mailmerge_on']) {
echo "<script>\n function mailmerge_overlib() {\n return overlib('<a style=\\'width: 150px\\' class=\\'menuItem\\' onmouseover=\\'hiliteItem(this,\"yes\");\\' onmouseout=\\'unhiliteItem(this);\\' onclick=\\'return sListView.send_form(true, \"MailMerge\", \"index.php\", \"{$this->local_app_strings['LBL_LISTVIEW_NO_SELECTED']}\")\\' href=\\'#\\'>{$this->local_app_strings['LBL_LISTVIEW_OPTION_SELECTED']}</a>" . "<a style=\\'width: 150px\\' class=\\'menuItem\\' onmouseover=\\'hiliteItem(this,\"yes\");\\' onmouseout=\\'unhiliteItem(this);\\' href=\\'index.php?action=index&module=MailMerge\\'>{$this->local_app_strings['LBL_LISTVIEW_OPTION_CURRENT']}</a>" . "<a style=\\'width: 150px\\' class=\\'menuItem\\' onmouseover=\\'hiliteItem(this,\"yes\");\\' onmouseout=\\'unhiliteItem(this);\\' href=\\'index.php?action=index&module=MailMerge&entire=true\\'>{$this->local_app_strings['LBL_LISTVIEW_OPTION_ENTIRE']}</a>" . "', CAPTION, '" . $this->local_app_strings['LBL_MAILMERGE'] . "', STICKY, MOUSEOFF, 3000, CLOSETEXT, '<img border=0 style=\\'margin-left:2px; margin-right: 2px;\\' src=" . $this->local_image_path . "close.gif>', WIDTH, 150, CLOSETITLE, '" . $this->local_app_strings['LBL_ADDITIONAL_DETAILS_CLOSE_TITLE'] . "', CLOSECLICK, FGCLASS, 'olOptionsFgClass', " . "CGCLASS, 'olOptionsCgClass', BGCLASS, 'olBgClass', TEXTFONTCLASS, 'olFontClass', CAPTIONFONTCLASS, 'olOptionsCapFontClass', CLOSEFONTCLASS, 'olCloseFontClass');\n }\n </script>";
$merge_link = " | <a id='mailmerge_link' onclick='return mailmerge_overlib()'; href=\"#\">" . $this->local_app_strings['LBL_MAILMERGE'] . "</a>";
} else {
$merge_link = " ";
}
$selected_objects_span = " | {$this->local_app_strings['LBL_LISTVIEW_SELECTED_OBJECTS']}<input style='border: 0px; background: transparent; font-size: inherit; color: inherit' type='text' readonly name='selectCount[]' value='" . (!empty($select_entire_list) ? $row_count : 0) . "' />";
if ($_REQUEST['module'] == 'Home' || $this->local_current_module == 'Import' || $this->show_export_button == false || !empty($sugar_config['disable_export']) || !empty($sugar_config['admin_export_only']) && !(is_admin($current_user) || ACLController::moduleSupportsACL($_REQUEST['module']) && ACLAction::getUserAccessLevel($current_user->id, $_REQUEST['module'], 'access') == ACL_ALLOW_ENABLED && (ACLAction::getUserAccessLevel($current_user->id, $_REQUEST['module'], 'admin') == ACL_ALLOW_ADMIN || ACLAction::getUserAccessLevel($current_user->id, $_REQUEST['module'], 'admin') == ACL_ALLOW_ADMIN_DEV))) {
if ($_REQUEST['module'] != 'InboundEmail' && $_REQUEST['module'] != 'EmailMan' && $_REQUEST['module'] != 'iFrames') {
$selected_objects_span = '';
}
$export_link = " ";
$merge_link = " ";
} elseif ($_REQUEST['module'] != "Accounts" && $_REQUEST['module'] != "Cases" && $_REQUEST['module'] != "Contacts" && $_REQUEST['module'] != "Leads" && $_REQUEST['module'] != "Opportunities") {
$merge_link = " ";
}
if ($this->show_paging == true) {
if (!empty($sugar_config['disable_count_query'])) {
if ($row_count > $end_record) {
$row_count .= '+';
}
}
$html_text = '';
$html_text .= "<tr class='pagination'>\n";
$html_text .= "<td COLSPAN=\"{$col_count}\" align=\"right\">\n";
//$html_text .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"><tr><td align=\"left\" >$export_link$merge_link$selected_objects_span</td>\n";
//$html_text .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"><tr><td align=\"left\" >";
if ($subpanel_def != null) {
include_once 'include/SubPanel/SubPanelTiles.php';
$subpanelTiles = new SubPanelTiles($sugarbean);
$html_text .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"><tr><td align=\"left\" >";
//attempt to get the query to recreate this subpanel
if (!empty($this->response)) {
$response =& $this->response;
} else {
$response = SugarBean::get_union_related_list($sugarbean, $this->sortby, $this->sort_order, $this->query_where, $current_offset, -1, -1, $this->query_limit, $subpanel_def);
$this->response = $response;
}
//if query is present, then pass it in as parameter
if (isset($response['query']) && !empty($response['query'])) {
$html_text .= $subpanelTiles->get_buttons($subpanel_def, $response['query']);
} else {
$html_text .= $subpanelTiles->get_buttons($subpanel_def);
}
} else {
$html_text .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"><tr><td align=\"left\" nowrap>{$select_link} {$export_link} {$delete_link} {$selected_objects_span}";
}
$html_text .= "</td>\n<td nowrap align=\"right\">" . $start_link . " " . $previous_link . " <span class='pageNumbers'>(" . $start_record . " - " . $end_record . " " . $this->local_app_strings['LBL_LIST_OF'] . " " . $row_count . ")</span> " . $next_link . " " . $end_link . "</td></tr></table>\n";
$html_text .= "</td>\n";
$html_text .= "</tr>\n";
$this->xTemplate->assign("PAGINATION", $html_text);
}
//C.L. - Fix for 23461
if (empty($_REQUEST['action']) || $_REQUEST['action'] != 'Popup') {
$_SESSION['export_where'] = $this->query_where;
}
$this->xTemplate->parse($xtemplateSection . ".list_nav_row");
}
}
示例8: processListNavigation
//.........这里部分代码省略.........
$onClick = "'location.href=\"{$end_URL}\";'";
}
$end_link = "<button type='button' name='listViewEndButton' class='button' title='{$this->local_app_strings['LNK_LIST_END']}' onClick=" . $onClick . ">" . SugarThemeRegistry::current()->getImage("end", "border='0' align='absmiddle'", null, null, '.gif', $this->local_app_strings['LNK_LIST_END']) . "</button>";
}
}
$GLOBALS['log']->info("Offset (next, current, prev)({$next_offset}, {$current_offset}, {$previous_offset})");
$GLOBALS['log']->info("Start/end records ({$start_record}, {$end_record})");
$end_record = $end_record - 1;
$script_href = "<a style=\\'width: 150px\\' name=\"thispage\" class=\\'menuItem\\' onmouseover=\\'hiliteItem(this,\"yes\");\\' onmouseout=\\'unhiliteItem(this);\\' onclick=\\'if (document.MassUpdate.select_entire_list.value==1){document.MassUpdate.select_entire_list.value=0;sListView.check_all(document.MassUpdate, \"mass[]\", true, {$this->records_per_page})}else {sListView.check_all(document.MassUpdate, \"mass[]\", true)};\\' href=\\'#\\'>{$this->local_app_strings['LBL_LISTVIEW_OPTION_CURRENT']} ({$this->records_per_page})‎</a>" . "<a style=\\'width: 150px\\' name=\"selectall\" class=\\'menuItem\\' onmouseover=\\'hiliteItem(this,\"yes\");\\' onmouseout=\\'unhiliteItem(this);\\' onclick=\\'sListView.check_entire_list(document.MassUpdate, \"mass[]\",true,{$row_count});\\' href=\\'#\\'>{$this->local_app_strings['LBL_LISTVIEW_OPTION_ENTIRE']} ({$row_count})‎</a>" . "<a style=\\'width: 150px\\' name=\"deselect\" class=\\'menuItem\\' onmouseover=\\'hiliteItem(this,\"yes\");\\' onmouseout=\\'unhiliteItem(this);\\' onclick=\\'sListView.clear_all(document.MassUpdate, \"mass[]\", false);\\' href=\\'#\\'>{$this->local_app_strings['LBL_LISTVIEW_NONE']}</a>";
$close_inline_img = SugarThemeRegistry::current()->getImage('close_inline', 'border=0', null, null, ".gif", $app_strings['LBL_CLOSEINLINE']);
echo "<script>\n function select_dialog() {\n \tvar \$dialog = \$('<div></div>')\n\t\t\t\t\t.html('<a style=\\'width: 150px\\' name=\"thispage\" class=\\'menuItem\\' onmouseover=\\'hiliteItem(this,\"yes\");\\' onmouseout=\\'unhiliteItem(this);\\' onclick=\\'if (document.MassUpdate.select_entire_list.value==1){document.MassUpdate.select_entire_list.value=0;sListView.check_all(document.MassUpdate, \"mass[]\", true, {$this->records_per_page})}else {sListView.check_all(document.MassUpdate, \"mass[]\", true)};\\' href=\\'javascript:void(0)\\'>{$this->local_app_strings['LBL_LISTVIEW_OPTION_CURRENT']} ({$this->records_per_page})‎</a>" . "<a style=\\'width: 150px\\' name=\"selectall\" class=\\'menuItem\\' onmouseover=\\'hiliteItem(this,\"yes\");\\' onmouseout=\\'unhiliteItem(this);\\' onclick=\\'sListView.check_entire_list(document.MassUpdate, \"mass[]\",true,{$row_count});\\' href=\\'javascript:void(0)\\'>{$this->local_app_strings['LBL_LISTVIEW_OPTION_ENTIRE']} ({$row_count})‎</a>" . "<a style=\\'width: 150px\\' name=\"deselect\" class=\\'menuItem\\' onmouseover=\\'hiliteItem(this,\"yes\");\\' onmouseout=\\'unhiliteItem(this);\\' onclick=\\'sListView.clear_all(document.MassUpdate, \"mass[]\", false);\\' href=\\'javascript:void(0)\\'>{$this->local_app_strings['LBL_LISTVIEW_NONE']}</a>')\n\t\t\t\t\t.dialog({\n\t\t\t\t\t\tautoOpen: false,\n\t\t\t\t\t\twidth: 150\n\t\t\t\t\t});\n\t\t\t\t\t\$dialog.dialog('open');\n\n }\n </script>";
if ($this->show_select_menu) {
$total_label = "";
$total = $row_count;
$pageTotal = $row_count > 0 ? $end_record - $start_record + 1 : 0;
if (!empty($GLOBALS['sugar_config']['disable_count_query']) && $GLOBALS['sugar_config']['disable_count_query'] === true && $total > $pageTotal) {
$this->show_plus = true;
$total = $pageTotal;
$total_label = $total . '+';
} else {
$this->show_plus = false;
$total_label = $total;
}
echo "<input type='hidden' name='show_plus' value='{$this->show_plus}'>\n";
//Bug#52931: Replace with actionMenu
//$select_link = "<a id='select_link' onclick='return select_dialog();' href=\"javascript:void(0)\">".$this->local_app_strings['LBL_LINK_SELECT']." ".SugarThemeRegistry::current()->getImage('MoreDetail', 'border=0', 11, 7, '.png', $app_strings['LBL_MOREDETAIL'])."</a>";
$menuItems = array("<input title=\"" . $app_strings['LBL_SELECT_ALL_TITLE'] . "\" type='checkbox' class='checkbox massall' name='massall' id='massall' value='' onclick='sListView.check_all(document.MassUpdate, \"mass[]\", this.checked);' /><a href='javascript: void(0);'></a>", "<a name='thispage' id='button_select_this_page' class='menuItem' onmouseover='hiliteItem(this,\"yes\");' onmouseout='unhiliteItem(this);' onclick='if (document.MassUpdate.select_entire_list.value==1){document.MassUpdate.select_entire_list.value=0;sListView.check_all(document.MassUpdate, \"mass[]\", true, {$pageTotal})}else {sListView.check_all(document.MassUpdate, \"mass[]\", true)};' href='#'>{$app_strings['LBL_LISTVIEW_OPTION_CURRENT']} ({$pageTotal})‎</a>", "<a name='selectall' id='button_select_all' class='menuItem' onmouseover='hiliteItem(this,\"yes\");' onmouseout='unhiliteItem(this);' onclick='sListView.check_entire_list(document.MassUpdate, \"mass[]\",true,{$total});' href='#'>{$app_strings['LBL_LISTVIEW_OPTION_ENTIRE']} ({$total_label})‎</a>", "<a name='deselect' id='button_deselect' class='menuItem' onmouseover='hiliteItem(this,\"yes\");' onmouseout='unhiliteItem(this);' onclick='sListView.clear_all(document.MassUpdate, \"mass[]\", false);' href='#'>{$app_strings['LBL_LISTVIEW_NONE']}</a>");
require_once 'include/Smarty/plugins/function.sugar_action_menu.php';
$select_link = smarty_function_sugar_action_menu(array('class' => 'clickMenu selectmenu', 'id' => 'selectLink', 'buttons' => $menuItems), $this->xTemplate);
} else {
$select_link = " ";
}
$export_link = '<input class="button" type="button" value="' . $this->local_app_strings['LBL_EXPORT'] . '" ' . 'onclick="return sListView.send_form(true, \'' . $_REQUEST['module'] . '\', \'index.php?entryPoint=export\',\'' . $this->local_app_strings['LBL_LISTVIEW_NO_SELECTED'] . '\')">';
if ($this->show_delete_button) {
$delete_link = '<input class="button" type="button" id="delete_button" name="Delete" value="' . $this->local_app_strings['LBL_DELETE_BUTTON_LABEL'] . '" onclick="return sListView.send_mass_update(\'selected\',\'' . $this->local_app_strings['LBL_LISTVIEW_NO_SELECTED'] . '\', 1)">';
} else {
$delete_link = ' ';
}
$admin = new Administration();
$admin->retrieveSettings('system');
$user_merge = $current_user->getPreference('mailmerge_on');
if ($user_merge == 'on' && isset($admin->settings['system_mailmerge_on']) && $admin->settings['system_mailmerge_on']) {
echo "<script>\n function mailmerge_dialog(el) {\n \tvar \$dialog = \$('<div></div>')\n\t\t\t\t\t.html('<a style=\\'width: 150px\\' class=\\'menuItem\\' onmouseover=\\'hiliteItem(this,\"yes\");\\' onmouseout=\\'unhiliteItem(this);\\' onclick=\\'return sListView.send_form(true, \"MailMerge\", \"index.php\", \"{$this->local_app_strings['LBL_LISTVIEW_NO_SELECTED']}\")\\' href=\\'javascript:void(0)\\'>{$this->local_app_strings['LBL_LISTVIEW_OPTION_SELECTED']}</a>" . "<a style=\\'width: 150px\\' class=\\'menuItem\\' onmouseover=\\'hiliteItem(this,\"yes\");\\' onmouseout=\\'unhiliteItem(this);\\' href=\\'index.php?action=index&module=MailMerge\\'>{$this->local_app_strings['LBL_LISTVIEW_OPTION_CURRENT']}</a>" . "<a style=\\'width: 150px\\' class=\\'menuItem\\' onmouseover=\\'hiliteItem(this,\"yes\");\\' onmouseout=\\'unhiliteItem(this);\\' href=\\'index.php?action=index&module=MailMerge&entire=true\\'>{$this->local_app_strings['LBL_LISTVIEW_OPTION_ENTIRE']}</a>')\n\t\t\t\t\t.dialog({\n\t\t\t\t\t\tautoOpen: false,\n\t\t\t\t\t\ttitle: '" . $this->local_app_strings['LBL_MAILMERGE'] . "',\n\t\t\t\t\t\twidth: 150,\n\t\t\t\t\t\tposition: {\n\t\t\t\t\t\t my: myPos,\n\t\t\t\t\t\t at: atPos,\n\t\t\t\t\t\t of: \$(el)\n\t\t\t\t\t \t}\n\t\t\t\t\t});\n\n }\n </script>";
$merge_link = " | <a id='mailmerge_link' onclick='return mailmerge_dialog(this)'; href=\"javascript:void(0)\">" . $this->local_app_strings['LBL_MAILMERGE'] . "</a>";
} else {
$merge_link = " ";
}
$selected_objects_span = " | {$this->local_app_strings['LBL_LISTVIEW_SELECTED_OBJECTS']}<input style='border: 0px; background: transparent; font-size: inherit; color: inherit' type='text' readonly name='selectCount[]' value='" . (isset($_POST['mass']) ? count($_POST['mass']) : 0) . "' />";
if ($_REQUEST['module'] == 'Home' || $this->local_current_module == 'Import' || $this->show_export_button == false || !empty($sugar_config['disable_export']) || !empty($sugar_config['admin_export_only']) && !(is_admin($current_user) || ACLController::moduleSupportsACL($_REQUEST['module']) && ACLAction::getUserAccessLevel($current_user->id, $_REQUEST['module'], 'access') == ACL_ALLOW_ENABLED && (ACLAction::getUserAccessLevel($current_user->id, $_REQUEST['module'], 'admin') == ACL_ALLOW_ADMIN || ACLAction::getUserAccessLevel($current_user->id, $_REQUEST['module'], 'admin') == ACL_ALLOW_ADMIN_DEV))) {
if ($_REQUEST['module'] != 'InboundEmail' && $_REQUEST['module'] != 'EmailMan' && $_REQUEST['module'] != 'iFrames') {
$selected_objects_span = '';
}
$export_link = " ";
$merge_link = " ";
} elseif ($_REQUEST['module'] != "Accounts" && $_REQUEST['module'] != "Cases" && $_REQUEST['module'] != "Contacts" && $_REQUEST['module'] != "Leads" && $_REQUEST['module'] != "Opportunities") {
$merge_link = " ";
}
if ($this->show_paging == true) {
if (!empty($sugar_config['disable_count_query'])) {
if ($row_count > $end_record) {
$row_count .= '+';
}
}
$html_text = '';
$html_text .= "<tr class='pagination' role='presentation'>\n";
$html_text .= "<td COLSPAN=\"{$col_count}\" align=\"right\">\n";
//$html_text .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"><tr><td align=\"left\" >$export_link$merge_link$selected_objects_span</td>\n";
//$html_text .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"><tr><td align=\"left\" >";
if ($subpanel_def != null) {
include_once 'include/SubPanel/SubPanelTiles.php';
$subpanelTiles = new SubPanelTiles($sugarbean);
$html_text .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"><tr><td align=\"left\" >";
//attempt to get the query to recreate this subpanel
if (!empty($this->response)) {
$response =& $this->response;
} else {
$response = SugarBean::get_union_related_list($sugarbean, $this->sortby, $this->sort_order, $this->query_where, $current_offset, -1, -1, $this->query_limit, $subpanel_def);
$this->response = $response;
}
//if query is present, then pass it in as parameter
if (isset($response['query']) && !empty($response['query'])) {
$html_text .= $subpanelTiles->get_buttons($subpanel_def, $response['query']);
} else {
$html_text .= $subpanelTiles->get_buttons($subpanel_def);
}
} else {
$html_text .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"><tr><td align=\"left\" nowrap>{$select_link} {$export_link} {$delete_link} {$selected_objects_span}";
}
$html_text .= "</td>\n<td nowrap align=\"right\">" . $start_link . " " . $previous_link . " <span class='pageNumbers'>(" . $start_record . " - " . $end_record . " " . $this->local_app_strings['LBL_LIST_OF'] . " " . $row_count . ")</span> " . $next_link . " " . $end_link . "</td></tr></table>\n";
$html_text .= "</td>\n";
$html_text .= "</tr>\n";
$this->xTemplate->assign("PAGINATION", $html_text);
}
//C.L. - Fix for 23461
if (empty($_REQUEST['action']) || $_REQUEST['action'] != 'Popup') {
$_SESSION['export_where'] = $this->query_where;
}
$this->xTemplate->parse($xtemplateSection . ".list_nav_row");
}
}
示例9: ini_set
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
//Bug 30094, If zlib is enabled, it can break the calls to header() due to output buffering. This will only work php5.2+
ini_set('zlib.output_compression', 'Off');
ob_start();
require_once 'include/export_utils.php';
global $sugar_config;
global $locale;
global $current_user;
global $app_list_strings;
$the_module = clean_string($_REQUEST['module']);
if ($sugar_config['disable_export'] || !empty($sugar_config['admin_export_only']) && !(is_admin($current_user) || ACLController::moduleSupportsACL($the_module) && ACLAction::getUserAccessLevel($current_user->id, $the_module, 'access') == ACL_ALLOW_ENABLED && (ACLAction::getUserAccessLevel($current_user->id, $the_module, 'admin') == ACL_ALLOW_ADMIN || ACLAction::getUserAccessLevel($current_user->id, $the_module, 'admin') == ACL_ALLOW_ADMIN_DEV))) {
die($GLOBALS['app_strings']['ERR_EXPORT_DISABLED']);
}
//check to see if this is a request for a sample or for a regular export
if (!empty($_REQUEST['sample'])) {
//call special method that will create dummy data for bean as well as insert standard help message.
$content = exportSample(clean_string($_REQUEST['module']));
} else {
if (!empty($_REQUEST['uid'])) {
$content = export(clean_string($_REQUEST['module']), $_REQUEST['uid'], isset($_REQUEST['members']) ? $_REQUEST['members'] : false);
} else {
$content = export(clean_string($_REQUEST['module']));
}
}
$filename = $_REQUEST['module'];
//use label if one is defined
示例10: testgetUserAccessLevel
public function testgetUserAccessLevel()
{
//tes for accoounts module with two different actions
$this->assertEquals(90, ACLAction::getUserAccessLevel('1', 'Accounts', 'list'));
$this->assertEquals(89, ACLAction::getUserAccessLevel('1', 'Accounts', 'access'));
//tes for users module with two different actions
$this->assertEquals(90, ACLAction::getUserAccessLevel('1', 'Users', 'list'));
$this->assertEquals(89, ACLAction::getUserAccessLevel('1', 'Users', 'access'));
}
示例11: __construct
/**
* Constructor for the bean, it performs following tasks:
*
* 1. Initalized a database connections
* 2. Load the vardefs for the module implemeting the class. cache the entries
* if needed
* 3. Setup row-level security preference
* All implementing classes must call this constructor using the parent::__construct()
*
*/
public function __construct()
{
// FIXME: this will be removed, needed for ensuring BeanFactory is always used
//$this->checkBacktrace();
global $dictionary, $current_user;
$this->db = DBManagerFactory::getInstance();
if (empty($this->module_name)) {
$this->module_name = $this->module_dir;
}
if (isset($this->disable_team_security)) {
$this->disable_row_level_security = $this->disable_team_security;
}
// Verify that current user is not null then do an ACL check. The current user check is to support installation.
if (!$this->disable_row_level_security && !empty($current_user->id) && (is_admin($current_user) || $this->bean_implements('ACL') && (ACLAction::getUserAccessLevel($current_user->id, $this->module_dir, 'access') == ACL_ALLOW_ENABLED && (ACLAction::getUserAccessLevel($current_user->id, $this->module_dir, 'admin') == ACL_ALLOW_ADMIN || ACLAction::getUserAccessLevel($current_user->id, $this->module_dir, 'admin') == ACL_ALLOW_ADMIN_DEV)))) {
$this->disable_row_level_security = true;
}
if (false == $this->disable_vardefs && (empty(self::$loadedDefs[$this->object_name]) || !empty($GLOBALS['reload_vardefs']))) {
$refresh = inDeveloperMode() || !empty($_SESSION['developerMode']);
if ($refresh && !empty(VardefManager::$inReload["{$this->module_dir}:{$this->object_name}"])) {
// if we're already reloading this vardef, no need to do it again
$refresh = false;
}
VardefManager::loadVardef($this->module_dir, $this->object_name, $refresh, array("bean" => $this));
// build $this->column_fields from the field_defs if they exist
if (!empty($dictionary[$this->object_name]['fields'])) {
foreach ($dictionary[$this->object_name]['fields'] as $key => $value_array) {
$column_fields[] = $key;
if (!empty($value_array['required']) && !empty($value_array['name'])) {
$this->required_fields[$value_array['name']] = 1;
}
}
$this->column_fields = $column_fields;
}
//setup custom fields
if (!isset($this->custom_fields) && empty($this->disable_custom_fields)) {
$this->setupCustomFields($this->module_dir);
}
//load up field_arrays from CacheHandler;
if (empty($this->list_fields)) {
$this->list_fields = $this->_loadCachedArray($this->module_dir, $this->object_name, 'list_fields');
}
if (empty($this->column_fields)) {
$this->column_fields = $this->_loadCachedArray($this->module_dir, $this->object_name, 'column_fields');
}
if (empty($this->required_fields)) {
$this->required_fields = $this->_loadCachedArray($this->module_dir, $this->object_name, 'required_fields');
}
if (isset($GLOBALS['dictionary'][$this->object_name]) && !$this->disable_vardefs) {
$this->field_name_map = $dictionary[$this->object_name]['fields'];
$this->field_defs = $dictionary[$this->object_name]['fields'];
if (isset($dictionary[$this->object_name]['name_format_map'])) {
$this->name_format_map = $dictionary[$this->object_name]['name_format_map'];
}
if (!empty($dictionary[$this->object_name]['optimistic_locking'])) {
$this->optimistic_lock = true;
}
if (isset($dictionary[$this->object_name]['importable'])) {
$this->importable = isTruthy($dictionary[$this->object_name]['importable']);
}
}
self::$loadedDefs[$this->object_name]['column_fields'] =& $this->column_fields;
self::$loadedDefs[$this->object_name]['list_fields'] =& $this->list_fields;
self::$loadedDefs[$this->object_name]['required_fields'] =& $this->required_fields;
self::$loadedDefs[$this->object_name]['field_name_map'] =& $this->field_name_map;
self::$loadedDefs[$this->object_name]['field_defs'] =& $this->field_defs;
self::$loadedDefs[$this->object_name]['name_format_map'] =& $this->name_format_map;
} else {
$this->column_fields =& self::$loadedDefs[$this->object_name]['column_fields'];
$this->list_fields =& self::$loadedDefs[$this->object_name]['list_fields'];
$this->required_fields =& self::$loadedDefs[$this->object_name]['required_fields'];
$this->field_name_map =& self::$loadedDefs[$this->object_name]['field_name_map'];
$this->field_defs =& self::$loadedDefs[$this->object_name]['field_defs'];
$this->name_format_map =& self::$loadedDefs[$this->object_name]['name_format_map'];
$this->added_custom_field_defs = true;
if (!isset($this->custom_fields) && empty($this->disable_custom_fields)) {
$this->setupCustomFields($this->module_dir, false);
}
if (!empty($dictionary[$this->object_name]['optimistic_locking'])) {
$this->optimistic_lock = true;
}
}
// Verify that current user is not null then do an ACL check. The current user check is to support installation.
if (!$this->disable_row_level_security && !empty($current_user->id) && !isset($this->disable_team_security) && !SugarACL::checkAccess($this->module_dir, 'team_security', array('bean' => $this))) {
// We can disable team security for this module
$this->disable_row_level_security = true;
}
if ($this->bean_implements('ACL')) {
$this->acl_fields = isset($dictionary[$this->object_name]['acl_fields']) && $dictionary[$this->object_name]['acl_fields'] === false ? false : true;
if (!empty($current_user->id)) {
ACLField::loadUserFields($this->module_dir, $this->object_name, $current_user->id);
//.........这里部分代码省略.........
示例12: process
function process($lvsParams = array())
{
global $current_user;
$currentSearchFields = array();
$configureView = true;
// configure view or regular view
$query = false;
$whereArray = array();
$lvsParams['massupdate'] = false;
// apply filters
if (isset($this->filters) || $this->myItemsOnly) {
$whereArray = $this->buildWhere();
}
$this->lvs->export = false;
$this->lvs->multiSelect = false;
$this->lvs->quickViewLinks = false;
// columns
foreach ($this->columns as $name => $val) {
if (!empty($val['default']) && $val['default']) {
$displayColumns[strtoupper($name)] = $val;
$displayColumns[strtoupper($name)]['label'] = trim($displayColumns[strtoupper($name)]['label'], ':');
}
}
$this->lvs->displayColumns = $displayColumns;
$this->lvs->lvd->setVariableName($this->seedBean->object_name, array());
$lvsParams['overrideOrder'] = true;
$lvsParams['orderBy'] = 'date_entered';
$lvsParams['sortOrder'] = 'DESC';
// Get the real module list
if (empty($this->selectedCategories)) {
$mod_list = $this->categories;
} else {
$mod_list = array_flip($this->selectedCategories);
//27949, here the key of $this->selectedCategories is not module name, the value is module name, so array_flip it.
}
$admin_modules = array();
$owner_modules = array();
$regular_modules = array();
foreach ($mod_list as $module => $ignore) {
// Handle the UserFeed differently
if ($module == 'UserFeed') {
$regular_modules[] = 'UserFeed';
continue;
}
if (ACLAction::getUserAccessLevel($current_user->id, $module, 'view') <= ACL_ALLOW_NONE) {
// Not enough access to view any records, don't add it to any lists
continue;
}
if (ACLAction::getUserAccessLevel($current_user->id, $module, 'view') == ACL_ALLOW_OWNER) {
$owner_modules[] = $module;
} else {
$regular_modules[] = $module;
}
}
if (!empty($this->displayTpl)) {
//MFH BUG #14296
$where = '';
if (!empty($whereArray)) {
$where = '(' . implode(') AND (', $whereArray) . ')';
}
$module_limiter = " sugarfeed.related_module in ('" . implode("','", $regular_modules) . "')";
if (count($owner_modules) > 0) {
$module_limiter = " ((sugarfeed.related_module IN ('" . implode("','", $regular_modules) . "') " . ") ";
if (count($owner_modules) > 0) {
$module_limiter .= "OR (sugarfeed.related_module IN('" . implode("','", $owner_modules) . "') AND sugarfeed.assigned_user_id = '" . $current_user->id . "' " . ") ";
}
$module_limiter .= ")";
}
if (!empty($where)) {
$where .= ' AND ';
}
$where .= $module_limiter;
$this->lvs->setup($this->seedBean, $this->displayTpl, $where, $lvsParams, 0, $this->displayRows, array('name', 'description', 'date_entered', 'created_by', 'link_url', 'link_type'));
foreach ($this->lvs->data['data'] as $row => $data) {
$this->lvs->data['data'][$row]['CREATED_BY'] = get_assigned_user_name($data['CREATED_BY']);
$this->lvs->data['data'][$row]['NAME'] = str_replace("{this.CREATED_BY}", $this->lvs->data['data'][$row]['CREATED_BY'], $data['NAME']);
}
// assign a baseURL w/ the action set as DisplayDashlet
foreach ($this->lvs->data['pageData']['urls'] as $type => $url) {
// awu Replacing action=DisplayDashlet with action=DynamicAction&DynamicAction=DisplayDashlet
if ($type == 'orderBy') {
$this->lvs->data['pageData']['urls'][$type] = preg_replace('/(action=.*&)/Ui', 'action=DynamicAction&DynamicAction=displayDashlet&', $url);
} else {
$this->lvs->data['pageData']['urls'][$type] = preg_replace('/(action=.*&)/Ui', 'action=DynamicAction&DynamicAction=displayDashlet&', $url) . '&sugar_body_only=1&id=' . $this->id;
}
}
$this->lvs->ss->assign('dashletId', $this->id);
}
}
示例13: userHasAccess
/**
* static function userHasAccess($user_id, $category, $action, $is_owner = false)
*
* @param GUID $user_id the user id who you want to check access for
* @param STRING $category the category you would like to check access for
* @param STRING $action the action of that category you would like to check access for
* @param BOOLEAN OPTIONAL $is_owner if the object is owned by the user you are checking access for
*/
function userHasAccess($user_id, $category, $action, $type = 'module', $is_owner = false)
{
//check if we don't have it set in the cache if not lets reload the cache
if (ACLAction::getUserAccessLevel($user_id, $category, 'access') < ACL_ALLOW_ENABLED) {
return false;
}
if (empty($_SESSION['ACL'][$user_id][$category][$type][$action])) {
ACLAction::getUserActions($user_id, false);
}
if (!empty($_SESSION['ACL'][$user_id][$category][$type][$action])) {
return ACLAction::hasAccess($is_owner, $_SESSION['ACL'][$user_id][$category][$type][$action]['aclaccess']);
}
return false;
}
示例14: userHasAccess
/**
* static function userHasAccess($user_id, $category, $action, $is_owner = false)
*
* @param GUID $user_id the user id who you want to check access for
* @param STRING $category the category you would like to check access for
* @param STRING $action the action of that category you would like to check access for
* @param BOOLEAN OPTIONAL $is_owner if the object is owned by the user you are checking access for
*/
public static function userHasAccess($user_id, $category, $action, $type = 'module', $is_owner = false)
{
global $current_user;
//check if we don't have it set in the cache if not lets reload the cache
if (ACLAction::getUserAccessLevel($user_id, $category, 'access', $type) < ACL_ALLOW_ENABLED) {
return false;
}
if (empty(self::$acls[$user_id][$category][$type][$action])) {
ACLAction::getUserActions($user_id, false);
}
if (!empty(self::$acls[$user_id][$category][$type][$action])) {
if ($action == 'access' && self::$acls[$user_id][$category][$type][$action]['aclaccess'] == ACL_ALLOW_ENABLED) {
return true;
}
return ACLAction::hasAccess($is_owner, self::$acls[$user_id][$category][$type][$action]['aclaccess']);
}
return false;
}
示例15: processListNavigation
//.........这里部分代码省略.........
$start_URL = $this->base_URL . "0" . $dynamic_url;
$previous_URL = $this->base_URL . $previous_offset . $dynamic_url;
$next_URL = $this->base_URL . $next_offset . $dynamic_url;
$end_URL = $this->base_URL . '-100' . $dynamic_url;
if (!empty($this->start_link_wrapper)) {
$current_URL = $this->start_link_wrapper . $current_URL . $this->end_link_wrapper;
$start_URL = $this->start_link_wrapper . $start_URL . $this->end_link_wrapper;
$previous_URL = $this->start_link_wrapper . $previous_URL . $this->end_link_wrapper;
$next_URL = $this->start_link_wrapper . $next_URL . $this->end_link_wrapper;
$end_URL = $this->start_link_wrapper . $end_URL . $this->end_link_wrapper;
}
$moduleString = "{$currentModule}_{$html_varName}_offset";
if ($this->shouldProcess && !$this->multi_select_popup) {
// check the checkboxes onload
echo '<script>YAHOO.util.Event.addListener(window, "load", sListView.check_boxes);</script>';
$uids = empty($_REQUEST['uid']) || !empty($_REQUEST['massupdate']) && $_REQUEST['massupdate'] == 'true' ? '' : $_REQUEST['uid'];
echo "<textarea style='display: none' name='uid'>{$uids}</textarea>\n\t\t\t<input type='hidden' name='{$moduleString}' value='0'>";
}
$GLOBALS['log']->debug("Offsets: (start, previous, next, last)(0, {$previous_offset}, {$next_offset}, {$last_offset})");
if (0 == $current_offset) {
$start_link = get_image($image_path . "start_off", "alt='" . $this->local_app_strings['LNK_LIST_START'] . "' border='0' align='absmiddle'") . " " . $this->local_app_strings['LNK_LIST_START'];
$previous_link = get_image($image_path . "previous_off", "alt='" . $this->local_app_strings['LNK_LIST_PREVIOUS'] . "' border='0' align='absmiddle'") . " " . $this->local_app_strings['LNK_LIST_PREVIOUS'];
} else {
if ($this->multi_select_popup) {
// nav links for multiselect popup, submit form to save checks.
$start_link = "<a href=\"#\" onclick=\"javascript:save_checks(0, '{$moduleString}')\" class=\"listViewPaginationLinkS1\">" . get_image($image_path . "start", "alt='" . $this->local_app_strings['LNK_LIST_START'] . "' border='0' align='absmiddle'") . " " . $this->local_app_strings['LNK_LIST_START'] . "</a>";
$previous_link = "<a href=\"#\" onclick=\"javascript:save_checks({$previous_offset}, '{$moduleString}')\" class=\"listViewPaginationLinkS1\">" . get_image($image_path . "previous", "alt='" . $this->local_app_strings['LNK_LIST_PREVIOUS'] . "' border='0' align='absmiddle'") . " " . $this->local_app_strings['LNK_LIST_PREVIOUS'] . "</a>";
} elseif ($this->shouldProcess) {
// TODO: make popups / listview check saving the same
$start_link = "<a href=\"{$start_URL}\" onclick=\"javascript:return sListView.save_checks(0, '{$moduleString}')\" class=\"listViewPaginationLinkS1\">" . get_image($image_path . "start", "alt='" . $this->local_app_strings['LNK_LIST_START'] . "' border='0' align='absmiddle'") . " " . $this->local_app_strings['LNK_LIST_START'] . "</a>";
$previous_link = "<a href=\"{$previous_URL}\" onclick=\"javascript:return sListView.save_checks({$previous_offset}, '{$moduleString}')\" class=\"listViewPaginationLinkS1\">" . get_image($image_path . "previous", "alt='" . $this->local_app_strings['LNK_LIST_PREVIOUS'] . "' border='0' align='absmiddle'") . " " . $this->local_app_strings['LNK_LIST_PREVIOUS'] . "</a>";
} else {
$start_link = "<a href=\"{$start_URL}\" class=\"listViewPaginationLinkS1\">" . get_image($image_path . "start", "alt='" . $this->local_app_strings['LNK_LIST_START'] . "' border='0' align='absmiddle'") . " " . $this->local_app_strings['LNK_LIST_START'] . "</a>";
$previous_link = "<a href=\"{$previous_URL}\" class=\"listViewPaginationLinkS1\">" . get_image($image_path . "previous", "alt='" . $this->local_app_strings['LNK_LIST_PREVIOUS'] . "' border='0' align='absmiddle'") . " " . $this->local_app_strings['LNK_LIST_PREVIOUS'] . "</a>";
}
}
if ($last_offset <= $current_offset) {
$end_link = $this->local_app_strings['LNK_LIST_END'] . " " . get_image($image_path . "end_off", "alt='" . $this->local_app_strings['LNK_LIST_END'] . "' border='0' align='absmiddle'");
$next_link = $this->local_app_strings['LNK_LIST_NEXT'] . " " . get_image($image_path . "next_off", "alt='" . $this->local_app_strings['LNK_LIST_NEXT'] . "' border='0' align='absmiddle'");
} else {
if ($this->multi_select_popup) {
// nav links for multiselect popup, submit form to save checks.
$end_link = "<a href=\"#\" onclick=\"javascript:save_checks({$last_offset}, '{$moduleString}')\" class=\"listViewPaginationLinkS1\">" . $this->local_app_strings['LNK_LIST_END'] . " " . get_image($image_path . "end", "alt='" . $this->local_app_strings['LNK_LIST_END'] . "' border='0' align='absmiddle'") . "</a>";
if (!empty($sugar_config['disable_count_query'])) {
$end_link = '';
}
$next_link = "<a href=\"#\" onclick=\"javascript:save_checks({$next_offset}, '{$moduleString}')\" class=\"listViewPaginationLinkS1\">" . $this->local_app_strings['LNK_LIST_NEXT'] . " " . get_image($image_path . "next", "alt='" . $this->local_app_strings['LNK_LIST_NEXT'] . "' border='0' align='absmiddle'") . "</a>";
} elseif ($this->shouldProcess) {
$end_link = "<a href=\"{$end_URL}\" onclick=\"javascript:return sListView.save_checks({$last_offset}, '{$moduleString}')\" class=\"listViewPaginationLinkS1\">" . $this->local_app_strings['LNK_LIST_END'] . " " . get_image($image_path . "end", "alt='" . $this->local_app_strings['LNK_LIST_END'] . "' border='0' align='absmiddle'") . "</a>";
$next_link = "<a href=\"{$next_URL}\" onclick=\"javascript:return sListView.save_checks({$next_offset}, '{$moduleString}')\" class=\"listViewPaginationLinkS1\">" . $this->local_app_strings['LNK_LIST_NEXT'] . " " . get_image($image_path . "next", "alt='" . $this->local_app_strings['LNK_LIST_NEXT'] . "' border='0' align='absmiddle'") . "</a>";
} else {
$end_link = "<a href=\"{$end_URL}\" class=\"listViewPaginationLinkS1\">" . $this->local_app_strings['LNK_LIST_END'] . " " . get_image($image_path . "end", "alt='" . $this->local_app_strings['LNK_LIST_END'] . "' border='0' align='absmiddle'") . "</a>";
$next_link = "<a href=\"{$next_URL}\" class=\"listViewPaginationLinkS1\">" . $this->local_app_strings['LNK_LIST_NEXT'] . " " . get_image($image_path . "next", "alt='" . $this->local_app_strings['LNK_LIST_NEXT'] . "' border='0' align='absmiddle'") . "</a>";
}
}
$GLOBALS['log']->info("Offset (next, current, prev)({$next_offset}, {$current_offset}, {$previous_offset})");
$GLOBALS['log']->info("Start/end records ({$start_record}, {$end_record})");
$end_record = $end_record - 1;
// put overlib strings into functions to avoid backslash plague!
echo "<script> \n\t\t\tfunction export_overlib() {\n\t\t\t\treturn overlib('<a style=\\'width: 150px\\' class=\\'menuItem\\' onmouseover=\\'hiliteItem(this,\"yes\");\\' onmouseout=\\'unhiliteItem(this);\\' onclick=\\'return sListView.send_form(true, \"{$_REQUEST['module']}\", \"export.php\", \"{$this->local_app_strings['LBL_LISTVIEW_NO_SELECTED']}\")\\' href=\\'#\\'>{$this->local_app_strings['LBL_LISTVIEW_OPTION_SELECTED']}</a>" . "<a style=\\'width: 150px\\' class=\\'menuItem\\' onmouseover=\\'hiliteItem(this,\"yes\");\\' onmouseout=\\'unhiliteItem(this);\\' onclick=\\'return sListView.send_form(false, \"{$_REQUEST['module']}\", \"export.php\", \"{$this->local_app_strings['LBL_LISTVIEW_NO_SELECTED']}\")\\' href=\\'#\\'>{$this->local_app_strings['LBL_LISTVIEW_OPTION_CURRENT']}</a>" . "<a style=\\'width: 150px\\' class=\\'menuItem\\' onmouseover=\\'hiliteItem(this,\"yes\");\\' onmouseout=\\'unhiliteItem(this);\\' href=\\'export.php?module={$_REQUEST['module']}\\'>{$this->local_app_strings['LBL_LISTVIEW_OPTION_ENTIRE']}</a>" . "', CAPTION, '" . $this->local_app_strings['LBL_EXPORT'] . "', STICKY, MOUSEOFF, 3000, CLOSETEXT, '<img border=0 src=" . $this->local_image_path . "close_inline.gif>', WIDTH, 150, CLOSETITLE, '" . $this->local_app_strings['LBL_ADDITIONAL_DETAILS_CLOSE_TITLE'] . "', CLOSECLICK, FGCLASS, 'olOptionsFgClass', " . "CGCLASS, 'olOptionsCgClass', BGCLASS, 'olBgClass', TEXTFONTCLASS, 'olFontClass', CAPTIONFONTCLASS, 'olOptionsCapFontClass', CLOSEFONTCLASS, 'olOptionsCloseFontClass');\n\t\t\t}\n\t\t\t</script>";
$export_link = "<a id='export_link' onclick='return export_overlib();' href=\"#\" class=\"listViewPaginationLinkS1\">" . get_image($image_path . "export", "alt='" . $this->local_app_strings['LBL_EXPORT'] . "' border='0' align='absmiddle'") . " " . $this->local_app_strings['LBL_EXPORT'] . "</a>";
require_once "modules/Administration/Administration.php";
$admin = new Administration();
$admin->retrieveSettings('system');
$user_merge = $current_user->getPreference('mailmerge_on');
if ($user_merge == 'on' && isset($admin->settings['system_mailmerge_on']) && $admin->settings['system_mailmerge_on']) {
echo "<script>\n\t\t\t\tfunction mailmerge_overlib() {\n\t\t\t\t\treturn overlib('<a style=\\'width: 150px\\' class=\\'menuItem\\' onmouseover=\\'hiliteItem(this,\"yes\");\\' onmouseout=\\'unhiliteItem(this);\\' onclick=\\'return sListView.send_form(true, \"MailMerge\", \"index.php\", \"{$this->local_app_strings['LBL_LISTVIEW_NO_SELECTED']}\")\\' href=\\'#\\'>{$this->local_app_strings['LBL_LISTVIEW_OPTION_SELECTED']}</a>" . "<a style=\\'width: 150px\\' class=\\'menuItem\\' onmouseover=\\'hiliteItem(this,\"yes\");\\' onmouseout=\\'unhiliteItem(this);\\' href=\\'index.php?action=index&module=MailMerge\\'>{$this->local_app_strings['LBL_LISTVIEW_OPTION_CURRENT']}</a>" . "<a style=\\'width: 150px\\' class=\\'menuItem\\' onmouseover=\\'hiliteItem(this,\"yes\");\\' onmouseout=\\'unhiliteItem(this);\\' href=\\'index.php?action=index&module=MailMerge&entire=true\\'>{$this->local_app_strings['LBL_LISTVIEW_OPTION_ENTIRE']}</a>" . "', CAPTION, '" . $this->local_app_strings['LBL_MAILMERGE'] . "', STICKY, MOUSEOFF, 3000, CLOSETEXT, '<img border=0 src=" . $this->local_image_path . "close_inline.gif>', WIDTH, 150, CLOSETITLE, '" . $this->local_app_strings['LBL_ADDITIONAL_DETAILS_CLOSE_TITLE'] . "', CLOSECLICK, FGCLASS, 'olOptionsFgClass', " . "CGCLASS, 'olOptionsCgClass', BGCLASS, 'olBgClass', TEXTFONTCLASS, 'olFontClass', CAPTIONFONTCLASS, 'olOptionsCapFontClass', CLOSEFONTCLASS, 'olCloseFontClass');\n\t\t\t\t}\t\t\t\t\n\t\t\t</script>";
$merge_link = " | <a id='mailmerge_link' onclick='return mailmerge_overlib()'; href=\"#\" class=\"listViewPaginationLinkS1\">" . $this->local_app_strings['LBL_MAILMERGE'] . "</a>";
} else {
$merge_link = " ";
}
$selected_objects_span = " | {$this->local_app_strings['LBL_LISTVIEW_SELECTED_OBJECTS']}<input class='listViewPaginationTdS1' style='border: 0px; background: transparent; font-size: inherit; color: inherit' type='text' readonly name='selectCount[]' value='0' />";
if ($_REQUEST['module'] == 'Home' || $this->local_current_module == 'Import' || $this->show_export_button == false || !empty($sugar_config['disable_export']) || !empty($sugar_config['admin_export_only']) && !(is_admin($current_user) || ACLController::moduleSupportsACL($_REQUEST['module']) && ACLAction::getUserAccessLevel($current_user->id, $_REQUEST['module'], 'access') == ACL_ALLOW_ENABLED && ACLAction::getUserAccessLevel($current_user->id, $_REQUEST['module'], 'admin') == ACL_ALLOW_ADMIN)) {
$selected_objects_span = '';
$export_link = " ";
$merge_link = " ";
} else {
if ($_REQUEST['module'] != "Accounts" && $_REQUEST['module'] != "Cases" && $_REQUEST['module'] != "Contacts" && $_REQUEST['module'] != "Leads" && $_REQUEST['module'] != "Opportunities") {
$merge_link = " ";
}
}
if ($this->show_paging == true) {
if (!empty($sugar_config['disable_count_query'])) {
if ($row_count > $end_record) {
$row_count .= '+';
}
}
$html_text = '';
$html_text .= "<tr>\n";
$html_text .= "<td COLSPAN=\"20\" align=\"right\">\n";
$html_text .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"><tr><td align=\"left\" class=\"listViewPaginationTdS1\">{$export_link}{$merge_link}{$selected_objects_span}</td>\n";
$html_text .= "<td nowrap align=\"right\" class=\"listViewPaginationTdS1\" id='listViewPaginationButtons'>" . $start_link . " " . $previous_link . " <span class='pageNumbers'>(" . $start_record . " - " . $end_record . " " . $this->local_app_strings['LBL_LIST_OF'] . " " . $row_count . ")</span> " . $next_link . " " . $end_link . "</td></tr></table>\n";
$html_text .= "</td>\n";
$html_text .= "</tr>\n";
$this->xTemplate->assign("PAGINATION", $html_text);
}
$_SESSION['export_where'] = $this->query_where;
$this->xTemplate->parse($xtemplateSection . ".list_nav_row");
}
}