From ae03e57004e1be3870b6826ee4268aeb4f504ed9 Mon Sep 17 00:00:00 2001 From: "V. Radev" Date: Mon, 2 Jul 2018 13:03:31 +0300 Subject: [PATCH] fix(resources): add default value to form checkboxes (#6421) --- .../accessLists/resourcesACL/formResourcesAccess.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/www/include/options/accessLists/resourcesACL/formResourcesAccess.php b/www/include/options/accessLists/resourcesACL/formResourcesAccess.php index b4befe4bf8b..33d39ae01d4 100644 --- a/www/include/options/accessLists/resourcesACL/formResourcesAccess.php +++ b/www/include/options/accessLists/resourcesACL/formResourcesAccess.php @@ -483,6 +483,11 @@ $tpl = new Smarty(); $tpl = initSmartyTpl($path, $tpl); +$formDefaults = $acl; +$formDefaults['all_hosts[all_hosts]'] = $formDefaults['all_hosts']; +$formDefaults['all_hostgroups[all_hostgroups]'] = $formDefaults['all_hostgroups']; +$formDefaults['all_servicegroups[all_servicegroups]'] = $formDefaults['all_servicegroups']; + if ($o == "w") { /* * Just watch a LCA information @@ -491,7 +496,7 @@ "onClick" => "javascript:window.location.href='?p=" . $p . "&o=c&acl_id=" . $acl_id . "'", "class" => "btc bt_success" )); - $form->setDefaults($acl); + $form->setDefaults($formDefaults); $form->freeze(); } elseif ($o == "c") { /* @@ -499,7 +504,7 @@ */ $subC = $form->addElement('submit', 'submitC', _("Save"), array("class" => "btc bt_success")); $res = $form->addElement('reset', 'reset', _("Delete"), array("class" => "btc bt_danger")); - $form->setDefaults($acl); + $form->setDefaults($formDefaults); } elseif ($o == "a") { /* * Add a LCA information