Edit file File name : EditViewGoogleContacts.php Content :<?php if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); require_once('XTemplate/xtpl.php'); require_once('include/export_utils.php'); require_once('modules/Users/User.php'); require_once('modules/Users/Forms.php'); require_once('modules/Users/UserSignature.php'); require_once('modules/Administration/Administration.php'); require_once('include/javascript/javascript.php'); $admin = new Administration(); $admin->retrieveSettings("notify"); global $app_strings; global $app_list_strings; global $mod_strings; $admin = new Administration(); $admin->retrieveSettings(); $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']; } if ($aokusers==""){ $sq = "insert into config (category,name,value) values ('info','allow_google_contacts_user_chang',1)"; $result= $db->query($sq, 1); $aokusers = true; } $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 ($alogsusers==""){ $sq = "insert into config (category,name,value) values ('info','allow_logs_contacts_user_change',1)"; $result= $db->query($sq, 1); $alogsusers = true; } $focus = new User(); if($aokusers == '1' or $aokusers==true) { }else{ if(!is_admin($current_user) ) sugar_die("Unauthorized access to administration."); } if(isset($_REQUEST['record'])) { $focus->retrieve($_REQUEST['record']); } if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') { $focus->id = ""; $focus->user_name = ""; } echo "\n<p>\n"; echo get_module_title($mod_strings['LBL_MODULE_NAME'], $mod_strings['LBL_MODULE_NAME'].": ".$focus->first_name." ".$focus->last_name."(".$focus->user_name.")", true); echo "\n</p>\n"; global $theme; $theme_path='themes/'.$theme.'/'; $image_path=$theme_path.'images/'; require_once($theme_path.'layout_utils.php'); $xtpl=new XTemplate('modules/Users/EditViewGoogleContacts.html'); $xtpl->assign('MOD', $mod_strings); $xtpl->assign('APP', $app_strings); if(isset($_REQUEST['error_string'])) $xtpl->assign('ERROR_STRING', '<span class="error">Error: '.$_REQUEST['error_string'].'</span>'); if(isset($_REQUEST['return_module'])) $xtpl->assign('RETURN_MODULE', $_REQUEST['return_module']); if(isset($_REQUEST['return_action'])) $xtpl->assign('RETURN_ACTION', "DetailViewGoogleContacts"); if(isset($_REQUEST['return_id'])) $xtpl->assign('RETURN_ID', $_REQUEST['return_id']); else { $xtpl->assign('RETURN_ACTION', 'ListView'); } $xtpl->assign('JAVASCRIPT', get_set_focus_js().user_get_validate_record_js().user_get_chooser_js().user_get_confsettings_js().'<script type="text/javascript" language="Javascript" src="modules/Users/User.js"></script>'); $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('FIRST_NAME', $focus->first_name); $xtpl->assign('LAST_NAME', $focus->last_name); if($focus->getPreference('use_real_names') == 'on') { $xtpl->assign('USE_REAL_NAMES', 'CHECKED'); } if($focus->getPreference('no_opps') == 'on') { $xtpl->assign('NO_OPPS', 'CHECKED'); } if($aokusers == '1' or $aokusers==true) { $xtpl->assign('ALLOWUSERS', 'CHECKED'); } if($alogsusers == '1' or $alogsusers==true) { $xtpl->assign('ALLOWLOGS', 'CHECKED'); } 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(!is_admin($current_user)){ $xtpl->assign('ALLOWUSERS_STATUS', 'disabled'); $xtpl->assign('ALLOWLOGS_STATUS', 'disabled'); } 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'); } $xtpl->assign('GOOGLE_MDOCSNEWFILES', $focus->google_mdocsnewfiles_c); if($focus->google_mplannedcalls_c == 'on') { $xtpl->assign('GOOGLE_MPLANNEDCALLS', "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"); } $xtpl->assign('GOOGLE_MAFTERDATE', $focus->google_mafterdate_c); $xtpl->assign('GOOGLE_MMAIL_C', $focus->google_mmail_c); $xtpl->assign('GOOGLE_MPASS_C', $focus->google_mpass_c); $xtpl->assign('GOOGLE_MMAIL_CTS_C', $focus->google_mmail_cts_contacts_c); $xtpl->assign('GOOGLE_MPASS_CTS_C', $focus->google_mpass_cts_contacts_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); if(is_admin($current_user)) $xtpl->parse('main.prompttz'); if (file_exists($theme_path.'config.php')){ require_once($theme_path.'config.php'); } //Add Custom Fields require_once('modules/DynamicFields/templates/Files/EditView.php'); if(is_admin($focus)) { $xtpl->assign('IS_ADMIN', 'checked'); } $reports_to_change_button_html = ''; $xtpl->parse('main.freebusy'); $xtpl->parse('main'); $xtpl->out('main'); $str = "<script> YAHOO.util.Event.addListener(window, 'load', SUGAR.util.fillShortcuts, $savedSearchSelects); </script>"; echo $str; ?> Save