[Fusionforge-commits] FusionForge branch master updated. v6.0.3-225-geec57a8

Franck Villaume nerville at libremir.placard.fr.eu.org
Sun Nov 15 16:13:23 CET 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, master has been updated
       via  eec57a8653b5395b6ecfd964efa7ac34837a4a60 (commit)
      from  9e5ea81299a72d58fe558af2599a085d251ff302 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=eec57a8653b5395b6ecfd964efa7ac34837a4a60

commit eec57a8653b5395b6ecfd964efa7ac34837a4a60
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Sun Nov 15 16:12:16 2015 +0100

    little memory improvement: reuse the LUSER object & set paging by default

diff --git a/src/common/tracker/actions/browse.php b/src/common/tracker/actions/browse.php
index 548d890..a0b502a 100644
--- a/src/common/tracker/actions/browse.php
+++ b/src/common/tracker/actions/browse.php
@@ -34,6 +34,7 @@ global $ath;
 global $group_id;
 global $group;
 global $HTML;
+global $LUSER;
 
 //
 //  make sure this person has permission to view artifacts
@@ -42,7 +43,6 @@ session_require_perm('tracker', $ath->getID(), 'read');
 
 $query_id = getIntFromRequest('query_id');
 $start = getIntFromRequest('start');
-$paging = 0;
 
 //
 //	The browse page can be powered by a pre-saved query
@@ -54,21 +54,20 @@ $paging = 0;
 //	If the query_id = -1, unset the pref and use regular browse boxes
 //
 if (session_loggedin()) {
-	$u =& session_get_user();
 	if (getStringFromRequest('setpaging')) {
 		/* store paging preferences */
 		$paging = getIntFromRequest('nres');
 		if (!$paging) {
 			$paging = 25;
 		}
-		$u->setPreference("paging", $paging);
+		$LUSER->setPreference("paging", $paging);
 	}
 	/* logged in users get configurable paging */
-	$paging = $u->getPreference("paging");
+	$paging = $LUSER->getPreference("paging");
 
 	if($query_id) {
 		if ($query_id == '-1') {
-			$u->setPreference('art_query'.$ath->getID(),'');
+			$LUSER->setPreference('art_query'.$ath->getID(),'');
 		} else {
 			$aq = new ArtifactQuery($ath,$query_id);
 			if (!$aq || !is_object($aq)) {
@@ -77,7 +76,7 @@ if (session_loggedin()) {
 			$aq->makeDefault();
 		}
 	} else {
-		$query_id=$u->getPreference('art_query'.$ath->getID(),'');
+		$query_id= $LUSER->getPreference('art_query'.$ath->getID(),'');
 	}
 } elseif ($query_id) {
 	// If user is not logged, then use a cookie to store the current query.
@@ -95,6 +94,9 @@ if (session_loggedin()) {
 	$query_id = (int)$gf_tracker[$ath->getID()];
 }
 
+if(!isset($paging) || !$paging)
+	$paging = 25;
+
 $af = new ArtifactFactory($ath);
 
 if (!$af || !is_object($af)) {
diff --git a/src/www/admin/grouplist.php b/src/www/admin/grouplist.php
index 573a2bb..1cf3f1b 100644
--- a/src/www/admin/grouplist.php
+++ b/src/www/admin/grouplist.php
@@ -26,19 +26,19 @@ require_once $gfcommon.'include/pre.php';
 require_once $gfcommon.'include/UserManager.class.php';
 require_once $gfwww.'admin/admin_utils.php';
 
+global $LUSER;
+
 site_admin_header(array('title'=>_('Project List')));
 
-$paging = 25;
-$u = UserManager::instance()->getCurrentUser();
 if (getStringFromRequest('setpaging')) {
 	/* store paging preferences */
 	$paging = getIntFromRequest('nres');
 	if (!$paging) {
 		$paging = 25;
 	}
-	$u->setPreference('paging', $paging);
+	$LUSER->setPreference('paging', $paging);
 } else {
-	$paging = $u->getPreference('paging');
+	$paging = $LUSER->getPreference('paging');
 }
 
 if (!$paging)
diff --git a/src/www/admin/userlist.php b/src/www/admin/userlist.php
index 2287240..27dc93e 100644
--- a/src/www/admin/userlist.php
+++ b/src/www/admin/userlist.php
@@ -27,6 +27,9 @@ require_once $gfcommon.'include/pre.php';
 require_once $gfcommon.'include/UserManager.class.php';
 require_once $gfwww.'admin/admin_utils.php';
 
+global $HTML;
+global $LUSER;
+
 // user must be forge admin to proceed
 session_require_global_perm('forge_admin');
 
@@ -153,20 +156,15 @@ function show_users_list($users, $filter = '', $sortorder = 'realname', $start,
 	echo $HTML->paging_bottom($start, $paging, $totalUsers, '/admin/userlist.php?sortorder='.$sortorder.$filter);
 }
 
-
-global $HTML;
-
-$paging = 25;
-$u = UserManager::instance()->getCurrentUser();
 if (getStringFromRequest('setpaging')) {
 	/* store paging preferences */
 	$paging = getIntFromRequest('nres');
 	if (!$paging) {
 		$paging = 25;
 	}
-	$u->setPreference('paging', $paging);
+	$LUSER->setPreference('paging', $paging);
 } else {
-	$paging = $u->getPreference('paging');
+	$paging = $LUSER->getPreference('paging');
 }
 
 if (!$paging)
diff --git a/src/www/pm/browse_task.php b/src/www/pm/browse_task.php
index afaaa5f..b27d0db 100644
--- a/src/www/pm/browse_task.php
+++ b/src/www/pm/browse_task.php
@@ -34,12 +34,13 @@ require_once $gfcommon.'pm/ProjectTaskFactory.class.php';
 //same for status
 
 global $HTML;
+global $LUSER;
 
 $pagename = "pm_browse_custom";
 
 $start = getIntFromRequest('start');
 if ($start < 0) {
-	$start = 0 ;
+	$start = 0;
 }
 
 $ptf = new ProjectTaskFactory($pg);
@@ -57,22 +58,20 @@ $_status = getStringFromRequest('_status');
 $_category_id = getIntFromRequest('_category_id');
 $_view = getStringFromRequest('_view');
 
-$paging = 0;
 if (session_loggedin()) {
-    $u = UserManager::instance()->getCurrentUser();
 	if (getStringFromRequest('setpaging')) {
 		/* store paging preferences */
 		$paging = getIntFromRequest('nres');
 		if (!$paging) {
 			$paging = 25;
 		}
-		$u->setPreference('paging', $paging);
+		$LUSER->setPreference('paging', $paging);
 	} else
-		$paging = $u->getPreference('paging');
+		$paging = $LUSER->getPreference('paging');
 }
-if (!$paging) {
+
+if(!isset($paging) || !$paging)
 	$paging = 25;
-}
 
 $ptf->setup($start, $_order, $paging, $set, $_assigned_to, $_status, $_category_id, $_view, $_sort_order);
 if ($ptf->isError()) {

-----------------------------------------------------------------------

Summary of changes:
 src/common/tracker/actions/browse.php | 14 ++++++++------
 src/www/admin/grouplist.php           |  8 ++++----
 src/www/admin/userlist.php            | 12 +++++-------
 src/www/pm/browse_task.php            | 13 ++++++-------
 4 files changed, 23 insertions(+), 24 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list