[Fusionforge-commits] FusionForge branch master updated. v6.0.3-359-g28451f9

Franck Villaume nerville at libremir.placard.fr.eu.org
Sun Feb 14 19:55:31 CET 2016


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  28451f934c304dac83ec7c2966bd2bc13a470e61 (commit)
       via  928a7fe850c5dfa98a437073d9660bebfdda2f61 (commit)
      from  ec8ece1e90d7623ee4bb9b67cd0eb02ca0e236ec (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=28451f934c304dac83ec7c2966bd2bc13a470e61

commit 28451f934c304dac83ec7c2966bd2bc13a470e61
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Sun Feb 14 19:55:15 2016 +0100

    fix Widget_MyProjectsLastDocuments, using stateid for documents

diff --git a/src/common/docman/DocumentFactory.class.php b/src/common/docman/DocumentFactory.class.php
index 6d48d33..1173cb0 100644
--- a/src/common/docman/DocumentFactory.class.php
+++ b/src/common/docman/DocumentFactory.class.php
@@ -49,7 +49,7 @@ class DocumentFactory extends Error {
 	 * The stateid Array limit
 	 * @var	array	Contains the different stateid to limit return documents in getDocuments.
 	 */
-	var $stateidArr;
+	var $stateidArr = array();
 
 	/**
 	 * The doc_group_id limit
diff --git a/src/common/widget/Widget_MyProjectsLastDocuments.class.php b/src/common/widget/Widget_MyProjectsLastDocuments.class.php
index c4c0ee9..66bff29 100644
--- a/src/common/widget/Widget_MyProjectsLastDocuments.class.php
+++ b/src/common/widget/Widget_MyProjectsLastDocuments.class.php
@@ -70,11 +70,14 @@ class Widget_MyProjectsLastDocuments extends Widget {
 					}
 
 					$stateIdDg = 1;
+					$stateIdDocuments = array(1);
 					if (forge_check_perm('docman', $g->getID(), 'approve')) {
 						$stateIdDg = 5;
+						$stateIdDocuments = array(1, 2, 3, 4, 5);
 					}
 					$df = new DocumentFactory($g);
 					$df->setDocGroupState($stateIdDg);
+					$df->setStateID($stateIdDocuments);
 					$df->setLimit(5);
 					$df->setOrder(array('updatedate', 'createdate'));
 					$df->setSort('DESC');

https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=928a7fe850c5dfa98a437073d9660bebfdda2f61

commit 928a7fe850c5dfa98a437073d9660bebfdda2f61
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Sun Feb 14 19:51:58 2016 +0100

    use proper parameter to function. limit & offset are supported by db_query_params & db_query_qpa

diff --git a/src/common/docman/DocumentFactory.class.php b/src/common/docman/DocumentFactory.class.php
index 978bf5a..6d48d33 100644
--- a/src/common/docman/DocumentFactory.class.php
+++ b/src/common/docman/DocumentFactory.class.php
@@ -396,13 +396,7 @@ class DocumentFactory extends Error {
 
 		$qpa = db_construct_qpa($qpa, $this->sort);
 
-		if ($this->limit !== 0) {
-			$qpa = db_construct_qpa($qpa, ' LIMIT $1', array($this->limit));
-		}
-
-		$qpa = db_construct_qpa($qpa, ' OFFSET $1', array($this->offset));
-
-		$result = db_query_qpa($qpa);
+		$result = db_query_qpa($qpa, $this->limit, $this->offset);
 		if (!$result) {
 			$this->setError('getFromStorage:'.db_error());
 			return false;
diff --git a/src/common/widget/Widget_MyTasks.class.php b/src/common/widget/Widget_MyTasks.class.php
index 33e9e6a..81c7718 100644
--- a/src/common/widget/Widget_MyTasks.class.php
+++ b/src/common/widget/Widget_MyTasks.class.php
@@ -68,13 +68,13 @@ class Widget_MyTasks extends Widget {
 				$sql2 = 'SELECT project_task.project_task_id, project_task.priority, project_task.summary,project_task.percent_complete '.
 					'FROM groups,project_group_list,project_task,project_assigned_to '.
 					'WHERE project_task.project_task_id=project_assigned_to.project_task_id '.
-					"AND project_assigned_to.assigned_to_id=$1 AND project_task.status_id='1'  ".
+					'AND project_assigned_to.assigned_to_id = $1 AND project_task.status_id = 1 '.
 					'AND project_group_list.group_id=groups.group_id '.
 					"AND groups.group_id=$2 ".
 					'AND project_group_list.group_project_id=project_task.group_project_id '.
-					"AND project_group_list.group_project_id= $3 LIMIT 100";
+					'AND project_group_list.group_project_id= $3 ';
 
-				$result2 = db_query_params($sql2,array(user_getid(),$group_id,$group_project_id));
+				$result2 = db_query_params($sql2,array(user_getid(),$group_id,$group_project_id), 100);
 				$rows2 = db_numrows($result2);
 
 				$vItemId = new Valid_UInt('hide_item_id');

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

Summary of changes:
 src/common/docman/DocumentFactory.class.php                | 10 ++--------
 src/common/widget/Widget_MyProjectsLastDocuments.class.php |  3 +++
 src/common/widget/Widget_MyTasks.class.php                 |  6 +++---
 3 files changed, 8 insertions(+), 11 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list