Browse Source

Bug 24786: Default to 'branch default' on auth.

If no branch is selected (i.e. 'My library') then we should default to
'branch default' if one is defined for the users library 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 12 months ago
committed by Jonathan Druart
parent
commit
8ece86e769
  1. 13
      C4/Auth.pm
  2. 5
      koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt

13
C4/Auth.pm

@ -1141,10 +1141,15 @@ sub checkauth {
my $desk = Koha::Desks->find($desk_id);
$desk_name = $desk ? $desk->desk_name : '';
}
if ( $query->param('register_id') ) {
$register_id = $query->param('register_id');
my $register = Koha::Cash::Registers->find($register_id);
$register_name = $register ? $register->name : '';
if ( C4::Context->preference('UseCashRegisters') ) {
my $register =
$query->param('register_id')
? Koha::Cash::Registers->find($query->param('register_id'))
: Koha::Cash::Registers->search(
{ branch => $branchcode, branch_default => 1 },
{ rows => 1 } )->single;
$register_id = $register->id if ($register);
$register_name = $register->name if ($register);
}
my $branches = { map { $_->branchcode => $_->unblessed } Koha::Libraries->search };
if ( $type ne 'opac' and C4::Context->boolean_preference('AutoLocation') ) {

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

@ -101,7 +101,10 @@
<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() %]
<option id="noregister" value="" selected="selected">Branch default</option>
[% FOREACH r IN Registers.all() %]
<option class="[% r.branch | html %] [% IF r.branch_default %]default[% END %]" value="[% r.id | html %]" disabled hidden>[% r.name | html %]</option>
[% END %]
</select>
</p>
[% END %]

Loading…
Cancel
Save