[Vtigercrm-commits] [vtiger-commits] r6056 - in /vtigercrm/trunk: include/utils/ListViewUtils.php modules/Leads/ListView.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Tue May 16 10:09:56 EDT 2006


Author: saraj
Date: Tue May 16 08:09:50 2006
New Revision: 6056

Log:
simplified function to store listview variables

Modified:
    vtigercrm/trunk/include/utils/ListViewUtils.php
    vtigercrm/trunk/modules/Leads/ListView.php

Modified: vtigercrm/trunk/include/utils/ListViewUtils.php
==============================================================================
--- vtigercrm/trunk/include/utils/ListViewUtils.php (original)
+++ vtigercrm/trunk/include/utils/ListViewUtils.php Tue May 16 08:09:50 2006
@@ -1981,6 +1981,7 @@
 
 function setSessionVar($lv_array)
 {
+	$start = $_REQUEST['start'];
 	if(isset($_REQUEST['start']) && $_REQUEST['start'] !='')
 	$lv_array['start']=$_REQUEST['start'];
 	if(isset($_REQUEST['viewname']) && $_REQUEST['viewname'] !='')
@@ -1988,6 +1989,11 @@
 
 	$_SESSION['lvs'][$_REQUEST['module']]=$lv_array;
 
+	if ($start < ceil ($noofrows / $list_max_entries_per_page) && $start !='')
+	{
+		$start = ceil ($noofrows / $max_ent);
+		$_SESSION['lvs'][$currentModule]['start'] = $start;
+	}
 }
-								
+
 ?>

Modified: vtigercrm/trunk/modules/Leads/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/Leads/ListView.php (original)
+++ vtigercrm/trunk/modules/Leads/ListView.php Tue May 16 08:09:50 2006
@@ -66,22 +66,6 @@
 $_SESSION['LEADS_SORT_ORDER'] = $sorder;
 //<<<<<<<<<<<<<<<<<<< sorting - stored in session >>>>>>>>>>>>>>>>>>>>
 
-//Storing Listvew session object
-if(!$_SESSION['lvs'][$currentModule])
-{
-	unset($_SESSION['lvs']);
-	$modObj = new ListViewSession();
-	$modObj->sorder = $sorder;
-	$modObj->sortby = $order_by;
-	$_SESSION['lvs'][$currentModule] = get_object_vars($modObj);
-}
-else
-{
-	setSessionVar($_SESSION['lvs'][$currentModule]);
-}
-
-$modOb = $_SESSION['lvs'][$currentModule];
-								
 //for change owner and change status
 $change_status = get_select_options_with_id($comboFieldArray['leadstatus_dom'], $focus->lead_status);
 $smarty->assign("CHANGE_STATUS",$change_status);
@@ -182,27 +166,22 @@
 //Retreiving the no of rows
 $noofrows = $adb->num_rows($list_result);
 
-//Retreiving the start value from request
-if(isset($_REQUEST['start']) && $_REQUEST['start'] != '')
-{
-        $start = $_REQUEST['start'];
-
-	//added to remain the navigation when sort
-	//$url_string = "&start=".$_REQUEST['start'];
-	$_SESSION['lvs'][$currentModule]['start'] = $_REQUEST['start'];
-}
-else
-{
-	if ($start < ceil ($noofrows / $list_max_entries_per_page))
-	{
-		$start = ceil ($noofrows / $list_max_entries_per_page);
-		$_SESSION['lvs'][$currentModule]['start'] = $start;
+//Storing Listview session object
+if(!$_SESSION['lvs'][$currentModule])
+{
+	unset($_SESSION['lvs']);
+	$modObj = new ListViewSession();
+	$modObj->sorder = $sorder;
+	$modObj->sortby = $order_by;
+	$_SESSION['lvs'][$currentModule] = get_object_vars($modObj);
 	}
 	else
 	{
-		$start = $modOb['start'];
+		setSessionVar($_SESSION['lvs'][$currentModule],$noofrows,$list_max_entries_per_page);
 	}
-}
+
+$start = $_SESSION['lvs'][$currentModule]['start'];
+
 //Retreive the Navigation array
 $navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page);
 





More information about the vtigercrm-commits mailing list