[Fusionforge-commits] FusionForge branch master updated. acb03f0a7a62e9ec935b4f609975fc3b64ff4ccd

Franck VILLAUME nerville at fusionforge.org
Thu May 2 21:19:04 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  acb03f0a7a62e9ec935b4f609975fc3b64ff4ccd (commit)
      from  10fd53d13e7721fabd2035f23a85f39b889d9f4b (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 acb03f0a7a62e9ec935b4f609975fc3b64ff4ccd
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Thu May 2 21:12:51 2013 +0200

    patch #547: order display documents search

diff --git a/src/common/search/DocsAllSearchQuery.class.php b/src/common/search/DocsAllSearchQuery.class.php
index 63b5a7f..015c259 100644
--- a/src/common/search/DocsAllSearchQuery.class.php
+++ b/src/common/search/DocsAllSearchQuery.class.php
@@ -5,6 +5,7 @@
  * Copyright 2004, Dominik Haas
  * Copyright 2011, Franck Villaume - Capgemini
  * Copyright (C) 2012 Alain Peyrat - Alcatel-Lucent
+ * Copyright 2013, French Minitry of National Education
  *
  * This file is part of FusionForge.
  *
@@ -80,7 +81,7 @@ class DocsAllSearchQuery extends SearchQuery {
 		$qpa = $this->addIlikeCondition($qpa, 'description', $this->words);
 		$qpa = db_construct_qpa($qpa, ') OR (');
 		$qpa = $this->addIlikeCondition($qpa, 'data_words', $this->words);
-		$qpa = db_construct_qpa ($qpa, ')) ORDER BY doc_groups.groupname, doc_data.docid') ;
+		$qpa = db_construct_qpa ($qpa, ')) ORDER BY groups.group_name, doc_groups.groupname, doc_data.title') ;
 
 		return $qpa;
 	}
diff --git a/src/common/search/DocsSearchQuery.class.php b/src/common/search/DocsSearchQuery.class.php
index b07f05d..c252c87 100644
--- a/src/common/search/DocsSearchQuery.class.php
+++ b/src/common/search/DocsSearchQuery.class.php
@@ -5,6 +5,8 @@
  * Copyright 2004, Dominik Haas
  * Copyright 2009, Roland Mas
  * Copyright (C) 2012 Alain Peyrat - Alcatel-Lucent
+ * Copyright 2013, Franck Villaume - TrivialDev
+ * Copyright 2013, French Ministry of National Education
  * http://fusionforge.org
  *
  * This file is part of FusionForge. FusionForge is free software;
@@ -88,7 +90,7 @@ class DocsSearchQuery extends SearchQuery {
 						 ') AS x WHERE ') ;
 			$qpa = $this->addIlikeCondition ($qpa, 'full_string_agg') ;
 			$qpa = db_construct_qpa ($qpa,
-						 ' ORDER BY x.groupname, x.docid') ;
+						 ' ORDER BY x.groupname, x.title') ;
 		}
 		return $qpa;
 	}
@@ -128,7 +130,7 @@ class DocsSearchQuery extends SearchQuery {
 			$qpa = $this->addMatchCondition($qpa, 'full_string_agg');
 		}
 		$qpa = db_construct_qpa ($qpa,
-					 ' ORDER BY ts_rank(vectors, to_tsquery($1)) DESC, groupname ASC',
+					 ' ORDER BY groupname ASC, ts_rank(vectors, to_tsquery($1)) DESC, title ASC',
 					 array($words)) ;
 		return $qpa ;
 	}
diff --git a/src/www/search/include/renderers/DocsAllHtmlSearchRenderer.class.php b/src/www/search/include/renderers/DocsAllHtmlSearchRenderer.class.php
index 188359f..1a3e436 100644
--- a/src/www/search/include/renderers/DocsAllHtmlSearchRenderer.class.php
+++ b/src/www/search/include/renderers/DocsAllHtmlSearchRenderer.class.php
@@ -4,6 +4,8 @@
  *
  * Copyright 2004 (c) Dominik Haas, GForge Team
  * Copyright 2011, Franck Villaume - Capgemini
+ * Copyright 2013, Franck Villaume - TrivialDev
+ * Copyright 2013, French Ministry of National Education
  * http://fusionforge.org
  *
  * This file is part of FusionForge. FusionForge is free software;
