[evolvis-commits] r17275: [#1644] [#1645] Disable paging in PM/Tasks altogether

mirabilos at evolvis.org mirabilos at evolvis.org
Fri May 20 14:36:14 CEST 2011


Author: mirabilos
Date: 2011-05-20 14:36:14 +0200 (Fri, 20 May 2011)
New Revision: 17275

Modified:
   trunk/gforge_base/evolvisforge/gforge/common/pm/ProjectTaskFactory.class.php
   trunk/gforge_base/evolvisforge/gforge/debian/changelog
   trunk/gforge_base/evolvisforge/gforge/www/pm/browse_task.php
Log:
[#1644] [#1645] Disable paging in PM/Tasks altogether

problem related to [#1161]

I think both task and tracker browse pages need a full
rewrite-from-scratch by now, but that won’t be done
before 5.1 migration…


Modified: trunk/gforge_base/evolvisforge/gforge/common/pm/ProjectTaskFactory.class.php
===================================================================
--- trunk/gforge_base/evolvisforge/gforge/common/pm/ProjectTaskFactory.class.php	2011-05-19 10:12:04 UTC (rev 17274)
+++ trunk/gforge_base/evolvisforge/gforge/common/pm/ProjectTaskFactory.class.php	2011-05-20 12:36:14 UTC (rev 17275)
@@ -46,10 +46,10 @@
 	var $status;
 	var $category;
 	var $assigned_to;
-	var $offset;
-	var $max_rows;
+	var $offset = 0;
 	var $fetched_rows;
 	var $view_type;
+	var $max_rows = -1;
 
 	/**
 	 *  Constructor.
@@ -69,7 +69,6 @@
 		}
 		$this->ProjectGroup =& $ProjectGroup;
 		$this->order='project_task_id';
-		$this->offset=0;
 
 		return true;
 	}
@@ -77,22 +76,15 @@
 	/**
 	 *	setup - sets up limits and sorts before you call getTasks().
 	 *
-	 *	@param	int	The offset - number of rows to skip.
+	 *	@param	int	ignored (formerly: The offset - number of rows to skip.)
 	 *	@param	string	The way to order - ASC or DESC.
-	 *	@param	int	The max number of rows to return.
+	 *	@param	int	ignored (formerly: The max number of rows to return.)
 	 *	@param	string	Whether to set these prefs into the user_prefs table - use "custom".
 	 *	@param	int	Include this param if you want to limit to a certain assignee.
 	 *	@param	int	Include this param if you want to limit to a certain category.
 	 *	@param	string	What view mode the screen should be in.
 	 */
 	function setup($offset,$order,$max_rows,$set,$_assigned_to,$_status,$_category_id,$_view='') {
-//echo "<br />offset: $offset| order: $order|max_rows: $max_rows|_assigned_to: $_assigned_to|_status: $_status|_category_id: $_category_id +";
-		if ((!$offset) || ($offset < 0)) {
-			$this->offset=0;
-		} else {
-			$this->offset=$offset;
-		}
-
 		if (session_loggedin()) {
 			$u =& session_get_user();
 		}
@@ -139,11 +131,6 @@
 		$this->assigned_to=$_assigned_to;
 		$this->category=$_category_id;
 		$this->view_type=$_view;
-
-		if (!$max_rows || $max_rows < 5) {
-			$max_rows=50;
-		}
-		$this->max_rows=$max_rows;
 	}
 	
 	/**
@@ -173,16 +160,12 @@
                           AND project_task_vw.group_project_id = $1
                           AND project_assigned_to.assigned_to_id = ANY ($2)' . $order,
 						   array ($this->ProjectGroup->getID(),
-							  db_int_array_to_any_clause ($tat)),
-						   $this->max_rows,
-						   $this->offset) ;
+							  db_int_array_to_any_clause ($tat)));
 		} else {
 			$result = db_query_params ('SELECT project_task_vw.*, project_task_external_order.external_id
 			FROM project_task_vw natural left join project_task_external_order
 			WHERE project_task_vw.group_project_id = $1' . $order,
-						   array ($this->ProjectGroup->getID()),
-						   $this->max_rows,
-						   $this->offset) ;
+						   array ($this->ProjectGroup->getID()));
 		}
 
 		$rows = db_numrows($result);

Modified: trunk/gforge_base/evolvisforge/gforge/debian/changelog
===================================================================
--- trunk/gforge_base/evolvisforge/gforge/debian/changelog	2011-05-19 10:12:04 UTC (rev 17274)
+++ trunk/gforge_base/evolvisforge/gforge/debian/changelog	2011-05-20 12:36:14 UTC (rev 17275)
@@ -15,8 +15,9 @@
   * Tracker: “Add” and “Browse” instructions can contain newlines
   * [#824] Standard configuration for Tracker Custom Fields
   * [TTID# 1111894] Update tarent GmbH information
+  * [#1644] [#1645] Disable paging in PM/Tasks altogether
 
- -- Thorsten Glaser <t.glaser at tarent.de>  Thu, 19 May 2011 12:10:04 +0200
+ -- Thorsten Glaser <t.glaser at tarent.de>  Fri, 20 May 2011 13:22:12 +0200
 
 gforge (4.8.3+evolvis33) unstable; urgency=high
 

Modified: trunk/gforge_base/evolvisforge/gforge/www/pm/browse_task.php
===================================================================
--- trunk/gforge_base/evolvisforge/gforge/www/pm/browse_task.php	2011-05-19 10:12:04 UTC (rev 17274)
+++ trunk/gforge_base/evolvisforge/gforge/www/pm/browse_task.php	2011-05-20 12:36:14 UTC (rev 17275)
@@ -48,9 +48,6 @@
 
 $pagename = "pm_browse_custom";
 
-$offset = getIntFromRequest('offset');
-if ($offset < 0)
-	$offset = 0;
 $showAll = getStringFromRequest('showAll');
 
 $_order = getStringFromRequest('_order');
@@ -60,20 +57,6 @@
 $_category_id = getIntFromRequest('_category_id');
 $_view = getStringFromRequest('_view');
 
-$paging = 0;
-if (session_loggedin()) {
-	if (getStringFromRequest('setpaging')) {
-		/* store paging preferences */
-		$paging = getIntFromRequest('nres');
-		if (!$paging)
-			$paging = 25;
-		$u->setPreference("paging", $paging);
-	} else
-		$paging = $u->getPreference("paging");
-}
-if (!$paging)
-	$paging = 25;
-
 //showAll url parameter decides whether one subproject is shown
 //or the union of subprojects (decided by All option in dropdownlist)
 if ($showAll == 'showAllSubProjects') {
@@ -117,7 +100,7 @@
 			exit_error('Error',$ptf->getErrorMessage());
 		}
 
-		$ptf->setup($offset,$_order,$paging,$set,$_assigned_to,$_status,$_category_id,$_view);
+		$ptf->setup(…,$_order,…,$set,$_assigned_to,$_status,$_category_id,$_view);
 		if ($ptf->isError()) {
 			exit_error('Error',$ptf->getErrorMessage());
 		}
@@ -143,7 +126,7 @@
 		exit_error('Error',$ptf->getErrorMessage());
 	}
 
