[Vtigercrm-commits] [vtiger-commits] r9107 - in /vtigercrm/trunk/modules/Products: CallRelatedList.php DetailView.php Product.php addPbProductRelToDB.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Thu Aug 24 01:33:23 EDT 2006


Author: richie
Date: Wed Aug 23 23:33:09 2006
New Revision: 9107

Log:
Updated the single pane view feature for detailview in Products Module -- ahmed

Modified:
    vtigercrm/trunk/modules/Products/CallRelatedList.php
    vtigercrm/trunk/modules/Products/DetailView.php
    vtigercrm/trunk/modules/Products/Product.php
    vtigercrm/trunk/modules/Products/addPbProductRelToDB.php

Modified: vtigercrm/trunk/modules/Products/CallRelatedList.php
==============================================================================
--- vtigercrm/trunk/modules/Products/CallRelatedList.php (original)
+++ vtigercrm/trunk/modules/Products/CallRelatedList.php Wed Aug 23 23:33:09 2006
@@ -46,8 +46,7 @@
 $category = getParentTab();
 $smarty->assign("CATEGORY",$category);
 
-$smarty->assign("id",$focus->id);
-$smarty->assign("ID",$RECORD );
+$smarty->assign("ID",$focus->id);
 $smarty->assign("MODULE",$currentmodule);
 $smarty->assign("UPDATEINFO",updateInfo($focus->id));
 $smarty->assign("SINGLE_MOD",$app_strings['Product']);

Modified: vtigercrm/trunk/modules/Products/DetailView.php
==============================================================================
--- vtigercrm/trunk/modules/Products/DetailView.php (original)
+++ vtigercrm/trunk/modules/Products/DetailView.php Wed Aug 23 23:33:09 2006
@@ -12,6 +12,7 @@
 require_once('Smarty_setup.php');
 require_once('modules/Products/Product.php');
 require_once('include/utils/utils.php');
+require_once('user_privileges/default_module_view.php');
 
 $focus = new Product();
 
@@ -32,7 +33,7 @@
         $focus->id = "";
 }
 
-global $app_strings,$currentModule;
+global $app_strings,$currentModule,$singlepane_view;
 global $mod_strings;
 
 global $theme;
@@ -89,6 +90,14 @@
 //Security check for related list
 $smarty->assign("MODULE", $currentModule);
 $smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record]));
+
+if($singlepane_view == 'true')
+{
+	$related_array = getRelatedLists($currentModule,$focus);
+	$smarty->assign("RELATEDLISTS", $related_array);
+}
+
+$smarty->assign("SinglePane_View", $singlepane_view);
 $smarty->display("Inventory/InventoryDetailView.tpl");
 
 ?>

Modified: vtigercrm/trunk/modules/Products/Product.php
==============================================================================
--- vtigercrm/trunk/modules/Products/Product.php (original)
+++ vtigercrm/trunk/modules/Products/Product.php Wed Aug 23 23:33:09 2006
@@ -16,6 +16,7 @@
 require_once('data/CRMEntity.php');
 require_once('include/utils/utils.php');
 require_once('include/RelatedListView.php');
