Edit file File name : DetailViewGoogleContacts.php Content :<?php if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); require_once('include/DetailView/DetailView.php'); require_once('include/export_utils.php'); require_once('include/timezone/timezones.php'); require_once('include/utils.php'); require_once('modules/Users/User.php'); global $current_user; global $theme; global $app_strings; global $mod_strings; global $timezones; $sq = "select * from config where category='info' and name='allow_google_contacts_user_chang'"; global $db; $result= $db->query($sq, true); while($row = $db->fetchByAssoc($result)) { $aokusers = $row['value']; } $sq = "select * from config where category='info' and name='allow_logs_contacts_user_change'"; global $db; $result= $db->query($sq, true); while($row = $db->fetchByAssoc($result)) { $alogsusers = $row['value']; } if($aokusers == '1' or $aokusers==true) { }else{ if(!is_admin($current_user) ) sugar_die("Unauthorized access to administration."); } $focus = new User(); $detailView = new DetailView(); $offset=0; if (isset($_REQUEST['offset']) || !empty($_REQUEST['record'])) { $result = $detailView->processSugarBean("USER", $focus, $offset); if($result == null) { sugar_die($app_strings['ERROR_NO_RECORD']); } $focus=$result; } else { header("Location: index.php?module=Users&action=index"); } if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') { $focus->id = ""; } if(isset($_REQUEST['reset_preferences'])){ $current_user->resetPreferences($focus); } if(isset($_REQUEST['reset_homepage'])){ $current_user->resetPreferences($focus, 'Home'); $_COOKIE[$current_user->id . '_activePage'] = '0'; setcookie($current_user->id . '_activePage','0',3000); } if(isset($_REQUEST['reset_dashboard'])){ $current_user->resetPreferences($focus, 'Dashboard'); $_COOKIE[$current_user->id . '_activeDashboardPage'] = '0'; setcookie($current_user->id . '_activeDashboardPage','0',3000); } echo "\n<p>\n"; echo get_module_title($mod_strings['LBL_MODULE_NAME'], $mod_strings['LBL_MODULE_NAME'].": ".$focus->full_name." (".$focus->user_name.")", true); echo "\n</p>\n"; global $theme; global $app_list_strings; $theme_path="themes/".$theme."/"; $image_path=$theme_path."images/"; require_once($theme_path.'layout_utils.php'); #$GLOBALS['log']->info("User detail view"); $xtpl=new XTemplate ('modules/Users/DetailViewGoogleContacts.html'); $xtpl->assign("MOD", $mod_strings); $xtpl->assign("APP", $app_strings); $xtpl->assign("THEME", $theme); $xtpl->assign("GRIDLINE", $gridline); $xtpl->assign("IMAGE_PATH", $image_path);$xtpl->assign("PRINT_URL", "index.php?".$GLOBALS['request_string']); $xtpl->assign("ID", $focus->id); $xtpl->assign("USER_NAME", $focus->user_name); $xtpl->assign("FULL_NAME", $focus->full_name); $xtpl->assign('FIRST_NAME', $focus->first_name); $xtpl->assign('LAST_NAME', $focus->last_name); $status = ''; if($focus->is_group) { $status = $mod_strings['LBL_GROUP_USER_STATUS']; } elseif(!empty($focus->status)) { $status = $app_list_strings['user_status_dom'][$focus->status]; } $xtpl->assign("STATUS", $status); $detailView->processListNavigation($xtpl, "USER", $offset); $reminder_time = $focus->getPreference('reminder_time'); if(empty($reminder_time)){ $reminder_time = -1; } if($reminder_time != -1){ $xtpl->assign("REMINDER_CHECKED", 'checked'); $xtpl->assign("REMINDER_TIME", translate('reminder_time_options', '', $reminder_time)); } // adding custom fields: require_once('modules/DynamicFields/templates/Files/DetailView.php'); if ($focus->google_mcts_sync_type_c=="no_sync" or $focus->google_mcts_sync_type_c==""){ $xtpl->assign('SYNC_CTS_NO', 'CHECKED'); } if ($focus->google_mcts_sync_type_c=="sync_user"){ $xtpl->assign('SYNC_CTS_USER', 'CHECKED'); } if ($focus->google_mcts_sync_type_c=="sync_role"){ $xtpl->assign('SYNC_CTS_ROLE_TEAM', 'CHECKED'); } if($focus->google_mctsupdate_c == 'on' or $focus->google_mctsupdate_c == '1') { $xtpl->assign('GOOGLE_MCTSUPDATE', "CHECKED"); } if($focus->google_mctsreceive_c == 'on' or $focus->google_mctsreceive_c == '1') { $xtpl->assign('GOOGLE_MCTSRECEIVE', "CHECKED"); } if($aokusers == '1' or $aokusers==true) { $xtpl->assign('ALLOWUSERS', 'CHECKED'); } if($alogsusers == '1' or $alogsusers==true) { $xtpl->assign('ALLOWLOGS', 'CHECKED'); } if($focus->google_mmeetings_c == 'on') { $xtpl->assign('GOOGLE_MMEETINGS', 'CHECKED'); } if($focus->google_mmeetingsdown_c == 'on') { $xtpl->assign('GOOGLE_MMEETINGSDOWN', 'CHECKED'); } if($focus->google_mcalls_c == 'on') { $xtpl->assign('GOOGLE_MCALLS', 'CHECKED'); } if($focus->google_mcallsdown_c == 'on') { $xtpl->assign('GOOGLE_MCALLSDOWN', 'CHECKED'); } if($focus->google_mtasks_c == 'on') { $xtpl->assign('GOOGLE_MTASKS', 'CHECKED'); } if($focus->google_mtasksdown_c == 'on') { $xtpl->assign('GOOGLE_MTASKSDOWN', 'CHECKED'); } if($focus->google_mnotifications_c == 'on') { $xtpl->assign('GOOGLE_MNOTIFICATIONS', 'CHECKED'); } if($focus->google_mplannedcalls_c == 'on') { $xtpl->assign('GOOGLE_MPLANNEDCALLS', 'CHECKED'); } if($focus->google_mdocsreceive_c == 'on') { $xtpl->assign('GOOGLE_MDOCSRECEIVE', 'CHECKED'); } if($focus->google_mdocsupdfgoogle_c == 'on') { $xtpl->assign('GOOGLE_MDOCSUPDFGOOGLE', 'CHECKED'); } if($focus->google_mmeetingsdown_c == 'on') { $xtpl->assign('GOOGLE_MMEETINGSDOWN', 'CHECKED'); } # if($focus->google_mdocsnewfiles_c == 'on') { $xtpl->assign('GOOGLE_MDOCSNEWFILES', $focus->google_mdocsnewfiles_c); #} if($focus->google_mplannedcalls_c == 'on') { $xtpl->assign('GOOGLE_MPLANNEDCALLS', "CHECKED"); } $xtpl->assign('GOOGLE_MAFTERDATE', $focus->google_mafterdate_c); $xtpl->assign('GOOGLE_MMAIL_C', $focus->google_mmail_c); $xtpl->assign('GOOGLE_MMAIL_CTS_C', $focus->google_mmail_cts_contacts_c); $xtpl->assign('GOOGLE_MPASS_C', $focus->google_mpass_c); $xtpl->assign('GOOGLE_MDOCSAFTERDATER', $focus->google_mdocsafterdater_c ); $xtpl->assign('GOOGLE_MCALENDAR', $focus->google_mcalendar_c); $xtpl->assign('GOOGLE_MDOCSAFTERDATES', $focus->google_mdocsafterdates_c); require_once("include/templates/TemplateGroupChooser.php"); require_once("modules/MySettings/TabController.php"); $chooser = new TemplateGroupChooser(); $controller = new TabController(); $xtpl->parse("user_info.tabchooser"); $xtpl->parse("main"); $xtpl->out("main"); $xtpl->parse("user_settings"); $xtpl->out("user_settings"); $xtpl->assign('NAME_FORMAT', $focus->getLocaleFormatDesc()); $xtpl->parse('user_locale'); $xtpl->out('user_locale'); $xtpl->parse("user_info.layoutopts"); $xtpl->parse("user_info"); $xtpl->out("user_info"); $xtpl->parse("user_info.email_info"); $xtpl->out("user_info.email_info"); echo "</td></tr>\n"; require_once('modules/SavedSearch/SavedSearch.php'); $savedSearch = new SavedSearch(); $json = getJSONobj(); $savedSearchSelects = $json->encode(array($GLOBALS['app_strings']['LBL_SAVED_SEARCH_SHORTCUT'] . '<br>' . $savedSearch->getSelect('Users'))); $str = "<script> YAHOO.util.Event.addListener(window, 'load', SUGAR.util.fillShortcuts, $savedSearchSelects); </script>"; echo $str; ?> Save