From 97cbb770058dbd8e360c9a383e6bcc4151831629 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 Signed-off-by: Garry Collum Signed-off-by: Mike Rylander --- 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-bootstrap/opac/parts/js.tt2 | 5 +++++ Open-ILS/src/templates/opac/parts/js.tt2 | 5 +++++ docs/RELEASE_NOTES_NEXT/OPAC/jquery_opac_setting.adoc | 8 ++++++++ 5 files changed, 43 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 4b212703c3..a0f937cacf 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -4660,6 +4660,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-bootstrap/opac/parts/js.tt2 b/Open-ILS/src/templates-bootstrap/opac/parts/js.tt2 index 51f9e3af23..87b7752a22 100755 --- a/Open-ILS/src/templates-bootstrap/opac/parts/js.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/parts/js.tt2 @@ -26,6 +26,11 @@ [% END %] +[% 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 %] + [% END %] +[% 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 %] +