[Vtigercrm-commits] [vtiger-commits] r10693 - in /vtigercrm/branches/5.0.3: Smarty/templates/ReportRun.tpl Smarty/templates/ReportsStep1.tpl modules/Reports/NewReport1.php modules/Reports/Reports.js

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Mon Apr 16 02:50:18 EDT 2007


Author: richie
Date: Mon Apr 16 00:50:07 2007
New Revision: 10693

Log:
* Fixed the issue with Start date and end date ie., previously we can give start date after end date. Now we should enter Start Date <= End Date This validation is added, Fixed #3611

Modified:
    vtigercrm/branches/5.0.3/Smarty/templates/ReportRun.tpl
    vtigercrm/branches/5.0.3/Smarty/templates/ReportsStep1.tpl
    vtigercrm/branches/5.0.3/modules/Reports/NewReport1.php
    vtigercrm/branches/5.0.3/modules/Reports/Reports.js

Modified: vtigercrm/branches/5.0.3/Smarty/templates/ReportRun.tpl
==============================================================================
--- vtigercrm/branches/5.0.3/Smarty/templates/ReportRun.tpl (original)
+++ vtigercrm/branches/5.0.3/Smarty/templates/ReportRun.tpl Mon Apr 16 00:50:07 2007
@@ -171,6 +171,24 @@
 	var stdDateFiltervalue = document.NewReport.stdDateFilter.options[document.NewReport.stdDateFilter.selectedIndex].value;
 	var startdatevalue = document.NewReport.startdate.value;
 	var enddatevalue = document.NewReport.enddate.value;
+
+	var date1=getObj("startdate")
+        var date2=getObj("enddate")
+	
+if ((date1.value != '') || (date2.value != ''))
+{
+
+        if(!dateValidate("startdate","Start Date","D"))
+                return false
+
+        if(!dateValidate("enddate","End Date","D"))
+                return false
+
+        if(! compareDates(date1.value,'Start Date',date2.value,'End Date','LE'))
+                return false;
+}
+
+
 	new Ajax.Request(
                 'index.php',
                 {queue: {position: 'end', scope: 'command'},

Modified: vtigercrm/branches/5.0.3/Smarty/templates/ReportsStep1.tpl
==============================================================================
--- vtigercrm/branches/5.0.3/Smarty/templates/ReportsStep1.tpl (original)
+++ vtigercrm/branches/5.0.3/Smarty/templates/ReportsStep1.tpl Mon Apr 16 00:50:07 2007
@@ -17,6 +17,7 @@
 	<script language="JavaScript" type="text/javascript" src="include/js/general.js"></script>
 	<script language="JavaScript" type="text/javascript" src="include/js/{php} echo $_SESSION['authenticated_user_language'];{/php}.lang.js?{php} echo $_SESSION['vtiger_version'];{/php}"></script>
 	<script language="JavaScript" type="text/javascript" src="modules/Reports/Reports.js"></script>
+{$DATE_FORMAT}
 </head>
 <body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">
 <!-- Master Table -->

Modified: vtigercrm/branches/5.0.3/modules/Reports/NewReport1.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Reports/NewReport1.php (original)
+++ vtigercrm/branches/5.0.3/modules/Reports/NewReport1.php Mon Apr 16 00:50:07 2007
@@ -61,6 +61,10 @@
 	$ogReport->getSecModuleColumnsList($secondarymodule);
 	$list_report_form->assign('BACK_WALK','true');
 }
+
+$date_format='<script> var userDateFormat = \''.$current_user->date_format.'\' </script>';
+$list_report_form->assign('DATE_FORMAT',$date_format);
+
 $list_report_form->assign('PRI_MODULE',$primarymodule);
 $list_report_form->assign('SEC_MODULE',$secondarymodule);
 $list_report_form->assign('REPORT_NAME',$reportname);

Modified: vtigercrm/branches/5.0.3/modules/Reports/Reports.js
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Reports/Reports.js (original)
+++ vtigercrm/branches/5.0.3/modules/Reports/Reports.js Mon Apr 16 00:50:07 2007
@@ -395,10 +395,27 @@
         
 function changeSteps1() 
 {
+	if(getObj('step5').style.display != 'none')
+	{
+	var date1=getObj("startdate")
+	var date2=getObj("enddate")
+
+
+//# validation added for date field validation in final step of report creation
+if ((date1.value != '') || (date2.value != ''))
+{
+
+	if(!dateValidate("startdate","Start Date","D"))
+                return false
 	
-	if(getObj('step5').style.display != 'none')
-	{
-		saveAndRunReport();
+	if(!dateValidate("enddate","End Date","D"))
+                return false
+	
+	if(! compareDates(date1.value,'Start Date',date2.value,'End Date','LE'))
+		return false;
+}	
+	saveAndRunReport();
+
 	}else
 	{
 		for(i = 0; i < divarray.length ;i++)





More information about the vtigercrm-commits mailing list