[Vtigercrm-commits] [vtiger-commits] r6225 - in /vtigercrm/trunk: Smarty/templates/UserEditView.tpl modules/Users/EditView.php modules/Users/Forms.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Sat May 20 06:27:01 EDT 2006
Author: don
Date: Sat May 20 04:26:55 2006
New Revision: 6225
Log:
issue in user detailview has been fixed
Modified:
vtigercrm/trunk/Smarty/templates/UserEditView.tpl
vtigercrm/trunk/modules/Users/EditView.php
vtigercrm/trunk/modules/Users/Forms.php
Modified: vtigercrm/trunk/Smarty/templates/UserEditView.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/UserEditView.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/UserEditView.tpl Sat May 20 04:26:55 2006
@@ -86,7 +86,7 @@
<form name="EditView" method="POST" action="index.php" ENCTYPE="multipart/form-data">
<input type="hidden" name="module" value="Users">
<input type="hidden" name="record" value="{$ID}">
- <input type="hidden" name="mode" value="register">
+ <input type="hidden" name="mode" value="{$MODE}">
<input type='hidden' name='parenttab' value='Settings'>
<input type="hidden" name="activity_mode" value="{$ACTIVITYMODE}">
<input type="hidden" name="action">
Modified: vtigercrm/trunk/modules/Users/EditView.php
==============================================================================
--- vtigercrm/trunk/modules/Users/EditView.php (original)
+++ vtigercrm/trunk/modules/Users/EditView.php Sat May 20 04:26:55 2006
@@ -99,10 +99,8 @@
$smarty->assign("RETURN_ID", $_REQUEST['return_id']);
$RETURN_ID = $_REQUEST['return_id'];
}
-if($mode == 'edit')
- $smarty->assign("JAVASCRIPT", get_set_focus_js().get_validate_record_js1());
-else
- $smarty->assign("JAVASCRIPT", get_set_focus_js().get_validate_record_js());
+
+$smarty->assign("JAVASCRIPT", get_validate_record_js());
$smarty->assign("IMAGE_PATH", $image_path);$smarty->assign("PRINT_URL", "phprint.php?jt=".session_id().$GLOBALS['request_string']);
$smarty->assign("ID", $focus->id);
Modified: vtigercrm/trunk/modules/Users/Forms.php
==============================================================================
--- vtigercrm/trunk/modules/Users/Forms.php (original)
+++ vtigercrm/trunk/modules/Users/Forms.php Sat May 20 04:26:55 2006
@@ -34,6 +34,7 @@
$lbl_last_name = $mod_strings['LBL_LIST_LAST_NAME'];
$lbl_user_name = $mod_strings['LBL_LIST_USER_NAME'];
+$lbl_role_name = $mod_strings['LBL_ROLE_NAME'];
$lbl_new_password = $mod_strings['LBL_LIST_PASSWORD'];
$lbl_confirm_new_password = $mod_strings['LBL_LIST_CONFIRM_PASSWORD'];
$lbl_user_email1 = $mod_strings['LBL_LIST_EMAIL'];
@@ -44,49 +45,71 @@
<script type="text/javascript" language="Javascript">
<!-- to hide script contents from old browsers
+function set_fieldfocus(errorMessage,oMiss_field){
+ alert("$err_missing_required_fields" + errorMessage);
+ oMiss_field.focus();
+ exit();
+}
function verify_data(form) {
var isError = false;
var errorMessage = "";
- if (trim(form.user_name.value) == "") {
+ if (trim(form.email1.value) == "") {
isError = true;
- errorMessage += "\\n$lbl_user_name";
+ errorMessage += "\\n$lbl_user_email1";
+ oField_miss = form.email1;
}
- if (trim(form.new_password.value) == "") {
+ if (trim(form.role_name.value) == "") {
isError = true;
- errorMessage += "\\n$lbl_new_password";
- }
- if (trim(form.confirm_new_password.value) == "") {
- isError = true;
- errorMessage += "\\n$lbl_confirm_new_password";
+ errorMessage += "\\n$lbl_role_name";
+ oField_miss =form.role_name;
}
if (trim(form.last_name.value) == "") {
isError = true;
errorMessage += "\\n$lbl_last_name";
+ oField_miss =form.last_name;
}
- if (trim(form.email1.value) == "") {
+ if(form.mode.value !='edit')
+ {
+ if (trim(form.new_password.value) == "") {
+ isError = true;
+ errorMessage += "\\n$lbl_new_password";
+ oField_miss =form.new_password;
+ }
+ if (trim(form.confirm_new_password.value) == "") {
+ isError = true;
+ errorMessage += "\\n$lbl_confirm_new_password";
+ oField_miss =form.confirm_new_password;
+ }
+ }
+ if (trim(form.user_name.value) == "") {
isError = true;
- errorMessage += "\\n$lbl_user_email1";
+ errorMessage += "\\n$lbl_user_name";
+ oField_miss =form.user_name;
}
if (isError == true) {
- alert("$err_missing_required_fields" + errorMessage);
- return false;
+ set_fieldfocus(errorMessage,oField_miss);
}
if (trim(form.email1.value) != "" && !/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(form.email1.value)) {
- alert('"' + form.email1.value + '" is $err_invalid_email_address');
- return false;
+ errorMessage='"' + form.email1.value + '" is $err_invalid_email_address';
+ set_fieldfocus(errorMessage,form.email1);
}
if (trim(form.email2.value) != "" && !/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(form.email2.value)) {
- alert('"' + form.email2.value + '" value in other email field is $err_invalid_email_address');
- return false;
+ errorMessage='"' + form.email2.value + '" value in other email field is $err_invalid_email_address';
+ set_fieldfocus(errorMessage,form.email2);
}
- if(trim(form.new_password.value) != trim(form.confirm_new_password.value))
- {
- alert("The password does't match");
- return false;
+ if(form.mode.value != 'edit')
+ {
+ if(trim(form.new_password.value) != trim(form.confirm_new_password.value))
+ {
+ set_fieldfocus("The password does't match",form.form.new_password);
+ }
+ check_duplicate();
+ }else
+ {
+ form.submit();
}
- check_duplicate();
}
// end hiding contents from old browsers -->
@@ -97,67 +120,4 @@
return $the_script;
}
-function get_validate_record_js1 () {
-global $mod_strings;
-global $app_strings;
-
-$lbl_last_name = $mod_strings['LBL_LIST_LAST_NAME'];
-$lbl_user_name = $mod_strings['LBL_LIST_USER_NAME'];
-$lbl_new_password = $mod_strings['LBL_LIST_PASSWORD'];
-$lbl_confirm_new_password = $mod_strings['LBL_LIST_CONFIRM_PASSWORD'];
-$lbl_user_email1 = $mod_strings['LBL_LIST_EMAIL'];
-$err_missing_required_fields = $app_strings['ERR_MISSING_REQUIRED_FIELDS'];
-$err_invalid_email_address = $app_strings['ERR_INVALID_EMAIL_ADDRESS'];
-
-$the_script = <<<EOQ
-
-<script type="text/javascript" language="Javascript">
-<!-- to hide script contents from old browsers
-
-function verify_data(form) {
- var isError = false;
- var errorMessage = "";
- if (trim(form.user_name.value) == "") {
- isError = true;
- errorMessage += "\\n$lbl_user_name";
- }
- if (trim(form.last_name.value) == "") {
- isError = true;
- errorMessage += "\\n$lbl_last_name";
- }
- if (trim(form.email1.value) == "") {
- isError = true;
- errorMessage += "\\n$lbl_user_email1";
- }
-
- if (isError == true) {
- alert("$err_missing_required_fields" + errorMessage);
- return false;
- }
- if (trim(form.email1.value) != "" && !/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(form.email1.value)) {
- alert('"' + form.email1.value + '" is $err_invalid_email_address');
- return false;
- }
- if (trim(form.email2.value) != "" && !/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(form.email2.value)) {
- alert('"' + form.email2.value + '" value in other email field is $err_invalid_email_address');
- return false;
- }
- if(trim(form.new_password.value) != trim(form.confirm_new_password.value))
- {
- alert("The password does't match");
- return false;
- }
- return true;
-}
-
-// end hiding contents from old browsers -->
-</script>
-
-EOQ;
-
-return $the_script;
-}
-
-
-
?>
More information about the vtigercrm-commits
mailing list