Bugzilla – Attachment 85881 Details for
Bug 10300
Allow transferring of items to be have separate IndependentBranches syspref
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10300: (follow-up) add controls on transfers page
Bug-10300-follow-up-add-controls-on-transfers-page.patch (text/plain), 4.25 KB, created by
Fridolin Somers
on 2019-02-28 15:36:16 UTC
(
hide
)
Description:
Bug 10300: (follow-up) add controls on transfers page
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2019-02-28 15:36:16 UTC
Size:
4.25 KB
patch
obsolete
>From 227b5061228364c50edd88fd467f6c3e89b715fe Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Thu, 28 Feb 2019 16:23:22 +0100 >Subject: [PATCH] Bug 10300: (follow-up) add controls on transfers page > >This patch moves the check of IndependentBranchesTransfers pref to templates and adds permission test inside branchtransfers.pl. >It also corrects the libraries combobox in branchtransfers.tt, this list can contain all libraries, it is the access to the page that may be protected. > >Additions to test plan : >1) >1.1) Enable CircSidebar >1.2) In circulation home page check the effect of IndependentBranchesTransfers on "Transfer" link >1.3) Go to return page and check then effect of IndependentBranchesTransfers on "Transfer" link > >2) >2.1) In circ/branchtransfers.pl, with and without IndependentBranches you see all libraries are in combobox > >3) >3.1) Set IndependentBranchesTransfers to no and go to circ/branchtransfers.pl >3.2) You are redirected to page 403 unless you are superlibarian >--- > circ/branchtransfers.pl | 6 ++++++ > koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc | 2 +- > .../intranet-tmpl/prog/en/modules/circ/branchtransfers.tt | 2 +- > .../intranet-tmpl/prog/en/modules/circ/circulation-home.tt | 2 +- > 4 files changed, 9 insertions(+), 3 deletions(-) > >diff --git a/circ/branchtransfers.pl b/circ/branchtransfers.pl >index e2280a229b..d5b8e9e726 100755 >--- a/circ/branchtransfers.pl >+++ b/circ/branchtransfers.pl >@@ -64,6 +64,12 @@ my ($template, $user, $cookie, $flags ) = get_template_and_user( > } > ); > >+# Check transfers is allowed from system preference >+if ( C4::Context->preference("IndependentBranchesTransfers") && !C4::Context->IsSuperLibrarian() ) { >+ print $query->redirect("/cgi-bin/koha/errors/403.pl"); >+ exit; >+} >+ > my $messages; > my $found; > my $reserved; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc >index bba7beac9b..708ff33e04 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc >@@ -11,7 +11,7 @@ > <li><a href="/cgi-bin/koha/circ/circulation.pl">Check out</a></li> > <li><a href="/cgi-bin/koha/circ/returns.pl">Check in</a></li> > <li><a href="/cgi-bin/koha/circ/renew.pl">Renew</a></li> >- [% IF Branches.InIndependentBranchesMode %] >+ [% IF !Koha.Preference('IndependentBranchesTransfers') || CAN_user_superlibrarian %] > <li><a href="/cgi-bin/koha/circ/branchtransfers.pl">Transfer</a></li> > [% END %] > [% IF ( AutoLocation ) %][% ELSE %][% IF ( IndependentBranches ) %][% ELSE %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchtransfers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchtransfers.tt >index 5dcd93b114..10a2cf5487 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchtransfers.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchtransfers.tt >@@ -152,7 +152,7 @@ > <li> > <label for="tobranchcd">Destination library: </label> > <select name="tobranchcd" id="tobranchcd"> >- [% PROCESS options_for_libraries libraries => Branches.all( selected => tobranchcd ) %] >+ [% PROCESS options_for_libraries libraries => Branches.all( selected => tobranchcd, unfiltered => 1) %] > </select> > </li> > <li> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt >index f59fcaa6fa..b1bac4ae2b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt >@@ -88,7 +88,7 @@ > <h3>Transfers</h3> > > <ul class="buttons-list"> >- [% IF Branches.InIndependentBranchesMode %] >+ [% IF !Koha.Preference('IndependentBranchesTransfers') || CAN_user_superlibrarian %] > <li> > <a class="circ-button" href="/cgi-bin/koha/circ/branchtransfers.pl"><i class="fa fa-exchange"></i> Transfer</a> > </li> >-- >2.17.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 10300
:
18272
|
54880
|
54939
|
85880
|
85881
|
86521
|
86522
|
88661
|
88662
|
88663