From 8ea39a86b51545af2073adfe7cf44c69a4ac04b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joonas=20Kylm=C3=A4l=C3=A4?= Date: Fri, 25 Sep 2015 08:08:55 +0000 Subject: [PATCH] Bug 14895: Removes the ability to edit already added item's info from serials-edit.pl page Test plan: 1. In serials create a new subscription with the option "create an item record when receiving this serial" selected. You can choose the other properties. 2. Find the newly created serial subscription by using the top bar's search. 3. Click from the 'Actions' drop-down menu 'Serial receive'. 4. Change the status to 'Arrived'. Add something to the barcode field. Save. 4.1 (Optional step) Open a new tab in your browser and go see that there is in the catalogue the item you just added and it has a barcode. 5. Now you should have arrived to the page serials-collection.pl. Here, select the very same serial item you just edited and click 'Edit serials' 6. Now click just save button without doing any changes. 7. Go to find that item from the biblio record. Notice its barcode is missing now. 8. Apply the patch 9. Put there some barcode to the item manually. 9. Go back to the serials-collection.pl page and select the item and click 'Edit serials'. 10. Click save on the edit-serials.pl page without changing any information. 11. Go and check that the item has still its barcode. 12. Find out if this patch's changes to edit-serials.pl has caused some problems in other parts of the system. --- .../intranet-tmpl/prog/en/modules/serials/serials-edit.tt | 13 +++++++++---- serials/serials-edit.pl | 3 +++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt index 20a4963..8309fd5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt @@ -243,8 +243,11 @@ $(document).ready(function() { [% UNLESS ( serialslis.subscriptionexpired ) %] [% IF ( serialslis.serialsadditems ) %] - - + + [% FOREACH item IN serialslis.items %] + [% IF ( item.itemid.substr(0,1) == "N" ) %] + + Click to add item + + [% END %] + [% END %] [% END %] [% END %] diff --git a/serials/serials-edit.pl b/serials/serials-edit.pl index 8fb2e60..c6151c7 100755 --- a/serials/serials-edit.pl +++ b/serials/serials-edit.pl @@ -260,6 +260,9 @@ if ( $op and $op eq 'serialchangestatus' ) { my $countdistinct; my $range = scalar(@itemid); for ( my $i = 0 ; $i < $range ; $i++ ) { + if (C4::Items::GetItem($itemid[$i])) { + next(); + } unless ( $itemhash{ $itemid[$i] } ) { if ( $serials[$countdistinct] && $serials[$countdistinct] ne "NEW" ) -- 1.9.1