From 580579026253ff6b595ab7d7d86d3d364197b1b0 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Wed, 19 Apr 2017 00:42:17 +0000 Subject: [PATCH] Bug 7960: Add syspref to hide/show item type text labels in catalog To test: 1) Apply patch and update database 2) Go to Admin -> Sysprefs -> Find system preference 'ItemTypeText' 3) Should have default value 'Show'. Change to 'Don't show'. 4) Make sure 'noItemTypeImages' is enabled. 5) Search for a record in catalog on staff client. Go to detail page. 6) Confirm the text label for the item type is hidden, but the item type image still shows. 7) Search for a record in catalog on OPAC. Go to detail page. 8) Confirm the text label for the item type is hidden, but the item type image still shows. 9) Go back to sysprefs and set 'ItemTypeText' to 'Show'. 10) Confirm text labels now show on detail pages. Sponsored-by: Catalyst IT --- .../mysql/atomicupdate/bug_7690_-_add_ItemTypeText_syspref.sql | 1 + installer/data/mysql/sysprefs.sql | 1 + .../intranet-tmpl/prog/en/modules/admin/preferences/admin.pref | 7 +++++++ koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt | 2 +- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 2 +- 5 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_7690_-_add_ItemTypeText_syspref.sql diff --git a/installer/data/mysql/atomicupdate/bug_7690_-_add_ItemTypeText_syspref.sql b/installer/data/mysql/atomicupdate/bug_7690_-_add_ItemTypeText_syspref.sql new file mode 100644 index 0000000..5549069 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_7690_-_add_ItemTypeText_syspref.sql @@ -0,0 +1 @@ +INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES ('ItemTypeText', 1, NULL, 'Show/hide the item type text label. It is recommended to have ItemTypeText enabled if noItemTypeImages is disabled.', 'YesNo'); diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 64aa493..c19b189 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -226,6 +226,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('itemBarcodeFallbackSearch','',NULL,'If set, uses scanned item barcodes as a catalogue search if not found as barcodes','YesNo'), ('itemBarcodeInputFilter','','whitespace|T-prefix|cuecat|libsuite8|EAN13','If set, allows specification of a item barcode input filter','Choice'), ('itemcallnumber','082ab',NULL,'The MARC field/subfield that is used to calculate the itemcallnumber (Dewey would be 082ab or 092ab; LOC would be 050ab or 090ab) could be 852hi from an item record','free'), +('ItemTypeText', 1, NULL, 'Show/hide the item type text label. It is recommended to have ItemTypeText enabled if noItemTypeImages is disabled.', 'YesNo'), ('KohaAdminEmailAddress','root@localhost','','Define the email address where patron modification requests are sent','free'), ('LabelMARCView','standard','standard|economical','Define how a MARC record will display','Choice'), ('language','en',NULL,'Set the default language in the staff client.','Languages'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref index ba49128..d9fe912 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref @@ -2,6 +2,13 @@ Administration: # Only used internally, omitted: FrameworksLoaded, Version Interface options: - + - pref: ItemTypeText + default: 1 + choices: + yes: "Show" + no: "Don't show" + - " itemtype text labels in the catalog. NOTE: It is recommended to have ItemTypeText enabled if noItemTypeImages is disabled." + - - "Email address for the administrator of Koha: " - pref: KohaAdminEmailAddress class: email diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index b9bf9ed..117ab82 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -666,7 +666,7 @@ function verify_images() { [% IF !noItemTypeImages && item.imageurl %] [% item.translated_description %] [% END %] - [% item.translated_description %] + [% IF ( Koha.Preference('ItemTypeText') ) %][% item.translated_description %][% END %] [% END %] [% UNLESS ( singlebranchmode ) %][% Branches.GetName( item.branchcode ) %] [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt index ca6e1b1..59acde7 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -1199,7 +1199,7 @@ [% ITEM_RESULT.description %] [% END %] [% END %] - [% ITEM_RESULT.description %] + [% IF ( Koha.Preference('ItemTypeText') ) %][% ITEM_RESULT.description %][% END %] [% END %] [% UNLESS singleBranchMode %] -- 2.1.4