From ddbb1a40558b28fa2cc7c9087e3501e76d91bb8f Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 8 Feb 2024 10:19:07 +0100 Subject: [PATCH] Bug 34478: Add 'op' to catalogue/MARCdetail Signed-off-by: Jonathan Druart --- cataloguing/linkitem.pl | 8 ++++---- .../prog/en/modules/cataloguing/linkitem.tt | 13 +++---------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/cataloguing/linkitem.pl b/cataloguing/linkitem.pl index 0acaf6f64b..7497ec1ba7 100755 --- a/cataloguing/linkitem.pl +++ b/cataloguing/linkitem.pl @@ -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 } ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/linkitem.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/linkitem.tt index 6d0ad685b6..6b89ba61f7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/linkitem.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/linkitem.tt @@ -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 %] -
- [% INCLUDE 'csrf-token.inc' %] - - -
+ OK [% ELSE %] [% IF ( success ) %]
The item has successfully been linked to [% bibliotitle | html %].
-
- [% INCLUDE 'csrf-token.inc' %] - - -
+ OK [% ELSE %] [% IF ( missingparameter ) %]
@@ -79,6 +71,7 @@ [% END %] +
-- 2.39.2