Bug 34478: Add 'op' to catalogue/MARCdetail

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2024-02-08 10:19:07 +01:00
parent a8cc3b3db5
commit ddbb1a4055
No known key found for this signature in database
GPG Key ID: A085E712BEF0E0F0
2 changed files with 7 additions and 14 deletions

View File

@ -31,9 +31,6 @@ use Koha::Biblios;
my $query = CGI->new;
my $biblionumber = $query->param('biblionumber');
my $barcode = $query->param('barcode');
my ($template, $loggedinuser, $cookie) = get_template_and_user(
{
template_name => "cataloguing/linkitem.tt",
@ -43,6 +40,9 @@ my ($template, $loggedinuser, $cookie) = get_template_and_user(
}
);
my $biblionumber = $query->param('biblionumber');
my $barcode = $query->param('barcode');
my $op = $query->param('op') || q{};
my $biblio = Koha::Biblios->find($biblionumber);
my $record = $biblio->metadata->record;
my $marcflavour = C4::Context->preference("marcflavour");
@ -55,7 +55,7 @@ if ($marcflavour eq 'MARC21') {
$template->param(biblionumber => $biblionumber);
if ( $barcode && $biblionumber ) {
if ( $op eq 'cud-linkitem' && $barcode && $biblionumber ) {
my $item = Koha::Items->find( { barcode => $barcode } );

View File

@ -36,19 +36,11 @@
[% IF ( errornomodbiblio ) %]ERROR: Unable to modify the bibliographic record.[% END %]
[% IF ( errornohostitemnumber ) %]ERROR: Unable to get the item number from this barcode.[% END %]
</div>
<form action="/cgi-bin/koha/catalogue/MARCdetail.pl" method="post">
[% INCLUDE 'csrf-token.inc' %]
<input type="submit" class="btn btn-primary" value="OK" />
<input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
</form>
<a href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% biblionumber | uri %]" class="btn btn-primary">OK</a>
[% ELSE %]
[% IF ( success ) %]
<div class="dialog message">The item has successfully been linked to <em>[% bibliotitle | html %]</em>.</div>
<form action="/cgi-bin/koha/catalogue/MARCdetail.pl" method="post">
[% INCLUDE 'csrf-token.inc' %]
<input type="submit" class="btn btn-primary" value="OK" />
<input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
</form>
<a href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% biblionumber | uri %]" class="btn btn-primary">OK</a>
[% ELSE %]
[% IF ( missingparameter ) %]
<form method="post" action="/cgi-bin/koha/cataloguing/linkitem.pl">
@ -79,6 +71,7 @@
<input type="hidden" name="barcode" id="barcode" value="[% barcode | html %]" />
[% END %]
<input type="hidden" name="op" value="cud-linkitem" />
<input type="submit" class="btn btn-primary" value="Select" />
</form>