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' %]
-
-
-[% END %]
[% IF ( error ) %]
- [% IF ( errornonewitem ) %]ERROR: Unable to create the new item.
- [% INCLUDE actions %]
- [% INCLUDE fail %]
-
- [% END %]
-
- [% IF ( errornoitem ) %]ERROR: Unable to get the 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
+
+
[% 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 ) %]
[% END %]
[% END %]