From 94a19ce51820bb5fab0ec867e2d8b9afb1b4d760 Mon Sep 17 00:00:00 2001 From: Robin Sheat Date: Sat, 26 May 2012 13:41:29 +1200 Subject: [PATCH] [SIGNED-OFF] Bug 7642 - OpacShowTagCloudWeight system preference This system preference allows the mouseover text on the tag cloud to be turned off. The text consists of the weight for the tag, but users are more likely to confuse it with the number of items that have this tag. Signed-off-by: Katrin Fischer Works as advertised, tiny change to the HTML output. --- installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 8 ++++++++ .../prog/en/modules/admin/preferences/opac.pref | 6 ++++++ koha-tmpl/opac-tmpl/prog/en/modules/opac-tags.tt | 7 ++++++- opac/opac-tags.pl | 7 +++++-- 5 files changed, 26 insertions(+), 3 deletions(-) diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 2ffe2df..1da0ef0 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -365,3 +365,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacBrowseResults','1','Disable/enable browsing and paging search results from the OPAC detail page.',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('SvcMaxReportRows','10','Maximum number of rows to return via the report web service.',NULL,'Integer'); INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('ReservesControlBranch','PatronLibrary','ItemHomeLibrary|PatronLibrary','Branch checked for members reservations rights','Choice'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacShowTagCloudWeight','1','Whether to show the weight of a tag when you hover over its name in the tag cloud',NULL,'YesNo'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index dbbdee3..9df0f3b 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -5308,6 +5308,14 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = "3.09.00.XXX"; +if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { + $dbh->do("INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacShowTagCloudWeight','1','Whether to show the weight of a tag when you hover over its name in the tag cloud',NULL,'YesNo')"); + print "Upgrade to $DBversion done (Add the 'OpacShowTagCloudWeight' system preference)\n"; + SetVersion($DBversion); +} + + =head1 FUNCTIONS =head2 TableExists($table) 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 e4ea15b..63ab78b 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 @@ -223,6 +223,12 @@ OPAC: - '
Note: Available options are: BIBTEX (bibtex), Dublin Core (dc),' - 'MARCXML (marcxml), MARC-8 encoded MARC (marc8), Unicode/UTF-8 encoded MARC (utf8),' - 'Unicode/UTF-8 encoded MARC without local use -9xx, x9x, xx9- fields and subfields (marcstd), MODS (mods), RIS (ris)' + - + - pref: OpacShowTagCloudWeight + choices: + yes: Show + no: "Don't show" + - 'the numerical weight of a tag when you hover over its name in the tag cloud.' Features: - - pref: opacuserlogin diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-tags.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-tags.tt index 1c291c9..b67d4e9 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-tags.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-tags.tt @@ -90,7 +90,12 @@ [% IF ( TAGLOOP ) %]
[% FOREACH TAGLOO IN TAGLOOP %] - + [% IF (showweight) %] + + [% ELSE %] + + [% END %] + [% TAGLOO.term |html %] [% TAGLOO.weight_total %] diff --git a/opac/opac-tags.pl b/opac/opac-tags.pl index 173a25c..601174d 100755 --- a/opac/opac-tags.pl +++ b/opac/opac-tags.pl @@ -236,8 +236,11 @@ if ($loggedinuser) { } } -$template->param(tagsview => 1, -dateformat => C4::Context->preference("dateformat")); +$template->param( + tagsview => 1, + dateformat => C4::Context->preference("dateformat"), + showweight => C4::Context->preference("OpacShowTagCloudWeight") +); if ($add_op) { my $adds = 0; -- 1.7.9.5