@@ -, +, @@ --- .../intranet-tmpl/prog/en/modules/tools/viewlog.tt | 78 +++++++++++----------- koha-tmpl/intranet-tmpl/prog/js/viewlog.js | 58 ++++++++++++++++ 2 files changed, 98 insertions(+), 38 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/js/viewlog.js --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt @@ -15,6 +15,13 @@ [% END %] [% INCLUDE 'doc-head-close.inc' %] + @@ -101,41 +108,37 @@ [% UNLESS src == "circ" %]
  • - + [% ELSE %] + + [% END %] + [% FOREACH modx IN [ 'CATALOGUING' 'AUTHORITIES' 'MEMBERS' 'ACQUISITIONS' 'SERIAL' 'HOLDS' 'ILL' 'CIRCULATION' 'LETTER' 'FINES' 'SYSTEMPREFERENCE' 'CRONJOBS', 'REPORTS' ] %] + [% IF modules.grep(modx).size %] + [% ELSE %] - - [% END %] - [% FOREACH modx IN [ 'CATALOGUING' 'AUTHORITIES' 'MEMBERS' 'ACQUISITIONS' 'SERIAL' 'HOLDS' 'ILL' 'CIRCULATION' 'LETTER' 'FINES' 'SYSTEMPREFERENCE' 'CRONJOBS', 'REPORTS' ] %] - [% IF modules.grep(modx).size %] - - [% ELSE %] - - [% END %] + [% END %] - + [% END %]
  • [% ELSE %] [% END %]
  • - + [% ELSE %] + + [% END %] - [% FOREACH actx IN [ 'ADD' 'DELETE' 'MODIFY' 'ISSUE' 'RETURN' 'RENEW' 'CREATE' 'CANCEL' 'SUSPEND' 'RESUME' 'ADDCIRCMESSAGE' 'DELCIRCMESSAGE' 'STATUS_CHANGE' 'CHANGE PASS' 'Run' ] %] - [% IF actions.grep(actx).size %] - - [% ELSE %] - - [% END %] + [% FOREACH actx IN [ 'ADD' 'DELETE' 'MODIFY' 'ISSUE' 'RETURN' 'RENEW' 'CREATE' 'CANCEL' 'SUSPEND' 'RESUME' 'ADDCIRCMESSAGE' 'DELCIRCMESSAGE' 'STATUS_CHANGE' 'CHANGE PASS' 'Run' ] %] + [% IF actions.grep(actx).size %] + + [% ELSE %] + [% END %] - + [% END %]
  • [% IF src == 'circ' %] @@ -152,21 +155,19 @@
  • - + [% ELSE %] + + [% END %] - [% FOREACH interf IN [ 'INTRANET' 'OPAC' 'SIP' 'COMMANDLINE' ] %] - [% IF interfaces.grep(interf).size %] - - [% ELSE %] - - [% END %] + [% FOREACH interf IN [ 'INTRANET' 'OPAC' 'SIP' 'COMMANDLINE' ] %] + [% IF interfaces.grep(interf).size %] + + [% ELSE %] + [% END %] - + [% END %]
  • @@ -313,6 +314,7 @@ [% INCLUDE 'str/members-menu.inc' %] [% Asset.js("js/members-menu.js") | $raw %] [% END %] + [% Asset.js("js/viewlog.js") | $raw %] [% END %] [% INCLUDE 'intranet-bottom.inc' %] --- a/koha-tmpl/intranet-tmpl/prog/js/viewlog.js +++ a/koha-tmpl/intranet-tmpl/prog/js/viewlog.js @@ -0,0 +1,58 @@ +function tickAll(section){ + $("input[name='" + section + "']").prop("checked", true); + $("#" + section.slice(0,-1) + "ALL").prop("checked", true); + $("input[name='" + section + "']").prop("disabled", true); + $("#" + section.slice(0,-1) + "ALL").prop("disabled", false); +} + +function untickAll(section){ + $("input[name='" + section + "']").prop("checked", false); + $("input[name='" + section + "']").prop("disabled", false); +} + +$(document).ready(function(){ + 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 ){ + tickAll('modules'); + } + }); + + tickAll('actions'); + $("#actionALL").change(function(){ + if ( this.checked == true ){ + tickAll('actions'); + } else { + untickAll('actions'); + } + + }); + $("input[name='actions']").change(function(){ + if ( $("input[name='actions']:checked").length == $("input[name='actions']").length - 1 ){ + tickAll('actions'); + } + }); + + tickAll('interfaces'); + $("#interfaceALL").change(function(){ + if ( this.checked == true ){ + tickAll('interfaces'); + } else { + untickAll('interfaces'); + } + + }); + $("input[name='interfaces']").change(function(){ + if ( $("input[name='interfaces']:checked").length == $("input[name='interfaces']").length - 1 ){ + tickAll('interfaces'); + } + }); +}); --