From 700924fd1520cbf297c50c2cd63606983ff05958 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 4 Oct 2011 10:20:52 -0400 Subject: [PATCH] [SIGNED-OFF] Follow-up fix for Bug 4473 - Recent comments view for the OPAC This follow-up adds a system preference which controls display of a link to recent comments in the OPAC masthead alongside "Advanced search," "Tag cloud," etc. Signed-off-by: Nicole C. Engard --- C4/Auth.pm | 1 + installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 7 +++++++ .../prog/en/modules/admin/preferences/opac.pref | 7 +++++++ koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc | 1 + 5 files changed, 17 insertions(+), 0 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index 7211769..3690f5e 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -424,6 +424,7 @@ sub get_template_and_user { OpacHighlightedWords => C4::Context->preference("OpacHighlightedWords"), OPACItemHolds => C4::Context->preference("OPACItemHolds"), OPACShelfBrowser => "". C4::Context->preference("OPACShelfBrowser"), + OpacShowRecentComments => C4::Context->preference("OpacShowRecentComments"), OPACURLOpenInNewWindow => "" . C4::Context->preference("OPACURLOpenInNewWindow"), OPACUserCSS => "". C4::Context->preference("OPACUserCSS"), OPACViewOthersSuggestions => "" . C4::Context->preference("OPACViewOthersSuggestions"), diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 79d4893..27bef9a 100755 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -318,3 +318,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('BasketConfirmations', '1', 'When closing or reopening a basket,', 'always ask for confirmation.|do not ask for confirmation.', 'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('MARCAuthorityControlField008', '|| aca||aabn | a|a d', NULL, NULL, 'Textarea'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpenLibraryCovers',0,'If ON Openlibrary book covers will be show',NULL,'YesNo'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacShowRecentComments',0,'If ON a link to recent comments will appear in the OPAC masthead',NULL,'YesNo'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 6b88c29..ebb6cb3 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -4446,6 +4446,13 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion($DBversion); } +$DBversion = "3.05.00.XXX"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacShowRecentComments',0,'If ON a link to recent comments will appear in the OPAC masthead',NULL,'YesNo');"); + print "Upgrade to $DBversion done (Add syspref OpacShowRecentComments. When the preference is turned on a link to recent comments will appear in the OPAC masthead. )\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref index 8bbf692..deb7cbb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -86,6 +86,13 @@ OPAC: no: "Don't show" - the name of the patron that has an item checked out on item detail pages on the OPAC. - + - pref: OpacShowRecentComments + default: 0 + choices: + yes: Show + no: "Don't show" + - a link to recent comments in the OPAC masthead. + - - pref: OpacHighlightedWords choices: yes: Highlight diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc index 2510a7f..07268a2 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc @@ -112,6 +112,7 @@ Advanced Search [% IF ( OpacBrowser ) %] | Browse by Hierarchy[% END %] [% IF ( OpacAuthorities ) %] | Browse by author or subject[% END %] +[% IF ( OpacShowRecentComments ) %] | Recent Comments[% END %] [% IF ( TagsEnabled ) %] | Tag Cloud[% END %] [% IF ( OpacCloud ) %] | Subject Cloud[% END %] [% IF ( OpacTopissue ) %] | Most Popular[% END %] -- 1.7.2.3