[Vtigercrm-commits] [vtiger-commits] r10783 - in /vtigercrm/branches/5.0.3: Smarty/templates/ modules/Reports/
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Wed Apr 25 09:35:51 EDT 2007
Author: richie
Date: Wed Apr 25 07:35:35 2007
New Revision: 10783
Log:
fix for Report Modules - standard Filter Date Format. Fixes #3581 --minnie
Modified:
vtigercrm/branches/5.0.3/Smarty/templates/ReportFilters.tpl
vtigercrm/branches/5.0.3/Smarty/templates/ReportRun.tpl
vtigercrm/branches/5.0.3/modules/Reports/ReportFilters.php
vtigercrm/branches/5.0.3/modules/Reports/Reports.js
vtigercrm/branches/5.0.3/modules/Reports/Reports.php
vtigercrm/branches/5.0.3/modules/Reports/Save.php
vtigercrm/branches/5.0.3/modules/Reports/SaveAndRun.php
vtigercrm/branches/5.0.3/modules/Reports/StandardFilter.php
Modified: vtigercrm/branches/5.0.3/Smarty/templates/ReportFilters.tpl
==============================================================================
--- vtigercrm/branches/5.0.3/Smarty/templates/ReportFilters.tpl (original)
+++ vtigercrm/branches/5.0.3/Smarty/templates/ReportFilters.tpl Wed Apr 25 07:35:35 2007
@@ -46,15 +46,29 @@
</select>
</td>
<td class="dvtCellInfo" width="25%">
- <select name="stdDateFilter" onchange='showDateRange( this.options[ this.selectedIndex ].value )' class="txtBox">
+ <select name="stdDateFilter" id="stdDateFilter" onchange='showDateRange( this.options[ this.selectedIndex ].value )' class="txtBox">
{$BLOCKCRITERIA_STD}
</select>
</td>
- <td class="dvtCellInfo"><input name="startdate" id="jscal_field_date_start" style="border: 1px solid rgb(186, 186, 186);" size="10" maxlength="10" value="{$STARTDATE_STD}" type="text">
- <img src="{$IMAGE_PATH}calendar.gif" id="jscal_trigger_date_start"><br><font size="1"><em old="{$APP.NTC_DATE_FORMAT}">{$APP.NTC_DATE_FORMAT}</em></font>
+ <td class="dvtCellInfo">
+ <input name="startdate" id="jscal_field_date_start" style="border: 1px solid rgb(186, 186, 186);" size="10" maxlength="10" value="{$STARTDATE_STD}" type="text" ><br>
+ <img src="{$IMAGE_PATH}calendar.gif" id="jscal_trigger_date_start" >
+ <font size="1"><em old="(yyyy-mm-dd)">({$DATEFORMAT})</em></font>
+ <script type="text/javascript">
+ Calendar.setup ({ldelim}
+ inputField : "jscal_field_date_start", ifFormat : "{$JS_DATEFORMAT}", showsTime : false, button : "jscal_trigger_date_start", singleClick : true, step : 1
+ {rdelim})
+ </script>
</td>
- <td class="dvtCellInfo"><input name="enddate" id="jscal_field_date_end" style="border: 1px solid rgb(186, 186, 186);" size="10" maxlength="10" value="{$ENDDATE_STD}" type="text">
- <img src="{$IMAGE_PATH}calendar.gif" id="jscal_trigger_date_end"><br><font size="1"><em old="{$APP.NTC_DATE_FORMAT}">{$APP.NTC_DATE_FORMAT}</em></font>
+ <td class="dvtCellInfo">
+ <input name="enddate" id="jscal_field_date_end" style="border: 1px solid rgb(186, 186, 186);" size="10" maxlength="10" value="{$ENDDATE_STD}" type="text"><br>
+ <img src="{$IMAGE_PATH}calendar.gif" id="jscal_trigger_date_end" >
+ <font size="1"><em old="(yyyy-mm-dd)">({$DATEFORMAT})</em></font>
+ <script type="text/javascript">
+ Calendar.setup ({ldelim}
+ inputField : "jscal_field_date_end", ifFormat : "{$JS_DATEFORMAT}", showsTime : false, button : "jscal_trigger_date_end", singleClick : true, step : 1
+ {rdelim})
+ </script>
</td>
</tr>
<tr>
@@ -170,11 +184,6 @@
showDateRange( filter );
}
</script>
-<script type="text/javascript">
- Calendar.setup ({inputField : "jscal_field_date_start", ifFormat : "%Y-%m-%d", showsTime : false, button : "jscal_trigger_date_start", singleClick : true, step : 1});
- Calendar.setup ({inputField : "jscal_field_date_end", ifFormat : "%Y-%m-%d", showsTime : false, button : "jscal_trigger_date_end", singleClick : true, step : 1});
-</script>
-
<script>
for(var i=1;i<=5;i++)
{
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 Wed Apr 25 07:35:35 2007
@@ -109,7 +109,14 @@
<table border=0 cellspacing=0 cellpadding=2>
<tr>
<td align=left><input name="startdate" id="jscal_field_date_start" type="text" size="10" class="importBox" style="width:70px;" value="{$STARTDATE}"></td>
- <td valign=absmiddle align=left><img src="{$IMAGE_PATH}calendar.gif" id="jscal_trigger_date_start"></td>
+ <td valign=absmiddle align=left><img src="{$IMAGE_PATH}calendar.gif" id="jscal_trigger_date_start"><font size="1"><em old="(yyyy-mm-dd)">({$DATEFORMAT})</em></font>
+ <script type="text/javascript">
+ Calendar.setup ({ldelim}
+ inputField : "jscal_field_date_start", ifFormat : "{$JS_DATEFORMAT}", showsTime : false, button : "jscal_trigger_date_start", singleClick : true, step : 1
+ {rdelim});
+ </script>
+
+ </td>
</tr>
</table>
</td>
@@ -118,7 +125,13 @@
<table border=0 cellspacing=0 cellpadding=2>
<tr>
<td align=left><input name="enddate" id="jscal_field_date_end" type="text" size="10" class="importBox" style="width:70px;" value="{$ENDDATE}"></td>
- <td valign=absmiddle align=left><img src="{$IMAGE_PATH}calendar.gif" id="jscal_trigger_date_end"></td>
+ <td valign=absmiddle align=left><img src="{$IMAGE_PATH}calendar.gif" id="jscal_trigger_date_end"><font size="1"><em old="(yyyy-mm-dd)">({$DATEFORMAT})</em></font>
+ <script type="text/javascript">
+ Calendar.setup ({ldelim}
+ inputField : "jscal_field_date_end", ifFormat : "{$JS_DATEFORMAT}", showsTime : false, button : "jscal_trigger_date_end", singleClick : true, step : 1
+ {rdelim});
+ </script>
+ </td>
</tr>
</table>
</td>
@@ -163,8 +176,6 @@
showDateRange( filter );
}
-Calendar.setup ({inputField : "jscal_field_date_start", ifFormat : "%Y-%m-%d", showsTime : false, button : "jscal_trigger_date_start", singleClick : true, step : 1});
- Calendar.setup ({inputField : "jscal_field_date_end", ifFormat : "%Y-%m-%d", showsTime : false, button : "jscal_trigger_date_end", singleClick : true, step : 1});
function generateReport(id)
{
var stdDateFilterFieldvalue = document.NewReport.stdDateFilterField.options [document.NewReport.stdDateFilterField.selectedIndex].value;
Modified: vtigercrm/branches/5.0.3/modules/Reports/ReportFilters.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Reports/ReportFilters.php (original)
+++ vtigercrm/branches/5.0.3/modules/Reports/ReportFilters.php Wed Apr 25 07:35:35 2007
@@ -29,11 +29,14 @@
global $currentModule;
global $image_path;
global $theme;
+global $current_user;
$report_std_filter = new vtigerCRM_Smarty;
$report_std_filter->assign("MOD", $mod_strings);
$report_std_filter->assign("APP", $app_strings);
$report_std_filter->assign("IMAGE_PATH",$image_path);
+$report_std_filter->assign("DATEFORMAT",$current_user->date_format);
+$report_std_filter->assign("JS_DATEFORMAT",parse_calendardate($app_strings['NTC_DATE_FORMAT']));
include("modules/Reports/StandardFilter.php");
include("modules/Reports/AdvancedFilter.php");
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 Wed Apr 25 07:35:35 2007
@@ -397,24 +397,23 @@
{
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
+ 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(!dateValidate("enddate","End 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;
-}
- saveAndRunReport();
+ if(! compareDates(date1.value,'Start Date',date2.value,'End Date','LE'))
+ return false;
+ }
+ saveAndRunReport();
}else
{
Modified: vtigercrm/branches/5.0.3/modules/Reports/Reports.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Reports/Reports.php (original)
+++ vtigercrm/branches/5.0.3/modules/Reports/Reports.php Wed Apr 25 07:35:35 2007
@@ -616,167 +616,167 @@
if (type!="custom")
{
document.NewReport.startdate.readOnly=true
- document.NewReport.enddate.readOnly=true
- getObj("jscal_trigger_date_start").style.visibility="hidden"
- getObj("jscal_trigger_date_end").style.visibility="hidden"
+ document.NewReport.enddate.readOnly=true
+ getObj("jscal_trigger_date_start").style.visibility="hidden"
+ getObj("jscal_trigger_date_end").style.visibility="hidden"
}
else
{
document.NewReport.startdate.readOnly=false
- document.NewReport.enddate.readOnly=false
- getObj("jscal_trigger_date_start").style.visibility="visible"
- getObj("jscal_trigger_date_end").style.visibility="visible"
+ document.NewReport.enddate.readOnly=false
+ getObj("jscal_trigger_date_start").style.visibility="visible"
+ getObj("jscal_trigger_date_end").style.visibility="visible"
}
if( type == "today" )
{
- document.NewReport.startdate.value = "'.$today.'";
- document.NewReport.enddate.value = "'.$today.'";
+ document.NewReport.startdate.value = "'.getDisplayDate($today).'";
+ document.NewReport.enddate.value = "'.getDisplayDate($today).'";
}
else if( type == "yesterday" )
{
- document.NewReport.startdate.value = "'.$yesterday.'";
- document.NewReport.enddate.value = "'.$yesterday.'";
+ document.NewReport.startdate.value = "'.getDisplayDate($yesterday).'";
+ document.NewReport.enddate.value = "'.getDisplayDate($yesterday).'";
}
else if( type == "tomorrow" )
{
- document.NewReport.startdate.value = "'.$tomorrow.'";
- document.NewReport.enddate.value = "'.$tomorrow.'";
+ document.NewReport.startdate.value = "'.getDisplayDate($tomorrow).'";
+ document.NewReport.enddate.value = "'.getDisplayDate($tomorrow).'";
}
else if( type == "thisweek" )
{
- document.NewReport.startdate.value = "'.$thisweek0.'";
- document.NewReport.enddate.value = "'.$thisweek1.'";
+ document.NewReport.startdate.value = "'.getDisplayDate($thisweek0).'";
+ document.NewReport.enddate.value = "'.getDisplayDate($thisweek1).'";
}
else if( type == "lastweek" )
{
- document.NewReport.startdate.value = "'.$lastweek0.'";
- document.NewReport.enddate.value = "'.$lastweek1.'";
+ document.NewReport.startdate.value = "'.getDisplayDate($lastweek0).'";
+ document.NewReport.enddate.value = "'.getDisplayDate($lastweek1).'";
}
else if( type == "nextweek" )
{
- document.NewReport.startdate.value = "'.$nextweek0.'";
- document.NewReport.enddate.value = "'.$nextweek1.'";
+ document.NewReport.startdate.value = "'.getDisplayDate($nextweek0).'";
+ document.NewReport.enddate.value = "'.getDisplayDate($nextweek1).'";
}
else if( type == "thismonth" )
{
- document.NewReport.startdate.value = "'.$currentmonth0.'";
- document.NewReport.enddate.value = "'.$currentmonth1.'";
+ document.NewReport.startdate.value = "'.getDisplayDate($currentmonth0).'";
+ document.NewReport.enddate.value = "'.getDisplayDate($currentmonth1).'";
}
else if( type == "lastmonth" )
{
- document.NewReport.startdate.value = "'.$lastmonth0.'";
- document.NewReport.enddate.value = "'.$lastmonth1.'";
+ document.NewReport.startdate.value = "'.getDisplayDate($lastmonth0).'";
+ document.NewReport.enddate.value = "'.getDisplayDate($lastmonth1).'";
}
else if( type == "nextmonth" )
{
- document.NewReport.startdate.value = "'.$nextmonth0.'";
- document.NewReport.enddate.value = "'.$nextmonth1.'";
+ document.NewReport.startdate.value = "'.getDisplayDate($nextmonth0).'";
+ document.NewReport.enddate.value = "'.getDisplayDate($nextmonth1).'";
}
else if( type == "next7days" )
{
- document.NewReport.startdate.value = "'.$today.'";
- document.NewReport.enddate.value = "'.$next7days.'";
+ document.NewReport.startdate.value = "'.getDisplayDate($today).'";
+ document.NewReport.enddate.value = "'.getDisplayDate($next7days).'";
}
else if( type == "next30days" )
{
- document.NewReport.startdate.value = "'.$today.'";
- document.NewReport.enddate.value = "'.$next30days.'";
+ document.NewReport.startdate.value = "'.getDisplayDate($today).'";
+ document.NewReport.enddate.value = "'.getDisplayDate($next30days).'";
}
else if( type == "next60days" )
{
- document.NewReport.startdate.value = "'.$today.'";
- document.NewReport.enddate.value = "'.$next60days.'";
+ document.NewReport.startdate.value = "'.getDisplayDate($today).'";
+ document.NewReport.enddate.value = "'.getDisplayDate($next60days).'";
}
else if( type == "next90days" )
{
- document.NewReport.startdate.value = "'.$today.'";
- document.NewReport.enddate.value = "'.$next90days.'";
+ document.NewReport.startdate.value = "'.getDisplayDate($today).'";
+ document.NewReport.enddate.value = "'.getDisplayDate($next90days).'";
}
else if( type == "next120days" )
{
- document.NewReport.startdate.value = "'.$today.'";
- document.NewReport.enddate.value = "'.$next120days.'";
+ document.NewReport.startdate.value = "'.getDisplayDate($today).'";
+ document.NewReport.enddate.value = "'.getDisplayDate($next120days).'";
}
else if( type == "last7days" )
{
- document.NewReport.startdate.value = "'.$last7days.'";
- document.NewReport.enddate.value = "'.$today.'";
+ document.NewReport.startdate.value = "'.getDisplayDate($last7days).'";
+ document.NewReport.enddate.value = "'.getDisplayDate($today).'";
}
else if( type == "last30days" )
{
- document.NewReport.startdate.value = "'.$last30days.'";
- document.NewReport.enddate.value = "'.$today.'";
+ document.NewReport.startdate.value = "'.getDisplayDate($last30days).'";
+ document.NewReport.enddate.value = "'.getDisplayDate($today).'";
}
else if( type == "last60days" )
{
- document.NewReport.startdate.value = "'.$last60days.'";
- document.NewReport.enddate.value = "'.$today.'";
+ document.NewReport.startdate.value = "'.getDisplayDate($last60days).'";
+ document.NewReport.enddate.value = "'.getDisplayDate($today).'";
}
else if( type == "last90days" )
{
- document.NewReport.startdate.value = "'.$last90days.'";
- document.NewReport.enddate.value = "'.$today.'";
+ document.NewReport.startdate.value = "'.getDisplayDate($last90days).'";
+ document.NewReport.enddate.value = "'.getDisplayDate($today).'";
}
else if( type == "last120days" )
{
- document.NewReport.startdate.value = "'.$last120days.'";
- document.NewReport.enddate.value = "'.$today.'";
+ document.NewReport.startdate.value = "'.getDisplayDate($last120days).'";
+ document.NewReport.enddate.value = "'.getDisplayDate($today).'";
}
else if( type == "thisfy" )
{
- document.NewReport.startdate.value = "'.$currentFY0.'";
- document.NewReport.enddate.value = "'.$currentFY1.'";
+ document.NewReport.startdate.value = "'.getDisplayDate($currentFY0).'";
+ document.NewReport.enddate.value = "'.getDisplayDate($currentFY1).'";
}
else if( type == "prevfy" )
{
- document.NewReport.startdate.value = "'.$lastFY0.'";
- document.NewReport.enddate.value = "'.$lastFY1.'";
+ document.NewReport.startdate.value = "'.getDisplayDate($lastFY0).'";
+ document.NewReport.enddate.value = "'.getDisplayDate($lastFY1).'";
}
else if( type == "nextfy" )
{
- document.NewReport.startdate.value = "'.$nextFY0.'";
- document.NewReport.enddate.value = "'.$nextFY1.'";
+ document.NewReport.startdate.value = "'.getDisplayDate($nextFY0).'";
+ document.NewReport.enddate.value = "'.getDisplayDate($nextFY1).'";
}
else if( type == "nextfq" )
{
- document.NewReport.startdate.value = "'.$nFq.'";
- document.NewReport.enddate.value = "'.$nFq1.'";
+ document.NewReport.startdate.value = "'.getDisplayDate($nFq).'";
+ document.NewReport.enddate.value = "'.getDisplayDate($nFq1).'";
}
else if( type == "prevfq" )
{
- document.NewReport.startdate.value = "'.$pFq.'";
- document.NewReport.enddate.value = "'.$pFq1.'";
+ document.NewReport.startdate.value = "'.getDisplayDate($pFq).'";
+ document.NewReport.enddate.value = "'.getDisplayDate($pFq1).'";
}
else if( type == "thisfq" )
{
- document.NewReport.startdate.value = "'.$cFq.'";
- document.NewReport.enddate.value = "'.$cFq1.'";
+ document.NewReport.startdate.value = "'.getDisplayDate($cFq).'";
+ document.NewReport.enddate.value = "'.getDisplayDate($cFq1).'";
}
else
{
Modified: vtigercrm/branches/5.0.3/modules/Reports/Save.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Reports/Save.php (original)
+++ vtigercrm/branches/5.0.3/modules/Reports/Save.php Wed Apr 25 07:35:35 2007
@@ -43,8 +43,8 @@
//<<<<<<<standarfilters>>>>>>>>>
$stdDateFilterField = $_REQUEST["stdDateFilterField"];
$stdDateFilter = $_REQUEST["stdDateFilter"];
-$startdate = $_REQUEST["startdate"];
-$enddate = $_REQUEST["enddate"];
+$startdate = getDBInsertDateValue($_REQUEST["startdate"]);
+$enddate = getDBInsertDateValue($_REQUEST["enddate"]);
//<<<<<<<standardfilters>>>>>>>>>
//<<<<<<<columnstototal>>>>>>>>>>
Modified: vtigercrm/branches/5.0.3/modules/Reports/SaveAndRun.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Reports/SaveAndRun.php (original)
+++ vtigercrm/branches/5.0.3/modules/Reports/SaveAndRun.php Wed Apr 25 07:35:35 2007
@@ -20,8 +20,7 @@
require_once('include/utils/utils.php');
require_once('Smarty_setup.php');
-global $adb;
-global $mod_strings;
+global $adb,$mod_strings,$app_strings;
$reportid = $_REQUEST["record"];
$folderid = $_REQUEST["folderid"];
@@ -30,11 +29,7 @@
$startdate = $_REQUEST["startdate"];
$enddate = $_REQUEST["enddate"];
-global $primarymodule;
-global $secondarymodule;
-global $orderbylistsql;
-global $orderbylistcolumns;
-global $ogReport;
+global $primarymodule,$secondarymodule,$orderbylistsql,$orderbylistcolumns,$ogReport;
$ogReport = new Reports($reportid);
$primarymodule = $ogReport->primodule;
@@ -45,7 +40,6 @@
$totalhtml = $oReportRun->GenerateReport("TOTALHTML",$filterlist);
if(isPermitted($primarymodule,'index') == "yes" && (isPermitted($secondarymodule,'index')== "yes"))
{
-
$list_report_form = new vtigerCRM_Smarty;
$ogReport->getSelectedStandardCriteria($reportid);
//commented to omit dashboards for vtiger_reports
@@ -61,13 +55,15 @@
$BLOCKCRITERIA = $ogReport->getSelectedStdFilterCriteria($ogReport->stdselectedfilter);
$list_report_form->assign("BLOCKCRITERIA",$BLOCKCRITERIA);
-
- $startdate = $ogReport->startdate;
- $list_report_form->assign("STARTDATE",$startdate);
-
- $enddate = $ogReport->enddate;
- $list_report_form->assign("ENDDATE",$enddate);
-
+ if(isset($ogReport->startdate) && isset($ogReport->enddate))
+ {
+ $list_report_form->assign("STARTDATE",getDisplayDate($ogReport->startdate));
+ $list_report_form->assign("ENDDATE",getDisplayDate($ogReport->enddate));
+ }else
+ {
+ $list_report_form->assign("STARTDATE",$ogReport->startdate);
+ $list_report_form->assign("ENDDATE",$ogReport->enddate);
+ }
$list_report_form->assign("MOD", $mod_strings);
$list_report_form->assign("APP", $app_strings);
$list_report_form->assign("IMAGE_PATH", $image_path);
@@ -76,6 +72,9 @@
$list_report_form->assign("REPORTHTML", $sshtml);
$list_report_form->assign("REPORTTOTHTML", $totalhtml);
$list_report_form->assign("FOLDERID", $folderid);
+ $list_report_form->assign("DATEFORMAT",$current_user->date_format);
+ $list_report_form->assign("JS_DATEFORMAT",parse_calendardate($app_strings['NTC_DATE_FORMAT']));
+
if($_REQUEST['mode'] != 'ajax')
{
$list_report_form->assign("REPINFOLDER", getReportsinFolder($folderid));
Modified: vtigercrm/branches/5.0.3/modules/Reports/StandardFilter.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Reports/StandardFilter.php (original)
+++ vtigercrm/branches/5.0.3/modules/Reports/StandardFilter.php Wed Apr 25 07:35:35 2007
@@ -40,11 +40,14 @@
$BLOCKCRITERIA = $oReport->getSelectedStdFilterCriteria($oReport->stdselectedfilter);
$report_std_filter->assign("BLOCKCRITERIA_STD",$BLOCKCRITERIA);
- $startdate = $oReport->startdate;
- $report_std_filter->assign("STARTDATE_STD",$startdate);
-
- $enddate = $oReport->enddate;
- $report_std_filter->assign("ENDDATE_STD",$enddate);
+ if(isset($oReport->startdate) && isset($oReport->enddate))
+ {
+ $report_std_filter->assign("STARTDATE_STD",getDisplayDate($oReport->startdate));
+ $report_std_filter->assign("ENDDATE_STD",getDisplayDate($oReport->enddate));
+ }else{
+ $report_std_filter->assign("STARTDATE_STD",$oReport->startdate);
+ $report_std_filter->assign("ENDDATE_STD",$oReport->enddate);
+ }
}
More information about the vtigercrm-commits
mailing list