Bugzilla – Attachment 101782 Details for
Bug 24982
Update the log viewer to use checkboxes instead of select lists
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24982: Use checkboxes in Log Viewer
Bug-24982-Use-checkboxes-in-Log-Viewer.patch (text/plain), 11.96 KB, created by
Aleisha Amohia
on 2020-03-26 01:46:23 UTC
(
hide
)
Description:
Bug 24982: Use checkboxes in Log Viewer
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2020-03-26 01:46:23 UTC
Size:
11.96 KB
patch
obsolete
>From e2ad3be55722303fb15f48369ab92624064aa3d7 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Tue, 24 Mar 2020 16:00:41 +0000 >Subject: [PATCH] Bug 24982: Use checkboxes in Log Viewer > >So we can see all options at once, and more easily select more than one >option. > >Test plan: >1) Go to Tools -> Log viewer >2) Notice the new checkboxes under Modules, Actions and Interface. 'All' >should be selected by default for all three options >3) Confirm you can deselect 'All' and the other options are enabled. >Confirm selection all of the other options automatically selects 'All' >and disables the options again. >4) Confirm the results still work as expected when clicking 'Submit' >button > >Sponsored-by: Catalyst IT >--- > .../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 > >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 6e2632c6e3..e496ff7724 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt >@@ -15,6 +15,13 @@ > [% END %] > </title> > [% INCLUDE 'doc-head-close.inc' %] >+<style> >+fieldset.rows label.viewlog { >+ float: none; >+ padding-left: 15px; >+ font-weight: normal; >+} >+</style> > </head> > > <body id="tools_viewlog" class="tools"> >@@ -101,41 +108,37 @@ > [% UNLESS src == "circ" %] > <li> > <label for="modules">Modules:</label> >- <select name="modules" id="modules" multiple="multiple"> >- [% UNLESS modules %] >- <option value="" selected="selected">All</option> >+ [% UNLESS modules %] >+ <label for="moduleALL" class="viewlog">All <input type="checkbox" id="moduleALL" name="modules" value="" checked="checked"></label> >+ [% ELSE %] >+ <label for="moduleALL" class="viewlog">All <input type="checkbox" id="moduleALL" name="modules" value=""></label> >+ [% END %] >+ [% FOREACH modx IN [ 'CATALOGUING' 'AUTHORITIES' 'MEMBERS' 'ACQUISITIONS' 'SERIAL' 'HOLDS' 'ILL' 'CIRCULATION' 'LETTER' 'FINES' 'SYSTEMPREFERENCE' 'CRONJOBS', 'REPORTS' ] %] >+ [% IF modules.grep(modx).size %] >+ <label for="module[% modx | html %]" class="viewlog">[% PROCESS translate_log_module module=modx %] <input type="checkbox" id="module[% modx | html %]" name="modules" value="[% modx | html %]" checked="checked"></label> > [% ELSE %] >- <option value="">All</option> >- [% END %] >- [% FOREACH modx IN [ 'CATALOGUING' 'AUTHORITIES' 'MEMBERS' 'ACQUISITIONS' 'SERIAL' 'HOLDS' 'ILL' 'CIRCULATION' 'LETTER' 'FINES' 'SYSTEMPREFERENCE' 'CRONJOBS', 'REPORTS' ] %] >- [% IF modules.grep(modx).size %] >- <option value="[% modx | html %]" selected="selected">[% PROCESS translate_log_module module=modx %]</option> >- [% ELSE %] >- <option value="[% modx | html %]">[% PROCESS translate_log_module module=modx %]</option> >- [% END %] >+ <label for="module[% modx | html %]" class="viewlog">[% PROCESS translate_log_module module=modx %] <input type="checkbox" id="module[% modx | html %]" name="modules" value="[% modx | html %]"></label> > [% END %] >- </select> >+ [% END %] > </li> > [% ELSE %] > <input type="hidden" name="modules" value="MEMBERS" /> > [% END %] > <li> > <label for="actions">Actions:</label> >- <select name="actions" id="actions" multiple="multiple"> >- [% UNLESS actions %] >- <option value="" selected="selected">All</option> >- [% ELSE %] >- <option value="">All</option> >- [% END %] >+ [% UNLESS actions %] >+ <label for="actionALL" class="viewlog">All <input type="checkbox" id="actionALL" name="actions" value="" checked="checked"></label> >+ [% ELSE %] >+ <label for="actionALL" class="viewlog">All <input type="checkbox" id="actionALL" name="actions" value=""></label> >+ [% 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 %] >- <option value="[% actx | html %]" selected="selected">[% PROCESS translate_log_action action=actx %]</option> >- [% ELSE %] >- <option value="[% actx | html %]">[% PROCESS translate_log_action action=actx %]</option> >- [% 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 %] >+ <label for="action[% actx | html %]" class="viewlog">[% PROCESS translate_log_action action=actx %] <input type="checkbox" id="action[% actx | html %]" name="actions" value="[% actx | html %]" checked="checked"></label> >+ [% ELSE %] >+ <label for="action[% actx | html %]" class="viewlog">[% PROCESS translate_log_action action=actx %] <input type="checkbox" id="action[% actx | html %]" name="actions" value="[% actx | html %]"></label> > [% END %] >- </select> >+ [% END %] > </li> > <li> > [% IF src == 'circ' %] >@@ -152,21 +155,19 @@ > </li> > <li> > <label for="interfaces">Interface:</label> >- <select name="interfaces" id="interfaces" multiple="multiple"> >- [% UNLESS interfaces %] >- <option value="" selected="selected">All</option> >- [% ELSE %] >- <option value="">All</option> >- [% END %] >+ [% UNLESS interfaces %] >+ <label for="interfaceALL" class="viewlog">All <input type="checkbox" id="interfaceALL" name="interfaces" value="" checked="checked"></label> >+ [% ELSE %] >+ <label for="interfaceALL" class="viewlog">All <input type="checkbox" id="interfaceALL" name="interfaces" value=""></label> >+ [% END %] > >- [% FOREACH interf IN [ 'INTRANET' 'OPAC' 'SIP' 'COMMANDLINE' ] %] >- [% IF interfaces.grep(interf).size %] >- <option value="[% interf | html %]" selected="selected">[% PROCESS translate_log_interface log_interface=interf %]</option> >- [% ELSE %] >- <option value="[% interf | html %]">[% PROCESS translate_log_interface log_interface=interf %]</option> >- [% END %] >+ [% FOREACH interf IN [ 'INTRANET' 'OPAC' 'SIP' 'COMMANDLINE' ] %] >+ [% IF interfaces.grep(interf).size %] >+ <label for="interface[% interf | html %]" class="viewlog">[% PROCESS translate_log_interface log_interface=interf %] <input type="checkbox" id="interface[% interf | html %]" name="interfaces" value="" checked="checked"></label> >+ [% ELSE %] >+ <label for="interface[% interf | html %]" class="viewlog">[% PROCESS translate_log_interface log_interface=interf %] <input type="checkbox" id="interface[% interf | html %]" name="interfaces" value=""></label> > [% END %] >- </select> >+ [% END %] > </li> > <li> > <label for="from"> Display from: </label> <input type="text" size="10" id="from" name="from" value="[% datefrom | html %]" class="datepickerfrom" /> >@@ -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' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/viewlog.js b/koha-tmpl/intranet-tmpl/prog/js/viewlog.js >new file mode 100644 >index 0000000000..d41bb5d471 >--- /dev/null >+++ b/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'); >+ } >+ }); >+}); >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24982
:
101781
|
101782
|
101799
|
101824
|
101845
|
101860
|
101861
|
101862
|
101869
|
101870
|
101871
|
101872