@@ -54,8 +56,8 @@ class DocsAllHtmlSearchRenderer extends HtmlSearchRenderer {
 		$searchQuery = new DocsAllSearchQuery($words, $offset, $isExact , $sections, $parametersValues);
 		$this->HtmlSearchRenderer(SEARCH__TYPE_IS_ALLDOCS, $words, $isExact, $searchQuery);
 		$this->tableHeaders = array(
-			' ',
-			_('Project Name'),
+			_('Project'),
+			_('Directory'),
 			_('Title'),
 			_('Description')
 		);
@@ -88,13 +90,13 @@ class DocsAllHtmlSearchRenderer extends HtmlSearchRenderer {
 			$currentDocGroup = db_result($result, $i, 'project_name');
 			$currentDocGroupObject = group_get_object_by_publicname($currentDocGroup);
 			if ($lastDocGroup != $currentDocGroup) {
-				$return .= '<tr><td colspan="4">'.html_image('ic/home16b.png', '10', '12', array('border' => '0')).'<b>'.util_make_link('/docman/?group_id='.$currentDocGroupObject->getID(),$currentDocGroup).'</b></td></tr>';
+				$return .= '<tr><td>'.html_image('ic/home16b.png', '10', '12', array('border' => '0')).'<b>'.util_make_link('/docman/?group_id='.$currentDocGroupObject->getID(),$currentDocGroup).'</b></td><td colspan="3"> </td></tr>';
 				$lastDocGroup = $currentDocGroup;
 				$rowColor = 0;
 			}
 			$document = new Document($currentDocGroupObject, db_result($result, $i, 'docid'));
 			$return .= '<tr '. $GLOBALS['HTML']->boxGetAltRowStyle($rowColor) .'>'
-						. '<td width="5%"> </td>'
+						. '<td> </td>'
 						. '<td>'.html_image('ic/cfolder15.png', '10', '12', array('border' => '0')).util_make_link('/docman/?group_id='.$currentDocGroupObject->getID().'&view=listfile&dirid='.$document->getDocGroupID(),db_result($result, $i, 'groupname')).'</td>';
 						if (db_result($result, $i, 'filetype') == 'URL') {
 							$return .= '<td><a href="'.db_result($result, $i, 'filename').'">';
diff --git a/src/www/search/include/renderers/DocsHtmlSearchRenderer.class.php b/src/www/search/include/renderers/DocsHtmlSearchRenderer.class.php
index abe913c..a7606b9 100644
--- a/src/www/search/include/renderers/DocsHtmlSearchRenderer.class.php
+++ b/src/www/search/include/renderers/DocsHtmlSearchRenderer.class.php
@@ -4,6 +4,8 @@
  *
  * Copyright 2004 (c) Dominik Haas, GForge Team
  * Copyright (C) 2012 Alain Peyrat - Alcatel-Lucent
+ * Copyright 2013, Franck Villaume - TrivialDev
+ * Copyright 2013, French Ministry of National Education
  * http://fusionforge.org
  *
  * This file is part of FusionForge. FusionForge is free software;
@@ -47,7 +49,7 @@ class DocsHtmlSearchRenderer extends HtmlGroupSearchRenderer {
 		$this->HtmlGroupSearchRenderer(SEARCH__TYPE_IS_DOCS, $words, $isExact, $searchQuery, $groupId, 'docman');
 
 		$this->tableHeaders = array(
-			' ',
+			_('Directory'),
 			_('#'),
 			_('Title'),
 			_('Description')
@@ -79,12 +81,12 @@ class DocsHtmlSearchRenderer extends HtmlGroupSearchRenderer {
 			$groupObject = group_get_object($this->groupId);
 			$document = new Document($groupObject, db_result($result, $i, 'docid'));
 			if ($lastDocGroup != $currentDocGroup) {
-				$return .= '<tr><td colspan="4">'.html_image('ic/cfolder15.png', '10', '12', array('border' => '0')).util_make_link('/docman/?group_id='.$this->groupId.'&view=listfile&dirid='.$document->getDocGroupID(),$currentDocGroup).'</td></tr>';
+				$return .= '<tr><td>'.html_image('ic/cfolder15.png', '10', '12', array('border' => '0')).util_make_link('/docman/?group_id='.$this->groupId.'&view=listfile&dirid='.$document->getDocGroupID(),$currentDocGroup).'</td><td colspan="3"> </td></tr>';
 				$lastDocGroup = $currentDocGroup;
 				$rowColor = 0;
 			}
 			$return .= '<tr '. $GLOBALS['HTML']->boxGetAltRowStyle($rowColor) .'>'
-				. '<td width="5%"> </td>'
+				. '<td> </td>'
 				. '<td>'.db_result($result, $i, 'docid').'</td>'
 				. '<td><a href="'.util_make_url ('/docman/view.php/'.$this->groupId . '/'.db_result($result, $i, 'docid').'/'.db_result($result, $i, 'filename')).'">'
 				. html_image('ic/msg.png', '10', '12')

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

Summary of changes:
 src/common/search/DocsAllSearchQuery.class.php               |    3 ++-
 src/common/search/DocsSearchQuery.class.php                  |    6 ++++--
 .../include/renderers/DocsAllHtmlSearchRenderer.class.php    |   10 ++++++----
 .../include/renderers/DocsHtmlSearchRenderer.class.php       |    8 +++++---
 4 files changed, 17 insertions(+), 10 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list