From: Bill Erickson Date: Thu, 13 Feb 2014 21:28:01 +0000 (-0500) Subject: LP#1269911 global flag for opac format selector attribute X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=0ff7bbc92dcd268051cc2b7c808ae5fc4cb1e040;p=working%2FEvergreen.git LP#1269911 global flag for opac format selector attribute Adds a new config.global_flag for defining which record attribute the OPAC will use to find formats for the format selector. Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql index 9c8a287ad8..eb4a25693f 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -13868,5 +13868,19 @@ INSERT INTO config.global_flag (name, label, value, enabled) VALUES ( TRUE ); +-- until we have a custom attribute for the selector, +-- default to the icon_format attribute +INSERT INTO config.global_flag (name, label, value, enabled) VALUES ( + 'opac.format_selector.attr', + oils_i18n_gettext( + 'opac.format_selector.attr', + 'OPAC Format Selector Attribute', + 'cgf', + 'label' + ), + 'icon_format', + TRUE +); + diff --git a/Open-ILS/src/sql/Pg/upgrade/ZZZZZ.data.mmr-holds-formats.sql b/Open-ILS/src/sql/Pg/upgrade/ZZZZZ.data.mmr-holds-formats.sql index 690d919a23..bab086ebfb 100644 --- a/Open-ILS/src/sql/Pg/upgrade/ZZZZZ.data.mmr-holds-formats.sql +++ b/Open-ILS/src/sql/Pg/upgrade/ZZZZZ.data.mmr-holds-formats.sql @@ -12,6 +12,21 @@ INSERT INTO config.global_flag (name, label, value, enabled) VALUES ( TRUE ); +-- until we have a custom attribute for the selector, +-- default to the icon_format attribute +INSERT INTO config.global_flag (name, label, value, enabled) VALUES ( + 'opac.format_selector.attr', + oils_i18n_gettext( + 'opac.format_selector.attr', + 'OPAC Format Selector Attribute', + 'cgf', + 'label' + ), + 'icon_format', + TRUE +); + + INSERT INTO config.record_attr_definition (name, label, multi, filter, composite) VALUES ( diff --git a/Open-ILS/src/templates/opac/parts/config.tt2 b/Open-ILS/src/templates/opac/parts/config.tt2 index 509d6a1305..618d63a669 100644 --- a/Open-ILS/src/templates/opac/parts/config.tt2 +++ b/Open-ILS/src/templates/opac/parts/config.tt2 @@ -147,7 +147,7 @@ search.default_qtypes = ['keyword','title','author']; search.basic_config = { type => 'attr', - group => [ctx.get_cgf('opac.icon_attr').value, 'item_type'], + group => [ctx.get_cgf('opac.format_selector.attr').value, 'item_type'], none_label => l("All Formats"), };