setReturnId(); parent::__construct(); } protected function setReturnId() { $returnId = $GLOBALS['current_user']->id; if(!empty($_REQUEST['user_id']) && !empty($_REQUEST['return_module']) && 'Users' == $_REQUEST['return_module']){ $returnId = $_REQUEST['user_id']; } $this->_returnId = $returnId; } protected function _getModuleTab() { return 'Users'; } /** * @see SugarView::_getModuleTitleParams() */ protected function _getModuleTitleParams($browserTitle = false) { global $mod_strings; $returnAction = 'DetailView'; $returnModule = 'Users'; $returnId = $GLOBALS['current_user']->id; $returnName = $GLOBALS['current_user']->full_name; if(!empty($_REQUEST['return_action']) && !empty($_REQUEST['return_module'])){ if('Users' == $_REQUEST['return_module']){ if('EditView' == $_REQUEST['return_action']){ $returnAction = 'EditView'; } if(!empty($_REQUEST['return_name'])){ $returnName = $_REQUEST['return_name']; } if(!empty($_REQUEST['user_id'])){ $returnId = $_REQUEST['user_id']; } } } $this->_returnId = $returnId; $iconPath = $this->getModuleTitleIconPath($this->module); $params = array(); if (!empty($iconPath) && !$browserTitle) { $params[] = "".translate("; } else { $params[] = translate('LBL_MODULE_NAME','Users'); } $params[] = "".$returnName.""; if($returnAction == 'EditView'){ $params[] = $GLOBALS['app_strings']['LBL_EDIT_BUTTON_LABEL']; } return $params; } /** * @see SugarView::getModuleTitleIconPath() */ protected function getModuleTitleIconPath($module) { return parent::getModuleTitleIconPath('Users'); } function display(){ $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(); } } } ?>