Bugzilla – Attachment 59483 Details for
Bug 14272
Allow OPAC to show a single news entry
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14272: [FOLLOW-UP] Show single news item
Bug-14272-FOLLOW-UP-Show-single-news-item.patch (text/plain), 5.58 KB, created by
Aleisha Amohia
on 2017-01-24 03:33:36 UTC
(
hide
)
Description:
Bug 14272: [FOLLOW-UP] Show single news item
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2017-01-24 03:33:36 UTC
Size:
5.58 KB
patch
obsolete
>From c8bbbab99316056de78f6bf8c49bef6fc601fd9e Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >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 %] > <div class="newsitem" id="news[% koha_new.idnew %]"><h4>[% koha_new.title %]</h4> >- <div class="newsbody">[% koha_new.new %]</div> >+ <div class="newsbody">[% koha_new.content %]</div> > <p class="newsfooter"> Posted on [% koha_new.newdate %][% IF( ( newsdisp == 'staff' || newsdisp == 'both' ) && koha_new.borrowernumber ) %] by <span class="newsauthor_title">[% koha_new.author_title %] </span>[% koha_new.author_firstname %] [% koha_new.author_surname %]<br />[% END %] > [% IF ( CAN_user_tools ) %] > <a href="/cgi-bin/koha/tools/koha-news.pl?op=add_form&id=[% koha_new.idnew %]">Edit</a> >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 %]</div> > [% END %] > </li> > <li><label for="new">News: </label> >- <textarea name="new" id="new" cols="75" rows="10">[% new_detail.new %]</textarea> >+ <textarea name="new" id="new" cols="75" rows="10">[% new_detail.content %]</textarea> > </li> > </ol> > </fieldset> >@@ -254,7 +254,7 @@ Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %]</div> > <td>[% opac_new.title %]</td> > <td>[% opac_new.author_title %] [% opac_new.author_firstname %] [% opac_new.author_surname %]</td> > <td> >- [% opac_new.new %] >+ [% opac_new.content %] > </td> > <td class="actions"> > <a href="/cgi-bin/koha/tools/koha-news.pl?op=add_form&id=[% opac_new.idnew %]" class="btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a> >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 %] > <div class="newsitem"> > <a name="newsitem[% koha_new.idnew %]" href="/cgi-bin/koha/opac-main.pl?news_id=[% koha_new.idnew %]"><h4 class="newsheader">[% koha_new.title %]</h4></a> >- <div class="newsbody">[% koha_new.new %]</div> >+ <div class="newsbody">[% koha_new.content %]</div> > <div class="newsfooter">(published on [% koha_new.newdate %][% IF ( (newsdisp == 'opac' || newsdisp == 'both') && koha_new.borrowernumber ) %] by <span class="newsauthor_title">[% koha_new.author_title %] </span>[% koha_new.author_firstname %] [% koha_new.author_surname %][% END %])</div> > </div> > [% END %] >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14272
:
45721
|
45740
|
45741
|
45818
|
45820
|
45845
|
45846
|
45935
|
45936
|
45937
|
47556
|
47557
|
47558
|
47665
|
47666
|
47667
|
47668
|
47669
|
47670
|
47671
|
47672
|
47673
|
50557
|
50558
|
50559
|
59483
|
70728
|
70729
|
70730
|
70731
|
72065
|
72548
|
72549
|
72550
|
72551
|
76015
|
76307
|
76580
|
76662
|
77546
|
77564
|
77565
|
77566
|
77567
|
77568
|
77569
|
78104
|
78206
|
78207
|
78208
|
78231
|
81643
|
82713
|
83425
|
83426
|
83427
|
83428
|
83429
|
83430
|
84868
|
84869
|
84870
|
84871
|
84872
|
84873
|
84874