From f9dbfc41e9742d1c66b92026c3c04202d5e5efcd Mon Sep 17 00:00:00 2001 From: Rogan Hamby Date: Mon, 21 Oct 2019 09:47:45 -0400 Subject: [PATCH] adding query to opac by library setting --- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 9 +++++++++ .../Pg/upgrade/xxxx.data.jquery_opac_library_setting.sql | 16 ++++++++++++++++ Open-ILS/src/templates/opac/parts/js.tt2 | 5 +++++ docs/RELEASE_NOTES_NEXT/OPAC/jquery_opac_setting.adoc | 8 ++++++++ 4 files changed, 38 insertions(+) create mode 100644 Open-ILS/src/sql/Pg/upgrade/xxxx.data.jquery_opac_library_setting.sql create mode 100644 docs/RELEASE_NOTES_NEXT/OPAC/jquery_opac_setting.adoc 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 04ca260c36..fae121e8e1 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -4444,6 +4444,15 @@ INSERT into config.org_unit_setting_type 'coust', 'description'), 'string', null) +,( 'opac.patron.custom_jquery', 'opac', + oils_i18n_gettext('opac.patron.custom_jquery', + 'Custom jQuery for the OPAC', + 'coust', 'label'), + oils_i18n_gettext('opac.patron.custom_jquery', + 'Custom jQuery for the OPAC', + 'coust', 'description'), + 'string', NULL) + ,( 'org.patron_opt_boundary', 'sec', oils_i18n_gettext('org.patron_opt_boundary', 'Patron Opt-In Boundary', diff --git a/Open-ILS/src/sql/Pg/upgrade/xxxx.data.jquery_opac_library_setting.sql b/Open-ILS/src/sql/Pg/upgrade/xxxx.data.jquery_opac_library_setting.sql new file mode 100644 index 0000000000..28fe4785ba --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/xxxx.data.jquery_opac_library_setting.sql @@ -0,0 +1,16 @@ +BEGIN; + +SELECT evergreen.upgrade_deps_block_check('xxxx', :eg_version); + +INSERT into config.org_unit_setting_type +( name, grp, label, description, datatype, fm_class ) VALUES +( 'opac.patron.custom_jquery', 'opac', + oils_i18n_gettext('opac.patron.custom_jquery', + 'Custom jQuery for the OPAC', + 'coust', 'label'), + oils_i18n_gettext('opac.patron.custom_jquery', + 'Custom jQuery for the OPAC', + 'coust', 'description'), + 'string', NULL); + +COMMIT; diff --git a/Open-ILS/src/templates/opac/parts/js.tt2 b/Open-ILS/src/templates/opac/parts/js.tt2 index 74a9bd49cf..731d1d6843 100644 --- a/Open-ILS/src/templates/opac/parts/js.tt2 +++ b/Open-ILS/src/templates/opac/parts/js.tt2 @@ -6,6 +6,11 @@ [% END; # ctx.want_jquery %] +[% IF ctx.get_org_setting(ctx.search_ou, 'opac.patron.custom_jquery') %] + [% custom_jquery = ctx.get_org_setting(ctx.search_ou, 'opac.patron.custom_jquery') %] +[% '' %] +[% END %] +