Koha/admin
Matt Blenkinsop 82e2547e1b
Bug 32721: Add branch specific userjs and usercss
This patch allows for branch specific userJS and userCSS to be added through the libraries table. This works in conjunction with the global UserJS and UserCSS functionality and allows for multiple OPACs with different css and js options.

Test plan:
1) Add to apache conf (/etc/apache2/sites-available/kohadev.conf)
    SetEnv OPAC_BRANCH_DEFAULT "FFL"
    RequestHeader add X-Koha-SetEnv "OPAC_BRANCH_DEFAULT FFL"
2) In the container, run restart_all
3) Navigate to the OPACUserJS and OPACUserCSS system preferences and add the following: OPACUserJS - console.log('Hello from global sysprefs');, OPACUserCSS - 'body { background-color: black; }'
4) Refresh the OPAC and the background should be black and the message should be logged to the console in developer tools
5) Navigate to Administration > Libraries
6) On the Fairfield branch (if this does not exist you will need to create a branch with a code matching the code that you added to the apache conf file), click edit
7) At the bottom there should be two fields to add userjs and usercss, complete with Codemirror syntax checking
8) In userjs add console.log('Hello from branch level'); and in usercss add 'body { background-color: blue; } then save
9) Return to the OPAC and refresh
10) If you are logged out of the OPAC it should now be logging both the message from global and from the branch level and the background should be blue (if not you will need to log out)
11) Log back into the OPAC using a user that DOES NOT have a default branch matching the branch you added to the Apache conf
12) The OPAC should now revert to only showing the global message in the console with a black background

