[Vtigercrm-commits] [vtiger-commits] r4718 - /vtigercrm/trunk/include/utils/CommonUtils.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Wed Mar 29 10:46:57 EST 2006


Author: saraj
Date: Wed Mar 29 08:46:51 2006
New Revision: 4718

Log:
* Added function setObjectValuesFromRequest to set all the request values in object column_fields, specially for save

Modified:
    vtigercrm/trunk/include/utils/CommonUtils.php

Modified: vtigercrm/trunk/include/utils/CommonUtils.php
==============================================================================
--- vtigercrm/trunk/include/utils/CommonUtils.php (original)
+++ vtigercrm/trunk/include/utils/CommonUtils.php Wed Mar 29 08:46:51 2006
@@ -1221,4 +1221,30 @@
 
 }
 
+
+/**
+ * This function is used to set the Object values from the REQUEST values.
+ * @param  object reference $focus - reference of the object
+ */
+function setObjectValuesFromRequest($focus)
+{
+	if(isset($_REQUEST['record']))
+	{
+		$focus->id = $_REQUEST['record'];
+	}
+	if(isset($_REQUEST['mode']))
+	{
+		$focus->mode = $_REQUEST['mode'];
+	}
+	foreach($focus->column_fields as $fieldname => $val)
+	{
+		if(isset($_REQUEST[$fieldname]))
+		{
+			$value = $_REQUEST[$fieldname];
+			$focus->column_fields[$fieldname] = $value;
+		}
+	}
+}
+
+
 ?>





More information about the vtigercrm-commits mailing list