+require_once('user_privileges/default_module_view.php');
 
 class Product extends CRMEntity {
 	var $log;
@@ -197,7 +198,7 @@
 	 */
 	function get_tickets($id)
 	{
-		global $log;
+		global $log, $singlepane_view;
 		$log->debug("Entering get_tickets(".$id.") method ...");
 		global $mod_strings;
 		require_once('modules/HelpDesk/HelpDesk.php');
@@ -205,7 +206,10 @@
 
 		$button = '';
 
-		$returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id;
+		if($singlepane_view == 'true')
+			$returnset = '&return_module=Products&return_action=DetailView&return_id='.$id;
+		else
+			$returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id;
 
 		$query = "SELECT vtiger_users.user_name, vtiger_users.id,
 			vtiger_products.productid, vtiger_products.productname,
@@ -237,7 +241,7 @@
 	 */
 	function get_activities($id)
 	{
-		global $log;
+		global $log, $singlepane_view;
 		$log->debug("Entering get_activities(".$id.") method ...");
 		global $app_strings;
 	
@@ -248,7 +252,10 @@
 
 		$button = '';
 
-		$returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id;
+		if($singlepane_view == 'true')
+			$returnset = '&return_module=Products&return_action=DetailView&return_id='.$id;
+		else
+			$returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id;
 
 
 		$query = "SELECT vtiger_contactdetails.lastname,
@@ -291,14 +298,17 @@
 	 */
 	function get_quotes($id)
 	{
-		global $log;
+		global $log, $singlepane_view;
 		$log->debug("Entering get_quotes(".$id.") method ...");	
 		global $app_strings;
 		require_once('modules/Quotes/Quote.php');	
 		$focus = new Quote();
 	
 		$button = '';
-		$returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id;
+		if($singlepane_view == 'true')
+			$returnset = '&return_module=Products&return_action=DetailView&return_id='.$id;
+		else
+			$returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id;
 
 
 		$query = "SELECT vtiger_crmentity.*,
@@ -331,7 +341,7 @@
 	 */
 	function get_purchase_orders($id)
 	{
-		global $log;
+		global $log,$singlepane_view;
 		$log->debug("Entering get_purchase_orders(".$id.") method ...");
 		global $app_strings;
 		require_once('modules/PurchaseOrder/PurchaseOrder.php');
@@ -339,7 +349,10 @@
 
 		$button = '';
 
-		$returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id;
+		if($singlepane_view == 'true')
+			$returnset = '&return_module=Products&return_action=DetailView&return_id='.$id;
+		else
+			$returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id;
 
 		$query = "SELECT vtiger_crmentity.*,
 			vtiger_purchaseorder.*,
@@ -368,7 +381,7 @@
 	 */
 	function get_salesorder($id)
 	{
-		global $log;
+		global $log,$singlepane_view;
 		$log->debug("Entering get_salesorder(".$id.") method ...");
 		global $app_strings;
 		require_once('modules/SalesOrder/SalesOrder.php');
@@ -376,7 +389,10 @@
 	        $focus = new SalesOrder();
  
 		$button = '';
-		$returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id;
+		if($singlepane_view == 'true')
+			$returnset = '&return_module=Products&return_action=DetailView&return_id='.$id;
+		else
+			$returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id;
 
 		$query = "SELECT vtiger_crmentity.*,
 			vtiger_salesorder.*,
@@ -407,14 +423,17 @@
 	 */
 	function get_invoices($id)
 	{
-		global $log;
+		global $log,$singlepane_view;
 		$log->debug("Entering get_invoices(".$id.") method ...");
 		global $app_strings;
 		require_once('modules/Invoice/Invoice.php');
 		$focus = new Invoice();
 
 		$button = '';
-		$returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id;
+		if($singlepane_view == 'true')
+			$returnset = '&return_module=Products&return_action=DetailView&return_id='.$id;
+		else
+			$returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id;
 
 
 		$query = "SELECT vtiger_crmentity.*,
@@ -444,13 +463,16 @@
 	 */
 	function get_product_pricebooks($id)
 	{     
-		global $log;
+		global $log,$singlepane_view;
 		$log->debug("Entering get_product_pricebooks(".$id.") method ...");
 		global $mod_strings;
 		require_once('modules/PriceBooks/PriceBook.php');
 		$focus = new PriceBook();
 		$button = '';
-		$returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id;
+		if($singlepane_view == 'true')
+			$returnset = '&return_module=Products&return_action=DetailView&return_id='.$id;
+		else
+			$returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id;
 
 
 		$query = "SELECT vtiger_crmentity.crmid,

Modified: vtigercrm/trunk/modules/Products/addPbProductRelToDB.php
==============================================================================
--- vtigercrm/trunk/modules/Products/addPbProductRelToDB.php (original)
+++ vtigercrm/trunk/modules/Products/addPbProductRelToDB.php Wed Aug 23 23:33:09 2006
@@ -11,9 +11,10 @@
 *
  ********************************************************************************/
 
-global $adb;	
+require_once('include/database/PearDatabase.php');
+require_once('user_privileges/default_module_view.php');
+global $adb,$singlepane_view;	
 global $log;
-require_once('include/database/PearDatabase.php');
 $idlist = $_POST['idlist'];
 $returnmodule=$_REQUEST['return_module'];
 $pricebook_id=$_REQUEST['pricebook_id'];
@@ -33,7 +34,10 @@
 			$adb->query($query);
 		}
 	}
-	header("Location: index.php?module=PriceBooks&action=CallRelatedList&record=".$pricebook_id);
+	if($singlepane_view == 'true')
+		header("Location: index.php?module=PriceBooks&action=DetailView&record=".$pricebook_id);
+	else
+		header("Location: index.php?module=PriceBooks&action=CallRelatedList&record=".$pricebook_id);
 }
 elseif(isset($_REQUEST['product_id']) && $_REQUEST['product_id']!='')
 {
@@ -50,7 +54,10 @@
 			$adb->query($query);
 		}
 	}
-	header("Location: index.php?module=Products&action=CallRelatedList&record=".$productid);
+	if($singlepane_view == 'true')
+		header("Location: index.php?module=Products&action=DetailView&record=".$productid);
+	else
+		header("Location: index.php?module=Products&action=CallRelatedList&record=".$productid);
 }
 
 ?>





More information about the vtigercrm-commits mailing list