@@ -, +, @@ --- koha-tmpl/intranet-tmpl/prog/css/login.css | 4 +++ .../intranet-tmpl/prog/en/modules/auth.tt | 12 +++++++ .../prog/en/modules/circ/set-library.tt | 31 +------------------ .../prog/js/register_selection.js | 27 ++++++++++++++++ 4 files changed, 44 insertions(+), 30 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/js/register_selection.js --- a/koha-tmpl/intranet-tmpl/prog/css/login.css +++ a/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; --- a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt +++ a/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' %] Koha › @@ -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 ) { --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/set-library.tt +++ a/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' %] --- a/koha-tmpl/intranet-tmpl/prog/js/register_selection.js +++ a/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); + } + }); + }); +}); --