View | Details | Raw Unified | Return to bug 38441
Collapse All | Expand All

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt (+38 lines)
Lines 309-314 Link Here
309
                                    </fieldset>
309
                                    </fieldset>
310
                                </form>
310
                                </form>
311
                            </div>
311
                            </div>
312
                        [% ELSIF op == 'historycheck' %]
313
                            <h1>Request history check</h1>
314
                            <div id="results" class="page-section">
315
                                [% INCLUDE messages %]
316
                                <form method="post" id="historycheck-form">
317
                                    [%# This will get its name="op" value="cud-" from the loop over whole.keys below %]
318
                                    [% INCLUDE 'csrf-token.inc' %]
319
                                    <p>You have requested this interlibrary loan before:</p>
320
                                    [% IF matching_requests_for_patron.size %]
321
                                        <ul class="list-unstyled">
322
                                            [% FOREACH matching_request_for_patron IN matching_requests_for_patron %]
323
                                                <li>
324
                                                    <a href="/cgi-bin/koha/opac-illrequests.pl?op=view&amp;illrequest_id=[% matching_request_for_patron.illrequest_id %]">ILL Request #[% matching_request_for_patron.illrequest_id %]</a>
325
                                                </li>
326
                                            [% END %]
327
                                        </ul>
328
                                    [% END %]
329
                                    <fieldset class="action">
330
                                        [% FOREACH key IN whole.keys %]
331
                                            [% value = whole.$key %]
332
                                            [% IF key != 'custom_key' && key != 'custom_value' && key != 'csrf_token' %]
333
                                                <input type="hidden" name="[% key | html %]" value="[% value | html %]" />
334
                                            [% END %]
335
                                        [% END %]
336
                                        [% custom_keys = whole.custom_key.split('\0') %]
337
                                        [% custom_values = whole.custom_value.split('\0') %]
338
                                        [% i = 0 %]
339
                                        [% FOREACH custom_key IN custom_keys %]
340
                                            <input type="hidden" name="custom_key" value="[% custom_key | html %]" />
341
                                            <input type="hidden" name="custom_value" value="[% custom_values.$i | html %]" />
342
                                            [% i = i + 1 %]
343
                                        [% END %]
344
                                        <input type="hidden" name="history_check_submitted" value="1" />
345
                                        <input type="submit" class="btn btn-primary" value="Submit anyway" />
346
                                        <a class="action" href="/cgi-bin/koha/opac-illrequests.pl">Cancel</a>
347
                                    </fieldset>
348
                                </form>
349
                            </div>
312
                        [% ELSIF op == 'confirmautoill' %]
350
                        [% ELSIF op == 'confirmautoill' %]
313
                            <h1>Confirming request</h1>
351
                            <h1>Confirming request</h1>
314
                            <div id="results" class="page-section">
352
                            <div id="results" class="page-section">
(-)a/opac/opac-illrequests.pl (-3 / +16 lines)
Lines 37-42 use Koha::Libraries; Link Here
37
use Koha::Patrons;
37
use Koha::Patrons;
38
use Koha::ILL::Request::Workflow::Availability;
38
use Koha::ILL::Request::Workflow::Availability;
39
use Koha::ILL::Request::Workflow::ConfirmAuto;
39
use Koha::ILL::Request::Workflow::ConfirmAuto;
40
use Koha::ILL::Request::Workflow::HistoryCheck;
40
use Koha::ILL::Request::Workflow::TypeDisclaimer;
41
use Koha::ILL::Request::Workflow::TypeDisclaimer;
41
42
42
my $query = CGI->new;
43
my $query = CGI->new;
Lines 128-139 if ( $op eq 'list' ) { Link Here
128
        my $request = Koha::ILL::Request->new->load_backend( $params->{backend} );
129
        my $request = Koha::ILL::Request->new->load_backend( $params->{backend} );
129
130
130
        # Before request creation operations - Preparation
131
        # Before request creation operations - Preparation
132
        my $history_check   = Koha::ILL::Request::Workflow::HistoryCheck->new( $params, 'opac' );
131
        my $availability    = Koha::ILL::Request::Workflow::Availability->new( $params, 'opac' );
133
        my $availability    = Koha::ILL::Request::Workflow::Availability->new( $params, 'opac' );
132
        my $type_disclaimer = Koha::ILL::Request::Workflow::TypeDisclaimer->new( $params, 'opac' );
134
        my $type_disclaimer = Koha::ILL::Request::Workflow::TypeDisclaimer->new( $params, 'opac' );
133
        my $confirm_auto    = Koha::ILL::Request::Workflow::ConfirmAuto->new( $params, 'opac' );
135
        my $confirm_auto    = Koha::ILL::Request::Workflow::ConfirmAuto->new( $params, 'opac' );
134
136
135
        # ILLCheckAvailability operation
137
        # ILLHistoryCheck operation
136
        if ( $availability->show_availability($request) ) {
138
        if ( $history_check->show_history_check($request) ) {
139
            $op = 'historycheck';
140
            $template->param( $history_check->history_check_template_params($params) );
141
            output_html_with_http_headers $query, $cookie,
142
                $template->output, undef,
143
                { force_no_caching => 1 };
144
            exit;
145
146
            # ILLCheckAvailability operation
147
        } elsif ( $availability->show_availability($request) ) {
137
            $op = 'availability';
148
            $op = 'availability';
138
            $template->param( $availability->availability_template_params($params) );
149
            $template->param( $availability->availability_template_params($params) );
139
            output_html_with_http_headers $query, $cookie,
150
            output_html_with_http_headers $query, $cookie,
Lines 190-195 if ( $op eq 'list' ) { Link Here
190
                if ( $params->{type_disclaimer_submitted} ) {
201
                if ( $params->{type_disclaimer_submitted} ) {
191
                    $type_disclaimer->after_request_created( $params, $request );
202
                    $type_disclaimer->after_request_created( $params, $request );
192
                }
203
                }
204
                if ( C4::Context->preference('ILLHistoryCheck') ) {
205
                    $history_check->after_request_created( $params, $request );
206
                }
193
                if ( C4::Context->preference('ILLOpacUnauthenticatedRequest') && !$patron ) {
207
                if ( C4::Context->preference('ILLOpacUnauthenticatedRequest') && !$patron ) {
194
                    my $sessionID = $query->cookie('CGISESSID');
208
                    my $sessionID = $query->cookie('CGISESSID');
195
                    my $session   = C4::Auth::get_session($sessionID);
209
                    my $session   = C4::Auth::get_session($sessionID);
196
- 

Return to bug 38441