Bug 17674: Handling of special cases

This patch adds handling for those 2 particular cases:
1. Deleting the expected issue
2. Deleting a serial and it's item, but one item cannot be deleted

To test:

1.1 Create a subscription that creates items
1.2 Receive two issues
1.3 Use the new button to delete the 'Expected' issue
1.4 The issue is correctly deleted, but the new expected issue created
to replace the one which has been deleted don't have a published or
received date and is show in it's own tab.
1.5 Apply patch
1.6 Repeat steps 1.1 through 1.4
    => The new expected issue is created correctly

2.1 Use the same serial as in 1 or repeat step 1.1 and 1.2
2.2 Check out one of the items
2.3 Delete the corresponding serial and check box to delete items
2.4 The serial is deleted, but not the item.
    => No feedback is show to the user
2.5 Apply patch
2.6 Repeat step 2.1 through 2.4
    => As before, the serial is deleted, but not the item
    => This time, an error is shown to inform the user

Signed-off-by: sonia <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Maryse Simard 2020-02-21 14:09:17 -05:00 committed by Martin Renvoize
parent 6cb8c9e4e9
commit 2fcc16b62c
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
2 changed files with 10 additions and 3 deletions

View File

@ -55,6 +55,12 @@
</div>
[% END %]
[% IF ( error_delitem ) %]
<div class="dialog alert">
<p><strong>Error</strong>: one or more associated items could not be deleted at this time.</p>
</div>
[% END %]
[% IF ( subscriptions ) %]
<table>
[% IF ( subscriptions.size == 1 ) %]

View File

@ -124,14 +124,15 @@ if($op eq 'delete_confirm'){
foreach my $serialid (@serialsid){
my @itemnumbers = Koha::Serial::Items->search({serialid => $serialid})->get_column('itemnumber');
foreach my $itemnumber (@itemnumbers){
C4::Items::DelItem({'biblionumber' => $biblionumber, 'itemnumber' => $itemnumber});
my $delcheck = C4::Items::DelItemCheck($biblionumber, $itemnumber);
$template->param(error_delitem => 1) if $delcheck != 1;
}
}
}
for my $serialid (@serialsid){
ModSerialStatus($serialid,"","","","",6);
my $serial = Koha::Serials->find($serialid);
ModSerialStatus($serialid, $serial->serialseq, $serial->planneddate, $serial->publisheddate, $serial->publisheddatetext, 6, "");
}
print $query->redirect('/cgi-bin/koha/serials/serials-collection.pl?subscriptionid='.$subscriptionid);
}
my $subscriptioncount;