id) die ("Unauthorized access to user administration.");
$focus->retrieve($_REQUEST['record']);
}
if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') {
$focus->id = "";
$focus->user_name = "";
}
global $theme;
$theme_path="themes/".$theme."/";
$image_path=$theme_path."images/";
require_once($theme_path.'layout_utils.php');
$log->info("User edit view");
$xtpl=new XTemplate ('modules/Users/EditView.html');
$xtpl->assign("MOD", $mod_strings);
$xtpl->assign("APP", $app_strings);
if (isset($_REQUEST['error_string'])) $xtpl->assign("ERROR_STRING", "Error: ".$_REQUEST['error_string']."");
if (isset($_REQUEST['return_module']))
{
$xtpl->assign("RETURN_MODULE", $_REQUEST['return_module']);
$RETURN_MODULE=$_REQUEST['return_module'];
}
if (isset($_REQUEST['return_action']))
{
$xtpl->assign("RETURN_ACTION", $_REQUEST['return_action']);
$RETURN_ACTION = $_REQUEST['return_action'];
}
if(isset($_REQUEST['activity_mode']))
{
$xtpl->assign("ACTIVITYMODE",$_REQUEST['activity_mode']);
}
if ($_REQUEST['isDuplicate'] != 'true' && isset($_REQUEST['return_id']))
{
$xtpl->assign("RETURN_ID", $_REQUEST['return_id']);
$RETURN_ID = $_REQUEST['return_id'];
}
$xtpl->assign("JAVASCRIPT", get_set_focus_js().get_validate_record_js());
$xtpl->assign("IMAGE_PATH", $image_path);$xtpl->assign("PRINT_URL", "phprint.php?jt=".session_id().$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);
$xtpl->assign("TITLE", $focus->title);
$xtpl->assign("DEPARTMENT", $focus->department);
$xtpl->assign("REPORTS_TO_ID", $focus->reports_to_id);
$xtpl->assign("REPORTS_TO_NAME", $focus->reports_to_name);
$xtpl->assign("PHONE_HOME", $focus->phone_home);
$xtpl->assign("PHONE_MOBILE", $focus->phone_mobile);
$xtpl->assign("PHONE_WORK", $focus->phone_work);
$xtpl->assign("PHONE_OTHER", $focus->phone_other);
$xtpl->assign("PHONE_FAX", $focus->phone_fax);
$xtpl->assign("EMAIL1", $focus->email1);
$xtpl->assign("EMAIL2", $focus->email2);
$xtpl->assign("YAHOO_ID", $focus->yahoo_id);
if (isset($focus->yahoo_id) && $focus->yahoo_id !== "") $xtpl->assign("YAHOO_MESSENGER", "");
$xtpl->assign("ADDRESS_STREET", $focus->address_street);
$xtpl->assign("ADDRESS_CITY", $focus->address_city);
$xtpl->assign("ADDRESS_STATE", $focus->address_state);
$xtpl->assign("ADDRESS_POSTALCODE", $focus->address_postalcode);
$xtpl->assign("ADDRESS_COUNTRY", $focus->address_country);
$xtpl->assign("SIGNATURE", $focus->signature);
$xtpl->assign("DESCRIPTION", $focus->description);
$DATE_FORMAT_SELECT_OPTION = '';
$xtpl->assign("DATE_FORMAT", $DATE_FORMAT_SELECT_OPTION);
if (is_admin($current_user)) {
$status = "
".$app_strings['LBL_REQUIRED_SYMBOL']."".$mod_strings['LBL_STATUS']." | \n";
$status .= " | \n";
$xtpl->assign("USER_STATUS_OPTIONS", $status);
$ROLE_SELECT_OPTION = '';
$xtpl->assign("USER_ROLE", $ROLE_SELECT_OPTION);
$GROUP_SELECT_OPTION = '';
$xtpl->assign("GROUP_NAME", $GROUP_SELECT_OPTION);
}
if (isset($default_user_name)
&& $default_user_name != ""
&& $default_user_name == $focus->user_name
&& isset($lock_default_user_name)
&& $lock_default_user_name == true ) {
$status .= " disabled ";
$xtpl->assign("DISABLED", "disabled");
}
if ($_REQUEST['Edit'] == ' Edit ')
{
$xtpl->assign("READONLY", "readonly");
$xtpl->assign("USERNAME_READONLY", "readonly");
}
if(isset($_REQUEST['record']) && $_REQUEST['isDuplicate'] != 'true')
{
$xtpl->assign("USERNAME_READONLY", "readonly");
}
if (is_admin($current_user) && $focus->is_admin == 'on') $xtpl->assign("IS_ADMIN", "checked");
elseif (is_admin($current_user) && $focus->is_admin != 'on') ;
elseif (!is_admin($current_user) && $focus->is_admin == 'on') $xtpl->assign("IS_ADMIN", "disabled checked");
else $xtpl->assign("IS_ADMIN", "disabled");
$xtpl->parse("main");
$xtpl->out("main");
/*
echo "
";
if(is_admin($current_user) && ! isset($focus->id))
{
include ('modules/Calendar/user_new.php');
}
else
{
#require_once('modules/Calendar/Authenticate.php');
#$a = $current_user->uid;
#echo $a;
#include ('modules/Calendar/user_new.php?id=$a');
}
echo "\n";
echo " | \n";
echo " \n";
echo " \n";
echo " | \n";
echo " | \n";
echo "
\n";
echo "";
echo get_set_focus_js();
echo get_validate_record_js();
*/
?>