-	$ptf->setup($offset,$_order,$paging,$set,$_assigned_to,$_status,$_category_id,$_view);
+	$ptf->setup(…,$_order,…,$set,$_assigned_to,$_status,$_category_id,$_view);
 	if ($ptf->isError()) {
 		exit_error('Error',$ptf->getErrorMessage());
 	}
@@ -375,22 +358,6 @@
 		<span class="important">'._('Add tasks using the link above').'</span>';
 	echo db_error();
 } else {
-
-if (session_loggedin()) {
-	/* logged in users get configurable paging */
-	echo '<form action="'. getStringFromServer('PHP_SELF') .'?group_id='.$group_id.'&group_project_id='.$pg->getID().'&offset='.$offset.'" method="post">'."\n";
-}
-printf('<p>' . _('Displaying results %1$d‒%2$d.'), $offset + 1, $offset + $rows);
-if (session_loggedin()) {
-	printf(' ' . _('Displaying %2$s results.') . "\n\t<input " .
-	    'type="submit" name="setpaging" value="%1$s" class="hidePartForPrinting" />' .
-	    "\n</p>\n</form>\n", _('Change'),
-	    html_build_select_box_from_array(array(
-		'10', '25', '50', '100', '99999'), 'nres', $paging, 1));
-} else {
-	echo "</p>\n";
-}
-
 	//create a new $set string to be used for next/prev button
 	if ($set=='custom') {
 		$set .= '&_assigned_to='.$_assigned_to.'&_status='.$_status;
@@ -633,27 +600,6 @@
 		echo '</tr><tr><td colspan="'.($columnRowCount + $columnRowCount_ + 3).'"> </td></tr>';
 	}
 
-	/*
-		Show extra rows for <-- Prev / Next -->
-	*/
-	echo '<tr><td colspan="2">';
-	if ($offset > 0) {
-		echo '<div class="hidePartForPrinting">';
-		echo util_make_link ('/pm/task.php?func=browse&group_project_id='.$group_project_id.'&group_id='.$group_id.'&offset='.($offset-$paging),'<strong>← '._('previous').'</strong>');
-		echo '</div>';
-	} else {
-		echo ' ';
-	}
-	echo '</td><td> </td><td colspan="2">';
-
-	if ($rows==$paging) {
-		echo '<div class="hidePartForPrinting">';
-		echo util_make_link ('/pm/task.php?func=browse&group_project_id='.$group_project_id.'&group_id='.$group_id.'&offset='.($offset+$paging),'<strong>'._('next').' →</strong>');
-		echo '</div>';
-	} else {
-		echo ' ';
-	}
-	echo '</td></tr>';
 	echo $GLOBALS['HTML']->listTableBottom();
 
 	if ($IS_ADMIN) {



More information about the evolvis-commits mailing list