From 6c8fc9ffc945b4c867709d666c103f9035e9f25a Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 8 Feb 2024 10:57:15 +0100 Subject: [PATCH] Bug 34478: Add 'op' to cataloguing/moveitem Bug 34478: [TO SQUASH] Add 'op' to cataloguing/moveitem Signed-off-by: Jonathan Druart --- cataloguing/moveitem.pl | 15 ++-- .../prog/en/modules/cataloguing/moveitem.tt | 72 +++++++------------ 2 files changed, 33 insertions(+), 54 deletions(-) diff --git a/cataloguing/moveitem.pl b/cataloguing/moveitem.pl index 03ca711694..8fda82d4b8 100755 --- a/cataloguing/moveitem.pl +++ b/cataloguing/moveitem.pl @@ -31,13 +31,6 @@ use Koha::Items; my $query = CGI->new; -# The biblio to move the item to -my $biblionumber = $query->param('biblionumber'); - -# The barcode of the item to move -my $barcode = barcodedecode($query->param('barcode')); - - my ($template, $loggedinuser, $cookie) = get_template_and_user( { template_name => "cataloguing/moveitem.tt", @@ -47,12 +40,18 @@ my ($template, $loggedinuser, $cookie) = get_template_and_user( } ); +my $op = $query->param('op') || q{}; +# The biblio to move the item to +my $biblionumber = $query->param('biblionumber'); +# The barcode of the item to move +my $barcode = barcodedecode($query->param('barcode')); + my $biblio = Koha::Biblios->find( $biblionumber ); $template->param(biblio => $biblio); $template->param(biblionumber => $biblionumber); # If we already have the barcode of the item to move and the biblionumber to move the item to -if ( $barcode && $biblionumber ) { +if ( $op eq 'cud-moveitem' && $barcode && $biblionumber ) { my $itemnumber; my $item = Koha::Items->find( { barcode => $barcode } ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/moveitem.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/moveitem.tt index 6ef311e0ca..298fffa70b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/moveitem.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/moveitem.tt @@ -28,49 +28,35 @@ [% END #/ WRAPPER breadcrumbs %] [% END #/ WRAPPER sub-header.inc %] +[% SWITCH Koha.Preference('IntranetBiblioDefaultView') %] +[% CASE 'marc' %] [% action_link = "/cgi-bin/koha/catalogue/MARCdetail.pl" %] +[% CASE 'labeled_marc' %] [% action_link = "/cgi-bin/koha/catalogue/labeledMARCdetail.pl" %] +[% CASE 'isbd' %] [% action_link = "/cgi-bin/koha/catalogue/ISBDdetail.pl" %] +[% CASE %] [% action_link = "/cgi-bin/koha/catalogue/detail.pl" %] +[% END %] +[% action_link = action_link _ '?biblionumber=' _ biblio.biblionumber %] +
[% INCLUDE 'messages.inc' %]

Attach an item [% IF ( biblio.title ) %] to [% INCLUDE 'biblio-title.inc' %][% END %]

-[% BLOCK actions %] - [% IF Koha.Preference('IntranetBiblioDefaultView') == 'marc' %] -
- [% ELSIF Koha.Preference('IntranetBiblioDefaultView') == 'labeled_marc' %] - - [% ELSIF Koha.Preference('IntranetBiblioDefaultView') == 'isbd' %] - - [% ELSE %] - - [% INCLUDE 'csrf-token.inc' %] - [% END %] -[% END %] - -[% BLOCK fail %] - - -
-
- - -
-[% END %] [% IF ( error ) %]
- [% IF ( errornonewitem ) %]ERROR: Unable to create the new item.

- [% INCLUDE actions %] - [% INCLUDE fail %] + [% IF errornonewitem %] + ERROR: Unable to create the new item. + [% ELSIF errornoitem %] + ERROR: Unable to get the item. + [% END %] +

+ OK + + Try again with a different barcode

- [% END %] - [% IF ( errornoitem ) %]ERROR: Unable to get the item.

- [% INCLUDE actions %] - [% INCLUDE fail %] -

- [% END %]
[% ELSE %] @@ -89,19 +75,13 @@
[% END %] -
The item has successfully been attached to [% INCLUDE 'biblio-title.inc' link = 1 %]. -

- [% INCLUDE actions %] - - - -

- - -
-

- -
+
+ The item has successfully been attached to [% INCLUDE 'biblio-title.inc' link = 1 %]. +

+ OK + Attach another item +

+
[% ELSE %] [% IF ( missingparameter ) %]
@@ -116,7 +96,7 @@ [% ELSE %] - + [% END %] [% IF ( missingbarcode ) %] @@ -131,7 +111,7 @@ [% ELSE %] [% END %] - +
[% END %] [% END %] -- 2.39.5