[Vtigercrm-commits] [vtiger-commits] r4722 - in /vtigercrm/trunk/modules: Campaigns/Save.php Faq/Save.php HelpDesk/Save.php Invoice/Save.php Potentials/Save.php PriceBooks/Save.php PurchaseOrder/Save.php SalesOrder/Save.php Vendors/Save.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Thu Mar 30 00:32:20 EST 2006
Author: saraj
Date: Wed Mar 29 22:31:55 2006
New Revision: 4722
Log:
* Removed the lines which are used to assign the REQUEST values to focus->column_fileds and make it as a common function call
Modified:
vtigercrm/trunk/modules/Campaigns/Save.php
vtigercrm/trunk/modules/Faq/Save.php
vtigercrm/trunk/modules/HelpDesk/Save.php
vtigercrm/trunk/modules/Invoice/Save.php
vtigercrm/trunk/modules/Potentials/Save.php
vtigercrm/trunk/modules/PriceBooks/Save.php
vtigercrm/trunk/modules/PurchaseOrder/Save.php
vtigercrm/trunk/modules/SalesOrder/Save.php
vtigercrm/trunk/modules/Vendors/Save.php
Modified: vtigercrm/trunk/modules/Campaigns/Save.php
==============================================================================
--- vtigercrm/trunk/modules/Campaigns/Save.php (original)
+++ vtigercrm/trunk/modules/Campaigns/Save.php Wed Mar 29 22:31:55 2006
@@ -26,24 +26,8 @@
require_once('include/database/PearDatabase.php');
$focus = new Campaign();
-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;
- }
-
-}
+setObjectValuesFromRequest(&$focus);
$focus->save("Campaigns");
$return_id = $focus->id;
Modified: vtigercrm/trunk/modules/Faq/Save.php
==============================================================================
--- vtigercrm/trunk/modules/Faq/Save.php (original)
+++ vtigercrm/trunk/modules/Faq/Save.php Wed Mar 29 22:31:55 2006
@@ -28,23 +28,8 @@
$local_log =& LoggerManager::getLogger('index');
$focus = new Faq();
-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;
- }
-}
+setObjectValuesFromRequest(&$focus);
$focus->save("Faq");
$return_id = $focus->id;
Modified: vtigercrm/trunk/modules/HelpDesk/Save.php
==============================================================================
Binary files - no diff available.
Modified: vtigercrm/trunk/modules/Invoice/Save.php
==============================================================================
--- vtigercrm/trunk/modules/Invoice/Save.php (original)
+++ vtigercrm/trunk/modules/Invoice/Save.php Wed Mar 29 22:31:55 2006
@@ -29,24 +29,8 @@
$local_log =& LoggerManager::getLogger('index');
$focus = new Invoice();
-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;
- }
-
-}
+
+setObjectValuesFromRequest(&$focus);
$focus->save("Invoice");
Modified: vtigercrm/trunk/modules/Potentials/Save.php
==============================================================================
Binary files - no diff available.
Modified: vtigercrm/trunk/modules/PriceBooks/Save.php
==============================================================================
--- vtigercrm/trunk/modules/PriceBooks/Save.php (original)
+++ vtigercrm/trunk/modules/PriceBooks/Save.php Wed Mar 29 22:31:55 2006
@@ -26,25 +26,9 @@
require_once('include/database/PearDatabase.php');
$focus = new PriceBook();
-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;
- }
-
-}
-//$focus->saveentity("PriceBooks");
+setObjectValuesFromRequest(&$focus);
+
$focus->save("PriceBooks");
$return_id = $focus->id;
Modified: vtigercrm/trunk/modules/PurchaseOrder/Save.php
==============================================================================
--- vtigercrm/trunk/modules/PurchaseOrder/Save.php (original)
+++ vtigercrm/trunk/modules/PurchaseOrder/Save.php Wed Mar 29 22:31:55 2006
@@ -28,25 +28,9 @@
$local_log =& LoggerManager::getLogger('index');
$focus = new Order();
-if(isset($_REQUEST['record']))
-{
- $focus->id = $_REQUEST['record'];
-}
-if(isset($_REQUEST['mode']))
-{
- $focus->mode = $_REQUEST['mode'];
-}
+setObjectValuesFromRequest(&$focus);
-foreach($focus->column_fields as $fieldname => $val)
-{
- if(isset($_REQUEST[$fieldname]))
- {
- $value = $_REQUEST[$fieldname];
- $focus->column_fields[$fieldname] = $value;
- }
-
-}
//Added code for auto product stock updation on receiving goods
$update_prod_stock='';
if($focus->column_fields['postatus'] == 'Received Shipment' && $focus->mode == 'edit')
@@ -103,8 +87,9 @@
$local_log->debug("Saved record with id of ".$return_id);
- //code added for returning back to the current view after edit from list view
- if($_REQUEST['return_viewname'] == '') $return_viewname='0';
- if($_REQUEST['return_viewname'] != '')$return_viewname=$_REQUEST['return_viewname'];
+//code added for returning back to the current view after edit from list view
+if($_REQUEST['return_viewname'] == '') $return_viewname='0';
+if($_REQUEST['return_viewname'] != '')$return_viewname=$_REQUEST['return_viewname'];
+
header("Location: index.php?action=$return_action&module=$return_module&record=$return_id&viewname=$return_viewname");
?>
Modified: vtigercrm/trunk/modules/SalesOrder/Save.php
==============================================================================
--- vtigercrm/trunk/modules/SalesOrder/Save.php (original)
+++ vtigercrm/trunk/modules/SalesOrder/Save.php Wed Mar 29 22:31:55 2006
@@ -30,27 +30,10 @@
$focus = new SalesOrder();
-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;
- }
-
-}
-
+setObjectValuesFromRequest(&$focus);
$focus->save("SalesOrder");
+
//Checking if quote_id is present and updating the quote status
if($focus->column_fields["quote_id"] != '')
{
@@ -58,7 +41,6 @@
$query1 = "update quotes set quotestage='Accepted' where quoteid=".$qt_id;
$adb->query($query1);
}
-
$ext_prod_arr = Array();
if($focus->mode == 'edit')
Modified: vtigercrm/trunk/modules/Vendors/Save.php
==============================================================================
--- vtigercrm/trunk/modules/Vendors/Save.php (original)
+++ vtigercrm/trunk/modules/Vendors/Save.php Wed Mar 29 22:31:55 2006
@@ -26,25 +26,8 @@
require_once('include/database/PearDatabase.php');
$focus = new Vendor();
-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;
- }
-
-}
+setObjectValuesFromRequest(&$focus);
-//$focus->saveentity("Vendors");
$focus->save("Vendors");
$return_id = $focus->id;
@@ -53,6 +36,7 @@
if(isset($_REQUEST['return_action']) && $_REQUEST['return_action'] != "") $return_action = $_REQUEST['return_action'];
else $return_action = "DetailView";
if(isset($_REQUEST['return_id']) && $_REQUEST['return_id'] != "") $return_id = $_REQUEST['return_id'];
+
//code added for returning back to the current view after edit from list view
if($_REQUEST['return_viewname'] == '') $return_viewname='0';
if($_REQUEST['return_viewname'] != '')$return_viewname=$_REQUEST['return_viewname'];
More information about the vtigercrm-commits
mailing list