[Fusionforge-commits] r16030 - branches/Branch_5_2/src/common/docman/views

Franck VILLAUME nerville at fusionforge.org
Sat Jul 21 10:00:28 CEST 2012


Author: nerville
Date: 2012-07-21 10:00:26 +0200 (Sat, 21 Jul 2012)
New Revision: 16030

Modified:
   branches/Branch_5_2/src/common/docman/views/search.php
Log:
fix search when search is empty and remove useless var

Modified: branches/Branch_5_2/src/common/docman/views/search.php
===================================================================
--- branches/Branch_5_2/src/common/docman/views/search.php	2012-07-21 07:53:21 UTC (rev 16029)
+++ branches/Branch_5_2/src/common/docman/views/search.php	2012-07-21 08:00:26 UTC (rev 16030)
@@ -78,9 +78,7 @@
 echo '</table>';
 echo '</form>';
 if ($searchString) {
-	$textsearch = trim(getStringFromPost("textsearch"));
-	//$textsearch = prepare_search_text($textsearch);
-	$mots = preg_split("/[\s,]+/",$textsearch);
+	$mots = preg_split("/[\s,]+/",$searchString);
 	$qpa = db_construct_qpa(false, 'SELECT filename, filetype, docid, doc_data.stateid as stateid, doc_states.name as statename, title, description, createdate, updatedate, doc_group, group_id FROM doc_data, doc_states WHERE doc_data.stateid = doc_states.stateid');
 	if (getStringFromPost('search_type') == "one") {
 		if (count($mots) > 0) {
@@ -128,7 +126,7 @@
 		echo '<p class="error">'._('Database query error').'</p>';
 		db_free_result($result);
 	} elseif (db_numrows($result) < 1) {
-		echo '<p class="warning_msg">'._('Your search did not match any documents').'</p>';
+		echo '<p class="warning_msg">'._('Your search did not match any documents.').'</p>';
 		db_free_result($result);
 	} else {
 		$resarr = array();
@@ -166,6 +164,8 @@
 		}
 		echo '</table>';
 	}
+} else {
+	echo '<p class="warning_msg">'._('Your search is empty.').'</p>';
 }
 echo '</div>';
 ?>




More information about the Fusionforge-commits mailing list