[Fusionforge-commits] FusionForge branch master updated. 13e513dacc5995cee4c71eb7cb532121edf9ed1f

Franck VILLAUME nerville at fusionforge.org
Sat Apr 27 14:28:22 CEST 2013


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  13e513dacc5995cee4c71eb7cb532121edf9ed1f (commit)
      from  401aaa34825437fce9f0c5344995117deee81eb4 (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 -----------------------------------------------------------------
commit 13e513dacc5995cee4c71eb7cb532121edf9ed1f
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Sat Apr 27 14:28:27 2013 +0200

    patch #544: fix Project Latest Documents query: sql query

diff --git a/src/common/widget/Widget_ProjectLatestDocuments.class.php b/src/common/widget/Widget_ProjectLatestDocuments.class.php
index 8a704dc..891d0b7 100644
--- a/src/common/widget/Widget_ProjectLatestDocuments.class.php
+++ b/src/common/widget/Widget_ProjectLatestDocuments.class.php
@@ -2,7 +2,8 @@
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
  * Copyright 2010, Franck Villaume - Capgemini
- * Copyright 2012, Franck Villaume - TrivialDev
+ * Copyright 2012-2013, Franck Villaume - TrivialDev
+ * Copyright 2013, French Ministry of National Education
  *
  * This file is a part of Fusionforge.
  *
@@ -50,13 +51,14 @@ class Widget_ProjectLatestDocuments extends Widget {
 		$qpa = db_construct_qpa();
 		$qpa = db_construct_qpa($qpa, 'SELECT filename, title, updatedate, createdate, realname, user_name, state_name, filetype, docid
 						FROM docdata_vw
-						WHERE group_id=$1
-						AND stateid=$2',
-					array($group_id, '1'));
+						WHERE group_id=$1',
+					array($group_id));
 
 		if (session_loggedin() && (user_ismember($group_id) ||
 		    forge_check_global_perm('forge_admin'))) {
-			$qpa = db_construct_qpa($qpa, ' OR stateid=$1 OR stateid=$2 OR stateid=$3', array('3','4','5'));
+			$qpa = db_construct_qpa($qpa, ' AND stateid IN ($1, $2, $3, $4)', array('1','3','4','5'));
+		} else {
+			$qpa = db_construct_qpa($qpa, ' AND stateid=$1', array('1'));
 		}
 
 		$qpa = db_construct_qpa($qpa, ' ORDER BY updatedate,createdate DESC LIMIT 5',array());
@@ -78,7 +80,6 @@ class Widget_ProjectLatestDocuments extends Widget {
 				$updatedate = db_result($res_files, $f, 'updatedate');
 				$createdate = db_result($res_files, $f, 'createdate');
 				$realdate = ($updatedate >= $createdate) ? $updatedate : $createdate;
-				$displaydate = getdate($realdate);
 				$filename = db_result($res_files,$f,'filename');
 				$title = db_result($res_files,$f,'title');
 				$realname = db_result($res_files,$f,'realname');
@@ -98,7 +99,7 @@ class Widget_ProjectLatestDocuments extends Widget {
 				echo '
 					<tr '. $HTML->boxGetAltRowStyle($f+1) .'>
 						<td>'
-							. $displaydate["month"] . ' ' . $displaydate["mday"] . ', ' . $displaydate["year"] .
+							. date(_('Y-m-d'),$realdate) .
 						'</td>
 						<td>
 							<a href="'.$docurl.'" ><strong>' . $filename . '</strong></a>

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

Summary of changes:
 .../widget/Widget_ProjectLatestDocuments.class.php      |   15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list