From f77269997a72f188ca8a733f5125175bf2b83dc2 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 13 Feb 2014 16:28:01 -0500 Subject: [PATCH] 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 Signed-off-by: Mike Rylander Signed-off-by: Dan Wells --- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 14 ++++++++++++++ .../Pg/upgrade/ZZZZZ.data.mmr-holds-formats.sql | 15 +++++++++++++++ Open-ILS/src/templates/opac/parts/config.tt2 | 2 +- 3 files changed, 30 insertions(+), 1 deletion(-) 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 1605b05bfe..08e71ab687 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -13925,5 +13925,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"), }; -- 2.43.2