From a44ce976f61299f893b415dc27a1864e1a028445 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 26 Mar 2020 11:14:59 -0400 Subject: [PATCH] Bug 24982: (follow-up) Retain checkbox selections after for submit Signed-off-by: Kyle M Hall Signed-off-by: Martin Renvoize --- .../intranet-tmpl/prog/en/modules/tools/viewlog.tt | 10 +++++----- koha-tmpl/intranet-tmpl/prog/js/viewlog.js | 14 ++++++++++---- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt index 1388368a57..5533f5aa8e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt @@ -118,7 +118,7 @@ fieldset.rows label.viewlog {
  • - [% UNLESS modules %] + [% IF modules.size == 0 %] [% ELSE %] @@ -138,7 +138,7 @@ fieldset.rows label.viewlog {
  • - [% UNLESS actions %] + [% IF actions.length == 0 %] [% ELSE %] @@ -168,7 +168,7 @@ fieldset.rows label.viewlog {
  • - [% UNLESS interfaces %] + [% IF interfaces.size == 0 %] [% ELSE %] @@ -176,9 +176,9 @@ fieldset.rows label.viewlog { [% FOREACH interf IN [ 'INTRANET' 'OPAC' 'SIP' 'COMMANDLINE' ] %] [% IF interfaces.grep(interf).size %] - + [% ELSE %] - + [% END %] [% END %]
  • diff --git a/koha-tmpl/intranet-tmpl/prog/js/viewlog.js b/koha-tmpl/intranet-tmpl/prog/js/viewlog.js index d41bb5d471..ccec003ade 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/viewlog.js +++ b/koha-tmpl/intranet-tmpl/prog/js/viewlog.js @@ -11,14 +11,16 @@ function untickAll(section){ } $(document).ready(function(){ - tickAll('modules'); + + if ( $('input[name="modules"]:checked').length == 0 ) { + tickAll('modules'); + } $("#moduleALL").change(function(){ if ( this.checked == true ){ tickAll('modules'); } else { untickAll('modules'); } - }); $("input[name='modules']").change(function(){ if ( $("input[name='modules']:checked").length == $("input[name='modules']").length - 1 ){ @@ -26,7 +28,9 @@ $(document).ready(function(){ } }); - tickAll('actions'); + if ( $('input[name="actions"]:checked').length == 0 ) { + tickAll('actions'); + } $("#actionALL").change(function(){ if ( this.checked == true ){ tickAll('actions'); @@ -41,7 +45,9 @@ $(document).ready(function(){ } }); - tickAll('interfaces'); + if ( $('input[name="interfaces"]:checked').length == 0 ) { + tickAll('interfaces'); + } $("#interfaceALL").change(function(){ if ( this.checked == true ){ tickAll('interfaces'); -- 2.39.5