2 if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
4 /*********************************************************************************
5 * SugarCRM Community Edition is a customer relationship management program developed by
6 * SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
8 * This program is free software; you can redistribute it and/or modify it under
9 * the terms of the GNU Affero General Public License version 3 as published by the
10 * Free Software Foundation with the addition of the following permission added
11 * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
12 * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
13 * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
15 * This program is distributed in the hope that it will be useful, but WITHOUT
16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17 * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
20 * You should have received a copy of the GNU Affero General Public License along with
21 * this program; if not, see http://www.gnu.org/licenses or write to the Free
22 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25 * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
26 * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
28 * The interactive user interfaces in modified source and object code versions
29 * of this program must display Appropriate Legal Notices, as required under
30 * Section 5 of the GNU Affero General Public License version 3.
32 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
33 * these Appropriate Legal Notices must retain the display of the "Powered by
34 * SugarCRM" logo. If the display of the logo is not reasonably feasible for
35 * technical reasons, the Appropriate Legal Notices must display the words
36 * "Powered by SugarCRM".
37 ********************************************************************************/
40 require_once('include/MVC/View/views/view.detail.php');
42 class EmployeesViewDetail extends ViewDetail {
44 function EmployeesViewDetail(){
49 * Return the "breadcrumbs" to display at the top of the page
51 * @param bool $show_help optional, true if we show the help links
52 * @return HTML string containing breadcrumb title
54 public function getModuleTitle($show_help = true)
56 global $sugar_version, $sugar_flavor, $server_unique_key, $current_language, $action, $current_user;
58 $theTitle = "<div class='moduleTitle'>\n<h2>";
60 $module = preg_replace("/ /","",$this->module);
62 $params = $this->_getModuleTitleParams();
63 $count = count($params);
66 if(SugarThemeRegistry::current()->directionality == "rtl") {
67 $params = array_reverse($params);
70 foreach($params as $parm){
74 $theTitle .= $this->getBreadCrumbSymbol();
77 $theTitle .= "</h2>\n";
80 $theTitle .= "<span class='utils'>";
81 if(is_admin($current_user) || is_admin_for_module($current_user, $this->module))
83 $createImageURL = SugarThemeRegistry::current()->getImageURL('create-record.gif');
84 $theTitle .= <<<EOHTML
86 <a href="index.php?module={$module}&action=EditView&return_module={$module}&return_action=DetailView" class="utilsLink">
87 <img src='{$createImageURL}' alt='{$GLOBALS['app_strings']['LNK_CREATE']}'></a>
88 <a href="index.php?module={$module}&action=EditView&return_module={$module}&return_action=DetailView" class="utilsLink">
89 {$GLOBALS['app_strings']['LNK_CREATE']}
95 $theTitle .= "</span></div>\n";
100 if(is_admin($GLOBALS['current_user']) || $_REQUEST['record'] == $GLOBALS['current_user']->id) {
101 $this->ss->assign('DISPLAY_EDIT', true);
103 if(is_admin($GLOBALS['current_user'])){
104 $this->ss->assign('DISPLAY_DUPLICATE', true);
107 $showDeleteButton = FALSE;
108 if( $_REQUEST['record'] != $GLOBALS['current_user']->id && $GLOBALS['current_user']->isAdminForModule('Users') )
110 $showDeleteButton = TRUE;
111 if( empty($this->bean->user_name) ) //Indicates just employee
112 $deleteWarning = $GLOBALS['mod_strings']['LBL_DELETE_EMPLOYEE_CONFIRM'];
114 $deleteWarning = $GLOBALS['mod_strings']['LBL_DELETE_USER_CONFIRM'];
115 $this->ss->assign('DELETE_WARNING', $deleteWarning);
117 $this->ss->assign('DISPLAY_DELETE', $showDeleteButton);