From: Rogan Hamby Date: Mon, 21 Oct 2019 13:47:45 +0000 (-0400) Subject: adding query to opac by library setting X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f9dbfc41e9742d1c66b92026c3c04202d5e5efcd;p=working%2FEvergreen.git adding query to opac by library setting --- 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 %] +