[Vtigercrm-commits] [vtiger-commits] r10784 - in /vtigercrm/branches/5.0.3: Smarty/templates/CustomView.tpl modules/CustomView/CustomView.php modules/CustomView/EditView.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Wed Apr 25 09:41:25 EDT 2007


Author: richie
Date: Wed Apr 25 07:41:18 2007
New Revision: 10784

Log:
fix for customview stdfilter date format. --minnie

Modified:
    vtigercrm/branches/5.0.3/Smarty/templates/CustomView.tpl
    vtigercrm/branches/5.0.3/modules/CustomView/CustomView.php
    vtigercrm/branches/5.0.3/modules/CustomView/EditView.php

Modified: vtigercrm/branches/5.0.3/Smarty/templates/CustomView.tpl
==============================================================================
--- vtigercrm/branches/5.0.3/Smarty/templates/CustomView.tpl (original)
+++ vtigercrm/branches/5.0.3/Smarty/templates/CustomView.tpl Wed Apr 25 07:41:18 2007
@@ -83,7 +83,7 @@
                                 {rdelim}
                                 if(mandatorycheck == true)
                                 {ldelim}
-					if(($("stdDateFilter").options[$("stdDateFilter").selectedIndex].value == "custom") && ($("jscal_field_date_start").value.replace(/^\s+/g, '').replace(/\s+$/g, '').length!=0) || ($("jscal_field_date_end").value.replace(/^\s+/g, '').replace(/\s+$/g, '').length!=0))
+					if(($("jscal_field_date_start").value.replace(/^\s+/g, '').replace(/\s+$/g, '').length!=0) || ($("jscal_field_date_end").value.replace(/^\s+/g, '').replace(/\s+$/g, '').length!=0))
 						return stdfilterdateValidate();
 					else
 						return true;
@@ -423,7 +423,7 @@
 			  <tr>
 			     <td align="right" class="dvtCellLabel">{$MOD.Start_Date} :</td>
 			     <td width="25%" align=left class="dvtCellInfo">
-			     {if $STDFILTERCRITERIA.0.value eq "custom"}
+			     {if $STDFILTERCRITERIA.0.selected eq "selected" || $CUSTOMVIEWID eq ""}
 				{assign var=img_style value="visibility:visible"}
 				{assign var=msg_style value=""}
 			     {else}
@@ -432,7 +432,7 @@
 			     {/if}	
 			     <input name="startdate" id="jscal_field_date_start" type="text" size="10" class="textField" value="{$STARTDATE}" {$msg_style}>
 			     <img src="{$IMAGE_PATH}calendar.gif" id="jscal_trigger_date_start" style={$img_style}>
-			     <span id="jscal_trigger_start_format" style={$img_style}><font size=1><em old="(yyyy-mm-dd)">({$DATEFORMAT})</em></font></span>
+			     <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
@@ -444,7 +444,7 @@
   			     <td width="25%" align=left class="dvtCellInfo">
 			     <input name="enddate" {$msg_style} id="jscal_field_date_end" type="text" size="10" class="textField" value="{$ENDDATE}">
 			     <img src="{$IMAGE_PATH}calendar.gif" id="jscal_trigger_date_end" style={$img_style}>
-			     <span id="jscal_trigger_end_format" style={$img_style}><font size=1><em old="(yyyy-mm-dd)">({$DATEFORMAT})</em></font></span>
+			     <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

Modified: vtigercrm/branches/5.0.3/modules/CustomView/CustomView.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/CustomView/CustomView.php (original)
+++ vtigercrm/branches/5.0.3/modules/CustomView/CustomView.php Wed Apr 25 07:41:18 2007
@@ -539,8 +539,6 @@
 					document.CustomView.enddate.readOnly=true
 					getObj("jscal_trigger_date_start").style.visibility="hidden"
 					getObj("jscal_trigger_date_end").style.visibility="hidden"
