This feature supplies the ability to create alternate templates for Action Triggers
authorRogan Hamby <rogan.hamby@gmail.com>
Wed, 23 Feb 2022 18:55:01 +0000 (13:55 -0500)
committerRogan Hamby <rogan.hamby@gmail.com>
Wed, 23 Feb 2022 18:55:01 +0000 (13:55 -0500)
commit2542925ced2283f61fb9f8a2fc2e8a20e7eabaf6
tree1b228596e9e086eccbea4b7f15b57e94f1e055c7
parent26dfb7c6ab66ff339d73dbfc7e4d059c5ce3558a
This feature supplies the ability to create alternate templates for Action Triggers
that will generate locale specific out for Action Triggers.  If you send notices in
multiple languages, we recommend putting some words to that effect in your notice
templates.  The template, message and message title can all be localized.  To use the
feature the following new UI elements have been added:

- When you double-click on an Event Definition under Notifications / Action Triggers
  to edit it there will be a tab option for Edit Alternate Template if the reactor is
  ProcessTemplate, SendEmail or SendSMS.
- In the Patron Registration and Patron Editor screens staff members may now select a
  locale for a patron and edit it in the Patron Preferred Language field.
- Patrons may set their own locale in the My Account interface off the OPAC by going to
  Preferences -> Personal Information and setting the Preferred Language field.

The templates used on the Edit Definition tab are the defaults that are used if there are
no alternate templates available that match the preferred language.  If alternate templates
are available the system will use a locale that is an exact match and then if failing that
use one where the language code matches and then fall back to the default one.

For example, if a patron has a locale of fr-CA and there are templates for both fr-CA and
fr-FR it will use the fr-CA.  If the fr-CA template was deleted it would fall back on using
the fr-FR for the patron since it at least shares the same base language.

Valid locales are the codes defined in the i18n_locale table in the config schema.
20 files changed:
Open-ILS/examples/fm_IDL.xml
Open-ILS/src/eg2/angular.json
Open-ILS/src/eg2/src/app/staff/admin/local/triggers/trigger-edit.component.html
Open-ILS/src/eg2/src/app/staff/admin/local/triggers/trigger-edit.component.ts
Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Event.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor.pm
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
Open-ILS/src/sql/Pg/005.schema.actors.sql
Open-ILS/src/sql/Pg/400.schema.action_trigger.sql
Open-ILS/src/sql/Pg/upgrade/xxxx.schema.preferred_locale_and_alternate_at_templates.sql [new file with mode: 0644]
Open-ILS/src/templates-bootstrap/opac/css/style.css.tt2
Open-ILS/src/templates-bootstrap/opac/myopac/prefs.tt2
Open-ILS/src/templates-bootstrap/opac/myopac/update_locale.tt2 [new file with mode: 0755]
Open-ILS/src/templates/staff/circ/patron/t_edit.tt2
Open-ILS/src/templates/staff/circ/patron/t_summary.tt2
Open-ILS/web/js/ui/default/staff/circ/patron/app.js
Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js
docs/RELEASE_NOTES_NEXT/Administration/localized_action_triggers.adoc [new file with mode: 0644]