Bug 34478: Add 'op' to opac-request-article

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2024-01-31 11:56:04 +01:00
parent 8de3f8a8f6
commit 797586b908
Signed by: jonathan.druart
GPG key ID: A085E712BEF0E0F0
2 changed files with 9 additions and 8 deletions

View file

@ -40,10 +40,10 @@
</div>
[% ELSIF biblio.can_article_request( patron ) %]
<h1>Place article request for [% biblio.title | html %]</h1>
[% IF ( disclaimer && !action) %]
[% IF ( disclaimer && !accepted ) %]
<div class="alert alert-warning">
[% PROCESS koha_news_block news => disclaimer %]
<a href="/cgi-bin/koha/opac-request-article.pl?biblionumber=[% biblio.biblionumber | uri %]&amp;action=accept"
<a href="/cgi-bin/koha/opac-request-article.pl?biblionumber=[% biblio.biblionumber | uri %]&amp;accepted=1"
class="btn btn-sm btn-primary"><i class="fa fa-check" aria-hidden="true"></i> Accept</a>
</div>
[% ELSE %]
@ -63,7 +63,7 @@
<form id="place-article-request" method="post" action="/cgi-bin/koha/opac-request-article.pl">
[% INCLUDE 'csrf-token.inc' %]
<legend class="sr-only">Place article request</legend>
<input type="hidden" name="action" value="create" />
<input type="hidden" name="op" value="cud-create" />
<input type="hidden" name="biblionumber" id="biblionumber" value="[% biblio.biblionumber | html %]" />
<fieldset class="rows">

View file

@ -41,7 +41,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
}
);
my $action = $cgi->param('action') || q{};
my $op = $cgi->param('op') || q{};
my $biblionumber = $cgi->param('biblionumber');
my $biblio = Koha::Biblios->find($biblionumber);
if( !$biblio ) {
@ -49,7 +49,7 @@ if( !$biblio ) {
exit;
}
if ( $action eq 'create' ) {
if ( $op eq 'cud-create' ) {
my $branchcode = $cgi->param('branchcode');
my $itemnumber = $cgi->param('itemnumber') || undef;
@ -107,7 +107,7 @@ if ( $action eq 'create' ) {
}
# Should we redirect?
}
elsif ( !$action && C4::Context->preference('ArticleRequestsOpacHostRedirection') ) {
elsif ( !$op && C4::Context->preference('ArticleRequestsOpacHostRedirection') ) {
# Conditions: no items, host item entry (MARC21 773)
my ( $host, $pageinfo ) = $biblio->get_marc_host( { no_items => 1 } );
if ($host) {
@ -129,12 +129,13 @@ if(!$patron->can_request_article) {
}
$template->param( article_request_fee => $patron->article_request_fee )
if $action ne 'create';
if $op ne 'cud-create';
$template->param(
biblio => $biblio,
patron => $patron,
action => $action
op => $op,
accepted => scalar $cgi->param('accepted'),
);
output_html_with_http_headers $cgi, $cookie, $template->output, undef, { force_no_caching => 1 };