From de5fc8931975b0918adbd3809dd7b25ddfb3bc25 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Wed, 19 Apr 2017 00:42:17 +0000 Subject: [PATCH] [SIGNED OFF] 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 Signed-off-by: Katrin Fischer --- .../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 3e0f93b..9cd61ad 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -227,6 +227,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 ab8cfa5..08255ea 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 31f7723..fe1f57c 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 b5066fe..b6b569e 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -1210,7 +1210,7 @@ [% ITEM_RESULT.description %] [% END %] [% END %] - [% ITEM_RESULT.description %] + [% IF ( Koha.Preference('ItemTypeText') ) %][% ITEM_RESULT.description %][% END %] [% END %] [% UNLESS singleBranchMode %] -- 2.7.4