Bugzilla – Attachment 107740 Details for
Bug 24786
Allow setting a cash register for a login session and configuring library-default cash registers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24786: Allow selection of cash register at login
Bug-24786-Allow-selection-of-cash-register-at-logi.patch (text/plain), 5.22 KB, created by
Martin Renvoize (ashimema)
on 2020-08-04 10:36:01 UTC
(
hide
)
Description:
Bug 24786: Allow selection of cash register at login
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-08-04 10:36:01 UTC
Size:
5.22 KB
patch
obsolete
>From 252431f34912a8b2b3425858956c1ea6e29083be Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 21 Jul 2020 13:37:16 +0100 >Subject: [PATCH] Bug 24786: Allow selection of cash register at login > >--- > koha-tmpl/intranet-tmpl/prog/css/login.css | 8 ++--- > .../intranet-tmpl/prog/en/modules/auth.tt | 12 +++++++ > .../prog/en/modules/circ/set-library.tt | 33 ++----------------- > .../prog/js/register_selection.js | 27 +++++++++++++++ > 4 files changed, 46 insertions(+), 34 deletions(-) > create mode 100644 koha-tmpl/intranet-tmpl/prog/js/register_selection.js > >diff --git a/koha-tmpl/intranet-tmpl/prog/css/login.css b/koha-tmpl/intranet-tmpl/prog/css/login.css >index 14f271421a..c4304cc439 100644 >--- a/koha-tmpl/intranet-tmpl/prog/css/login.css >+++ b/koha-tmpl/intranet-tmpl/prog/css/login.css >@@ -96,6 +96,10 @@ label { > padding: 3px; > } > >+#login select { >+ width: 98%; >+} >+ > #login ul { > list-style: none; > margin: 0; >@@ -113,10 +117,6 @@ label { > width: 97%; > } > >-#login #branch { >- width : 99%; >-} >- > #login #submit, #login .button { > font-size: 1.4em; > padding : .3em .6em; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt >index acdbeb327e..013ed26ab3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt >@@ -1,7 +1,9 @@ > [% USE raw %] >+[% USE Asset %] > [% USE Koha %] > [% USE Branches %] > [% USE Categories %] >+[% USE Registers %] > [% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › >@@ -83,6 +85,15 @@ > </p> > [% END %] > >+[% IF Koha.Preference('UseCashRegisters') %] >+ <p> >+ <label for="register_id">Cash register:</label> >+ <select name="register_id" id="register_id" class="input" tabindex="4"> >+ [% PROCESS options_for_registers registers => Registers.all() %] >+ </select> >+ </p> >+[% END %] >+ > <!-- <p><label><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="3" />Remember me</label></p> --> > > <p class="submit"><input id="submit" type="submit" value="Login" tabindex="4" /></p> >@@ -121,6 +132,7 @@ > </div> > > [% MACRO jsinclude BLOCK %] >+ [% Asset.js("js/register_selection.js") | $raw %] > <script type="text/javascript"> > $(document).ready( function() { > if ( document.location.hash ) { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/set-library.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/set-library.tt >index dac89b8a50..a0d0e8d84c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/set-library.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/set-library.tt >@@ -1,3 +1,5 @@ >+[% USE raw %] >+[% USE Asset %] > [% USE Branches %] > [% USE Registers %] > [% USE Koha %] >@@ -118,36 +120,7 @@ Updated:<ul> > </div> <!-- /.row --> > > [% MACRO jsinclude BLOCK %] >-<script> >- $(document).ready(function() { >- $("#branch").on("change", function() { >- var selectedBranch = $("#branch").children( >- "option:selected").val(); >- >- $("#register_id").children().each(function() { >- // default to no-register >- if ($(this).is("#noregister")) { >- $(this).prop("selected", true) >- } >- // display branch registers >- else if ($(this).hasClass(selectedBranch)) { >- $(this).prop("disabled", false); >- $(this).show(); >- // default to branch default if there is one >- if ($(this).hasClass("default")) { >- $(this).prop("selected", true) >- } >- } >- // hide non-branch registers >- else >- { >- $(this).hide(); >- $(this).prop("disabled", true); >- } >- }); >- }); >- }); >-</script> >+ [% Asset.js("js/register_selection.js") | $raw %] > [% END %] > > [% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/register_selection.js b/koha-tmpl/intranet-tmpl/prog/js/register_selection.js >new file mode 100644 >index 0000000000..b4d68590c6 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/js/register_selection.js >@@ -0,0 +1,27 @@ >+$(document).ready(function() { >+ $("#branch").on("change", function() { >+ var selectedBranch = $("#branch").children( >+ "option:selected").val(); >+ >+ $("#register_id").children().each(function() { >+ // default to no-register >+ if ($(this).is("#noregister")) { >+ $(this).prop("selected", true) >+ } >+ // display branch registers >+ else if ($(this).hasClass(selectedBranch)) { >+ $(this).prop("disabled", false); >+ $(this).show(); >+ // default to branch default if there is one >+ if ($(this).hasClass("default")) { >+ $(this).prop("selected", true) >+ } >+ } >+ // hide non-branch registers >+ else { >+ $(this).hide(); >+ $(this).prop("disabled", true); >+ } >+ }); >+ }); >+}); >-- >2.20.1
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 24786
:
107145
|
107146
|
107147
|
107148
|
107149
|
107739
|
107740
|
107741
|
107742
|
107743
|
107754
|
107755
|
107756
|
107757
|
107758
|
107759
|
107957
|
107958
|
107959
|
107960
|
107961
|
107962
|
108060
|
108061
|
108062
|
108063
|
108064
|
108065
|
108066
|
108510
|
108511
|
108512
|
108513
|
108514
|
108515
|
108516
|
110162
|
110163
|
110164
|
110165
|
110166
|
110167
|
110168
|
110187
|
110188
|
110189
|
110190
|
110191
|
110192
|
110193
|
111066
|
111067
|
111068
|
111069
|
111070
|
111071
|
111072
|
111074
|
111126
|
111127
|
111128
|
111129
|
111130
|
111131
|
111132
|
111133
|
111220
|
111221
|
111222
|
111223
|
111224
|
111225
|
111226
|
111227
|
111228
|
111229
|
111230
|
111231
|
111232
|
111233
|
111234
|
111235
|
111611
|
111612
|
111613
|
111614
|
111615
|
111616
|
111617
|
111618
|
111619
|
111620
|
111623
|
111725
|
111757
|
111758
|
111759
|
111760
|
111761
|
111762
|
111763
|
111764
|
111765
|
111766
|
111767
|
111768
|
111769
|
111770
|
111776
|
111777
|
111778
|
111779
|
111780
|
111781
|
111782
|
111783
|
111784
|
111785
|
111786
|
111787
|
111788
|
112985
|
112988
|
112989
|
113226
|
113227
|
113241
|
113251
|
113253
|
113256
|
113257
|
113260