[Vtigercrm-commits] [vtiger-commits] r11078 - /vtigercrm/branches/5.0.3/modules/CustomView/CustomView.js
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Mon May 28 04:25:53 EDT 2007
Author: richie
Date: Mon May 28 02:25:49 2007
New Revision: 11078
Log:
* Added changed to show the format details for the user when we select a field and added support for multiple entries in single field with comma seperated
Modified:
vtigercrm/branches/5.0.3/modules/CustomView/CustomView.js
Modified: vtigercrm/branches/5.0.3/modules/CustomView/CustomView.js
==============================================================================
--- vtigercrm/branches/5.0.3/modules/CustomView/CustomView.js (original)
+++ vtigercrm/branches/5.0.3/modules/CustomView/CustomView.js Mon May 28 02:25:49 2007
@@ -23,20 +23,36 @@
var fld = currField.value.split(":");
var tod = fld[4];
- if(fld[4] == 'D' || (fld[4] == 'T' && fld[1] != 'time_start' && fld[1] != 'time_end') || fld[4] == 'DT')
- {
- $("and"+sel.id).innerHTML = "";
- if(sel.id != "fcol5")
- $("and"+sel.id).innerHTML = "<em old='(yyyy-mm-dd)'>("+$("user_dateformat").value+")</em> "+alert_arr.LBL_AND;
- else
- $("and"+sel.id).innerHTML = "<em old='(yyyy-mm-dd)'>("+$("user_dateformat").value+")</em> ";
+ if(fld[4] == 'D' || fld[4] == 'DT')
+ {
+ $("and"+sel.id).innerHTML = "";
+ if(sel.id != "fcol5")
+ $("and"+sel.id).innerHTML = "<em old='(yyyy-mm-dd)'>("+$("user_dateformat").value+")</em> "+alert_arr.LBL_AND;
+ else
+ $("and"+sel.id).innerHTML = "<em old='(yyyy-mm-dd)'>("+$("user_dateformat").value+")</em> ";
}
+ else if(fld[4] == 'T' && fld[1] != 'time_start' && fld[1] != 'time_end')
+ {
+ $("and"+sel.id).innerHTML = "";
+ if(sel.id != "fcol5")
+ $("and"+sel.id).innerHTML = "<em old='(yyyy-mm-dd)'>("+$("user_dateformat").value+" hh:mm:ss)</em> "+alert_arr.LBL_AND;
+ else
+ $("and"+sel.id).innerHTML = "<em old='(yyyy-mm-dd)'>("+$("user_dateformat").value+" hh:mm:ss)</em> ";
+ }
+ else if(fld[4] == 'C')
+ {
+ $("and"+sel.id).innerHTML = "";
+ if(sel.id != "fcol5")
+ $("and"+sel.id).innerHTML = "( Yes / No ) "+alert_arr.LBL_AND;
+ else
+ $("and"+sel.id).innerHTML = "( Yes / No ) ";
+ }
else {
- $("and"+sel.id).innerHTML = "";
- if(sel.id != "fcol5")
- $("and"+sel.id).innerHTML = " "+alert_arr.LBL_AND;
- else
- $("and"+sel.id).innerHTML = " ";
+ $("and"+sel.id).innerHTML = "";
+ if(sel.id != "fcol5")
+ $("and"+sel.id).innerHTML = " "+alert_arr.LBL_AND;
+ else
+ $("and"+sel.id).innerHTML = " ";
}
if(currField.value != null && currField.value.length != 0)
@@ -129,7 +145,7 @@
// Added for Custom View Advance Filter validation
function checkval()
{
- var value,option,arr,dttime;
+ var value,option,arr,dttime,sep;
for(var i=1;i<=5;i++)
{
value=trim(getObj("fval"+i).value);
@@ -137,52 +153,73 @@
if(option !="" && value !="")
{
if(getObj("fop"+i).selectedIndex == 0)
- {
- alert(alert_arr.LBL_SELECT_CRITERIA);
- return false;
- }
+ {
+ alert(alert_arr.LBL_SELECT_CRITERIA);
+ return false;
+ }
arr=option.split(":");
if(arr[4] == "N" || arr[4] == "I" || arr[4] == "NN")
{
- if(isNaN(value))
+ sep=value.split(",");
+ for(var j=0;j<sep.length;j++)
{
+ if(isNaN(sep[j]))
+ {
alert(alert_arr.LBL_ENTER_VALID_NO);
getObj("fval"+i).select();
return false;
+ }
+
+
}
}
if(arr[4] == "D")
{
- if(!cv_dateValidate(trim(getObj("fval"+i).value),"Date","OTH"))
- {
- getObj("fval"+i).select();
- return false;
+
+ sep=value.split(",");
+ for(var j=0;j<sep.length;j++)
+ {
+ if(!cv_dateValidate(trim(sep[j]),"Date","OTH"))
+ {
+ getObj("fval"+i).select();
+ return false;
+ }
}
}
if(arr[4] == "T")
{
- var dttime=value.split(" ");
- if(!cv_dateValidate(dttime[0],"Date","OTH"))
- {
- getObj("fval"+i).select();
- return false;
- }
-
-
- if(!cv_patternValidate(dttime[1],"Time","TIMESECONDS"))
+
+ sep=value.split(",");
+ for(var j=0;j<sep.length;j++)
{
- getObj("fval"+i).select();
- return false;
+ var dttime=sep[j].split(" ");
+ if(!cv_dateValidate(dttime[0],"Date","OTH"))
+ {
+ getObj("fval"+i).select();
+ return false;
+ }
+
+
+ if(!cv_patternValidate(dttime[1],"Time","TIMESECONDS"))
+ {
+ getObj("fval"+i).select();
+ return false;
+ }
}
}
if(arr[4] == "C")
{
- if(value.toLowerCase() != "yes") if(value.toLowerCase() != "no")
- {
- alert(alert_arr.LBL_PROVIDE_YES_NO);
- getObj("fval"+i).select();
- return false;
+ sep=value.split(",");
+ for(var j=0;j<sep.length;j++)
+ {
+
+ if(sep[j].toLowerCase() != "yes") if(sep[j].toLowerCase() != "no")
+ {
+ alert(alert_arr.LBL_PROVIDE_YES_NO);
+ getObj("fval"+i).select();
+ return false;
+ }
}
}
}
More information about the vtigercrm-commits
mailing list