Browse Source

Bug 20284: ILLModuleCopyrightClearance text breaks

This patch fixes the display of the copyright notice text that is defined
in ILLModuleCopyrightClearance preference when placing ILL requests from
the OPAC. Handling of the copyrightclearance stage was missing,
this has been added.

To test:
1) Ensure you have at least one ILL backend available:
   https://wiki.koha-community.org/wiki/ILL_backends
2) Ensure you have the "ILLModule" preference enabled
3) Add some text to the "ILLModuleCopyrightClearance" preference
4) Navigate to a search results page in the catalog
5) Click the "Make an Interlibrary Loan request" link at the bottom
6) Choose "Create a new request", then select a backend
7) Observe the text you added earlier is displayed with buttons for
   agreeing or disagreeing (prior to this patch, this screen displayed
   an error)
8) Observe that clicking "Yes" takes you to the form for adding request
   details
9) Observe that clicking "No" takes you back to the "Interlibrary loan
   requests" page

Signed-off-by: Barry Cannon <bc@interleaf.ie>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
18.05.x
Andrew Isherwood 6 years ago
committed by Jonathan Druart
parent
commit
b12d5e7c20
  1. 47
      koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt
  2. 24
      opac/opac-illrequests.pl

47
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt

@ -54,24 +54,37 @@
<div id="illrequests" class="maincontent">
[% IF method == 'create' %]
<h2>New Interlibrary loan request</h2>
[% INCLUDE messages %]
[% IF backends %]
<form method="post" id="illrequestcreate-form" novalidate="novalidate">
<fieldset class="rows">
<label for="backend">Provider:</label>
<select name="backend">
[% FOREACH backend IN backends %]
<option value="[% backend %]">[% backend %]</option>
[% END %]
</select>
</fieldset>
<fieldset class="action">
<input type="hidden" name="method" value="create">
<input type="submit" name="create_select_backend" value="Next">
</fieldset>
</form>
[% IF stage == 'copyrightclearance' %]
[% INCLUDE messages %]
<div>
<p>
[% Koha.Preference('ILLModuleCopyrightClearance') %]
</p>
<a href="?method=create&stage=copyrightclearance&backend=[% whole.value.backend %]"
class="btn btn-sm btn-default"><i class="fa fa-check"></i> Yes</a>
<a href="/cgi-bin/koha/opac-illrequests.pl"
class="btn btn-sm btn-default"><i class="fa fa-times"></i> No</a>
</div>
[% ELSE %]
[% PROCESS $whole.opac_template %]
[% INCLUDE messages %]
[% IF backends %]
<form method="post" id="illrequestcreate-form" novalidate="novalidate">
<fieldset class="rows">
<label for="backend">Provider:</label>
<select name="backend">
[% FOREACH backend IN backends %]
<option value="[% backend %]">[% backend %]</option>
[% END %]
</select>
</fieldset>
<fieldset class="action">
<input type="hidden" name="method" value="create">
<input type="submit" name="create_select_backend" value="Next">
</fieldset>
</form>
[% ELSE %]
[% PROCESS $whole.opac_template %]
[% END %]
[% END %]
[% ELSIF method == 'list' %]
<h2>Interlibrary loan requests</h2>

24
opac/opac-illrequests.pl

@ -112,15 +112,23 @@ if ( $op eq 'list' ) {
borrowernumber => $loggedinuser
})->cardnumber;
my $backend_result = $request->backend_create($params);
$template->param(
media => [ "Book", "Article", "Journal" ],
branches => Koha::Libraries->search->unblessed,
whole => $backend_result,
request => $request
);
if ($backend_result->{stage} eq 'commit') {
print $query->redirect('/cgi-bin/koha/opac-illrequests.pl?message=2');
if ($backend_result->{stage} eq 'copyrightclearance') {
$template->param(
stage => $backend_result->{stage},
whole => $backend_result
);
} else {
$template->param(
media => [ "Book", "Article", "Journal" ],
branches => Koha::Libraries->search->unblessed,
whole => $backend_result,
request => $request
);
if ($backend_result->{stage} eq 'commit') {
print $query->redirect('/cgi-bin/koha/opac-illrequests.pl?message=2');
}
}
}
}

Loading…
Cancel
Save