Bugzilla – Attachment 110193 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: Default to 'branch default' on auth.
Bug-24786-Default-to-branch-default-on-auth.patch (text/plain), 2.78 KB, created by
Martin Renvoize (ashimema)
on 2020-09-16 12:49:08 UTC
(
hide
)
Description:
Bug 24786: Default to 'branch default' on auth.
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-09-16 12:49:08 UTC
Size:
2.78 KB
patch
obsolete
>From 66e93c317f4c39eb900a5ecf22b28047254353da Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 11 Aug 2020 14:24:19 +0100 >Subject: [PATCH] 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. >--- > C4/Auth.pm | 13 +++++++++---- > koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt | 5 ++++- > 2 files changed, 13 insertions(+), 5 deletions(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index 8dcee3fc0e..7de5ffce3e 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -1131,10 +1131,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') ) { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt >index 5d6e208208..6db00bac43 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt >+++ b/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 %] >-- >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