use C4::Context;
use Koha::DateUtils;
-use vars qw($VERSION @ISA @EXPORT);
+use vars qw(@ISA @EXPORT);
BEGIN {
- $VERSION = 3.07.00.049; # set the version for version checking
@ISA = qw(Exporter);
@EXPORT = qw(
&GetNewsToDisplay
$sth->execute($idnew);
my $data = $sth->fetchrow_hashref;
$data->{$data->{'lang'}} = 1 if defined $data->{lang};
- $data->{expirationdate} = output_pref({ dt => dt_from_string( $data->{expirationdate} ), dateonly => 1 });
+ $data->{expirationdate} = output_pref({ dt => dt_from_string( $data->{expirationdate} ), dateonly => 1 }) if ( $data->{expirationdate} );
$data->{timestamp} = output_pref({ dt => dt_from_string( $data->{timestamp} ), dateonly => 1 }) ;
return $data;
}
=head2 GetNewsToDisplay
$news = &GetNewsToDisplay($lang,$branch);
- C<$news> is a ref to an array which containts
+ C<$news> is a ref to an array which contains
all news with expirationdate > today or expirationdate is null
that is applicable for a given branch.
OR expirationdate = '00-00-0000'
)
AND DATE(timestamp) < DATE_ADD(CURDATE(), INTERVAL 1 DAY)
- AND (lang = '' OR lang = ?)
+ AND (opac_news.lang = '' OR opac_news.lang = ?)
AND (opac_news.branchcode IS NULL OR opac_news.branchcode = ?)
ORDER BY number
}; # expirationdate field is NOT in ISO format?