Bug 38441: ILLHistoryCheck: Staff UI

Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Pedro Amorim 2024-11-14 09:54:20 -01:00 committed by Katrin Fischer
parent e9ca220884
commit cb4ecb4e77
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
2 changed files with 76 additions and 2 deletions

View File

@ -30,6 +30,7 @@ use Koha::ILL::Requests;
use Koha::ILL::Request;
use Koha::ILL::Batches;
use Koha::ILL::Request::Workflow::Availability;
use Koha::ILL::Request::Workflow::HistoryCheck;
use Koha::ILL::Request::Workflow::TypeDisclaimer;
use Koha::ILL::Request::Workflow::ConfirmAuto;
use Koha::Libraries;
@ -133,12 +134,18 @@ if ($backends_available) {
my $request = Koha::ILL::Request->new->load_backend( $params->{backend} );
# Before request creation operations - Preparation
my $history_check = Koha::ILL::Request::Workflow::HistoryCheck->new( $params, 'staff' );
my $availability = Koha::ILL::Request::Workflow::Availability->new( $params, 'staff' );
my $type_disclaimer = Koha::ILL::Request::Workflow::TypeDisclaimer->new( $params, 'staff' );
my $confirm_auto = Koha::ILL::Request::Workflow::ConfirmAuto->new( $params, 'staff' );
# ILLCheckAvailability operation
if ( $availability->show_availability($request) ) {
# ILLHistoryCheck operation
if ( $history_check->show_history_check($request) ) {
$op = 'historycheck';
$template->param( $history_check->history_check_template_params($params) )
# ILLCheckAvailability operation
} elsif ( $availability->show_availability($request) ) {
$op = 'availability';
$template->param( $availability->availability_template_params($params) )

View File

@ -65,6 +65,8 @@
[% ELSE %]
<span>Confirm request</span>
[% END %]
[% ELSIF op == 'historycheck' %]
<span>Request history check</span>
[% END %]
[% END %]
[% END #/ WRAPPER breadcrumbs %]
@ -900,6 +902,71 @@
</fieldset>
</form>
</div>
[% ELSIF op == 'historycheck' %]
<!-- historycheck -->
<h1>Request history check</h1>
<div id="results" class="page-section">
<form method="post" id="historycheck-form">
[% INCLUDE 'csrf-token.inc' %]
<h3>You are attempting to place the following request:</h3>
<table>
[% FOREACH key IN whole.keys %]
[% value = whole.$key %]
[% IF key != 'op' && key != 'method' && key != 'custom_key' && key != 'custom_value' && key != 'csrf_token' && value %]
<tr>
<td>[% key_mapping(key) || key | html %]</td>
<td>[% value | html %]</td>
</tr>
[% END %]
[% END %]
</table>
&nbsp;
<h3>This interlibrary loan has been requested before:</h3>
[% IF matching_requests_for_patron.size %]
<h4>By this patron [%- INCLUDE 'patron-title.inc' patron => request_patron_obj hide_patron_infos_if_needed => 1 -%]:</h4>
<ul class="list-unstyled">
[% FOREACH matching_request_for_patron IN matching_requests_for_patron %]
<li>
<a href="/cgi-bin/koha/ill/ill-requests.pl?op=illview&amp;illrequest_id=[% matching_request_for_patron.illrequest_id %]">ILL Request #[% matching_request_for_patron.illrequest_id %]</a>
</li>
[% END %]
</ul>
[% END %]
[% IF remaining_matching_requests.size %]
[% IF matching_requests_for_patron.size %]
<h4>By other patrons:</h4>
[% END %]
<ul class="list-unstyled">
[% FOREACH remaining_matching_request IN remaining_matching_requests %]
<li>
<a href="/cgi-bin/koha/ill/ill-requests.pl?op=illview&amp;illrequest_id=[% remaining_matching_request.illrequest_id %]">ILL Request #[% remaining_matching_request.illrequest_id %]</a> by [%- INCLUDE 'patron-title.inc' patron => remaining_matching_request.patron hide_patron_infos_if_needed => 1 -%]
</li>
[% END %]
</ul>
[% END %]
<fieldset class="action">
[% FOREACH key IN whole.keys %]
[% value = whole.$key %]
[% IF key != 'op' && key != 'method' && key != 'custom_key' && key != 'custom_value' && key != 'csrf_token' %]
<input type="hidden" name="[% key | html %]" value="[% value | html %]" />
[% END %]
[% END %]
[% custom_keys = whole.custom_key.split('\0') %]
[% custom_values = whole.custom_value.split('\0') %]
[% i = 0 %]
[% FOREACH custom_key IN custom_keys %]
<input type="hidden" name="custom_key" value="[% custom_key | html %]" />
<input type="hidden" name="custom_value" value="[% custom_values.$i | html %]" />
[% i = i + 1 %]
[% END %]
<input type="hidden" name="op" value="cud-create" />
<input type="hidden" name="stage" value="form" />
<input type="hidden" name="history_check_submitted" value="1" />
<input type="submit" class="btn btn-primary" value="Submit anyway" />
<a class="cancel" href="ill-requests.pl">Cancel</a>
</fieldset>
</form>
</div>
[% ELSIF op == 'confirmautoill' %]
<!-- confirmautoill -->
[% IF(auto_migrate) %]