[icinga-checkins] icinga.org: icinga-core/test/ido: Revert "ugly workaround for sending (un) checked values for sticky_ack and send_notification values on acknowledgement (refs #3329)"

git at icinga.org git at icinga.org
Wed Nov 28 15:58:20 CET 2012


Module: icinga-core
Branch: test/ido
Commit: 27f47ba81248b5229941f141234da109dc26f0c2
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=27f47ba81248b5229941f141234da109dc26f0c2

Author: Ricardo Bartels <ricardo at bitchbrothers.com>
Date:   Fri Nov  9 17:38:41 2012 +0100

Revert "ugly workaround for sending (un)checked values for sticky_ack and send_notification values on acknowledgement (refs #3329)"

This reverts commit eda48c8b21dd044ffd79f15c8c731202053abafa.

refs: #3329

found a way of not messing around with html and hoping every browser behaving the same way.

---

 cgi/cmd.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/cgi/cmd.c b/cgi/cmd.c
index 35ba013..1cf832b 100644
--- a/cgi/cmd.c
+++ b/cgi/cmd.c
@@ -1010,9 +1010,7 @@ void print_form_element(int element, int cmd) {
 		printf("<tr><td class=\"objectDescription descriptionleft\">Sticky Acknowledgement:");
 		print_help_box(help_text);
 		printf("</td><td align=\"left\">");
-		/* http://iamcam.wordpress.com/2008/01/15/unchecked-checkbox-values/ */
-		printf("<INPUT TYPE='hidden' NAME='sticky_ack' value='%d'>", (sticky_ack == TRUE) ? 0 : 1); /* negate value hack, if checkbox is unchecked */
-		printf("<INPUT TYPE='checkbox' NAME='sticky_ack' value='%d' %s></td></tr>\n", (sticky_ack == TRUE) ? 1 : 0, (sticky_ack == TRUE) ? "CHECKED" : "");
+		printf("<INPUT TYPE='checkbox' NAME='sticky_ack' %s></td></tr>\n", (sticky_ack == TRUE) ? "CHECKED" : "");
 		break;
 
 	case PRINT_SEND_NOTFICATION:
@@ -1022,9 +1020,7 @@ void print_form_element(int element, int cmd) {
 		printf("<tr><td class=\"objectDescription descriptionleft\">Send Notification:");
 		print_help_box(help_text);
 		printf("</td><td align=\"left\">");
-		/* http://iamcam.wordpress.com/2008/01/15/unchecked-checkbox-values/ */
-		printf("<INPUT TYPE='hidden' NAME='send_notification' value='%d'>", (send_notification == TRUE) ? 0 : 1); /* negate value hack, if checkbox is unchecked */
-		printf("<INPUT TYPE='checkbox' NAME='send_notification' value='%d' %s></td></tr>\n", (send_notification == TRUE) ? 1 : 0, (send_notification == TRUE) ? "CHECKED" : "");
+		printf("<INPUT TYPE='checkbox' NAME='send_notification' %s></td></tr>\n", (send_notification == TRUE) ? "CHECKED" : "");
 		break;
 
 	case PRINT_PERSISTENT:





More information about the icinga-checkins mailing list