package C4::Serials;
# Copyright 2000-2002 Katipo Communications
+# Parts Copyright 2010 Biblibre
#
# This file is part of Koha.
#
LEFT JOIN biblio ON biblio.biblionumber = subscription.biblionumber
LEFT JOIN aqbooksellers ON subscription.aqbooksellerid = aqbooksellers.id
WHERE ((planneddate < now() AND serial.STATUS =1) OR serial.STATUS = 3)
- AND subscription.aqbooksellerid=$supplierid
+ AND subscription.aqbooksellerid=?
ORDER BY title
|;
$sth = $dbh->prepare($query);
+ $sth->execute($supplierid);
} else {
my $query = qq|
SELECT name,title,planneddate,serialseq,serial.subscriptionid
ORDER BY title
|;
$sth = $dbh->prepare($query);
+ $sth->execute;
}
- $sth->execute;
my @issuelist;
my $last_title;
my $odd = 0;
my @serials;
while ( my $line = $sth->fetchrow_hashref ) {
- $line->{ "status" . $line->{status} } = 1; # fills a "statusX" value, used for template status select list
- $line->{"planneddate"} = format_date( $line->{"planneddate"} );
- $line->{"publisheddate"} = format_date( $line->{"publisheddate"} );
+ $line->{ "status" . $line->{status} } = 1; # fills a "statusX" value, used for template status select list
+ # Format dates for display
+ for my $datefield ( qw( planneddate publisheddate ) ) {
+ if ($line->{$datefield} =~m/^00/) {
+ $line->{$datefield} = q{};
+ }
+ else {
+ $line->{$datefield} = format_date( $line->{$datefield} );
+ }
+ }
push @serials, $line;
}
return @serials;