@@ -, +, @@
having the syspref on
---
circ/circulation.pl | 1 +
koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt | 5 ++++-
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-discharge.tt | 4 ++++
members/discharge.pl | 9 ++++++++-
4 files changed, 17 insertions(+), 2 deletions(-)
--- a/circ/circulation.pl
+++ a/circ/circulation.pl
@@ -693,6 +693,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;
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
+++ a/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() {
High demand item. Loan period was not shortened due to override. Shortened due date would have been [% alert.HIGHHOLDS.returndate %] ([% alert.HIGHHOLDS.duration %] days).
[% END %]
+[% IF ( nopermission ) %]
+ Staff members are not allowed to discharge borrowers, nor borrowers to request a discharge.
+[% END %]
+
[% IF ( NEEDSCONFIRMATION ) %]
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-discharge.tt
+++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-discharge.tt
@@ -23,6 +23,9 @@
Discharge
+ [% IF not(Koha.Preference("useDischarge")) %]
+ Discharges have not been enabled. Please contact the library.
+ [% ELSE %]
[% FOR message IN messages %]
[% IF message.code == "unable_to_generate_pdf" %]
@@ -46,6 +49,7 @@
Warning: 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.
Ask for a discharge
[% END %]
+ [% END %]
--- a/members/discharge.pl
+++ a/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');
--