Sponsored-by: PTFS Europe

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-19 16:00:52 -03:00
..
searchengine/elasticsearch Bug 34740: Update sort options in ES config to by Yes/No 2023-09-18 15:31:52 -03:00
additional-fields.pl Bug 11844: Use additional fields for order lines 2023-05-16 12:58:38 +02:00
admin-home.pl Bug 31401: Update administration sidebar to match entries on administration start page 2022-09-07 13:55:32 -07:00
adveditorshortcuts.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
aqbudgetperiods.pl Bug 30718: Use flatpickr's altInput 2022-08-19 08:26:31 -03:00
aqbudgets.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
aqcontract.pl Bug 30718: Use flatpickr's altInput 2022-08-19 08:26:31 -03:00
aqplan.pl Bug 28327: Unify CSV delimiter special behavior for tabulation 2022-08-19 15:53:12 -03:00
audio_alerts.pl Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
auth_subfields_structure.pl Bug 33341: Address some perlcritic errors in 5.36 2023-03-28 14:50:33 +02:00
auth_tag_structure.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
authorised_values.pl Bug 31976: Incorrect default category selected by authorized values page 2022-10-27 09:46:58 -03:00
authtypes.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
background_jobs.pl Bug 32922: Remove space in shebang 2023-02-20 09:44:06 -03:00
biblio_framework.pl Bug 31196: Remove 'default_value_for_mod_marc-' clear_from_cache calls 2022-10-25 11:16:57 -03:00
branch_transfer_limits.pl Bug 18247: Remove SQL queries from branch_transfer_limit.pl 2023-01-27 16:10:22 -03:00
branches.pl Bug 32721: Add branch specific userjs and usercss 2023-10-19 16:00:52 -03:00
cash_registers.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
categories.pl Bug 30718: Use flatpickr's altInput 2022-08-19 08:26:31 -03:00
check_budget_parent.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
check_parent_total.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
checkmarc.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
cities.pl Bug 32922: Remove space in shebang 2023-02-20 09:44:06 -03:00
classsources.pl Bug 32922: Remove space in shebang 2023-02-20 09:44:06 -03:00
clone-rules.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
columns_settings.pl Bug 29723: (QA follow-up) Correct scroll to table 2022-08-16 10:12:27 -03:00
columns_settings.yml Bug 30719: (QA follow-up) Squash: 2023-10-17 14:45:18 -03:00
credit_types.pl Bug 32922: Remove space in shebang 2023-02-20 09:44:06 -03:00
curbside_pickup.pl Bug 32922: Remove space in shebang 2023-02-20 09:44:06 -03:00
currency.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
debit_types.pl Bug 32450: Noissuescharge debit type exclusions 2023-05-17 10:25:06 -03:00
desks.pl Bug 32922: Remove space in shebang 2023-02-20 09:44:06 -03:00
didyoumean.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
edi_accounts.pl Bug 34261: Add missing argument to show_account 2023-07-14 15:23:16 -03:00
edi_ean_accounts.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
identity_providers.pl Bug 32139: Set "update on login" correctly when creating new IdP 2022-11-09 13:32:46 -03:00
ill_batch_statuses.pl Bug 30719: (QA follow-up) Squash: 2023-10-17 14:45:18 -03:00
import_export_authtype.pl Bug 13952: (follow-up) JS translatability, clean warns, other 2022-04-04 16:23:46 +02:00
import_export_framework.pl Bug 13952: (follow-up) Fixing export on default biblio framework 2022-04-04 16:23:45 +02:00
item_circulation_alerts.pl Bug 32122: Correct permissions check on item circulation alerts 2022-11-07 11:17:40 -03:00
items_search_field.pl Bug 34401: Fix inconsistencies in Item search fields page titles, breadcrumbs, and headers 2023-10-17 14:45:29 -03:00
items_search_fields.pl Bug 34401: Fix inconsistencies in Item search fields page titles, breadcrumbs, and headers 2023-10-17 14:45:29 -03:00
itemtypes.pl Bug 29859: Use iterator instead of as_list 2022-02-09 15:36:23 -10:00
koha2marclinks.pl Bug 31196: Remove 'default_value_for_mod_marc-' clear_from_cache calls 2022-10-25 11:16:57 -03:00
library_groups.pl Bug 9525: (QA follow-up) Tidy 2023-10-04 16:40:12 -04:00
localization.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
marc-overlay-rules.pl Bug 33335: (QA follow-up) Polishing and comments 2023-05-12 17:50:09 -03:00
marc_subfields_structure.pl Bug 34393: Fix inconsistencies in MARC bibliographic framework page titles, breadcrumbs, and header 2023-10-09 11:41:30 -03:00
marctagstructure.pl Bug 31196: Remove 'default_value_for_mod_marc-' clear_from_cache calls 2022-10-25 11:16:57 -03:00
matching-rules.pl Bug 32922: Remove space in shebang 2023-02-20 09:44:06 -03:00
oai_set_mappings.pl Bug 32797: Check if fields have a value, not if true 2023-02-03 10:30:07 -03:00
oai_sets.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
overdrive.pl Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
patron-attr-types.pl Bug 32922: Remove space in shebang 2023-02-20 09:44:06 -03:00
preferences.pl Bug 31731: Offer user a dropdown of authorized values instead of a text field in preferences 2023-10-10 10:54:00 -03:00
restrictions.pl Bug 16223: Tidy 2023-10-11 12:13:12 -03:00
search_filters.pl Bug 17170: Minor fixes 2022-10-21 11:15:21 -03:00
share_content.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
smart-rules.pl Bug 32271: (QA follow-up) Convert all positive numbers to monetary float and convert all 0 equivilents to blank value 2023-07-19 13:00:37 -03:00
sms_providers.pl Bug 29859: Use iterator instead of as_list 2022-02-09 15:36:23 -10:00
smtp_servers.pl Bug 34616: Fix showing default server info on edit SMTP server page 2023-09-01 11:07:30 -03:00
sru_modmapping.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
systempreferences.pl Bug 34369: Require CSRF token for updating system preferences 2023-09-25 18:18:40 -03:00
transfer_limits.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
transport-cost-matrix.pl Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
usage_statistics.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
z3950servers.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00