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;
$(':radio', this).prop('checked', 'true')
}
});
-
});
//]]>
<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">
<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" %]
<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 -->
use Koha::DateUtils;
my $input = new CGI;
+
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user({
template_name => 'members/discharge.tt',
query => $input,
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');