[Vtigercrm-commits] [vtiger-commits] r5539 - in /vtigercrm/branches/4.2: include/ListView/ modules/Accounts/ modules/Activities/ modules/Contacts/ modules/Emails/ modules/Faq/ modules/HelpDesk/ modules/Invoice/ modules/Leads/ modules/Notes/ modules/Orders/ modules/Potentials/ modules/Products/ modules/Quotes/

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Thu Apr 27 20:13:48 EDT 2006


Author: allanbush
Date: Thu Apr 27 18:13:39 2006
New Revision: 5539

Log:
Storing sorting in seesion variable from Fredy's contribution (http://forums.vtiger.com/viewtopic.php?t=4633).  Refs #750.

Modified:
    vtigercrm/branches/4.2/include/ListView/ListView.php
    vtigercrm/branches/4.2/modules/Accounts/ListView.php
    vtigercrm/branches/4.2/modules/Activities/ListView.php
    vtigercrm/branches/4.2/modules/Contacts/ListView.php
    vtigercrm/branches/4.2/modules/Emails/ListView.php
    vtigercrm/branches/4.2/modules/Faq/ListView.php
    vtigercrm/branches/4.2/modules/HelpDesk/ListView.php
    vtigercrm/branches/4.2/modules/Invoice/ListView.php
    vtigercrm/branches/4.2/modules/Leads/ListView.php
    vtigercrm/branches/4.2/modules/Notes/ListView.php
    vtigercrm/branches/4.2/modules/Orders/ListView.php
    vtigercrm/branches/4.2/modules/Orders/SalesOrderListView.php
    vtigercrm/branches/4.2/modules/Potentials/ListView.php
    vtigercrm/branches/4.2/modules/Products/ListView.php
    vtigercrm/branches/4.2/modules/Products/PriceBookListView.php
    vtigercrm/branches/4.2/modules/Products/VendorListView.php
    vtigercrm/branches/4.2/modules/Quotes/ListView.php

Modified: vtigercrm/branches/4.2/include/ListView/ListView.php
==============================================================================
--- vtigercrm/branches/4.2/include/ListView/ListView.php (original)
+++ vtigercrm/branches/4.2/include/ListView/ListView.php Thu Apr 27 18:13:39 2006
@@ -578,5 +578,40 @@
 }
 
 
+// as far as I can tell this isn't used anymore, however it is included in listview.php file of every module so I'm going to take advantage of it to put common functionallity in here
+
+global $currentModule;
+
+// ugly, because our module handling sucks
+$currentModule_name = $currentModule;
+$sub_module = (isset($_REQUEST['smodule'])) ? $_REQUEST['smodule'] : "";
+switch($sub_module) {
+	case 'SO':
+		$currentModule_name = 'SalesOrder';
+		break;
+	case 'VENDOR':
+		$currentModule_name = 'Vendor';
+		break;
+	case 'PRICEBOOK':
+		$currentModule_name = 'PriceBook';
+		break;
+}
+
+session_start();
+if (isset($_REQUEST['order_by'])) {
+	$order_by = $_REQUEST['order_by'];
+	$_SESSION["ListViewOrder[$currentModule_name][0]"] = $order_by;
+} elseif ($_SESSION["ListViewOrder[$currentModule_name][0]"] != '') {
+	$order_by = $_SESSION["ListViewOrder[$currentModule_name][0]"];
+}
+
+$sorder = 'ASC';
+if(isset($_REQUEST['sorder']) && $_REQUEST['sorder'] != '') {
+	        $sorder = $_REQUEST['sorder'];
+		        $_SESSION["ListViewOrder[$currentModule_name][1]"] = $sorder;
+} elseif ($_SESSION["ListViewOrder[$currentModule_name][1]"] != '') {
+	        $sorder = $_SESSION["ListViewOrder[$currentModule_name][1]"];
+}
+
 
 ?>

