[Vtigercrm-commits] [vtiger-commits] r6043 - in /vtigercrm/trunk: include/ListView/ListView.php include/ListView/ListViewSession.php include/js/ListView.js include/utils/ListViewUtils.php modules/CustomView/CustomView.php modules/Leads/ListView.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Tue May 16 07:36:44 EDT 2006
Author: saraj
Date: Tue May 16 05:36:31 2006
New Revision: 6043
Log:
Listview variables added in session
Added:
vtigercrm/trunk/include/ListView/ListViewSession.php
Modified:
vtigercrm/trunk/include/ListView/ListView.php
vtigercrm/trunk/include/js/ListView.js
vtigercrm/trunk/include/utils/ListViewUtils.php
vtigercrm/trunk/modules/CustomView/CustomView.php
vtigercrm/trunk/modules/Leads/ListView.php
Modified: vtigercrm/trunk/include/ListView/ListView.php
==============================================================================
--- vtigercrm/trunk/include/ListView/ListView.php (original)
+++ vtigercrm/trunk/include/ListView/ListView.php Tue May 16 05:36:31 2006
@@ -17,6 +17,7 @@
* Description: generic list view class.
********************************************************************************/
require_once('include/logging.php');
+require_once('include/ListView/ListViewSession.php');
class ListView {
Modified: vtigercrm/trunk/include/js/ListView.js
==============================================================================
--- vtigercrm/trunk/include/js/ListView.js (original)
+++ vtigercrm/trunk/include/js/ListView.js Tue May 16 05:36:31 2006
@@ -110,7 +110,7 @@
show("status");
var ajaxObj = new Ajax(ajaxSaveResponse);
var viewName = selectView.options[selectView.options.selectedIndex].value;
- var urlstring ="module="+module+"&action="+module+"Ajax&file=ListView&ajax=true&viewname="+viewName;
+ var urlstring ="module="+module+"&action="+module+"Ajax&file=ListView&ajax=true&start=1&viewname="+viewName;
ajaxObj.process("index.php?",urlstring);
}
Modified: vtigercrm/trunk/include/utils/ListViewUtils.php
==============================================================================
--- vtigercrm/trunk/include/utils/ListViewUtils.php (original)
+++ vtigercrm/trunk/include/utils/ListViewUtils.php Tue May 16 05:36:31 2006
@@ -1895,11 +1895,14 @@
$theme_path="themes/".$theme."/";
$image_path=$theme_path."images/";
$output = '<td align="right" style="padding="5px;">';
+
+ /* //commented due to usablity conflict -- Philip
$output .= '<a href="index.php?module='.$module.'&action='.$action_val.$url_qry.'&start=1&viewname='.$viewid.'&allflag='.$navigation_array['allflag'].'" >'.$navigation_array['allflag'].'</a> ';
+ */
if(($navigation_array['prev']) != 0)
{
$output .= '<a href="index.php?module='.$module.'&action='.$action_val.$url_qry.'&start=1&viewname='.$viewid.'" title="First"><img src="'.$image_path.'start.gif" border="0" align="absmiddle"></a> ';
- $output .= '<a href="index.php?module='.$module.'&action='.$action_val.$url_qry.'&start='.$navigation_array['prev'].'&viewname='.$viewid.'"><img src="'.$image_path.'previous.gif" border="0" align="absmiddle"></a> ';
+ $output .= '<a href="index.php?module='.$module.'&action='.$action_val.$url_qry.'&start='.$navigation_array['prev'].'&viewname='.$viewid.'" title="Previous"><img src="'.$image_path.'previous.gif" border="0" align="absmiddle"></a> ';
}
else
@@ -1917,8 +1920,8 @@
}
if(($navigation_array['next']) !=0)
{
- $output .= '<a href="index.php?module='.$module.'&action='.$action_val.$url_qry.'&start='.$navigation_array['next'].'&viewname='.$viewid.'"><img src="'.$image_path.'next.gif" border="0" align="absmiddle"></a> ';
- $output .= '<a href="index.php?module='.$module.'&action='.$action_val.$url_qry.'&start='.$navigation_array['verylast'].'&viewname='.$viewid.'"><img src="'.$image_path.'end.gif" border="0" align="absmiddle"></a> ';
+ $output .= '<a href="index.php?module='.$module.'&action='.$action_val.$url_qry.'&start='.$navigation_array['next'].'&viewname='.$viewid.'" title="Next"><img src="'.$image_path.'next.gif" border="0" align="absmiddle"></a> ';
+ $output .= '<a href="index.php?module='.$module.'&action='.$action_val.$url_qry.'&start='.$navigation_array['verylast'].'&viewname='.$viewid.'" title="Last"><img src="'.$image_path.'end.gif" border="0" align="absmiddle"></a> ';
}
else
{
@@ -1934,7 +1937,7 @@
Param $currentmodule - modulename of the entity to be selected
Param $returnmodule - modulename for which the entity is assingned
Param $recordid - the record id for which the entity is assigned
-Return tyep string.
+Return type string.
*/
function getRelCheckquery($currentmodule,$returnmodule,$recordid)
@@ -1971,4 +1974,20 @@
return $where_relquery;
}
+/**This function stores the variables sent in list view url string.
+Param $lv_array - list view session array
+Return type void.
+*/
+
+function setSessionVar($lv_array)
+{
+ if(isset($_REQUEST['start']) && $_REQUEST['start'] !='')
+ $lv_array['start']=$_REQUEST['start'];
+ if(isset($_REQUEST['viewname']) && $_REQUEST['viewname'] !='')
+ $lv_array['viewname']=$_REQUEST['viewname'];
+
+ $_SESSION['lvs'][$_REQUEST['module']]=$lv_array;
+
+}
+
?>
Modified: vtigercrm/trunk/modules/CustomView/CustomView.php
==============================================================================
--- vtigercrm/trunk/modules/CustomView/CustomView.php (original)
+++ vtigercrm/trunk/modules/CustomView/CustomView.php Tue May 16 05:36:31 2006
@@ -82,12 +82,12 @@
// Mike Crowe Mod --------------------------------------------------------getViewId
function getViewId($module)
{
- global $adb;
+ global $adb;
if(isset($_REQUEST['viewname']) == false)
{
- if (isset($_SESSION["cv$module"]) && $_SESSION["cv$module"]!='')
- {
- $viewid = $_SESSION["cv$module"];
+ if (isset($_SESSION['lvs'][$module]["viewname"]) && $_SESSION['lvs'][$module]["viewname"]!='')
+ {
+ $viewid = $_SESSION['lvs'][$module]["viewname"];
}
elseif($this->setdefaultviewid != "")
{
@@ -103,8 +103,9 @@
{
$viewid = $_REQUEST['viewname'];
}
- $_SESSION["cv$module"] = $viewid;
+ $_SESSION['lvs'][$module]["viewname"] = $viewid;
return $viewid;
+
}
// Mike Crowe Mod --------------------------------------------------------getGroupId
Modified: vtigercrm/trunk/modules/Leads/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/Leads/ListView.php (original)
+++ vtigercrm/trunk/modules/Leads/ListView.php Tue May 16 05:36:31 2006
@@ -66,6 +66,22 @@
$_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);
@@ -172,11 +188,20 @@
$start = $_REQUEST['start'];
//added to remain the navigation when sort
- $url_string = "&start=".$_REQUEST['start'];
+ //$url_string = "&start=".$_REQUEST['start'];
+ $_SESSION['lvs'][$currentModule]['start'] = $_REQUEST['start'];
}
else
{
- $start = 1;
+ if ($start < ceil ($noofrows / $list_max_entries_per_page))
+ {
+ $start = ceil ($noofrows / $list_max_entries_per_page);
+ $_SESSION['lvs'][$currentModule]['start'] = $start;
+ }
+ else
+ {
+ $start = $modOb['start'];
+ }
}
//Retreive the Navigation array
$navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page);
More information about the vtigercrm-commits
mailing list