[Vtigercrm-commits] [vtiger-commits] r10704 - in /vtigercrm/branches/5.0.3: include/js/QuickCreate.js include/js/general.js modules/Users/DefaultDataPopulator.php schema/DatabaseSchema.xml
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Tue Apr 17 05:32:06 EDT 2007
Author: richie
Date: Tue Apr 17 03:31:48 2007
New Revision: 10704
Log:
fix for emailid and noofemployees validation. Fixes #3278 #3309 #3461 --minnie
Modified:
vtigercrm/branches/5.0.3/include/js/QuickCreate.js
vtigercrm/branches/5.0.3/include/js/general.js
vtigercrm/branches/5.0.3/modules/Users/DefaultDataPopulator.php
vtigercrm/branches/5.0.3/schema/DatabaseSchema.xml
Modified: vtigercrm/branches/5.0.3/include/js/QuickCreate.js
==============================================================================
--- vtigercrm/branches/5.0.3/include/js/QuickCreate.js (original)
+++ vtigercrm/branches/5.0.3/include/js/QuickCreate.js Tue Apr 17 03:31:48 2007
@@ -43,7 +43,11 @@
function qcpatternValidate(fldName,fldLabel,type) {
var currObj=window.document.QcEditView[fldName];
if (type.toUpperCase()=="EMAIL") //Email ID validation
- var re=new RegExp(/^.+ at .+\..+$/)
+ {
+ /*changes made to fix -- ticket#3278 & ticket#3461
+ var re=new RegExp(/^.+ at .+\..+$/)*/
+ var re=new RegExp(/^[a-z0-9]([a-z0-9_\-\.]*)@([a-z0-9_\-\.]*)(\.[a-z]{2,3}(\.[a-z]{2}){0,2})$/)
+ }
if (type.toUpperCase()=="DATE") {//DATE validation
//YMD
@@ -176,13 +180,17 @@
alert(alert_arr.INVALID+fldLabel)
window.document.QcEditView[fldName].focus()
return false
- }
- else if( val < -2147483648 || val > 2147483647)
- {
- alert(fldLabel +alert_arr.OUT_OF_RANGE);
- return false;
- }
-
+ }
+ else if( (fldName != 'employees' || fldName != 'noofemployees') && (val < -2147483648 || val > 2147483647))
+ {
+ alert(fldLabel +alert_arr.OUT_OF_RANGE);
+ return false;
+ }
+ else if((fldName == 'employees' || fldName == 'noofemployees') && (val < 0 || val > 2147483647))
+ {
+ alert(fldLabel +alert_arr.OUT_OF_RANGE);
+ return false;
+ }
else
{
return true
Modified: vtigercrm/branches/5.0.3/include/js/general.js
==============================================================================
--- vtigercrm/branches/5.0.3/include/js/general.js (original)
+++ vtigercrm/branches/5.0.3/include/js/general.js Tue Apr 17 03:31:48 2007
@@ -240,8 +240,12 @@
function patternValidate(fldName,fldLabel,type) {
var currObj=getObj(fldName)
if (type.toUpperCase()=="EMAIL") //Email ID validation
- var re=new RegExp(/^.+ at .+\..+$/)
-
+ {
+ /*changes made to fix -- ticket#3278 & ticket#3461
+ var re=new RegExp(/^.+ at .+\..+$/)*/
+ var re=new RegExp(/^[a-z0-9]([a-z0-9_\-\.]*)@([a-z0-9_\-\.]*)(\.[a-z]{2,3}(\.[a-z]{2}){0,2})$/)
+ }
+
if (type.toUpperCase()=="DATE") {//DATE validation
//YMD
//var reg1 = /^\d{2}(\-|\/|\.)\d{1,2}\1\d{1,2}$/ //2 digit year
@@ -700,12 +704,12 @@
getObj(fldName).focus()
return false
}
- else if((fldName != 'employees') && (val < -2147483648 || val > 2147483647))
+ else if((fldName != 'employees' || fldName != 'noofemployees') && (val < -2147483648 || val > 2147483647))
{
alert(fldLabel +alert_arr.OUT_OF_RANGE);
return false;
}
- else if((fldName == 'employees') && (val < 0 || val > 2147483647))
+ else if((fldName == 'employees' || fldName != 'noofemployees') && (val < 0 || val > 2147483647))
{
alert(fldLabel +alert_arr.OUT_OF_RANGE);
return false;
Modified: vtigercrm/branches/5.0.3/modules/Users/DefaultDataPopulator.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Users/DefaultDataPopulator.php (original)
+++ vtigercrm/branches/5.0.3/modules/Users/DefaultDataPopulator.php Tue Apr 17 03:31:48 2007
@@ -248,7 +248,7 @@
$this->db->query("insert into vtiger_field values (7,".$this->db->getUniqueID("vtiger_field").",'rating','vtiger_leaddetails',1,'15','rating','Rating',1,0,0,100,15,13,1,'V~O',1,null,'ADV')");
$this->db->query("insert into vtiger_field values (7,".$this->db->getUniqueID("vtiger_field").",'noofemployees','vtiger_leaddetails',1,'1','noofemployees','No Of Employees',1,0,0,100,16,13,1,'V~O',1,null,'ADV')");
$this->db->query("insert into vtiger_field values (7,".$this->db->getUniqueID("vtiger_field").",'smownerid','vtiger_crmentity',1,'53','assigned_user_id','Assigned To',1,0,0,100,17,13,1,'V~M',1,null,'BAS')");
- $this->db->query("insert into vtiger_field values (7,".$this->db->getUniqueID("vtiger_field").",'yahooid','vtiger_leaddetails',1,'13','yahooid','Yahoo Id',1,0,0,100,18,13,1,'V~O',1,null,'ADV')");
+ $this->db->query("insert into vtiger_field values (7,".$this->db->getUniqueID("vtiger_field").",'yahooid','vtiger_leaddetails',1,'13','yahooid','Yahoo Id',1,0,0,100,18,13,1,'E~O',1,null,'ADV')");
$this->db->query("insert into vtiger_field values (7,".$this->db->getUniqueID("vtiger_field").",'createdtime','vtiger_crmentity',1,'70','createdtime','Created Time',1,0,0,100,19,13,2,'T~O',1,null,'BAS')");
$this->db->query("insert into vtiger_field values (7,".$this->db->getUniqueID("vtiger_field").",'modifiedtime','vtiger_crmentity',1,'70','modifiedtime','Modified Time',1,0,0,100,20,13,2,'T~O',1,null,'BAS')");
@@ -294,7 +294,7 @@
$this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'email','vtiger_contactdetails',1,'13','email','Email',1,0,0,100,15,4,1,'E~O',0,5,'BAS')");
$this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'reportsto','vtiger_contactdetails',1,'57','contact_id','Reports To',1,0,0,100,16,4,1,'V~O',1,null,'ADV')");
$this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'assistant','vtiger_contactsubdetails',1,'1','assistant','Assistant',1,0,0,100,17,4,1,'V~O',1,null,'ADV')");
- $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'yahooid','vtiger_contactdetails',1,'13','yahooid','Yahoo Id',1,0,0,100,18,4,1,'V~O',1,null,'ADV')");
+ $this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'yahooid','vtiger_contactdetails',1,'13','yahooid','Yahoo Id',1,0,0,100,18,4,1,'E~O',1,null,'ADV')");
$this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'assistantphone','vtiger_contactsubdetails',1,'11','assistantphone','Assistant Phone',1,0,0,100,19,4,1,'V~O',1,null,'ADV')");
$this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'donotcall','vtiger_contactdetails',1,'56','donotcall','Do Not Call',1,0,0,100,20,4,1,'C~O',1,null,'ADV')");
$this->db->query("insert into vtiger_field values (4,".$this->db->getUniqueID("vtiger_field").",'emailoptout','vtiger_contactdetails',1,'56','emailoptout','Email Opt Out',1,0,0,100,21,4,1,'C~O',1,null,'ADV')");
Modified: vtigercrm/branches/5.0.3/schema/DatabaseSchema.xml
==============================================================================
--- vtigercrm/branches/5.0.3/schema/DatabaseSchema.xml (original)
+++ vtigercrm/branches/5.0.3/schema/DatabaseSchema.xml Tue Apr 17 03:31:48 2007
@@ -625,7 +625,7 @@
<field name="evaluationstatus" type="C" size="50" />
<field name="transferdate" type="D" />
<field name="revenuetype" type="C" size="50" />
- <field name="noofemployees" type="C" size="50" />
+ <field name="noofemployees" type="I" size="50" />
<field name="yahooid" type="C" size="100" />
<field name="assignleadchk" type="I" size="1">
<default value="0" />
More information about the vtigercrm-commits
mailing list