@@ -, +, @@ - Have at least three serials, with items - check the box to select two of them - Press the Remove selected issues button - Decide to delete their items as well or not - Validate. --- C4/Serials.pm | 18 +++++ .../prog/en/modules/serials/serials-collection.tt | 83 +++++++++++++++++++++- serials/serials-collection.pl | 35 ++++++++- 3 files changed, 131 insertions(+), 5 deletions(-) --- a/C4/Serials.pm +++ a/C4/Serials.pm @@ -85,6 +85,7 @@ BEGIN { &CountIssues HasItems &subscriptionCurrentlyOnOrder + &GetSerialItemsInformations ); } @@ -2594,7 +2595,24 @@ sub _can_do_on_subscription { } return 0; } +=head1 GetSerialItemsInformations +=cut +sub GetSerialItemsInformations{ +my (@serialid)=@_; +my $i=0; +my @serialitemsinformation; +my $dbh = C4::Context->dbh; +foreach my $sid(@serialid){ + my $sth = $dbh->prepare("select count(i.itemnumber) as countitems,s.itemnumber as itemnumber from items i natural join serialitems s where s.serialid=?"); + $sth->execute($sid); + my $line = $sth->fetchrow_hashref; + if($line->{'countitems'}){ + push @serialitemsinformation,$line; + } +} + return @serialitemsinformation; +} =head2 findSerialsByStatus @serials = findSerialsByStatus($status, $subscriptionid); --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt @@ -15,6 +15,26 @@ +[% IF ( delete ) %] +
+
+

Are you sure delete [% serialnumber %] selected serials

+
+
Delete associated items Yes + No
+
Number of items available : [% countitems %]
+ + + + +
+
+ + +
+
+
+ [% END %]
@@ -120,6 +140,7 @@
[% END %] [% END %] +

[% END %] @@ -161,12 +182,20 @@ disabled [% ELSE %] [% IF ( serial.subscriptionexpired ) %] - + [% ELSE %] [% IF ( serial.checked ) %] - + [% IF ( delete ) %] + + [% ELSE %] + + [% END %] [% ELSE %] - + [% IF ( delete ) %] + + [% ELSE %] + + [% END %] [% END %] [% END %] [% END %] @@ -278,6 +307,54 @@ [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") %]