Bugzilla – Attachment 75690 Details for
Bug 20793
Don't show holds link in result list when staff user doesn't have place_holds permission
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20793: Don't show a holds link in staff for users without permission
Bug-20793-Dont-show-a-holds-link-in-staff-for-user.patch (text/plain), 4.94 KB, created by
Jonathan Druart
on 2018-05-30 20:24:16 UTC
(
hide
)
Description:
Bug 20793: Don't show a holds link in staff for users without permission
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-05-30 20:24:16 UTC
Size:
4.94 KB
patch
obsolete
>From 516dedb26898a733ae348b7d4c65a6cc7f88c3f6 Mon Sep 17 00:00:00 2001 >From: Katrin Fischer <katrin.fischer.83@web.de> >Date: Sun, 20 May 2018 02:42:28 +0200 >Subject: [PATCH] Bug 20793: Don't show a holds link in staff for users without > permission > >On the results list in staff the 'Holds (x)' link always shows >independent of the permissions of the staff user. > >This patch tightens the permission checks on the result page >to explicitly check for the place_holds permission. > >To test: >- Create a staff user with place_holds permission >- Check the result list, you should see 2 links to the > holds page: > - 'Place holds' on top of the results list > - 'Holds (x)' at the bottom of each entry in the results > list > - Verify both links work >- Create a staff user without place_holds_permission > - Without the patch you'll see the second link, > but it will lead to a permission error > - With the patch you'll still see the 'Holds (x)', but > it will no longer be a link. >- Go to the detail page of a record with an existing hold. > - Repeat test with both staff users. > - One time the Hold information in the bibliographic information > should show as a link, the other time as a simple text. > >Displaying the information about existing holds still make sense >as this is the current beheviour. > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt | 6 +++++- > koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt | 10 +++++++--- > 2 files changed, 12 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >index ec6695c2ce..b0af452946 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -112,7 +112,11 @@ > <span class="results_summary"> > <span class="label">Holds:</span> > <span class="number_box"> >- <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblionumber %]">[% holdcount %]</a> >+ [% IF CAN_user_reserveforothers_place_holds %] >+ <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblionumber %]">[% holdcount %]</a> >+ [% ELSE %] >+ [% holdcount %] >+ [% END %] > </span> > </span> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >index bb294cd92e..c2fb64c220 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >@@ -119,7 +119,7 @@ > [% END %] > > >- [% IF ( CAN_user_reserveforothers && DisplayMultiPlaceHold ) %] >+ [% IF ( CAN_user_reserveforothers_place_holds && DisplayMultiPlaceHold ) %] > [% IF ( holdfor ) %] > <div id="placeholdc" class="btn-group"> > <button class="btn btn-default btn-xs placehold"><i class="fa fa-sticky-note-o"></i> Place hold</button> >@@ -441,8 +441,12 @@ > [% IF ( SEARCH_RESULT.norequests ) %] > <span class="noholdstext">No holds allowed</span> > [% ELSE %] >- <a id="reserve_[% SEARCH_RESULT.biblionumber %]" href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">Holds ([% Biblio.HoldsCount( SEARCH_RESULT.biblionumber ) %])</a> >- [% IF ( holdfor ) %] <span class="holdforlink">| <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]&findborrower=[% holdfor_cardnumber %]">Place hold for [% holdfor_firstname %] [% holdfor_surname %] ([% holdfor_cardnumber %])</a></span>[% END %] >+ [% IF CAN_user_reserveforothers_place_holds %] >+ <a id="reserve_[% SEARCH_RESULT.biblionumber %]" href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">Holds ([% Biblio.HoldsCount( SEARCH_RESULT.biblionumber ) %])</a> >+ [% IF ( holdfor ) %] <span class="holdforlink">| <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]&findborrower=[% holdfor_cardnumber %]">Place hold for [% holdfor_firstname %] [% holdfor_surname %] ([% holdfor_cardnumber %])</a></span>[% END %] >+ [% ELSE %] >+ Holds ([% Biblio.HoldsCount( SEARCH_RESULT.biblionumber ) %]) >+ [% END %] > [% END %] > > [% IF Koha.Preference('intranetbookbag') == 1 %] >-- >2.11.0
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 20793
:
75446
|
75474
|
75475
|
75617
| 75690 |
75691