[icinga-checkins] icinga.org: icinga-web/jmosshammer/default: * Config search char trigger ( fixes #846)

git at icinga.org git at icinga.org
Tue Nov 9 11:32:25 CET 2010


Module: icinga-web
Branch: jmosshammer/default
Commit: b45042ec55cb823ee055405377e1752956d77073
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=b45042ec55cb823ee055405377e1752956d77073

Author: Marius Hein <marius.hein at netways.de>
Date:   Mon Oct  4 15:31:15 2010 +0200

* Config search char trigger (fixes #846)
* Typo in commands (fixes #847)

---

 app/modules/Cronks/config/module.xml               |   12 ++++++++++++
 .../Cronks/data/xml/grid/icinga-host-template.xml  |    2 +-
 .../System/ObjectSearchResultModel.class.php       |    8 +-------
 .../templates/System/ObjectSearchSuccess.php       |    2 +-
 4 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/app/modules/Cronks/config/module.xml b/app/modules/Cronks/config/module.xml
index 21f1b87..c8740f2 100755
--- a/app/modules/Cronks/config/module.xml
+++ b/app/modules/Cronks/config/module.xml
@@ -64,10 +64,22 @@
 				-->
 				<setting name="portal.loadmasktimeout">2300</setting>
 
+				<!--
+					* Grid settings
+				-->
 				<setting name="grid.pagerMaxItems">30</setting>
 
 				<setting name="grid.refreshTime">300</setting>
 				
+				<!--
+					* Search box
+				-->
+				<setting name="search.numberMinimumLetters">2</setting>
+				<setting name="search.maximumResults">200</setting>
+				
+				<!-- 
+					* Include cubconfig
+				-->
 				<setting name="categories">
 					<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="cronks.xml" xpointer="xpointer(//settings/setting[@name='categories']/node())" />
 					<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="cronks.site.xml" xpointer="xpointer(//settings/setting[@name='categories']/node())">
diff --git a/app/modules/Cronks/data/xml/grid/icinga-host-template.xml b/app/modules/Cronks/data/xml/grid/icinga-host-template.xml
index dc1c0e3..811f65c 100644
--- a/app/modules/Cronks/data/xml/grid/icinga-host-template.xml
+++ b/app/modules/Cronks/data/xml/grid/icinga-host-template.xml
@@ -87,7 +87,7 @@
         			<parameter name="icon_class">icinga-icon-downtime</parameter>
         		</parameter>
         		<parameter name="SCHEDULE_HOST_SVC_DOWNTIME">
-        			<parameter name="title">Schedule a downtime for this host and it's services</parameter>
+        			<parameter name="title">Schedule a downtime for this host and its services</parameter>
         			<parameter name="icon_class">icinga-icon-downtime</parameter>
         		</parameter>
 				<parameter name="ADD_HOST_COMMENT">
diff --git a/app/modules/Cronks/models/System/ObjectSearchResultModel.class.php b/app/modules/Cronks/models/System/ObjectSearchResultModel.class.php
index 7418475..a4d07c0 100755
--- a/app/modules/Cronks/models/System/ObjectSearchResultModel.class.php
+++ b/app/modules/Cronks/models/System/ObjectSearchResultModel.class.php
@@ -3,12 +3,6 @@
 class Cronks_System_ObjectSearchResultModel extends CronksBaseModel {
 	
 	/**
-	 * Limit search result to x rows
-	 * @var integer
-	 */
-	const RESULT_LIMIT = 200;
-	
-	/**
 	 * 
 	 * @var IcingaApiConnectionIdo
 	 */
@@ -146,7 +140,7 @@ class Cronks_System_ObjectSearchResultModel extends CronksBaseModel {
 			->setResultColumns(array_values($md['fields']))
 			->setSearchFilter($md['search'], $this->query, IcingaApi::MATCH_LIKE)
 			->setResultType(IcingaApi::RESULT_ARRAY)
-			->setSearchLimit(0, self::RESULT_LIMIT);
+			->setSearchLimit(0, AgaviConfig::get('modules.cronks.search.maximumResults', 200));
 			
 			// Limiting results for security
 			IcingaPrincipalTargetTool::applyApiSecurityPrincipals($search);
diff --git a/app/modules/Cronks/templates/System/ObjectSearchSuccess.php b/app/modules/Cronks/templates/System/ObjectSearchSuccess.php
index 59964b8..d1c6b36 100755
--- a/app/modules/Cronks/templates/System/ObjectSearchSuccess.php
+++ b/app/modules/Cronks/templates/System/ObjectSearchSuccess.php
@@ -7,7 +7,7 @@ Cronk.util.initEnvironment("<?php echo $parentid = $rd->getParameter('parentid')
 		 * Start search if minimum x chars entered
 		 * @type Integer
 		 */	
-		var minCharacters = 4;
+		var minCharacters = <?php echo AgaviConfig::get('modules.cronks.search.numberMinimumLetters', 2); ?>;
 		
 		var val;
 		var ctWindow;





More information about the icinga-checkins mailing list