@@ -, +, @@
---
Koha/News.pm | 9 +++++++--
.../intranet-tmpl/prog/en/modules/intranet-main.tt | 2 +-
.../intranet-tmpl/prog/en/modules/tools/koha-news.tt | 2 +-
t/db_dependent/Koha/News.t | 12 ++++++------
tools/koha-news.pl | 4 ++--
5 files changed, 17 insertions(+), 12 deletions(-)
--- a/Koha/News.pm
+++ a/Koha/News.pm
@@ -55,7 +55,12 @@ type is one of this:
- slip - for ISSUESLIP notice
- koha - for intranet
- opac - for online catalogue
-- OpanNavRight - Right column in the online catalogue
+- OpacNavRight - Right column in the online catalogue
+- OpacLoginInstructions
+- OpacMainUserBlock
+- OpacCustomSearch
+- opacheader
+- opaccredits
lang is language code - it is used only when type is opac or OpacNavRight
@@ -78,7 +83,7 @@ sub search_for_display {
}
$search_params->{branchcode} = [ $params->{library_id}, undef ] if $params->{library_id};
- $search_params->{timestamp} = { '<=' => \'NOW()' };
+ $search_params->{published_on} = { '<=' => \'NOW()' };
$search_params->{-or} = [ expirationdate => { '>=' => \'NOW()' },
expirationdate => undef ];
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt
@@ -31,7 +31,7 @@
[% FOREACH koha_new IN koha_news %]
[% koha_new.title | html %]
[% koha_new.content | $raw %]
-
[% opac_new.number | html %] |
-
[% opac_new.timestamp | $KohaDates %] |
+
[% opac_new.published_on | $KohaDates %] |
[% opac_new.expirationdate | $KohaDates %] [% IF ( opac_new.is_expired ) %](expired)[% END %] |
[% opac_new.title | html %] |
[% IF ( opac_new.author) %][% INCLUDE 'patron-title.inc' patron=opac_new.author hide_patron_infos_if_needed=1 %][% END %] |
--- a/t/db_dependent/Koha/News.t
+++ a/t/db_dependent/Koha/News.t
@@ -159,7 +159,7 @@ subtest '->search_for_display' => sub {
class => 'Koha::News',
value => {
expirationdate => $yesterday,
- timestamp => $today,
+ published_on => $today,
lang => '',
branchcode => undef,
number => 1,
@@ -169,7 +169,7 @@ subtest '->search_for_display' => sub {
class => 'Koha::News',
value => {
expirationdate => $tomorrow,
- timestamp => $today,
+ published_on => $today,
lang => '',
branchcode => undef,
number => 2,
@@ -179,7 +179,7 @@ subtest '->search_for_display' => sub {
class => 'Koha::News',
value => {
expirationdate => $tomorrow,
- timestamp => $tomorrow,
+ published_on => $tomorrow,
lang => '',
branchcode => undef,
number => 3,
@@ -189,7 +189,7 @@ subtest '->search_for_display' => sub {
class => 'Koha::News',
value => {
expirationdate => $tomorrow,
- timestamp => $today,
+ published_on => $today,
lang => 'slip',
branchcode => $library1->branchcode,
number => 4,
@@ -199,7 +199,7 @@ subtest '->search_for_display' => sub {
class => 'Koha::News',
value => {
expirationdate => $tomorrow,
- timestamp => $today,
+ published_on => $today,
lang => 'koha',
branchcode => $library2->branchcode,
number => 5,
@@ -209,7 +209,7 @@ subtest '->search_for_display' => sub {
class => 'Koha::News',
value => {
expirationdate => $tomorrow,
- timestamp => $today,
+ published_on => $today,
lang => 'koha',
branchcode => undef,
number => 5,
--- a/tools/koha-news.pl
+++ a/tools/koha-news.pl
@@ -112,7 +112,7 @@ elsif ( $op eq 'add' ) {
content => $content,
lang => $lang,
expirationdate => $expirationdate,
- timestamp => $timestamp,
+ published_on => $published_on,
number => $number,
branchcode => $branchcode,
borrowernumber => $borrowernumber,
@@ -150,7 +150,7 @@ else {
my $opac_news = Koha::News->search(
$params,
{
- order_by => { -desc => 'timestamp' },
+ order_by => { -desc => 'published_on' },
}
);
$template->param( opac_news => $opac_news );
--