[Fusionforge-commits] FusionForge branch feature/filter-search-results updated. v6.0.3-476-g258afcf

Roland Mas lolando at libremir.placard.fr.eu.org
Fri Apr 8 13:36:51 CEST 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, feature/filter-search-results has been updated
       via  258afcfe309183cf2e5f6f1552f53c24d734065b (commit)
       via  a8b4ed2cb19c95a3fbebe038b9de8f5fc555b3d9 (commit)
       via  64d7abda3720bc9ffe03a8cfb70ccc9c0bd1f58d (commit)
      from  cf1e38a7b586cd5dd5d72a96ed0baeb1b2325b6e (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=258afcfe309183cf2e5f6f1552f53c24d734065b

commit 258afcfe309183cf2e5f6f1552f53c24d734065b
Author: Roland Mas <lolando at debian.org>
Date:   Fri Apr 8 13:33:36 2016 +0200

    Update DocsAllHtmlSearchRenderer with new search

diff --git a/src/www/search/include/renderers/DocsAllHtmlSearchRenderer.class.php b/src/www/search/include/renderers/DocsAllHtmlSearchRenderer.class.php
index 0564152..0562dfc 100644
--- a/src/www/search/include/renderers/DocsAllHtmlSearchRenderer.class.php
+++ b/src/www/search/include/renderers/DocsAllHtmlSearchRenderer.class.php
@@ -79,8 +79,8 @@ class DocsAllHtmlSearchRenderer extends HtmlSearchRenderer {
 	 */
 	function getRows() {
 		global $HTML;
-		$rowsCount = $this->searchQuery->getRowsCount();
-		$result =& $this->searchQuery->getResult();
+		$result = $this->searchQuery->getData($this->searchQuery->getRowsPerPage(),$this->searchQuery->getOffset());
+		$rowsCount = count($result);
 
 		$return = '';
 
@@ -88,10 +88,11 @@ class DocsAllHtmlSearchRenderer extends HtmlSearchRenderer {
 		$lastDocGroupID = null;
 
 		$rowColor = 0;
-		for($i = 0; $i < $rowsCount; $i++) {
+		$i = 0;
+		foreach ($result as $row) {
 			$cells = array();
-			$document = document_get_object(db_result($result, $i, 'docid'), db_result($result, $i, 'group_id'));
-			$currentDocGroup = db_result($result, $i, 'project_name');
+			$document = document_get_object($row['docid'], $row['group_id']);
+			$currentDocGroup = $row['project_name'];
 			if ($lastGroupID != $document->Group->getID()) {
 				$cells[] = array(html_image('ic/home16b.png', 10, 12, array('border' => 0)).'<b>'.util_make_link('/docman/?group_id='.$document->Group->getID(),$currentDocGroup).'</b>', 'colspan' => 4);
 				$lastGroupID = $document->Group->getID();
@@ -101,7 +102,7 @@ class DocsAllHtmlSearchRenderer extends HtmlSearchRenderer {
 			$cells = array();
 			$cells[][] = ' ';
 			if ($lastDocGroupID != $document->getDocGroupID()) {
-				$cells[][] = html_image('ic/folder.png', 22, 22, array('border' => 0)).util_make_link('/docman/?group_id='.$document->Group->getID().'&view=listfile&dirid='.$document->getDocGroupID(),db_result($result, $i, 'groupname'));
+				$cells[][] = html_image('ic/folder.png', 22, 22, array('border' => 0)).util_make_link('/docman/?group_id='.$document->Group->getID().'&view=listfile&dirid='.$document->getDocGroupID(),$row['groupname']);
 				$lastDocGroupID = $document->getDocGroupID();
 			} else {
 				$cells[][] = '&nbsp';
@@ -109,10 +110,10 @@ class DocsAllHtmlSearchRenderer extends HtmlSearchRenderer {
 			if ($document->isURL()) {
 				$cells[][] = util_make_link($document->getFileName(), html_image($document->getFileTypeImage(), 22, 22), array('title' => _('Visit this link')), true);
 			} else {
-				$cells[][] = util_make_link('/docman/view.php/'.db_result($result, $i, 'group_id') . '/'.db_result($result, $i, 'docid').'/'.db_result($result, $i, 'filename'), html_image($document->getFileTypeImage(), 22, 22), array('title' => _('View this document')));
+				$cells[][] = util_make_link('/docman/view.php/'.$row['group_id'] . '/'.$row['docid'].'/'.$row['filename'], html_image($document->getFileTypeImage(), 22, 22), array('title' => _('View this document')));
 			}
-			$cells[][] = db_result($result, $i, 'title');
-			$cells[][] = db_result($result, $i, 'description');
+			$cells[][] = $row['title'];
+			$cells[][] = $row['description'];
 			$return .= $HTML->multiTableRow(array('class' => $HTML->boxGetAltRowStyle($rowColor, true)), $cells);
 			$rowColor++;
 		}

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

commit a8b4ed2cb19c95a3fbebe038b9de8f5fc555b3d9
Author: Roland Mas <lolando at debian.org>
Date:   Fri Apr 8 13:27:31 2016 +0200

    Update NewsHtmlSearchRenderer with new search

diff --git a/src/www/search/include/renderers/NewsHtmlSearchRenderer.class.php b/src/www/search/include/renderers/NewsHtmlSearchRenderer.class.php
index 0d57547..3fa0d75 100644
--- a/src/www/search/include/renderers/NewsHtmlSearchRenderer.class.php
+++ b/src/www/search/include/renderers/NewsHtmlSearchRenderer.class.php
@@ -57,17 +57,18 @@ class NewsHtmlSearchRenderer extends HtmlGroupSearchRenderer {
 	 * @return string html output
 	 */
 	function getRows() {
-		$rowsCount = $this->searchQuery->getRowsCount();
-		$result =& $this->searchQuery->getResult();
+		$result = $this->searchQuery->getData($this->searchQuery->getRowsPerPage(),$this->searchQuery->getOffset());
+		$rowsCount = count($result);
 
 		$return = '';
-		for($i = 0; $i < $rowsCount; $i++) {
+		$i = 0;
+		foreach ($result as $row) {
 			$return .= '<tr '. $GLOBALS['HTML']->boxGetAltRowStyle($i) .'>'
-				. '<td><a href="'.util_make_url ('/forum/forum.php?forum_id='. db_result($result, $i, 'forum_id')).'">'
+				. '<td><a href="'.util_make_url ('/forum/forum.php?forum_id='. $row['forum_id']).'">'
 				. html_image('ic/msg.png', '10', '12')
-				. ' '.db_result($result, $i, 'summary').'</a></td>
-				<td style="width: 15%">'.db_result($result, $i, 'realname').'</td>
-				<td style="width: 15%">'.relative_date(db_result($result, $i, 'post_date')).'</td></tr>';
+				. ' '.$row['summary'].'</a></td>
+				<td style="width: 15%">'.$row['realname'].'</td>
+				<td style="width: 15%">'.relative_date($row['post_date']).'</td></tr>';
 		}
 		return $return;
 	}

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

commit 64d7abda3720bc9ffe03a8cfb70ccc9c0bd1f58d
Author: Roland Mas <lolando at debian.org>
Date:   Fri Apr 8 13:25:54 2016 +0200

    Update DocsHtmlSearchRenderer with new search

diff --git a/src/www/search/include/renderers/DocsHtmlSearchRenderer.class.php b/src/www/search/include/renderers/DocsHtmlSearchRenderer.class.php
index f460dc4..57e1aee 100644
--- a/src/www/search/include/renderers/DocsHtmlSearchRenderer.class.php
+++ b/src/www/search/include/renderers/DocsHtmlSearchRenderer.class.php
@@ -63,14 +63,11 @@ class DocsHtmlSearchRenderer extends HtmlGroupSearchRenderer {
 	 * @return string html output
 	 */
 	function getRows() {
-		if (!forge_check_perm('docman', $this->groupId, 'read')) {
-			return '';
-		}
-
 		global $HTML;
 		global $LUSER;
-		$rowsCount = $this->searchQuery->getRowsCount();
-		$result =& $this->searchQuery->getResult();
+		$result = $this->searchQuery->getData($this->searchQuery->getRowsPerPage(),$this->searchQuery->getOffset());
+
+		$rowsCount = count($result);
 
 		$return = '';
 
@@ -98,8 +95,9 @@ class DocsHtmlSearchRenderer extends HtmlGroupSearchRenderer {
 			<?php
 			echo html_ac(html_ap() - 1);
 		}
-		for ($i = 0; $i < $rowsCount; $i++) {
-			$document = document_get_object(db_result($result, $i, 'docid'), db_result($result, $i, 'group_id'));
+		$i = 0;
+		foreach ($result as $row) {
+			$document = document_get_object($row['docid'], $row['group_id']);
 			$currentDocGroup = documentgroup_get_object($document->getDocGroupID(), $document->Group->getID());
 			//section changed
 			if ($lastDocGroupID != $currentDocGroup->getID()) {
@@ -129,8 +127,8 @@ class DocsHtmlSearchRenderer extends HtmlGroupSearchRenderer {
 			} else {
 				$cells[][] = util_make_link('/docman/view.php/'.$document->Group->getID().'/'.$document->getID().'/'.urlencode($document->getFileName()), html_image($document->getFileTypeImage(), 22, 22), array('title' => _('View this document')));
 			}
-			$cells[][] = db_result($result, $i, 'title');
-			$cells[][] = db_result($result, $i, 'description');
+			$cells[][] = $row['title'];
+			$cells[][] = $row['description'];
 			if (forge_check_perm('docman', $document->Group->getID(), 'approve')) {
 				if (!$document->getLocked() && !$document->getReserved()) {
 					$cells[][] = util_make_link('/docman/?group_id='.$document->Group->getID().'&view=listfile&dirid='.$document->getDocGroupID().'&filedetailid='.$document->getID(), html_image('docman/edit-file.png', 22, 22, array('alt' => _('Edit this document'))), array('title' => _('Edit this document')));

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

Summary of changes:
 .../renderers/DocsAllHtmlSearchRenderer.class.php     | 19 ++++++++++---------
 .../renderers/DocsHtmlSearchRenderer.class.php        | 18 ++++++++----------
 .../renderers/NewsHtmlSearchRenderer.class.php        | 15 ++++++++-------
 3 files changed, 26 insertions(+), 26 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list