Browse Source

Bug 24786: Allow selection of cash register at login

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
20.11.x
Martin Renvoize 1 year ago
committed by Jonathan Druart
parent
commit
30b23c5f1d
  1. 4
      koha-tmpl/intranet-tmpl/prog/css/login.css
  2. 12
      koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt
  3. 31
      koha-tmpl/intranet-tmpl/prog/en/modules/circ/set-library.tt
  4. 27
      koha-tmpl/intranet-tmpl/prog/js/register_selection.js

4
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;

12
koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt

@ -4,6 +4,7 @@
[% USE Branches %]
[% USE Desks %]
[% USE Categories %]
[% USE Registers %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo;
@ -95,6 +96,16 @@
</select>
</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 %]
</fieldset>
[% END %]
@ -137,6 +148,7 @@
[% MACRO jsinclude BLOCK %]
[% Asset.js("js/desk_selection.js") | $raw %]
[% Asset.js("js/register_selection.js") | $raw %]
<script type="text/javascript">
$(document).ready( function() {
if ( document.location.hash ) {

31
koha-tmpl/intranet-tmpl/prog/en/modules/circ/set-library.tt

@ -143,36 +143,7 @@ Updated:<ul>
[% MACRO jsinclude BLOCK %]
[% Asset.js("js/desk_selection.js") | $raw %]
<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' %]

27
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);
}
});
});
});
Loading…
Cancel
Save