Bugzilla – Attachment 70584 Details for
Bug 17765
Hide 'Holds' link in staff results list
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17765: Hid 'Holds' link on the 'Details' and 'Checkout' pages when the user does not have the permission to 'reserveforothers'.
Bug-17765-Hid-Holds-link-on-the-Details-and-Checko.patch (text/plain), 6.78 KB, created by
Zoe Bennett
on 2018-01-16 23:22:29 UTC
(
hide
)
Description:
Bug 17765: Hid 'Holds' link on the 'Details' and 'Checkout' pages when the user does not have the permission to 'reserveforothers'.
Filename:
MIME Type:
Creator:
Zoe Bennett
Created:
2018-01-16 23:22:29 UTC
Size:
6.78 KB
patch
obsolete
>From 28079b6488446f552c657adcf6d51b06c2cff850 Mon Sep 17 00:00:00 2001 >From: Zoe Bennett <zoebennett1308@gmail.com> >Date: Tue, 16 Jan 2018 23:04:20 +0000 >Subject: [PATCH] Bug 17765: Hid 'Holds' link on the 'Details' and 'Checkout' > pages when the user does not have the permission to 'reserveforothers'. > >Test Plan: >1) With a user who has the permission to 'reserveforothers' check that the 'Holds' link is on the 'Details' and 'Check out' pages >2) Then with a user who does not have the permission to 'reserveforothers' check that on the 'Details' and 'Check out' pages there is no longer the 'Holds' link next to the 'Checkouts' and 'Fines & Charges' tabs. >--- > circ/circulation.pl | 4 ++++ > .../prog/en/modules/circ/circulation.tt | 6 ++++-- > .../prog/en/modules/members/moremember.tt | 24 +++++++++++++--------- > members/moremember.pl | 5 +++++ > 4 files changed, 27 insertions(+), 12 deletions(-) > >diff --git a/circ/circulation.pl b/circ/circulation.pl >index 5dc5d89..4438dfb 100755 >--- a/circ/circulation.pl >+++ b/circ/circulation.pl >@@ -176,6 +176,10 @@ my $print = $query->param('print') || q{}; > my $debt_confirmed = $query->param('debt_confirmed') || 0; # Don't show the debt error dialog twice > my $charges = $query->param('charges') || q{}; > >+my $flags = C4::Auth::getuserflags($patron->flags, $patron->userid); >+if (ref $flags->{reserveforothers} && $flags->{reserveforothers}){ >+ $template->param( has_reserveforothers_permission => 1 )} >+ > # Check if stickyduedate is turned off > if ( @$barcodes ) { > # was stickyduedate loaded from session? >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >index 842e479..937efb0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -934,7 +934,7 @@ No patron matched <span class="ex">[% message | html %]</span> > [% IF relatives_issues_count %] > <li><a id="relatives-issues-tab" href="#relatives-issues">Relatives' checkouts</a></li> > [% END %] >- >+ [% IF has_reserveforothers_permission %] > <li> > [% IF ( holds_count ) %] > <a href="#reserves" id="holds-tab">[% holds_count %] Hold(s)</a> >@@ -942,6 +942,7 @@ No patron matched <span class="ex">[% message | html %]</span> > <a href="#reserves" id="holds-tab">0 Holds</a> > [% END %] > </li> >+ [% END %] > > [% IF Koha.Preference('ArticleRequests') %] > <li> >@@ -998,6 +999,7 @@ No patron matched <span class="ex">[% message | html %]</span> > > [% INCLUDE borrower_debarments.inc %] > >+[% IF has_reserveforothers_permission %] > <div id="reserves"> > [% IF ( holds_count ) %] > <form action="/cgi-bin/koha/reserve/modrequest.pl" method="post"> >@@ -1052,7 +1054,7 @@ No patron matched <span class="ex">[% message | html %]</span> > <p>Patron has nothing on hold.</p> > [% END %] > </div> <!-- reservesloop --> >- >+[% END %] > [% IF Koha.Preference('ArticleRequests') %] > [% INCLUDE 'patron-article-requests.inc' %] > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >index 180d941..6a1dfb0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >@@ -65,7 +65,7 @@ $(document).ready(function() { > $('#'+ui.newTab.context.id).click(); > } > } ); >- $("#holdst").dataTable($.extend(true, {}, dataTablesDefaults, { >+ $(CAN_user_reserveforothers("#holdst").dataTable($.extend(true, {}, dataTablesDefaults, { > "sDom": 't', > "aoColumnDefs": [ > { "aTargets": [ -1,-2 ], "bSortable": false, "bSearchable": false } >@@ -74,7 +74,7 @@ $(document).ready(function() { > { "sType": "title-string" },{ "sType": "anti-the" },null,null,null,null,null,null > ], > "bPaginate": false >- })); >+ }))); > [% IF ( picture ) %] > // new YAHOO.widget.Button("delpicture"); // FIXME: formatting mismatch between YUI and normal button > $('#delpicture').click(function(){ >@@ -446,7 +446,7 @@ function validate1(date) { > [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %] > <li><span class="label">Check previous checkouts: </span> > [% IF ( checkprevcheckout == 'yes' ) %] >- Yes >+ Yes > [% ELSIF ( checkprevcheckout == 'no' ) %] > No > [% ELSE %] >@@ -508,13 +508,15 @@ function validate1(date) { > <li><a href="#relatives-issues" id="relatives-issues-tab">Relatives' checkouts</a></li> > [% END %] > <li><a href="#finesandcharges">Fines & Charges</a></li> >+ [% IF has_reserveforothers_permission %] > <li> >- [% IF ( holds_count ) %] >- <a href="#reserves" id="holds-tab">[% holds_count %] Hold(s)</a> >- [% ELSE %] >- <a href="#reserves" id="holds-tab">0 Holds</a> >- [% END %] >+ [% IF ( holds_count ) %] >+ <a href="#reserves" id="holds-tab">[% holds_count %] Hold(s)</a> >+ [% ELSE %] >+ <a href="#reserves" id="holds-tab">0 Holds</a> >+ [% END %] > </li> >+ [% END %] > [% IF Koha.Preference('ArticleRequests') %] > <li> > <a href="#article-requests" id="article-requests-tab"> [% patron.article_requests_current.count %] Article requests</a> >@@ -574,6 +576,7 @@ function validate1(date) { > > [% INCLUDE borrower_debarments.inc %] > >+[% IF has_reserveforothers_permission %] > <div id="reserves"> > [% IF ( holds_count ) %] > <form action="/cgi-bin/koha/reserve/modrequest.pl" method="post"> >@@ -620,12 +623,13 @@ function validate1(date) { > <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" /> > <input type="hidden" name="suspend" value="0" /> > <input type="submit" value="Resume all suspended holds" /> >- </form> >+</form> > </fieldset> > [% END # IF SuspendHoldsIntranet %] > > [% ELSE %]<p>Patron has nothing on hold.</p>[% END %] >- </div> >+</div> >+[% END %] > > > [% IF Koha.Preference('ArticleRequests') %] >diff --git a/members/moremember.pl b/members/moremember.pl >index f79f2f8..56db5dd 100755 >--- a/members/moremember.pl >+++ b/members/moremember.pl >@@ -167,6 +167,11 @@ if ( $patron->is_debarred ) { > } > } > >+my $flags = C4::Auth::getuserflags($patron->flags, $patron->userid); >+if (ref $flags->{reserveforothers} && $flags->{reserveforothers}){ >+ $template->param( has_reserveforothers_permission => 1); >+} >+ > $data->{ "sex_".$data->{'sex'}."_p" } = 1 if defined $data->{sex}; > > if ( $category_type eq 'C') { >-- >2.1.4
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 17765
: 70584 |
70662
|
84165