-					getObj("jscal_trigger_start_format").style.visibility="hidden"
-					getObj("jscal_trigger_end_format").style.visibility="hidden"
 				}
 				else
 				{
@@ -548,134 +546,132 @@
 					document.CustomView.enddate.readOnly=false
 					getObj("jscal_trigger_date_start").style.visibility="visible"
 					getObj("jscal_trigger_date_end").style.visibility="visible"
-					getObj("jscal_trigger_start_format").style.visibility="visible"
-					getObj("jscal_trigger_end_format").style.visibility="visible"
 				}
 				if( type == "today" )
 				{
-					document.CustomView.startdate.value = "'.$today.'";
-					document.CustomView.enddate.value = "'.$today.'";
+					document.CustomView.startdate.value = "'.getDisplayDate($today).'";
+					document.CustomView.enddate.value = "'.getDisplayDate($today).'";
 				}
 				else if( type == "yesterday" )
 				{
-					document.CustomView.startdate.value = "'.$yesterday.'";
-					document.CustomView.enddate.value = "'.$yesterday.'";
+					document.CustomView.startdate.value = "'.getDisplayDate($yesterday).'";
+					document.CustomView.enddate.value = "'.getDisplayDate($yesterday).'";
 				}
 				else if( type == "tomorrow" )
 				{
 
-					document.CustomView.startdate.value = "'.$tomorrow.'";
-					document.CustomView.enddate.value = "'.$tomorrow.'";
+					document.CustomView.startdate.value = "'.getDisplayDate($tomorrow).'";
+					document.CustomView.enddate.value = "'.getDisplayDate($tomorrow).'";
 				}
 				else if( type == "thisweek" )
 				{
-					document.CustomView.startdate.value = "'.$thisweek0.'";
-					document.CustomView.enddate.value = "'.$thisweek1.'";
+					document.CustomView.startdate.value = "'.getDisplayDate($thisweek0).'";
+					document.CustomView.enddate.value = "'.getDisplayDate($thisweek1).'";
 				}
 				else if( type == "lastweek" )
 				{
-					document.CustomView.startdate.value = "'.$lastweek0.'";
-					document.CustomView.enddate.value = "'.$lastweek1.'";
+					document.CustomView.startdate.value = "'.getDisplayDate($lastweek0).'";
+					document.CustomView.enddate.value = "'.getDisplayDate($lastweek1).'";
 				}
 				else if( type == "nextweek" )
 				{
-					document.CustomView.startdate.value = "'.$nextweek0.'";
-					document.CustomView.enddate.value = "'.$nextweek1.'";
+					document.CustomView.startdate.value = "'.getDisplayDate($nextweek0).'";
+					document.CustomView.enddate.value = "'.getDisplayDate($nextweek1).'";
 				}
 				else if( type == "thismonth" )
 				{
-					document.CustomView.startdate.value = "'.$currentmonth0.'";
-					document.CustomView.enddate.value = "'.$currentmonth1.'";
+					document.CustomView.startdate.value = "'.getDisplayDate($currentmonth0).'";
+					document.CustomView.enddate.value = "'.getDisplayDate($currentmonth1).'";
 				}
 				else if( type == "lastmonth" )
 				{
-					document.CustomView.startdate.value = "'.$lastmonth0.'";
-					document.CustomView.enddate.value = "'.$lastmonth1.'";
+					document.CustomView.startdate.value = "'.getDisplayDate($lastmonth0).'";
+					document.CustomView.enddate.value = "'.getDisplayDate($lastmonth1).'";
 				}
 				else if( type == "nextmonth" )
 				{
-					document.CustomView.startdate.value = "'.$nextmonth0.'";
-					document.CustomView.enddate.value = "'.$nextmonth1.'";
+					document.CustomView.startdate.value = "'.getDisplayDate($nextmonth0).'";
+					document.CustomView.enddate.value = "'.getDisplayDate($nextmonth1).'";
 				}
 				else if( type == "next7days" )
 				{
-					document.CustomView.startdate.value = "'.$today.'";
-					document.CustomView.enddate.value = "'.$next7days.'";
+					document.CustomView.startdate.value = "'.getDisplayDate($today).'";
+					document.CustomView.enddate.value = "'.getDisplayDate($next7days).'";
 				}
 				else if( type == "next30days" )
 				{
-					document.CustomView.startdate.value = "'.$today.'";
-					document.CustomView.enddate.value = "'.$next30days.'";
+					document.CustomView.startdate.value = "'.getDisplayDate($today).'";
+					document.CustomView.enddate.value = "'.getDisplayDate($next30days).'";
 				}
 				else if( type == "next60days" )
 				{
-					document.CustomView.startdate.value = "'.$today.'";
-					document.CustomView.enddate.value = "'.$next60days.'";
+					document.CustomView.startdate.value = "'.getDisplayDate($today).'";
+					document.CustomView.enddate.value = "'.getDisplayDate($next60days).'";
 				}
 				else if( type == "next90days" )
 				{
-					document.CustomView.startdate.value = "'.$today.'";
-					document.CustomView.enddate.value = "'.$next90days.'";
+					document.CustomView.startdate.value = "'.getDisplayDate($today).'";
+					document.CustomView.enddate.value = "'.getDisplayDate($next90days).'";
 				}
 				else if( type == "next120days" )
 				{
-					document.CustomView.startdate.value = "'.$today.'";
-					document.CustomView.enddate.value = "'.$next120days.'";
+					document.CustomView.startdate.value = "'.getDisplayDate($today).'";
+					document.CustomView.enddate.value = "'.getDisplayDate($next120days).'";
 				}
 				else if( type == "last7days" )
 				{
-					document.CustomView.startdate.value = "'.$last7days.'";
-					document.CustomView.enddate.value =  "'.$today.'";
+					document.CustomView.startdate.value = "'.getDisplayDate($last7days).'";
+					document.CustomView.enddate.value =  "'.getDisplayDate($today).'";
 				}
 				else if( type == "last30days" )
 				{
-					document.CustomView.startdate.value = "'.$last30days.'";
-					document.CustomView.enddate.value = "'.$today.'";
+					document.CustomView.startdate.value = "'.getDisplayDate($last30days).'";
+					document.CustomView.enddate.value = "'.getDisplayDate($today).'";
 				}
 				else if( type == "last60days" )
 				{
-					document.CustomView.startdate.value = "'.$last60days.'";
-					document.CustomView.enddate.value = "'.$today.'";
+					document.CustomView.startdate.value = "'.getDisplayDate($last60days).'";
+					document.CustomView.enddate.value = "'.getDisplayDate($today).'";
 				}
 				else if( type == "last90days" )
 				{
-					document.CustomView.startdate.value = "'.$last90days.'";
-					document.CustomView.enddate.value = "'.$today.'";
+					document.CustomView.startdate.value = "'.getDisplayDate($last90days).'";
+					document.CustomView.enddate.value = "'.getDisplayDate($today).'";
 				}
 				else if( type == "last120days" )
 				{
-					document.CustomView.startdate.value = "'.$last120days.'";
-					document.CustomView.enddate.value = "'.$today.'";
+					document.CustomView.startdate.value = "'.getDisplayDate($last120days).'";
+					document.CustomView.enddate.value = "'.getDisplayDate($today).'";
 				}
 				else if( type == "thisfy" )
 				{
-					document.CustomView.startdate.value = "'.$currentFY0.'";
-					document.CustomView.enddate.value = "'.$currentFY1.'";
+					document.CustomView.startdate.value = "'.getDisplayDate($currentFY0).'";
+					document.CustomView.enddate.value = "'.getDisplayDate($currentFY1).'";
 				}
 				else if( type == "prevfy" )
 				{
-					document.CustomView.startdate.value = "'.$lastFY0.'";
-					document.CustomView.enddate.value = "'.$lastFY1.'";
+					document.CustomView.startdate.value = "'.getDisplayDate($lastFY0).'";
+					document.CustomView.enddate.value = "'.getDisplayDate($lastFY1).'";
 				}
 				else if( type == "nextfy" )
 				{
-					document.CustomView.startdate.value = "'.$nextFY0.'";
-					document.CustomView.enddate.value = "'.$nextFY1.'";
+					document.CustomView.startdate.value = "'.getDisplayDate($nextFY0).'";
+					document.CustomView.enddate.value = "'.getDisplayDate($nextFY1).'";
 				}
 				else if( type == "nextfq" )
 				{
-					document.CustomView.startdate.value = "'.$nFq.'";
-					document.CustomView.enddate.value = "'.$nFq1.'";
+					document.CustomView.startdate.value = "'.getDisplayDate($nFq).'";
+					document.CustomView.enddate.value = "'.getDisplayDate($nFq1).'";
 				}
 				else if( type == "prevfq" )
 				{
-					document.CustomView.startdate.value = "'.$pFq.'";
-					document.CustomView.enddate.value = "'.$pFq1.'";
+					document.CustomView.startdate.value = "'.getDisplayDate($pFq).'";
+					document.CustomView.enddate.value = "'.getDisplayDate($pFq1).'";
 				}
 				else if( type == "thisfq" )
 				{
-					document.CustomView.startdate.value = "'.$cFq.'";
-					document.CustomView.enddate.value = "'.$cFq1.'";
+					document.CustomView.startdate.value = "'.getDisplayDate($cFq).'";
+					document.CustomView.enddate.value = "'.getDisplayDate($cFq1).'";
 				}
 				else
 				{

Modified: vtigercrm/branches/5.0.3/modules/CustomView/EditView.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/CustomView/EditView.php (original)
+++ vtigercrm/branches/5.0.3/modules/CustomView/EditView.php Wed Apr 25 07:41:18 2007
@@ -112,15 +112,12 @@
 
 	if(isset($stdfilterlist["startdate"]) && isset($stdfilterlist["enddate"]))
 	{
-		if($stdfilterhtml[0]['value'] == 'custom')
-		{
-			$smarty->assign("STARTDATE",getDisplayDate($stdfilterlist["startdate"]));
-			$smarty->assign("ENDDATE",getDisplayDate($stdfilterlist["enddate"]));
-		}else{
-			$smarty->assign("STARTDATE",$stdfilterlist["startdate"]);
-			$smarty->assign("ENDDATE",$stdfilterlist["enddate"]);
-		}	
-	}
+		$smarty->assign("STARTDATE",getDisplayDate($stdfilterlist["startdate"]));
+		$smarty->assign("ENDDATE",getDisplayDate($stdfilterlist["enddate"]));
+	}else{
+		$smarty->assign("STARTDATE",$stdfilterlist["startdate"]);
+		$smarty->assign("ENDDATE",$stdfilterlist["enddate"]);
+	}	
 
 	$advfilterlist = $oCustomView->getAdvFilterByCvid($recordid);
 	$log->info('CustomView :: Successfully got Advanced Filter for the Viewid'.$recordid,'info');
@@ -149,7 +146,6 @@
 	$smarty->assign("STDCOLUMNSCOUNT",count($stdfiltercolhtml));
 	$smarty->assign("STDFILTERCRITERIA",$stdfilterhtml);
 	$smarty->assign("STDFILTER_JAVASCRIPT",$stdfilterjs);
-
 	$smarty->assign("MANDATORYCHECK",implode(",",array_unique($oCustomView->mandatoryvalues)));
 	$smarty->assign("SHOWVALUES",implode(",",$oCustomView->showvalues));
 





More information about the vtigercrm-commits mailing list