2 if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 /*********************************************************************************
4 * SugarCRM Community Edition is a customer relationship management program developed by
5 * SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
7 * This program is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU Affero General Public License version 3 as published by the
9 * Free Software Foundation with the addition of the following permission added
10 * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
11 * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
12 * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
14 * This program is distributed in the hope that it will be useful, but WITHOUT
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
19 * You should have received a copy of the GNU Affero General Public License along with
20 * this program; if not, see http://www.gnu.org/licenses or write to the Free
21 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
24 * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
25 * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
27 * The interactive user interfaces in modified source and object code versions
28 * of this program must display Appropriate Legal Notices, as required under
29 * Section 5 of the GNU Affero General Public License version 3.
31 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
32 * these Appropriate Legal Notices must retain the display of the "Powered by
33 * SugarCRM" logo. If the display of the logo is not reasonably feasible for
34 * technical reasons, the Appropriate Legal Notices must display the words
35 * "Powered by SugarCRM".
36 ********************************************************************************/
38 /*********************************************************************************
40 * Description: TODO: To be written.
41 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
42 * All Rights Reserved.
43 * Contributor(s): ______________________________________..
44 ********************************************************************************/
47 require_once('include/DetailView/DetailView.php');
48 require_once('include/export_utils.php');
49 require_once('include/SugarOAuthServer.php');
50 require_once('include/SubPanel/SubPanelTiles.php');
56 if (!is_admin($current_user) && !$GLOBALS['current_user']->isAdminForModule('Users')
57 && ($_REQUEST['record'] != $current_user->id)) sugar_die("Unauthorized access to administration.");
59 $is_current_admin=is_admin($current_user)
60 ||$GLOBALS['current_user']->isAdminForModule('Users');
64 $detailView = new DetailView();
66 if (isset($_REQUEST['offset']) || !empty($_REQUEST['record'])) {
67 $result = $detailView->processSugarBean("USER", $focus, $offset);
70 sugar_die($app_strings['ERROR_NO_RECORD']);
74 header("Location: index.php?module=Users&action=index");
77 if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') {
80 if(isset($_REQUEST['reset_preferences'])){
81 $focus->resetPreferences();
83 if(isset($_REQUEST['reset_homepage'])){
84 $focus->resetPreferences('Home');
85 if($focus->id == $current_user->id) {
86 $_COOKIE[$current_user->id . '_activePage'] = '0';
87 setcookie($current_user->id . '_activePage','0',3000);
92 $params[] = $locale->getLocaleFormattedName($focus->first_name,$focus->last_name);
94 $index_url = ($is_current_admin) ? "index.php?module=Users&action=index" : "index.php?module=Users&action=DetailView&record={$focus->id}";
97 echo getClassicModuleTitle("Users", $params, true,$index_url);
99 global $app_list_strings;
101 $GLOBALS['log']->info("User detail view");
103 $sugar_smarty = new Sugar_Smarty();
104 $sugar_smarty->assign("MOD", $mod_strings);
105 $sugar_smarty->assign("APP", $app_strings);
106 $sugar_smarty->assign("PRINT_URL", "index.php?".$GLOBALS['request_string']);
107 $sugar_smarty->assign("ID", $focus->id);
108 $sugar_smarty->assign("USER_NAME", $focus->user_name);
109 $sugar_smarty->assign("FULL_NAME", $focus->full_name);
110 if(!empty($GLOBALS['sugar_config']['authenticationClass'])){
111 $authclass = $GLOBALS['sugar_config']['authenticationClass'];
112 }else if(!empty($GLOBALS['system_config']->settings['system_ldap_enabled'])){
113 $authclass = 'LDAPAuthenticate';
115 if(is_admin($GLOBALS['current_user']) && !empty($authclass)){
116 $str = '<tr><td valign="top" scope="row">';
117 $str .= $authclass . ':';
118 $str .= '</td><td><input type="checkbox" disabled ';
119 if(!empty($focus->external_auth_only))$str .= ' CHECKED ';
120 $str .='/></td><td>'. $mod_strings['LBL_EXTERNAL_AUTH_ONLY'] . ' ' . $authclass. '</td></tr>';
121 $sugar_smarty->assign('EXTERNAL_AUTH', $str);
124 $edit_self = $current_user->id == $focus->id;
126 $sugar_smarty->assign('EDIT_SELF','1');
129 if (isset($sugar_config['show_download_tab']))
131 $enable_download_tab = $sugar_config['show_download_tab'];
134 $enable_download_tab = true;
137 $sugar_smarty->assign('SHOW_DOWNLOADS_TAB', $enable_download_tab);
144 ///////////////////////////////////////////////////////////////////////////////
145 //// TO SUPPORT LEGACY XTEMPLATES
146 $sugar_smarty->assign('FIRST_NAME', $focus->first_name);
147 $sugar_smarty->assign('LAST_NAME', $focus->last_name);
148 //// END SUPPORT LEGACY XTEMPLATES
149 ///////////////////////////////////////////////////////////////////////////////
152 if(!empty($focus->status)) {
153 // jc:#12261 - while not apparent, replaced the explicit reference to the
154 // app_strings['user_status_dom'] element with a call to the ultility translate
155 // function to retrieved the mapped value for User::status
156 $status = translate('user_status_dom', '', $focus->status);
158 $sugar_smarty->assign("STATUS", $status);
159 $detailView->processListNavigation($sugar_smarty, "USER", $offset);
160 $reminder_time = $focus->getPreference('reminder_time');
162 if(empty($reminder_time)){
165 if($reminder_time != -1){
166 $sugar_smarty->assign("REMINDER_CHECKED", 'checked');
167 $sugar_smarty->assign("REMINDER_TIME", translate('reminder_time_options', '', $reminder_time));
169 // Display the good usertype
170 $user_type_label=$mod_strings['LBL_REGULAR_USER'];
171 $usertype='RegularUser';
173 if((is_admin($current_user) || $_REQUEST['record'] == $current_user->id || $current_user->isAdminForModule('Users')) && $focus->is_admin == '1'){
174 $user_type_label=$mod_strings['LBL_ADMIN_USER'];
175 $usertype='Administrator';
179 $sugar_smarty->assign('IS_GROUP_OR_PORTAL','0');
180 if(!empty($focus->is_group) && $focus->is_group == 1){
181 $user_type_label=$mod_strings['LBL_GROUP_USER'];
182 $usertype='GroupUser';
183 $sugar_smarty->assign('IS_GROUP_OR_PORTAL','1');
186 $sugar_smarty->assign("USER_TYPE", $usertype);
187 $sugar_smarty->assign("USER_TYPE_LABEL", $user_type_label);
193 // adding custom fields:
194 $xtpl = $sugar_smarty;
195 require_once('modules/DynamicFields/templates/Files/DetailView.php');
198 if (isset($_REQUEST['pwd_set']) && $_REQUEST['pwd_set']!= 0){
199 if ($_REQUEST['pwd_set']=='4'){
200 require_once('modules/Users/password_utils.php');
201 $errors.=canSendPassword();
204 $errors.=$mod_strings['LBL_NEW_USER_PASSWORD_'.$_REQUEST['pwd_set']];
208 //IF FOCUS USER IS LOCKOUT
209 if($focus->getPreference('lockout')=='1')
210 $errors.=$mod_strings['ERR_USER_IS_LOCKED_OUT'];
212 $sugar_smarty->assign("ERRORS", $errors);
213 $sugar_smarty->assign("ERROR_MESSAGE", $msgGood ? $mod_strings['LBL_PASSWORD_SENT'] : $mod_strings['LBL_CANNOT_SEND_PASSWORD']);
215 if ((is_admin($current_user) || $_REQUEST['record'] == $current_user->id
217 && !empty($sugar_config['default_user_name'])
218 && $sugar_config['default_user_name'] == $focus->user_name
219 && isset($sugar_config['lock_default_user_name'])
220 && $sugar_config['lock_default_user_name']) {
221 $buttons .= "<input id='edit_button' title='".$app_strings['LBL_EDIT_BUTTON_TITLE']."' accessKey='".$app_strings['LBL_EDIT_BUTTON_KEY']."' class='button primary' onclick=\"this.form.return_module.value='Users'; this.form.return_action.value='DetailView'; this.form.return_id.value='$focus->id'; this.form.action.value='EditView'\" type='submit' name='Edit' value='".$app_strings['LBL_EDIT_BUTTON_LABEL']."'> ";
223 elseif (is_admin($current_user)|| ($GLOBALS['current_user']->isAdminForModule('Users')&& !$focus->is_admin)
224 || $_REQUEST['record'] == $current_user->id) {
225 $buttons .= "<input id='edit_button' title='".$app_strings['LBL_EDIT_BUTTON_TITLE']."' accessKey='".$app_strings['LBL_EDIT_BUTTON_KEY']."' class='button primary' onclick=\"this.form.return_module.value='Users'; this.form.return_action.value='DetailView'; this.form.return_id.value='$focus->id'; this.form.action.value='EditView'\" type='submit' name='Edit' value='".$app_strings['LBL_EDIT_BUTTON_LABEL']."'> ";
226 if ((is_admin($current_user)|| $GLOBALS['current_user']->isAdminForModule('Users')
229 if (!$current_user->is_group){
230 $buttons .= "<input title='".$app_strings['LBL_DUPLICATE_BUTTON_TITLE']."' accessKey='".$app_strings['LBL_DUPLICATE_BUTTON_KEY']."' class='button' onclick=\"this.form.return_module.value='Users'; this.form.return_action.value='DetailView'; this.form.isDuplicate.value=true; this.form.action.value='EditView'\" type='submit' name='Duplicate' value='".$app_strings['LBL_DUPLICATE_BUTTON_LABEL']."'> ";
232 if($focus->id != $current_user->id) {
233 $buttons .="<input type='button' class='button' onclick='confirmDelete();' value='".$app_strings['LBL_DELETE_BUTTON_LABEL']."' /> ";
236 if (!$focus->portal_only && !$focus->is_group && !$focus->external_auth_only
237 && isset($sugar_config['passwordsetting']['SystemGeneratedPasswordON']) && $sugar_config['passwordsetting']['SystemGeneratedPasswordON']){
238 $buttons .= "<input title='".$mod_strings['LBL_GENERATE_PASSWORD_BUTTON_TITLE']."' accessKey='".$mod_strings['LBL_GENERATE_PASSWORD_BUTTON_KEY']."' class='button' LANGUAGE=javascript onclick='generatepwd(\"".$focus->id."\");' type='button' name='password' value='".$mod_strings['LBL_GENERATE_PASSWORD_BUTTON_LABEL']."'> ";
244 if(isset($_SERVER['QUERY_STRING'])) $the_query_string = $_SERVER['QUERY_STRING'];
245 else $the_query_string = '';
247 if (!$current_user->is_group){
248 if ($focus->id == $current_user->id) {
249 $reset_pref_warning = $mod_strings['LBL_RESET_PREFERENCES_WARNING'];
250 $reset_home_warning = $mod_strings['LBL_RESET_HOMEPAGE_WARNING'];
253 $reset_pref_warning = $mod_strings['LBL_RESET_PREFERENCES_WARNING_USER'];
254 $reset_home_warning = $mod_strings['LBL_RESET_HOMEPAGE_WARNING_USER'];
256 $buttons .="<input type='button' class='button' onclick='if(confirm(\"{$reset_pref_warning}\"))window.location=\"".$_SERVER['PHP_SELF'] .'?'.$the_query_string."&reset_preferences=true\";' value='".$mod_strings['LBL_RESET_PREFERENCES']."' />";
257 $buttons .=" <input type='button' class='button' onclick='if(confirm(\"{$reset_home_warning}\"))window.location=\"".$_SERVER['PHP_SELF'] .'?'.$the_query_string."&reset_homepage=true\";' value='".$mod_strings['LBL_RESET_HOMEPAGE']."' />";
260 if (isset($buttons)) $sugar_smarty->assign("BUTTONS", $buttons);
262 require_once("include/templates/TemplateGroupChooser.php");
263 require_once("modules/MySettings/TabController.php");
264 $chooser = new TemplateGroupChooser();
265 $controller = new TabController();
267 //if(is_admin($current_user) || $controller->get_users_can_edit())
268 if(is_admin($current_user)||$GLOBALS['current_user']->isAdminForModule('Users'))
270 $chooser->display_third_tabs = true;
271 $chooser->args['third_name'] = 'remove_tabs';
272 $chooser->args['third_label'] = $mod_strings['LBL_REMOVED_TABS'];
274 elseif(!$controller->get_users_can_edit())
276 $chooser->display_hide_tabs = false;
280 $chooser->display_hide_tabs = true;
283 $chooser->args['id'] = 'edit_tabs';
284 $chooser->args['values_array'] = $controller->get_tabs($focus);
285 $chooser->args['left_name'] = 'display_tabs';
286 $chooser->args['right_name'] = 'hide_tabs';
287 $chooser->args['left_label'] = $mod_strings['LBL_DISPLAY_TABS'];
288 $chooser->args['right_label'] = $mod_strings['LBL_HIDE_TABS'];
289 $chooser->args['title'] = $mod_strings['LBL_EDIT_TABS'];
290 $chooser->args['disable'] = true;
292 foreach ($chooser->args['values_array'][0] as $key=>$value)
294 $chooser->args['values_array'][0][$key] = $app_list_strings['moduleList'][$key];
296 foreach ($chooser->args['values_array'][1] as $key=>$value)
298 $chooser->args['values_array'][1][$key] = $app_list_strings['moduleList'][$key];
302 $sugar_smarty->assign("TAB_CHOOSER", $chooser->display());
303 $sugar_smarty->assign("CHOOSE_WHICH", $mod_strings['LBL_CHOOSE_WHICH']);
307 if ($focus->receive_notifications) $sugar_smarty->assign("RECEIVE_NOTIFICATIONS", "checked");
308 if($focus->getPreference('mailmerge_on') == 'on') {
309 $sugar_smarty->assign("MAILMERGE_ON", "checked");
311 $sugar_smarty->assign("SETTINGS_URL", $sugar_config['site_url']);
314 $sugar_smarty->assign("EXPORT_DELIMITER", $focus->getPreference('export_delimiter'));
315 $sugar_smarty->assign('EXPORT_CHARSET', $locale->getExportCharset('', $focus));
316 $sugar_smarty->assign('USE_REAL_NAMES', $focus->getPreference('use_real_names'));
320 $sugar_smarty->assign("DATEFORMAT", $sugar_config['date_formats'][$timedate->get_date_format()]);
321 $sugar_smarty->assign("TIMEFORMAT", $sugar_config['time_formats'][$timedate->get_time_format()]);
323 $userTZ = $focus->getPreference('timezone');
324 $sugar_smarty->assign("TIMEZONE", TimeDate::tzName($userTZ));
325 $datef = $focus->getPreference('datef');
326 $timef = $focus->getPreference('timef');
329 $sugar_smarty->assign("DATEFORMAT", $sugar_config['date_formats'][$datef]);
331 $sugar_smarty->assign("TIMEFORMAT", $sugar_config['time_formats'][$timef]);
333 $num_grp_sep = $focus->getPreference('num_grp_sep');
334 $dec_sep = $focus->getPreference('dec_sep');
335 $sugar_smarty->assign("NUM_GRP_SEP", (empty($num_grp_sep) ? $sugar_config['default_number_grouping_seperator'] : $num_grp_sep));
336 $sugar_smarty->assign("DEC_SEP", (empty($dec_sep) ? $sugar_config['default_decimal_seperator'] : $dec_sep));
340 $currency = new Currency();
341 if($focus->getPreference('currency') ) {
342 $currency->retrieve($focus->getPreference('currency'));
343 $sugar_smarty->assign("CURRENCY", $currency->iso4217 .' '.$currency->symbol );
345 $sugar_smarty->assign("CURRENCY", $currency->getDefaultISO4217() .' '.$currency->getDefaultCurrencySymbol() );
347 $sugar_smarty->assign('CURRENCY_SIG_DIGITS', $locale->getPrecedentPreference('default_currency_significant_digits', $focus));
349 $sugar_smarty->assign('NAME_FORMAT', $focus->getLocaleFormatDesc());
352 $sugar_smarty->assign("DESCRIPTION", nl2br(url2html($focus->description)));
353 $sugar_smarty->assign("TITLE", $focus->title);
354 $sugar_smarty->assign("DEPARTMENT", $focus->department);
355 $sugar_smarty->assign("REPORTS_TO_ID", $focus->reports_to_id);
356 $sugar_smarty->assign("REPORTS_TO_NAME", $focus->reports_to_name);
357 $sugar_smarty->assign("PHONE_HOME", $focus->phone_home);
358 $sugar_smarty->assign("PHONE_MOBILE", $focus->phone_mobile);
359 $sugar_smarty->assign("PHONE_WORK", $focus->phone_work);
360 $sugar_smarty->assign("PHONE_OTHER", $focus->phone_other);
361 $sugar_smarty->assign("PHONE_FAX", $focus->phone_fax);
362 if (!empty($focus->employee_status)) {
363 $sugar_smarty->assign("EMPLOYEE_STATUS", $app_list_strings['employee_status_dom'][$focus->employee_status]);
365 $sugar_smarty->assign("MESSENGER_ID", $focus->messenger_id);
366 $sugar_smarty->assign("MESSENGER_TYPE", $focus->messenger_type);
367 $sugar_smarty->assign("ADDRESS_STREET", $focus->address_street);
368 $sugar_smarty->assign("ADDRESS_CITY", $focus->address_city);
369 $sugar_smarty->assign("ADDRESS_STATE", $focus->address_state);
370 $sugar_smarty->assign("ADDRESS_POSTALCODE", $focus->address_postalcode);
371 $sugar_smarty->assign("ADDRESS_COUNTRY", $focus->address_country);
372 $sugar_smarty->assign("EMAIL_ADDRESSES", $focus->emailAddress->getEmailAddressWidgetDetailView($focus));
373 $sugar_smarty->assign("CALENDAR_PUBLISH_KEY", $focus->getPreference('calendar_publish_key' ));
374 if (! empty($current_user->email1))
376 $publish_url = $sugar_config['site_url'].'/vcal_server.php';
378 //determine if the web server is running IIS
379 //if so then change the publish url
380 if(isset($_SERVER) && !empty($_SERVER['SERVER_SOFTWARE'])){
381 $position = strpos(strtolower($_SERVER['SERVER_SOFTWARE']), 'iis');
382 if($position !== false){
387 $publish_url .= $token.'type=vfb&email='.$focus->email1.'&source=outlook&key='.$focus->getPreference('calendar_publish_key' );
388 $sugar_smarty->assign("CALENDAR_PUBLISH_URL", $publish_url);
389 $sugar_smarty->assign("CALENDAR_SEARCH_URL", $sugar_config['site_url'].'/vcal_server.php/type=vfb&email=%NAME%@%SERVER%');
393 $sugar_smarty->assign("CALENDAR_PUBLISH_URL", $sugar_config['site_url'].'/vcal_server.php/type=vfb&user_name='.$focus->user_name.'&source=outlook&key='.$focus->getPreference('calendar_publish_key' ));
394 $sugar_smarty->assign("CALENDAR_SEARCH_URL", $sugar_config['site_url'].'/vcal_server.php/type=vfb&email=%NAME%@%SERVER%');
398 $useGroupTabs = $current_user->getPreference('navigation_paradigm');
399 if ( ! isset($useGroupTabs) ) {
400 if ( ! isset($GLOBALS['sugar_config']['default_navigation_paradigm']) ) {
401 $GLOBALS['sugar_config']['default_navigation_paradigm'] = 'gm';
403 $useGroupTabs = $GLOBALS['sugar_config']['default_navigation_paradigm'];
405 $sugar_smarty->assign("USE_GROUP_TABS",($useGroupTabs=='gm')?'checked':'');
407 $user_max_tabs = intval($focus->getPreference('max_tabs'));
408 if(isset($user_max_tabs) && $user_max_tabs > 0)
409 $sugar_smarty->assign("MAX_TAB", $user_max_tabs);
410 elseif(isset($max_tabs) && $max_tabs > 0)
411 $sugar_smarty->assign("MAX_TAB", $max_tabs);
413 $sugar_smarty->assign("MAX_TAB", $GLOBALS['sugar_config']['default_max_tabs']);
415 $user_subpanel_tabs = $focus->getPreference('subpanel_tabs');
416 if(isset($user_subpanel_tabs)) {
417 $sugar_smarty->assign("SUBPANEL_TABS", $user_subpanel_tabs?'checked':'');
419 $sugar_smarty->assign("SUBPANEL_TABS", $GLOBALS['sugar_config']['default_subpanel_tabs']?'checked':'');
424 $sugar_smarty->assign("EMAIL_OPTIONS", $focus->emailAddress->getEmailAddressWidgetDetailView($focus));
425 $email_link_type = $focus->getPreference('email_link_type');
426 if ( !empty($email_link_type) )
427 $sugar_smarty->assign('EMAIL_LINK_TYPE',$app_list_strings['dom_email_link_type'][$focus->getPreference('email_link_type')]);
428 if ( $focus->getPreference('email_link_type') == 'sugar' )
429 $sugar_smarty->assign('SHOW_SMTP_SETTINGS',true);
431 //Handle outbound email templates
432 $oe = new OutboundEmail();
433 $userOverrideOE = $oe->getUsersMailerForSystemOverride($focus->id);
435 $mail_smtpserver = "";
437 if($userOverrideOE == null)
439 $systemOE = $oe->getSystemMailerSettings();
440 $mail_smtpdisplay = $systemOE->mail_smtpdisplay;
441 $mail_smtpserver = $systemOE->mail_smtpserver;
442 $mail_smtptype = $systemOE->mail_smtptype;
443 if( $oe->isAllowUserAccessToSystemDefaultOutbound() )
444 $mail_smtpuser = $systemOE->mail_smtpuser;
448 $mail_smtpdisplay = $userOverrideOE->mail_smtpdisplay;
449 $mail_smtpuser = $userOverrideOE->mail_smtpuser;
450 $mail_smtpserver = $userOverrideOE->mail_smtpserver;
451 $mail_smtptype = $userOverrideOE->mail_smtptype;
453 $sugar_smarty->assign("MAIL_SMTPUSER", $mail_smtpuser);
454 $sugar_smarty->assign("MAIL_SMTPDISPLAY", $mail_smtpdisplay);
457 $show_roles = (!($focus->is_group=='1' || $focus->portal_only=='1'));
458 $sugar_smarty->assign('SHOW_ROLES', $show_roles);
460 // User Holidays subpanel on the advanced tab
461 global $modules_exempt_from_availability_check;
462 $modules_exempt_from_availability_check=array('Holidays'=>'Holidays',);
464 if(!empty($GLOBALS['sugar_config']['lock_subpanels'])){
467 $GLOBALS['sugar_config']['lock_subpanels'] = true;
469 $GLOBALS['sugar_config']['lock_subpanels'] = $locked;
471 $sugar_smarty->display('modules/Users/DetailView.tpl');
473 // Roles Grid and Roles subpanel should not be displayed for group and portal users
476 require_once('modules/ACLRoles/DetailUserRole.php');
477 if(SugarOAuthServer::enabled()) {
478 $subpanel = new SubPanelTiles($focus, 'UserOAuth');
479 echo $subpanel->display(true,true);
488 $savedSearch = new SavedSearch();
489 $json = getJSONobj();
490 $savedSearchSelects = $json->encode(array($GLOBALS['app_strings']['LBL_SAVED_SEARCH_SHORTCUT'] . '<br>' . $savedSearch->getSelect('Users')));
492 YAHOO.util.Event.addListener(window, 'load', SUGAR.util.fillShortcuts, $savedSearchSelects);
495 echo "<script type='text/javascript'>user_status_display('$usertype') </script>";
498 <script type='text/javascript'>
500 function confirmDelete() {
501 var handleYes = function() {
502 window.location=\"".$_SERVER['PHP_SELF'] ."?module=Users&action=delete&record={$focus->id}\";
505 var handleNo = function() {
506 confirmDeletePopup.hide();
509 var user_portal_group = '{$usertype}';
510 var confirm_text = SUGAR.language.get('Users', 'LBL_DELETE_USER_CONFIRM');
511 if(user_portal_group == 'GroupUser'){
512 confirm_text = SUGAR.language.get('Users', 'LBL_DELETE_GROUP_CONFIRM');
515 var confirmDeletePopup = new YAHOO.widget.SimpleDialog(\"Confirm \", {
518 constraintoviewport: true,
522 bodyStyle: \"padding:5px\",
524 text: SUGAR.language.get('Users', 'LBL_OK'),
528 text: SUGAR.language.get('Users', 'LBL_CANCEL'),
532 confirmDeletePopup.setHeader(SUGAR.language.get('Users', 'LBL_DELETE_USER'));
533 confirmDeletePopup.render(document.body);
536 echo $confirmDeleteJS;