X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=serials%2Fserials-search.pl;h=552500ef51a79021810d7f8a06749cf01b398d55;hb=HEAD;hp=ac5d0d37c254e274a523940eec009eee48486d34;hpb=8defeb2bd0449fb57945e54a487249283d64f191;p=koha.git diff --git a/serials/serials-search.pl b/serials/serials-search.pl index ac5d0d37c2..552500ef51 100755 --- a/serials/serials-search.pl +++ b/serials/serials-search.pl @@ -46,6 +46,8 @@ my $biblionumber = $query->param('biblionumber') || ''; my $branch = $query->param('branch_filter') || ''; my $routing = $query->param('routing') || C4::Context->preference("RoutingSerials"); my $searched = $query->param('searched') || 0; +my @subscriptionids = $query ->param('subscriptionid'); +my $op = $query->param('op'); my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { @@ -58,6 +60,16 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( } ); +if ( $op and $op eq "close" ) { + for my $subscriptionid ( @subscriptionids ) { + C4::Serials::CloseSubscription( $subscriptionid ); + } +} elsif ( $op and $op eq "reopen" ) { + for my $subscriptionid ( @subscriptionids ) { + C4::Serials::ReopenSubscription( $subscriptionid ); + } +} + my @subscriptions; if ($searched){ @subscriptions = SearchSubscriptions( @@ -81,11 +93,22 @@ if ($routing) { } } +my (@openedsubscriptions, @closedsubscriptions); +for my $sub ( @subscriptions ) { + unless ( $sub->{closed} ) { + push @openedsubscriptions, $sub + unless $sub->{cannotdisplay}; + } else { + push @closedsubscriptions, $sub + unless $sub->{cannotdisplay}; + } +} + my $branches = GetBranches(); my @branches_loop; foreach (sort keys %$branches){ my $selected = 0; - $selected = 1 if( $branch eq $_ ); + $selected = 1 if( defined $branch and $branch eq $_ ); push @branches_loop, { branchcode => $_, branchname => $branches->{$_}->{'branchname'}, @@ -94,7 +117,9 @@ foreach (sort keys %$branches){ } $template->param( - subscriptions => \@subscriptions, + openedsubscriptions => \@openedsubscriptions, + closedsubscriptions => \@closedsubscriptions, + total => @openedsubscriptions + @closedsubscriptions, title_filter => $title, ISSN_filter => $ISSN, EAN_filter => $EAN,