From c8bbbab99316056de78f6bf8c49bef6fc601fd9e Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Tue, 24 Jan 2017 03:31:59 +0000 Subject: [PATCH] Bug 14272: [FOLLOW-UP] Show single news item This patch fixes merge conflicts, an error in the query, and changes the column name `new` to `content`. This patch is now ready to test. Sponsored-by: Catalyst IT --- C4/NewsChannels.pm | 4 ++-- .../mysql/atomicupdate/bug-14272-change-column-name-in-opac-news.sql | 1 + koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt | 4 ++-- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug-14272-change-column-name-in-opac-news.sql diff --git a/C4/NewsChannels.pm b/C4/NewsChannels.pm index 01ab281..6760b78 100644 --- a/C4/NewsChannels.pm +++ b/C4/NewsChannels.pm @@ -207,7 +207,7 @@ sub GetNewsToDisplay { FROM opac_news LEFT JOIN borrowers on borrowers.borrowernumber = opac_news.borrowernumber - WHERE (}; + WHERE }; if ( defined $id ) { $query .= q{ opac_news.idnew = ? } if defined $id; @@ -216,7 +216,7 @@ sub GetNewsToDisplay { unless ( defined $time ) { $query .= q{ AND } if defined $id; - $query .= q{ + $query .= q{ ( expirationdate >= CURRENT_DATE() OR expirationdate IS NULL OR expirationdate = '00-00-0000' diff --git a/installer/data/mysql/atomicupdate/bug-14272-change-column-name-in-opac-news.sql b/installer/data/mysql/atomicupdate/bug-14272-change-column-name-in-opac-news.sql new file mode 100644 index 0000000..a525855 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug-14272-change-column-name-in-opac-news.sql @@ -0,0 +1 @@ +ALTER TABLE opac_news CHANGE COLUMN `new` `content` text NOT NULL; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt index c34c9ce..fa5cde8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt @@ -183,7 +183,7 @@ [% SET newsdisp = Koha.Preference('NewsAuthorDisplay') %] [% FOREACH koha_new IN koha_news %]

[% koha_new.title %]

-
[% koha_new.new %]
+
[% koha_new.content %]

Posted on [% koha_new.newdate %][% IF( ( newsdisp == 'staff' || newsdisp == 'both' ) && koha_new.borrowernumber ) %] by [% koha_new.author_title %] [% koha_new.author_firstname %] [% koha_new.author_surname %]
[% END %] [% IF ( CAN_user_tools ) %] Edit diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt index 13d8e94..9d007e5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt @@ -162,7 +162,7 @@ Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %]

[% END %]
  • - +
  • @@ -254,7 +254,7 @@ Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %] [% opac_new.title %] [% opac_new.author_title %] [% opac_new.author_firstname %] [% opac_new.author_surname %] - [% opac_new.new %] + [% opac_new.content %] Edit diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt index e41fa82..96f9451 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt @@ -53,7 +53,7 @@ [% FOREACH koha_new IN koha_news %]

    [% koha_new.title %]

    -
    [% koha_new.new %]
    +
    [% koha_new.content %]
    (published on [% koha_new.newdate %][% IF ( (newsdisp == 'opac' || newsdisp == 'both') && koha_new.borrowernumber ) %] by [% koha_new.author_title %] [% koha_new.author_firstname %] [% koha_new.author_surname %][% END %])
    [% END %] -- 2.1.4