function display() { global $current_user, $app_strings, $mod_strings; $admin = is_admin($current_user) || is_admin_for_module($current_user, 'Reports'); foreach ($this->data['data'] as $i => $rowData) { if (isset($this->data['data'][$i]['IS_PUBLISHED'])) { $this->data['data'][$i]['IS_PUBLISHED'] = "<input type='checkbox' "; if ($rowData['IS_PUBLISHED'] == 'yes') { $this->data['data'][$i]['IS_PUBLISHED'] .= ' checked '; } if ($admin) { $this->data['data'][$i]['IS_PUBLISHED'] .= " onclick='location.href=\"index.php?module=Reports&action=index&publish=no&publish_report_id={$rowData['ID']}\";'>"; } else { $this->data['data'][$i]['IS_PUBLISHED'] .= ' disabled=true>'; } } if (isset($this->data['data'][$i]['IS_SCHEDULED'])) { $this->data['data'][$i]['IS_SCHEDULED'] = "<a href='#' onclick=\"schedulePOPUP('{$rowData['ID']}'); return false\" class='listViewTdToolsS1'>{$rowData['IS_SCHEDULED_IMG']} {$rowData['IS_SCHEDULED']}</a>"; } if (!isset($this->data['data'][$i]['IS_EDIT'])) { if ($this->data['data'][$i]['ASSIGNED_USER_ID'] != $current_user->id || !ACLController::checkAccess('Reports', 'edit', $this->data['data'][$i]['ASSIGNED_USER_ID'])) { $this->data['data'][$i]['IS_EDIT'] = " "; } else { $this->data['data'][$i]['IS_EDIT'] = "<a title=\"{$app_strings['LBL_EDIT_BUTTON']}\" href=\"index.php?action=ReportsWizard&module=Reports&page=report&record={$rowData['ID']}\">" . SugarThemeRegistry::current()->getImage("edit_inline", '', null, null, ".gif", $mod_strings['LBL_EDIT']) . "</a>"; } } } $this->ss->assign('act', 'ReportsWizard'); return parent::display(); }
/** * @see SugarController::loadBean() */ public function loadBean() { global $mod_strings; if (!isset($_REQUEST['import_module'])) { return; // there is no module to load } $this->importModule = $_REQUEST['import_module']; $this->bean = BeanFactory::getBean($this->importModule); if ($this->bean) { if (!$this->bean->importable) { $this->bean = false; } elseif ($_REQUEST['import_module'] == 'Users' && !is_admin($GLOBALS['current_user'])) { $this->bean = false; } elseif ($this->bean->bean_implements('ACL')) { if (!ACLController::checkAccess($this->bean->module_dir, 'import', true)) { ACLController::displayNoAccess(); sugar_die(''); } } } if (!$this->bean && $this->importModule != "Administration") { $_REQUEST['message'] = $mod_strings['LBL_ERROR_IMPORTS_NOT_SET_UP']; $this->view = 'error'; if (!isset($_REQUEST['import_map_id']) && !isset($_REQUEST['delete_map_id'])) { $this->_processed = true; } } else { $GLOBALS['FOCUS'] = $this->bean; } }
function display($defines) { if (ACLController::moduleSupportsACL($defines['module']) && !ACLController::checkAccess($defines['module'], 'edit', true)) { $temp = ''; return $temp; } global $app_strings; global $mod_strings; global $currentModule; $title = $app_strings['LBL_TRACK_EMAIL_BUTTON_TITLE']; $accesskey = $app_strings['LBL_TRACK_EMAIL_BUTTON_KEY']; $value = $app_strings['LBL_TRACK_EMAIL_BUTTON_LABEL']; $this->module = 'Emails'; $additionalFormFields = array(); $additionalFormFields['type'] = 'archived'; // cn: bug 5727 - must override the parents' parent for contacts (which could be an Account) $additionalFormFields['parent_type'] = $defines['focus']->module_dir; $additionalFormFields['parent_id'] = $defines['focus']->id; $additionalFormFields['parent_name'] = $defines['focus']->name; if (isset($defines['focus']->email1)) { $additionalFormFields['to_email_addrs'] = $defines['focus']->email1; } if (ACLController::moduleSupportsACL($defines['module']) && !ACLController::checkAccess($defines['module'], 'edit', true)) { $button = "<input title='{$title}' class='button' type='button' name='button' value=' {$value} ' disabled/>\n"; return $button; } $button = $this->_get_form($defines, $additionalFormFields); $button .= "<input title='{$title}' accesskey='{$accesskey}' class='button' type='submit' name='button' value=' {$value} '/>\n"; $button .= "</form>"; return $button; }
function display() { ob_start(); if (isset($GLOBALS['cal_strings'])) { return parent::display() . "Only one Calendar dashlet is allowed."; } require_once 'modules/Calendar/Calendar.php'; require_once 'modules/Calendar/CalendarDisplay.php'; require_once "modules/Calendar/CalendarGrid.php"; global $cal_strings, $current_language; $cal_strings = return_module_language($current_language, 'Calendar'); if (!ACLController::checkAccess('Calendar', 'list', true)) { ACLController::displayNoAccess(true); } $cal = new Calendar($this->view); $cal->dashlet = true; $cal->add_activities($GLOBALS['current_user']); $cal->load_activities(); $display = new CalendarDisplay($cal, $this->id); $display->display_calendar_header(false); $display->display(); $str = ob_get_contents(); ob_end_clean(); return parent::display() . $str; }
public function preDisplay() { if (!$this->bean->ACLAccess('edit')) { ACLController::displayNoAccess(); sugar_die(''); } }
function display($defines) { global $app_strings; global $currentModule; $title = $app_strings['LBL_COMPOSE_EMAIL_BUTTON_TITLE']; $accesskey = $app_strings['LBL_COMPOSE_EMAIL_BUTTON_KEY']; $value = $app_strings['LBL_COMPOSE_EMAIL_BUTTON_LABEL']; $this->module = 'Emails'; $to_addrs = ''; $additionalFormFields = array(); $additionalFormFields['type'] = 'out'; // cn: bug 5727 - must override the parents' parent for contacts (which could be an Account) $additionalFormFields['parent_type'] = $defines['focus']->module_dir; $additionalFormFields['parent_id'] = $defines['focus']->id; $additionalFormFields['parent_name'] = $defines['focus']->name; if (isset($defines['focus']->email1)) { $to_addrs = $defines['focus']->email1; } elseif ($defines['focus']->object_name == 'Case') { require_once 'modules/Accounts/Account.php'; $acct = new Account(); $acct->retrieve($defines['focus']->account_id); $to_addrs = $acct->email1; } if (!empty($to_addrs)) { $additionalFormFields['to_email_addrs'] = $to_addrs; } if (ACLController::moduleSupportsACL($defines['module']) && !ACLController::checkAccess($defines['module'], 'edit', true)) { $button = "<input title='{$title}' class='button' type='button' name='button' value=' {$value} '/>\n"; return $button; } $button = $this->_get_form($defines, $additionalFormFields); $button .= "<input title='{$title}' accesskey='{$accesskey}' class='button' type='submit' name='button' value=' {$value} '/>\n"; $button .= "</form>"; return $button; }
/** * Create HTML form to enter a new record with the minimum necessary fields. * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc. * All Rights Reserved. * Contributor(s): ______________________________________.. */ function get_new_record_form() { if (!ACLController::checkAccess('Tasks', 'edit', true)) { return ''; } require_once 'include/time.php'; global $app_strings, $mod_strings, $app_list_strings; global $current_user; global $theme; // Unimplemented until jscalendar language files are fixed // global $current_language; // global $default_language; // global $cal_codes; $user_id = $current_user->id; $default_status = $mod_strings['LBL_DEFAULT_STATUS']; $default_priority = $mod_strings['LBL_DEFAULT_PRIORITY']; $default_parent_type = $app_list_strings['record_type_default_key']; // Unimplemented until jscalendar language files are fixed // $cal_lang = (empty($cal_codes[$current_language])) ? $cal_codes[$default_language] : $cal_codes[$current_language]; $cal_lang = "en"; $cal_dateformat = parse_calendardate($app_strings['NTC_DATE_FORMAT']); $ntc_time_format = '(' . getDisplayTimeFormat() . ')'; $ampm = AMPMMenu('', ''); $the_form = get_left_form_header($mod_strings['LBL_NEW_FORM_TITLE']); $the_form .= <<<EOQ \t\t<form name="TaskSave" onSubmit="return check_form('TaskSave')" method="POST" action="index.php"> \t\t\t<input type="hidden" name="module" value="Tasks"> \t\t\t<input type="hidden" name="record" value=""> \t\t\t<input type="hidden" name="status" value="{$default_status}"> \t\t\t<input type="hidden" name="assigned_user_id" value='{$user_id}'> \t\t\t<input type="hidden" name="priority" value="{$default_priority}"> \t\t\t<input type="hidden" name="parent_type" value="{$default_parent_type}"> \t\t\t<input type="hidden" name="action" value="Save"> \t\t\t<input type="hidden" name="date_due_flag"> \t\t<p>{$mod_strings['LBL_NEW_FORM_SUBJECT']} <span class="required">{$app_strings['LBL_REQUIRED_SYMBOL']}</span><br> \t\t<input name='name' type="text" value=""><br> \t\t{$mod_strings['LBL_NEW_FORM_DUE_DATE']} <span class="dateFormat">{$app_strings['NTC_DATE_FORMAT']}</span><br> \t\t<input name='date_due' maxlength="10" onblur="parseDate(this, '{$cal_dateformat}');" id='jscal_field' type="text" value=""> <img src="themes/{$theme}/images/jscalendar.gif" alt="{$app_strings['LBL_ENTER_DATE']}" id="jscal_trigger" align="absmiddle"><br> \t\t{$mod_strings['LBL_NEW_FORM_DUE_TIME']} <span class="dateFormat">{$ntc_time_format}</span><br> \t\t<input name='time_due' maxlength='5' type="text"> {$ampm}</p> \t\t<p><input title="{$app_strings['LBL_SAVE_BUTTON_TITLE']}" accessKey="{$app_strings['LBL_SAVE_BUTTON_KEY']}" class="button" type="submit" name="button" value="{$app_strings['LBL_SAVE_BUTTON_LABEL']}" ></p> \t\t</form> \t\t<script type="text/javascript"> \t\tCalendar.setup ({ \t\t\tinputField : "jscal_field", ifFormat : "{$cal_dateformat}", showsTime : false, button : "jscal_trigger", singleClick : true, step : 1 \t\t}); \t\t</script> EOQ; require_once 'include/javascript/javascript.php'; require_once 'modules/Tasks/Task.php'; $javascript = new javascript(); $javascript->setFormName('TaskSave'); $javascript->setSugarBean(new Task()); $javascript->addRequiredFields(''); $javascript->addField('date_due', false, ''); $javascript->addField('time_due', false, ''); $the_form .= $javascript->getScript(); $the_form .= get_left_form_footer(); return $the_form; }
/** * display * Override the display method to support customization for the buttons that display * a popup and allow you to copy the account's address into the selected contacts. * The custom_code_billing and custom_code_shipping Smarty variables are found in * include/SugarFields/Fields/Address/DetailView.tpl (default). If it's a English U.S. * locale then it'll use file include/SugarFields/Fields/Address/en_us.DetailView.tpl. */ function display() { if (empty($this->bean->id)) { global $app_strings; sugar_die($app_strings['ERROR_NO_RECORD']); } require_once 'modules/AOS_PDF_Templates/formLetter.php'; formLetter::DVPopupHtml('Accounts'); $this->dv->process(); global $mod_strings; if (ACLController::checkAccess('Contacts', 'edit', true)) { $push_billing = '<input class="button" title="' . $mod_strings['LBL_PUSH_CONTACTS_BUTTON_LABEL'] . '" type="button" onclick=\'open_contact_popup("Contacts", 600, 600, "&account_name=' . $this->bean->name . '&html=change_address' . '&primary_address_street=' . str_replace(array("\rn", "\r", "\n"), array('', '', '<br>'), urlencode($this->bean->billing_address_street)) . '&primary_address_city=' . $this->bean->billing_address_city . '&primary_address_state=' . $this->bean->billing_address_state . '&primary_address_postalcode=' . $this->bean->billing_address_postalcode . '&primary_address_country=' . $this->bean->billing_address_country . '", true, false);\' value="' . $mod_strings['LBL_PUSH_CONTACTS_BUTTON_TITLE'] . '">'; $push_shipping = '<input class="button" title="' . $mod_strings['LBL_PUSH_CONTACTS_BUTTON_LABEL'] . '" type="button" onclick=\'open_contact_popup("Contacts", 600, 600, "&account_name=' . $this->bean->name . '&html=change_address' . '&primary_address_street=' . str_replace(array("\rn", "\r", "\n"), array('', '', '<br>'), urlencode($this->bean->shipping_address_street)) . '&primary_address_city=' . $this->bean->shipping_address_city . '&primary_address_state=' . $this->bean->shipping_address_state . '&primary_address_postalcode=' . $this->bean->shipping_address_postalcode . '&primary_address_country=' . $this->bean->shipping_address_country . '", true, false);\' value="' . $mod_strings['LBL_PUSH_CONTACTS_BUTTON_TITLE'] . '">'; } else { $push_billing = ''; $push_shipping = ''; } $this->ss->assign("custom_code_billing", $push_billing); $this->ss->assign("custom_code_shipping", $push_shipping); if (empty($this->bean->id)) { global $app_strings; sugar_die($app_strings['ERROR_NO_RECORD']); } echo $this->dv->display(); }
function get_system_tabs() { global $moduleList; static $system_tabs_result = null; // if the value is not already cached, then retrieve it. if (empty($system_tabs_result)) { $administration = new Administration(); $administration->retrieveSettings('MySettings'); if (isset($administration->settings) && isset($administration->settings['MySettings_tab'])) { $tabs = $administration->settings['MySettings_tab']; $trimmed_tabs = trim($tabs); //make sure serialized string is not empty if (!empty($trimmed_tabs)) { $tabs = base64_decode($tabs); $tabs = unserialize($tabs); //Ensure modules saved in the prefences exist. foreach ($tabs as $id => $tab) { if (!in_array($tab, $moduleList)) { unset($tabs[$id]); } } ACLController::filterModuleList($tabs); $tabs = $this->get_key_array($tabs); $system_tabs_result = $tabs; } else { $system_tabs_result = $this->get_key_array($moduleList); } } else { $system_tabs_result = $this->get_key_array($moduleList); } } return $system_tabs_result; }
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"); }
public function preDisplay() { parent::preDisplay(); if (ACLController::checkAccess('KBDocuments', 'edit', true)) { array_push($this->dv->defs['templateMeta']['form']['buttons'], array('customCode' => '<input title="{$MOD.LBL_CREATE_KB_DOCUMENT}" accessKey="M" class="button" onclick="this.form.return_module.value=\'Cases\'; this.form.return_action.value=\'DetailView\';this.form.action.value=\'EditView\';this.form.module.value=\'KBDocuments\';" type="submit" name="button" value="{$MOD.LBL_CREATE_KB_DOCUMENT}">', 'sugar_html' => array('type' => 'submit', 'value' => '{$MOD.LBL_CREATE_KB_DOCUMENT}', 'htmlOptions' => array('title' => '{$MOD.LBL_CREATE_KB_DOCUMENT}', 'accessKey' => 'M', 'class' => 'button', 'onclick' => 'this.form.return_module.value=\'Cases\'; this.form.return_action.value=\'DetailView\';this.form.action.value=\'EditView\';this.form.module.value=\'KBDocuments\';', 'name' => 'button')))); } $this->dv->th->deleteTemplate($this->dv->module, $this->dv->view); }
/** * Create HTML form to enter a new record with the minimum necessary fields. * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc. * All Rights Reserved. * Contributor(s): ______________________________________.. */ function get_new_record_form() { if (!ACLController::checkAccess('Bugs', 'edit', true)) { return ''; } global $mod_strings; global $app_strings; global $app_list_strings; global $mod_strings; global $theme; global $current_user; $seedRelease = new Release(); $lbl_required_symbol = $app_strings['LBL_REQUIRED_SYMBOL']; $lbl_default_status = $app_list_strings['bug_status_default_key']; $lbl_subject = $mod_strings['LBL_SUBJECT']; $lbl_save_button_title = $app_strings['LBL_SAVE_BUTTON_TITLE']; $lbl_save_button_key = $app_strings['LBL_SAVE_BUTTON_KEY']; $lbl_save_button_label = $app_strings['LBL_SAVE_BUTTON_LABEL']; $user_id = $current_user->id; $priority_options = get_select_options_with_id($app_list_strings['bug_priority_dom'], $app_list_strings['bug_priority_default_key']); $release_options = get_select_options_with_id($seedRelease->get_releases(TRUE, "Active"), ""); $type_options = get_select_options_with_id($app_list_strings['bug_type_dom'], $app_list_strings['bug_type_default_key']); $the_form = get_left_form_header($mod_strings['LBL_NEW_FORM_TITLE']); $the_form .= <<<EOQ \t\t<form name="BugSave" onSubmit="return check_form('BugSave')" method="POST" action="index.php"> \t\t\t<input type="hidden" name="module" value="Bugs"> \t\t\t<input type="hidden" name="record" value=""> \t\t\t<input type="hidden" name="status" value="{$lbl_default_status}"> \t\t\t<input type="hidden" name="assigned_user_id" value='{$user_id}'> \t\t\t<input type="hidden" name="action" value="Save"> \t\t{$lbl_subject} <span class="required">{$lbl_required_symbol}</span><br> \t\t<p><input name='name' type="text" size='20' maxlength="255"value=""><br> \t\t{$mod_strings['LBL_TYPE']} <br> \t\t<select name='type' >{$type_options}</select><br> \t\t{$mod_strings['LBL_RELEASE']} <br> \t\t<select name='found_in_release' >{$release_options}</select><br> \t\t{$mod_strings['LBL_PRIORITY']} <br> \t\t<select name='priority' >{$priority_options}</select> </p><p>\t\t<input title="{$lbl_save_button_title}" accessKey="{$lbl_save_button_key}" class="button" type="submit" name="button" value=" {$lbl_save_button_label} " ></p> \t\t</form> EOQ; require_once 'include/javascript/javascript.php'; require_once 'modules/Bugs/Bug.php'; $javascript = new javascript(); $javascript->setFormName('BugSave'); $javascript->setSugarBean(new Bug()); $javascript->addRequiredFields(''); $the_form .= $javascript->getScript(); $the_form .= get_left_form_footer(); return $the_form; }
public function addSseVisibilityFilter($engine, $filter) { if ($this->bean->bean_implements('ACL') && ACLController::requireOwner($this->bean->module_dir, 'list')) { if ($engine instanceof SugarSearchEngineElastic) { $filter->addMust($engine->getOwnerTermFilter()); } } return $filter; }
public function preDisplay() { // Add by Thanh Le At 27/06/2012 // ViewConvertLead::convertToCustomer(); // End if (!$this->bean->ACLAccess('edit')) { ACLController::displayNoAccess(); sugar_die(''); } }
function display() { $this->bean->password = empty($this->bean->password) ? '' : EAPM::$passwordPlaceholder; $this->ss->assign('return_id', $this->_returnId); if ($GLOBALS['current_user']->is_admin || empty($this->bean) || empty($this->bean->id) || $this->bean->isOwner($GLOBALS['current_user']->id)) { parent::display(); } else { ACLController::displayNoAccess(); } }
public function checkAccess($thisReport) { global $current_user; require_once 'modules/ACL/ACLController.php'; if (ACLController::checkAccess('KReports', 'export', false)) { return true; } else { return false; } }
function buildExportLink($id = 'export_link') { $script = ""; if (ACLController::checkAccess($this->seed->module_dir, 'export', true)) { if ($this->export) { $script = parent::buildExportLink($id); } } return $script . formLetter::LVSmarty(); }
/** * Extends SugarBean::listviewACLHelper * * @return array */ public function listviewACLHelper() { $array_assign = parent::listviewACLHelper(); $is_owner = false; if (!ACLController::moduleSupportsACL('Accounts') || ACLController::checkAccess('Accounts', 'view', $is_owner)) { $array_assign['ACCOUNT'] = 'a'; } else { $array_assign['ACCOUNT'] = 'span'; } return $array_assign; }
function checkDashletDisplay() { if (!in_array($this->type, $GLOBALS['moduleList']) && !in_array($this->type, $GLOBALS['modInvisList']) && (!in_array('Activities', $GLOBALS['moduleList']) || !in_array($this->type, $GLOBALS['modInvisListActivities']))) { $displayDashlet = false; } elseif (ACLController::moduleSupportsACL($this->type) && !ACLController::checkAccess($this->type, 'list', true)) { $displayDashlet = false; } else { $displayDashlet = true; } return $displayDashlet; }
function preDisplay() { $this->sugarpdfBean = SugarpdfFactory::loadSugarpdf($this->sugarpdf, $this->module, $this->bean, $this->view_object_map); // ACL control if (!empty($this->bean) && !$this->bean->ACLAccess($this->sugarpdfBean->aclAction)) { ACLController::displayNoAccess(true); sugar_cleanup(true); } if (isset($this->errors)) { $this->sugarpdfBean->errors = $this->errors; } }
/** * adds a menu item to the current contextMenu * * @param string $text text of the item * @param string $action function or pointer to the javascript function to call * @param array $params other parameters includes: * url - The URL for the MenuItem's anchor's "href" attribute. * target - The value to be used for the MenuItem's anchor's "target" attribute. * helptext - Additional instructional text to accompany the text for a MenuItem. Example: If the text is * "Copy" you might want to add the help text "Ctrl + C" to inform the user there is a keyboard * shortcut for the item. * emphasis - If set to true the text for the MenuItem will be rendered with emphasis (using <em>). * strongemphasis - If set to true the text for the MenuItem will be rendered with strong emphasis (using <strong>). * disabled - If set to true the MenuItem will be dimmed and will not respond to user input or fire events. * selected - If set to true the MenuItem will be highlighted. * submenu - Appends / removes a menu (and it's associated DOM elements) to / from the MenuItem. * checked - If set to true the MenuItem will be rendered with a checkmark. */ function addMenuItem($text, $action, $module = null, $aclAction = null, $params = null) { // check ACLs if module and aclAction set otherwise no ACL check if (!empty($module) && !empty($aclAction) && ACLController::checkAccess($module, $aclAction) || (empty($module) || empty($aclAction))) { $item = array('text' => translate($text), 'action' => $action); foreach (array('url', 'target', 'helptext', 'emphasis', 'strongemphasis', 'disabled', 'selected', 'submenu', 'checked') as $param) { if (!empty($params[$param])) { $item[$param] = $params[$param]; } } array_push($this->menuItems, $item); } }
function buildExportLink($id = 'export_link') { global $app_strings; global $sugar_config; $script = ""; if (ACLController::checkAccess($this->seed->module_dir, 'export', true)) { if ($this->export) { $script = parent::buildExportLink($id); } } $script .= "<a href='javascript:void(0)' id='map_listview_top' " . " onclick=\"return sListView.send_form(true, 'jjwg_Maps', " . "'index.php?entryPoint=jjwg_Maps&display_module={$_REQUEST['module']}', " . "'{$app_strings['LBL_LISTVIEW_NO_SELECTED']}')\">{$app_strings['LBL_MAP']}</a>"; return formLetter::LVSmarty() . $script; }
function displayList(&$layout_def) { $module = ''; $record = ''; if (isset($layout_def['varname'])) { $key = strtoupper($layout_def['varname']); } else { $key = $this->_get_column_alias($layout_def); $key = strtoupper($key); } if (empty($layout_def['fields'][$key])) { return ""; } else { $value = $layout_def['fields'][$key]; } if (empty($layout_def['target_record_key'])) { $record = $layout_def['fields']['ID']; } else { $record_key = strtoupper($layout_def['target_record_key']); $record = $layout_def['fields'][$record_key]; } if (!empty($layout_def['target_module_key'])) { if (!empty($layout_def['fields'][strtoupper($layout_def['target_module_key'])])) { $module = $layout_def['fields'][strtoupper($layout_def['target_module_key'])]; } } if (empty($module)) { if (empty($layout_def['target_module'])) { $module = $layout_def['module']; } else { $module = $layout_def['target_module']; } } $action = 'DetailView'; $value = $layout_def['fields'][$key]; global $current_user; if (isset($layout_def['custom']) && $layout_def['custom'] == true && $key == "BEAN_NAME") { $productlog = new ProductLog(); $productlog->retrieve($layout_def['fields']['ID']); $module = $productlog->bean_name; if ($productlog->bean_name == 'Quote') { $module = 'Quotes'; } $record = $layout_def['fields']['BEAN_ID']; return '<a href="index.php?module=' . $module . '&action=' . $action . '&record=' . $record . '" class="listViewTdLinkS1">' . "{$value}</a>"; } elseif ($layout_def['DetailView'] && !$layout_def['owner_module'] || $layout_def['DetailView'] && !ACLController::moduleSupportsACL($layout_def['owner_module']) || ACLController::checkAccess($layout_def['owner_module'], 'view', $layout_def['owner_id'] == $current_user->id)) { return '<a href="index.php?module=' . $module . '&action=' . $action . '&record=' . $record . '" class="listViewTdLinkS1">' . "{$value}</a>"; } else { return $value; } }
/** * @see SugarView::display() */ public function display() { if ($this->bean instanceof SugarBean && isset($this->view_object_map['remap_action']) && !$this->bean->ACLAccess($this->view_object_map['remap_action'])) { ACLController::displayNoAccess(true); return false; } // Call SugarController::getActionFilename to handle case sensitive file names $file = SugarController::getActionFilename($this->action); $classic_file = SugarAutoLoader::existingCustomOne('modules/' . $this->module . '/' . $file . '.php'); if ($classic_file) { $this->includeClassicFile($classic_file); return true; } return false; }
protected function action_delete() { global $current_user; //do any pre delete processing //if there is some custom logic for deletion. if (!empty($_REQUEST['record'])) { if (!is_admin($current_user) && $this->bean->assigned_user_id != $current_user->id) { ACLController::displayNoAccess(true); sugar_cleanup(true); } $this->bean->mark_deleted($_REQUEST['record']); } else { sugar_die("A record number must be specified to delete"); } }
function checkDashletDisplay() { if (!in_array($this->type, $GLOBALS['moduleList']) && !in_array($this->type, $GLOBALS['modInvisList']) && !in_array('Activities', $GLOBALS['moduleList'])) { $displayDashlet = false; } elseif (ACLController::moduleSupportsACL($this->type)) { $bean = SugarModule::get($this->type)->loadBean(); if (!ACLController::checkAccess($this->type, 'list', true, $bean->acltype)) { $displayDashlet = false; } $displayDashlet = true; } else { $displayDashlet = true; } return $displayDashlet; }
function getDropDownDiv($tpl = 'modules/Home/UnifiedSearchAdvanced.tpl') { global $app_list_strings; if (!file_exists('cache/modules/unified_search_modules.php')) { $this->buildCache(); } include 'cache/modules/unified_search_modules.php'; global $mod_strings, $modListHeader, $app_list_strings, $current_user, $app_strings, $image_path, $beanList; $users_modules = $current_user->getPreference('globalSearch', 'search'); if (!isset($users_modules)) { // preferences are empty, select all $users_modules = array(); foreach ($unified_search_modules as $module => $data) { $users_modules[$module] = $beanList[$module]; } $current_user->setPreference('globalSearch', $users_modules, 0, 'search'); } $sugar_smarty = new Sugar_Smarty(); $modules_to_search = array(); foreach ($unified_search_modules as $module => $data) { if (array_key_exists($module, $modListHeader)) { if (ACLController::checkAccess($module, 'list')) { $modules_to_search[$module] = array('translated' => $app_list_strings['moduleList'][$module]); if (array_key_exists($module, $users_modules)) { $modules_to_search[$module]['checked'] = true; } else { $modules_to_search[$module]['checked'] = false; } } } } if (!empty($_REQUEST['query_string'])) { $sugar_smarty->assign('query_string', $_REQUEST['query_string']); } else { $sugar_smarty->assign('query_string', ''); } $sugar_smarty->assign('IMAGE_PATH', $image_path); if (file_exists($image_path . 'searchButton.gif')) { $sugar_smarty->assign('USE_SEARCH_GIF', 1); $sugar_smarty->assign('LBL_SEARCH_BUTTON_LABEL', $app_strings['LBL_SEARCH_BUTTON_LABEL']); } else { $sugar_smarty->assign('USE_SEARCH_GIF', 0); $sugar_smarty->assign('LBL_SEARCH_BUTTON_LABEL', $app_strings['LBL_GO_BUTTON_LABEL']); } $sugar_smarty->assign('MODULES_TO_SEARCH', $modules_to_search); $sugar_smarty->debugging = true; return $sugar_smarty->fetch($tpl); }
function display(&$widget_data) { /* * i.dymovsky * Because when user role can't edit Accounts, it also can't edit Membership Organizations. Select button leads to change MO list * See bug 25633 * Bug25633 code change start */ if (!ACLController::checkAccess($widget_data["module"], "edit", true)) { return; } /* * Bug25633 code change end */ return parent::display($widget_data); }
function displayList(&$layout_def) { $module = 'Supplies'; $record = ''; if (isset($layout_def['varname'])) { $key = strtoupper($layout_def['varname']); } else { $key = $this->_get_column_alias($layout_def); $key = strtoupper($key); } if (empty($layout_def['fields'][$key])) { return ""; } else { $value = $layout_def['fields'][$key]; } if (empty($layout_def['target_record_key'])) { $record = $layout_def['fields']['SUPPLYID']; } else { $record_key = strtoupper($layout_def['target_record_key']); $record = $layout_def['fields'][$record_key]; } /*if(!empty($layout_def['target_module_key'])) { if (!empty($layout_def['fields'][strtoupper($layout_def['target_module_key'])])) { $module=$layout_def['fields'][strtoupper($layout_def['target_module_key'])]; } } */ /*if (empty($module)) { if(empty($layout_def['target_module'])) { $module = $layout_def['module']; } else { $module = $layout_def['target_module']; } }*/ $action = 'DetailView'; $value = $layout_def['fields'][$key]; global $current_user; if ($layout_def['DetailView'] && !$layout_def['owner_module'] || $layout_def['DetailView'] && !ACLController::moduleSupportsACL($layout_def['owner_module']) || ACLController::checkAccess($layout_def['owner_module'], 'view', $layout_def['owner_id'] == $current_user->id)) { return '<a href="index.php?module=' . $module . '&action=' . $action . '&record=' . $record . '" class="listViewTdLinkS1">' . "{$value}</a>"; } else { return $value; } }
protected function action_removeAllRecurrences() { if (!empty($this->bean->repeat_parent_id)) { $id = $this->bean->repeat_parent_id; $this->bean->retrieve($id); } else { $id = $this->bean->id; } if (!$this->bean->ACLAccess('Delete')) { ACLController::displayNoAccess(true); sugar_cleanup(true); } require_once "modules/Calendar/CalendarUtils.php"; CalendarUtils::markRepeatDeleted($this->bean); $this->bean->mark_deleted($id); header("Location: index.php?module=Meetings"); }