Browse Source

Bug 15823: Can still access patron discharge slip without having the syspref on

EDIT: Fix for OPAC side
EDIT: Comment 10
EDIT: Merge conflicts

To test:
1) Ensure syspref useDischarge is disabled
2) Go to /cgi-bin/koha/members/discharge.pl?borrowernumber=X&discharge=1
3) Validate that you are still able to generate a discharge slip for this patron
4) Apply patch and refresh page
5) Confirm that you are redirected to the circulation.pl page for the user and that an error message is there.
OPAC SIDE
6) Go to the OPAC
7) Go to /cgi-bin/koha/opac-discharge.pl
8) Confirm you get a message saying discharges are disabled
9) Go to /cgi-bin/koha/opac-discharge.pl?op=request
10) Confirm you see same message

Sponsored-by: Catalyst IT

Followed test plan, works as expected (both staff client and OPAC).
Re-tested, works OK.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
16.05.x
Aleisha 8 years ago
committed by Brendan Gallagher
parent
commit
853d3cfe4d
  1. 1
      circ/circulation.pl
  2. 5
      koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
  3. 4
      koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-discharge.tt
  4. 9
      members/discharge.pl

1
circ/circulation.pl

@ -673,6 +673,7 @@ $template->param(
todaysdate => output_pref( { dt => dt_from_string()->set(hour => 23)->set(minute => 59), dateformat => 'sql' } ),
modifications => Koha::Patron::Modifications->GetModifications({ borrowernumber => $borrowernumber }),
override_high_holds => $override_high_holds,
nopermission => $query->param('nopermission'),
);
output_html_with_http_headers $query, $cookie, $template->output;

5
koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt

@ -123,7 +123,6 @@ $(document).ready(function() {
$(':radio', this).prop('checked', 'true')
}
});
});
//]]>
@ -217,6 +216,10 @@ $(document).ready(function() {
<div class="dialog message">High demand item. <b>Loan period was not shortened due to override.</b> Shortened due date would have been [% alert.HIGHHOLDS.returndate %] ([% alert.HIGHHOLDS.duration %] days).</div>
[% END %]
[% IF ( nopermission ) %]
<div class="dialog alert">Staff members are not allowed to discharge borrowers, nor borrowers to request a discharge.</div>
[% END %]
[% IF ( NEEDSCONFIRMATION ) %]
<div class="yui-g">

4
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-discharge.tt

@ -23,6 +23,9 @@
<div class="span10">
<div id="discharge" class="maincontainer">
<h1>Discharge</h1>
[% IF not(Koha.Preference("useDischarge")) %]
Discharges have not been enabled. Please contact the library.
[% ELSE %]
[% FOR message IN messages %]
<div class="dialog [% message.type %]">
[% IF message.code == "unable_to_generate_pdf" %]
@ -46,6 +49,7 @@
<p><strong>Warning</strong>: This request is only valid if you are in good standing with the library. Once the application is made, you can not borrow library materials.</p>
<a href="/cgi-bin/koha/opac-discharge.pl?op=request">Ask for a discharge</a>
[% END %]
[% END %]
</div> <!-- / #discharge -->
</div> <!-- / .span10 -->
</div> <!-- / .row-fluid -->

9
members/discharge.pl

@ -42,6 +42,7 @@ use Koha::Patron::Images;
use Koha::DateUtils;
my $input = new CGI;
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user({
template_name => 'members/discharge.tt',
query => $input,
@ -50,7 +51,13 @@ my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user({
flagsrequired => { 'borrowers' => '*' },
});
my $borrowernumber;
my $borrowernumber = $input->param('borrowernumber');
unless ( C4::Context->preference('useDischarge') ) {
print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber&nopermission=1");
exit;
}
my $data;
if ( $input->param('borrowernumber') ) {
$borrowernumber = $input->param('borrowernumber');

Loading…
Cancel
Save