Bugzilla – Attachment 55493 Details for
Bug 16274
Make the selfregistration branchcode selection configurable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16274: Limit the patron self registration to some libraries
Bug-16274-Limit-the-patron-self-registration-to-so.patch (text/plain), 3.52 KB, created by
Jonathan Druart
on 2016-09-12 14:50:18 UTC
(
hide
)
Description:
Bug 16274: Limit the patron self registration to some libraries
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-09-12 14:50:18 UTC
Size:
3.52 KB
patch
obsolete
>From 42bb1ae83d982e7d5018ab38aadf39ac97c280a3 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Sat, 23 Apr 2016 16:37:26 +0100 >Subject: [PATCH] Bug 16274: Limit the patron self registration to some > libraries > >Currently a patron can select a home library in the list of all >libraries defined in the system. >However some of these libraries might not accept self registration. >This patch adds a new pref to display only the allowed libraries. > >Test plan: >0/ Apply the patch, do not fill the new pref >1/ Self register a new patron >=> All the libraries defined should be displayed in the "Home library" >dropwdown list >2/ Fill the pref PatronSelfRegistrationLibraryList with some of the >branchcode defined in the system >=> Self register a new patron and confirm that the dropdown list has >been filtered. > >Sponsored-by: BULAC - http://www.bulac.fr/ >Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt | 8 +++++++- > opac/opac-memberentry.pl | 7 +++++++ > 2 files changed, 14 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt >index 66db306..71b45c8 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt >@@ -160,7 +160,13 @@ > Home library:</label> > > <select id="borrower_branchcode" name="borrower_branchcode"> >- [% PROCESS options_for_libraries libraries => Branches.all( selected => borrower.branchcode ) %] >+ [% FOREACH l IN libraries %] >+ [% IF l.branchcode == borrower.branchcode %] >+ <option value="[% l.branchcode | html %]" selected="selected">[% l.branchname %]</option> >+ [% ELSE %] >+ <option value="[% l.branchcode | html %]">[% l.branchname %]</option> >+ [% END %] >+ [% END %] > </select> > </li> > [% END %] >diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl >index 6dcc832..34f9ac8 100755 >--- a/opac/opac-memberentry.pl >+++ b/opac/opac-memberentry.pl >@@ -32,6 +32,7 @@ use Koha::Patron::Modifications; > use C4::Scrubber; > use Email::Valid; > use Koha::DateUtils; >+use Koha::Libraries; > use Koha::Patron::Images; > use Koha::Token; > >@@ -65,10 +66,16 @@ if ( $action eq q{} ) { > > my $mandatory = GetMandatoryFields($action); > >+my @libraries = Koha::Libraries->search; >+if ( my @libraries_to_display = split '\|', C4::Context->preference('PatronSelfRegistrationLibraryList') ) { >+ @libraries = map { my $b = $_; my $branchcode = $_->branchcode; grep( /^$branchcode$/, @libraries_to_display ) ? $b : () } @libraries; >+} >+ > $template->param( > action => $action, > hidden => GetHiddenFields( $mandatory, 'registration' ), > mandatory => $mandatory, >+ libraries => \@libraries, > OPACPatronDetails => C4::Context->preference('OPACPatronDetails'), > ); > >-- >2.8.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 16274
:
50610
|
50611
|
51179
|
51180
|
54382
|
54383
|
55492
| 55493