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

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Thu Apr 26 01:24:19 EDT 2007


Author: richie
Date: Wed Apr 25 23:24:08 2007
New Revision: 10787

Log:
* Fixed the advanced filter date issue, when we select date field then equal, not equal, lt, gt, <=, >= are included in the criteria. we have to find and include all module fields, Fixed #3571

Modified:
    vtigercrm/branches/5.0.3/Smarty/templates/CustomView.tpl
    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 23:24:08 2007
@@ -30,8 +30,8 @@
 typeofdata['T'] = ['e','n','l','g','m','h'];
 typeofdata['I'] = ['e','n','l','g','m','h'];
 typeofdata['C'] = ['e','n'];
-typeofdata['DT'] = ['e','n'];
-typeofdata['D'] = ['e','n'];
+typeofdata['DT'] = ['e','n','l','g','m','h'];
+typeofdata['D'] = ['e','n','l','g','m','h'];
 var fLabels = new Array();
 fLabels['e'] = 'equals';
 fLabels['n'] = 'not equal to';

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 23:24:08 2007
@@ -245,6 +245,8 @@
 		{
 			foreach($columnslist[$module][$key] as $field=>$fieldlabel)
 			{
+				//Here we have to change the typeofdata for special cases like Contacts - Birthdate
+				$field = changeTypeOfData($field);
 				if(!in_array($fieldlabel,$check_dup))
 				{
 					if(isset($mod_strings[$fieldlabel]))
@@ -396,4 +398,30 @@
 }
 //step4
 
+
+/**	function used to change the Type of Data for advanced filters
+	@param string $field - field details in the format of tablename:columnname:fieldname:Module_fieldlabel:typeofdata
+	return string $field - changed field details in the format of tablename:columnname:fieldname:Module_fieldlabel:typeofdata
+ */
+function changeTypeOfData($field)
+{
+	global $adb;
+	//$adb->println("Entering into function changeTypeOfData($field)");
+
+	//Add the field details in this array if you want to change the advance filter field details
+	//Array in which we have to specify as, existing value => new value
+	$new_field_details = Array(
+				"vtiger_contactsubdetails:birthday:birthday:Contacts_Birthdate:V"=>"vtiger_contactsubdetails:birthday:birthday:Contacts_Birthdate:T",
+				  );
+
+	if(isset($new_field_details[$field]))
+	{
+		$field = $new_field_details[$field];
+	}
+
+	//$adb->println("Exit from function changeTypeOfData($field). Return => $field");
+	return $field;
+}
+
+
 ?>





More information about the vtigercrm-commits mailing list