Modified: vtigercrm/branches/4.2/modules/Accounts/ListView.php
==============================================================================
--- vtigercrm/branches/4.2/modules/Accounts/ListView.php (original)
+++ vtigercrm/branches/4.2/modules/Accounts/ListView.php Thu Apr 27 18:13:39 2006
@@ -47,12 +47,7 @@
 
 if (!isset($where)) $where = "";
 
-if (isset($_REQUEST['order_by'])) $order_by = $_REQUEST['order_by'];
-
 $url_string = '';
-$sorder = 'ASC';
-if(isset($_REQUEST['sorder']) && $_REQUEST['sorder'] != '')
-$sorder = $_REQUEST['sorder'];
 
 if(isset($_REQUEST['query']) && $_REQUEST['query'] == 'true')
 {

Modified: vtigercrm/branches/4.2/modules/Activities/ListView.php
==============================================================================
--- vtigercrm/branches/4.2/modules/Activities/ListView.php (original)
+++ vtigercrm/branches/4.2/modules/Activities/ListView.php Thu Apr 27 18:13:39 2006
@@ -25,6 +25,7 @@
 require_once('modules/Activities/Activity.php');
 require_once('themes/'.$theme.'/layout_utils.php');
 require_once('include/logging.php');
+require_once('include/ListView/ListView.php');
 require_once('include/uifromdbutil.php');
 require_once('modules/CustomView/CustomView.php');
 
@@ -98,12 +99,7 @@
 
 $focus = new Activity();
 
-if (isset($_REQUEST['order_by'])) $order_by = $_REQUEST['order_by'];
-
 $url_string = ''; // assigning http url string
-$sorder = 'ASC';  // Default sort order
-if(isset($_REQUEST['sorder']) && $_REQUEST['sorder'] != '')
-$sorder = $_REQUEST['sorder'];
 
 if(isset($_REQUEST['query']) && $_REQUEST['query'] == 'true')
 {

Modified: vtigercrm/branches/4.2/modules/Contacts/ListView.php
==============================================================================
--- vtigercrm/branches/4.2/modules/Contacts/ListView.php (original)
+++ vtigercrm/branches/4.2/modules/Contacts/ListView.php Thu Apr 27 18:13:39 2006
@@ -26,6 +26,7 @@
 require_once('themes/'.$theme.'/layout_utils.php');
 require_once('include/logging.php');
 require_once('include/ComboUtil.php');
+require_once('include/ListView/ListView.php');
 require_once('include/uifromdbutil.php');
 require_once('modules/CustomView/CustomView.php');
 
@@ -47,12 +48,7 @@
 
 if (!isset($where)) $where = "";
 
-if (isset($_REQUEST['order_by'])) $order_by = $_REQUEST['order_by'];
-
 $url_string = ''; // assigning http url string
-$sorder = 'ASC';  // Default sort order
-if(isset($_REQUEST['sorder']) && $_REQUEST['sorder'] != '')
-$sorder = $_REQUEST['sorder'];
 
 $focus = new Contact();
 

Modified: vtigercrm/branches/4.2/modules/Emails/ListView.php
==============================================================================
--- vtigercrm/branches/4.2/modules/Emails/ListView.php (original)
+++ vtigercrm/branches/4.2/modules/Emails/ListView.php Thu Apr 27 18:13:39 2006
@@ -25,6 +25,7 @@
 require_once('modules/Emails/Email.php');
 require_once('themes/'.$theme.'/layout_utils.php');
 require_once('include/logging.php');
+require_once('include/ListView/ListView.php');
 require_once('include/uifromdbutil.php');
 require_once('modules/CustomView/CustomView.php');
 

Modified: vtigercrm/branches/4.2/modules/Faq/ListView.php
==============================================================================
--- vtigercrm/branches/4.2/modules/Faq/ListView.php (original)
+++ vtigercrm/branches/4.2/modules/Faq/ListView.php Thu Apr 27 18:13:39 2006
@@ -21,6 +21,7 @@
 require_once('modules/Faq/Faq.php');
 require_once('themes/'.$theme.'/layout_utils.php');
 require_once('include/uifromdbutil.php');
+require_once('include/ListView/ListView.php');
 
 global $app_strings;
 global $mod_strings;
@@ -33,12 +34,7 @@
 
 $focus = new Faq();
 
-if (isset($_REQUEST['order_by'])) $order_by = $_REQUEST['order_by'];
-
 $url_string = ''; // assigning http url string
-$sorder = 'ASC';  // Default sort order
-if(isset($_REQUEST['sorder']) && $_REQUEST['sorder'] != '')
-$sorder = $_REQUEST['sorder'];
 
 //Constructing the Search Form
 if (!isset($_REQUEST['search_form']) || $_REQUEST['search_form'] != 'false') {

Modified: vtigercrm/branches/4.2/modules/HelpDesk/ListView.php
==============================================================================
--- vtigercrm/branches/4.2/modules/HelpDesk/ListView.php (original)
+++ vtigercrm/branches/4.2/modules/HelpDesk/ListView.php Thu Apr 27 18:13:39 2006
@@ -19,6 +19,7 @@
 require_once('XTemplate/xtpl.php');
 require_once("data/Tracker.php");
 require_once('include/logging.php');
+require_once('include/ListView/ListView.php');
 require_once('include/ComboUtil.php');
 require_once('include/utils.php');
 require_once('modules/HelpDesk/HelpDeskUtil.php');
@@ -44,12 +45,7 @@
 
 $focus = new HelpDesk();
 
-if (isset($_REQUEST['order_by'])) $order_by = $_REQUEST['order_by'];
-
 $url_string = ''; // assigning http url string
-$sorder = 'ASC';  // Default sort order
-if(isset($_REQUEST['sorder']) && $_REQUEST['sorder'] != '')
-$sorder = $_REQUEST['sorder'];
 
 if(isset($_REQUEST['query']) && $_REQUEST['query'] == 'true')
 {

Modified: vtigercrm/branches/4.2/modules/Invoice/ListView.php
==============================================================================
--- vtigercrm/branches/4.2/modules/Invoice/ListView.php (original)
+++ vtigercrm/branches/4.2/modules/Invoice/ListView.php Thu Apr 27 18:13:39 2006
@@ -47,12 +47,7 @@
 
 if (!isset($where)) $where = "";
 
-if (isset($_REQUEST['order_by'])) $order_by = $_REQUEST['order_by'];
-
 $url_string = '';
-$sorder = 'ASC';
-if(isset($_REQUEST['sorder']) && $_REQUEST['sorder'] != '')
-$sorder = $_REQUEST['sorder'];
 
 if(isset($_REQUEST['query']) && $_REQUEST['query'] == 'true')
 {

Modified: vtigercrm/branches/4.2/modules/Leads/ListView.php
==============================================================================
--- vtigercrm/branches/4.2/modules/Leads/ListView.php (original)
+++ vtigercrm/branches/4.2/modules/Leads/ListView.php Thu Apr 27 18:13:39 2006
@@ -49,12 +49,7 @@
 
 if (!isset($where)) $where = "";
 
-if (isset($_REQUEST['order_by'])) $order_by = $_REQUEST['order_by'];
-
 $url_string = ''; // assigning http url string
-$sorder = 'ASC';  // Default sort order
-if(isset($_REQUEST['sorder']) && $_REQUEST['sorder'] != '')
-$sorder = $_REQUEST['sorder'];
 
 if(isset($_REQUEST['query']) && $_REQUEST['query'] == 'true')
 {

Modified: vtigercrm/branches/4.2/modules/Notes/ListView.php
==============================================================================
--- vtigercrm/branches/4.2/modules/Notes/ListView.php (original)
+++ vtigercrm/branches/4.2/modules/Notes/ListView.php Thu Apr 27 18:13:39 2006
@@ -93,12 +93,7 @@
 
 if (!isset($where)) $where = "";
 
-if (isset($_REQUEST['order_by'])) $order_by = $_REQUEST['order_by'];
-
 $url_string = ''; // assigning http url string
-$sorder = 'ASC';  // Default sort order
-if(isset($_REQUEST['sorder']) && $_REQUEST['sorder'] != '')
-$sorder = $_REQUEST['sorder'];
 
 if(isset($_REQUEST['query']) && $_REQUEST['query'] == 'true')
 {

Modified: vtigercrm/branches/4.2/modules/Orders/ListView.php
==============================================================================
--- vtigercrm/branches/4.2/modules/Orders/ListView.php (original)
+++ vtigercrm/branches/4.2/modules/Orders/ListView.php Thu Apr 27 18:13:39 2006
@@ -47,12 +47,7 @@
 
 if (!isset($where)) $where = "";
 
-if (isset($_REQUEST['order_by'])) $order_by = $_REQUEST['order_by'];
-
 $url_string = '&smodule=PO';
-$sorder = 'ASC';
-if(isset($_REQUEST['sorder']) && $_REQUEST['sorder'] != '')
-$sorder = $_REQUEST['sorder'];
 
 if(isset($_REQUEST['query']) && $_REQUEST['query'] == 'true')
 {

Modified: vtigercrm/branches/4.2/modules/Orders/SalesOrderListView.php
==============================================================================
--- vtigercrm/branches/4.2/modules/Orders/SalesOrderListView.php (original)
+++ vtigercrm/branches/4.2/modules/Orders/SalesOrderListView.php Thu Apr 27 18:13:39 2006
@@ -13,6 +13,7 @@
 require_once('modules/Orders/SalesOrder.php');
 require_once('include/utils.php');
 require_once('include/uifromdbutil.php');
+require_once('include/ListView/ListView.php');
 require_once('modules/CustomView/CustomView.php');
 
 global $app_strings;
@@ -44,12 +45,7 @@
 */
 $focus = new SalesOrder();
 
-if (isset($_REQUEST['order_by'])) $order_by = $_REQUEST['order_by'];
-
 $url_string = '&smodule=SO'; // assigning http url string
-$sorder = 'ASC';  // Default sort order
-if(isset($_REQUEST['sorder']) && $_REQUEST['sorder'] != '')
-$sorder = $_REQUEST['sorder'];
 
 if(isset($_REQUEST['query']) && $_REQUEST['query'] != '' && $_REQUEST['query'] == 'true')
 {

Modified: vtigercrm/branches/4.2/modules/Potentials/ListView.php
==============================================================================
--- vtigercrm/branches/4.2/modules/Potentials/ListView.php (original)
+++ vtigercrm/branches/4.2/modules/Potentials/ListView.php Thu Apr 27 18:13:39 2006
@@ -47,12 +47,7 @@
 
 $focus = new Potential();
 
-if (isset($_REQUEST['order_by'])) $order_by = $_REQUEST['order_by'];
-
 $url_string = ''; // assigning http url string
-$sorder = 'ASC';  // Default sort order
-if(isset($_REQUEST['sorder']) && $_REQUEST['sorder'] != '')
-$sorder = $_REQUEST['sorder'];
 
 if(isset($_REQUEST['query']) && $_REQUEST['query'] == 'true')
 {

Modified: vtigercrm/branches/4.2/modules/Products/ListView.php
==============================================================================
--- vtigercrm/branches/4.2/modules/Products/ListView.php (original)
+++ vtigercrm/branches/4.2/modules/Products/ListView.php Thu Apr 27 18:13:39 2006
@@ -14,6 +14,7 @@
 require_once('include/utils.php');
 require_once('include/ComboUtil.php');
 require_once('include/uifromdbutil.php');
+require_once('include/ListView/ListView.php');
 require_once('modules/CustomView/CustomView.php');
 
 global $app_strings;
@@ -44,12 +45,7 @@
 
 $focus = new Product();
 
-if (isset($_REQUEST['order_by'])) $order_by = $_REQUEST['order_by'];
-
 $url_string = '&smodule=PRODUCTS'; // assigning http url string
-$sorder = 'ASC';  // Default sort order
-if(isset($_REQUEST['sorder']) && $_REQUEST['sorder'] != '')
-$sorder = $_REQUEST['sorder'];
 
 if(isset($_REQUEST['query']) && $_REQUEST['query'] != '' && $_REQUEST['query'] == 'true')
 {

Modified: vtigercrm/branches/4.2/modules/Products/PriceBookListView.php
==============================================================================
--- vtigercrm/branches/4.2/modules/Products/PriceBookListView.php (original)
+++ vtigercrm/branches/4.2/modules/Products/PriceBookListView.php Thu Apr 27 18:13:39 2006
@@ -13,6 +13,7 @@
 require_once('modules/Products/PriceBook.php');
 require_once('include/utils.php');
 require_once('include/uifromdbutil.php');
+require_once('include/ListView/ListView.php');
 require_once('modules/CustomView/CustomView.php');
 
 global $app_strings;
@@ -46,12 +47,7 @@
 
 if (!isset($where)) $where = "";
 
-if (isset($_REQUEST['order_by'])) $order_by = $_REQUEST['order_by'];
-
 $url_string = '&smodule=PRICEBOOK'; // assigning http url string
-$sorder = 'ASC';  // Default sort order
-if(isset($_REQUEST['sorder']) && $_REQUEST['sorder'] != '')
-$sorder = $_REQUEST['sorder'];
 
 if(isset($_REQUEST['query']) && $_REQUEST['query'] != '' && $_REQUEST['query'] == 'true')
 {

Modified: vtigercrm/branches/4.2/modules/Products/VendorListView.php
==============================================================================
--- vtigercrm/branches/4.2/modules/Products/VendorListView.php (original)
+++ vtigercrm/branches/4.2/modules/Products/VendorListView.php Thu Apr 27 18:13:39 2006
@@ -13,6 +13,7 @@
 require_once('modules/Products/Vendor.php');
 require_once('include/utils.php');
 require_once('include/uifromdbutil.php');
+require_once('include/ListView/ListView.php');
 require_once('modules/CustomView/CustomView.php');
 
 global $app_strings;
@@ -46,12 +47,7 @@
 
 if (!isset($where)) $where = "";
 
-if (isset($_REQUEST['order_by'])) $order_by = $_REQUEST['order_by'];
-
 $url_string = '&smodule=VENDOR'; // assigning http url string
-$sorder = 'ASC';  // Default sort order
-if(isset($_REQUEST['sorder']) && $_REQUEST['sorder'] != '')
-$sorder = $_REQUEST['sorder'];
 
 if(isset($_REQUEST['query']) && $_REQUEST['query'] != '' && $_REQUEST['query'] == 'true')
 {

Modified: vtigercrm/branches/4.2/modules/Quotes/ListView.php
==============================================================================
--- vtigercrm/branches/4.2/modules/Quotes/ListView.php (original)
+++ vtigercrm/branches/4.2/modules/Quotes/ListView.php Thu Apr 27 18:13:39 2006
@@ -46,12 +46,7 @@
 
 if (!isset($where)) $where = "";
 
-if (isset($_REQUEST['order_by'])) $order_by = $_REQUEST['order_by'];
-
 $url_string = '';
-$sorder = 'ASC';
-if(isset($_REQUEST['sorder']) && $_REQUEST['sorder'] != '')
-$sorder = $_REQUEST['sorder'];
 
 if(isset($_REQUEST['query']) && $_REQUEST['query'] == 'true')
 {





More information about the vtigercrm-commits mailing list