[icinga-checkins] icinga.org: icinga-web/mhein/default: * Set fixed downtime as default in grid templates (fixes #2010)

git at icinga.org git at icinga.org
Wed Nov 16 16:55:37 CET 2011


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

Author: Marius Hein <marius.hein at netways.de>
Date:   Wed Nov 16 16:53:59 2011 +0100

* Set fixed downtime as default in grid templates (fixes #2010)

---

 .../Cronks/data/xml/grid/icinga-host-template.xml  |    3 ++-
 .../xml/grid/icinga-hostgroup-summary-template.xml |    1 +
 .../data/xml/grid/icinga-service-template.xml      |    1 +
 .../grid/icinga-servicegroup-summary-template.xml  |    1 +
 .../xml/grid/icinga-unhandled-host-problems.xml    |    1 +
 .../xml/grid/icinga-unhandled-service-problems.xml |    1 +
 .../Cronks/lib/js/grid/IcingaCommandHandler.js     |    8 ++++----
 7 files changed, 11 insertions(+), 5 deletions(-)

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 e93b4cc..6e0bf6f 100644
--- a/app/modules/Cronks/data/xml/grid/icinga-host-template.xml
+++ b/app/modules/Cronks/data/xml/grid/icinga-host-template.xml
@@ -82,7 +82,8 @@
         	
         	<parameter name="predefined">
         		<parameter name="IcingaApiConstants::COMMAND_AUTHOR">${xmlfn.author}</parameter>
-				<parameter name="IcingaApiConstants::COMMAND_ENDTIME">now+7200</parameter>
+			<parameter name="IcingaApiConstants::COMMAND_ENDTIME">now+7200</parameter>
+	                <parameter name="IcingaApiConstants::COMMAND_FIXED">1</parameter>
         	</parameter>
         	
         	<!-- 
diff --git a/app/modules/Cronks/data/xml/grid/icinga-hostgroup-summary-template.xml b/app/modules/Cronks/data/xml/grid/icinga-hostgroup-summary-template.xml
index 2cdeab5..302b875 100644
--- a/app/modules/Cronks/data/xml/grid/icinga-hostgroup-summary-template.xml
+++ b/app/modules/Cronks/data/xml/grid/icinga-hostgroup-summary-template.xml
@@ -68,6 +68,7 @@
         	
         	<parameter name="predefined">
         		<parameter name="IcingaApiConstants::COMMAND_AUTHOR">${xmlfn.author}</parameter>
+			<parameter name="IcingaApiConstants::COMMAND_FIXED">1</parameter>
         	</parameter>
         	
         	<!-- 
diff --git a/app/modules/Cronks/data/xml/grid/icinga-service-template.xml b/app/modules/Cronks/data/xml/grid/icinga-service-template.xml
index fc74e8b..ddfb5be 100644
--- a/app/modules/Cronks/data/xml/grid/icinga-service-template.xml
+++ b/app/modules/Cronks/data/xml/grid/icinga-service-template.xml
@@ -73,6 +73,7 @@
         	<parameter name="predefined">
         		<parameter name="IcingaApiConstants::COMMAND_AUTHOR">${xmlfn.author}</parameter>
 			<parameter name="IcingaApiConstants::COMMAND_ENDTIME">now+7200</parameter>
+			<parameter name="IcingaApiConstants::COMMAND_FIXED">1</parameter>
         	</parameter>
         	
         	<!-- 
diff --git a/app/modules/Cronks/data/xml/grid/icinga-servicegroup-summary-template.xml b/app/modules/Cronks/data/xml/grid/icinga-servicegroup-summary-template.xml
index 54dff6d..8d836c5 100644
--- a/app/modules/Cronks/data/xml/grid/icinga-servicegroup-summary-template.xml
+++ b/app/modules/Cronks/data/xml/grid/icinga-servicegroup-summary-template.xml
@@ -64,6 +64,7 @@
         	
         	<parameter name="predefined">
         		<parameter name="IcingaApiConstants::COMMAND_AUTHOR">${xmlfn.author}</parameter>
+			<parameter name="IcingaApiConstants::COMMAND_FIXED">1</parameter>
         	</parameter>
         	
         	<!-- 
diff --git a/app/modules/Cronks/data/xml/grid/icinga-unhandled-host-problems.xml b/app/modules/Cronks/data/xml/grid/icinga-unhandled-host-problems.xml
index a0ef35d..2e92c5d 100644
--- a/app/modules/Cronks/data/xml/grid/icinga-unhandled-host-problems.xml
+++ b/app/modules/Cronks/data/xml/grid/icinga-unhandled-host-problems.xml
@@ -72,6 +72,7 @@
         	<parameter name="predefined">
         		<parameter name="IcingaApiConstants::COMMAND_AUTHOR">${xmlfn.author}</parameter>
 				<parameter name="IcingaApiConstants::COMMAND_ENDTIME">now+7200</parameter>
+                <parameter name="IcingaApiConstants::COMMAND_FIXED">1</parameter>
         	</parameter>
         	
         	<!-- 
diff --git a/app/modules/Cronks/data/xml/grid/icinga-unhandled-service-problems.xml b/app/modules/Cronks/data/xml/grid/icinga-unhandled-service-problems.xml
index 7a3463f..eac4b09 100644
--- a/app/modules/Cronks/data/xml/grid/icinga-unhandled-service-problems.xml
+++ b/app/modules/Cronks/data/xml/grid/icinga-unhandled-service-problems.xml
@@ -73,6 +73,7 @@
         	<parameter name="predefined">
         		<parameter name="IcingaApiConstants::COMMAND_AUTHOR">${xmlfn.author}</parameter>
 			<parameter name="IcingaApiConstants::COMMAND_ENDTIME">now+7200</parameter>
+			<parameter name="IcingaApiConstants::COMMAND_FIXED">1</parameter>
         	</parameter>
         	
         	<!-- 
diff --git a/app/modules/Cronks/lib/js/grid/IcingaCommandHandler.js b/app/modules/Cronks/lib/js/grid/IcingaCommandHandler.js
index ebb72c9..585fb42 100755
--- a/app/modules/Cronks/lib/js/grid/IcingaCommandHandler.js
+++ b/app/modules/Cronks/lib/js/grid/IcingaCommandHandler.js
@@ -189,8 +189,8 @@ IcingaCommandHandler.prototype = {
                             var m = form.getForm().findField(affectedForms[i])
 
                             if (m) {
-                                checkedBox.initialConfig.boxLabel == _('Yes') ? m.setReadOnly(true) : m.setReadOnly(false);
-                                checkedBox.initialConfig.boxLabel == _('Yes') ? m.container.hide() : m.container.show();
+                                m.setReadOnly((checkedBox.initialConfig.boxLabel == _('Yes')) ? true : false);
+                                m.container.setVisible((checkedBox.initialConfig.boxLabel == _('Yes')) ? false : true);
                             }
                         }
                     }
@@ -483,8 +483,8 @@ IcingaCommandHandler.prototype = {
                 oWin.add(oForm);
 
                 oWin.render(Ext.getBody());
-
-                if (this.command_options.predefined.fixed === '1') {
+                
+                if (this.command_options.predefined.fixed === 1) {
                     var fdur = oForm.getForm().findField('duration');
                     fdur.setReadOnly(true);
                     fdur.container.hide();





More information about the icinga-checkins mailing list