Bug 32918 - ERM authorized values should be in installer/data/mysql/en/mandatory/auth_values.yml
Summary: ERM authorized values should be in installer/data/mysql/en/mandatory/auth_val...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Installation and upgrade (web-based installer) (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Caroline Cyr La Rose
QA Contact: Testopia
URL:
Keywords:
Depends on: 32030
Blocks:
  Show dependency treegraph
 
Reported: 2023-02-08 21:14 UTC by Caroline Cyr La Rose
Modified: 2023-12-28 20:43 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00,22.11.04
Circulation function:


Attachments
Bug 32918: ERM authorized values should be in installer/data/mysql/en/mandatory/auth_values.yml (11.82 KB, patch)
2023-02-08 22:22 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 32918: ERM authorized values should be in installer/data/mysql/en/mandatory/auth_values.yml (11.66 KB, patch)
2023-02-09 16:13 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 32918: ERM authorized values should be in installer/data/mysql/en/mandatory/auth_values.yml (11.71 KB, patch)
2023-02-20 23:01 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 32918: (follow-up) Add new lines for formatting consistency (6.65 KB, patch)
2023-02-20 23:01 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 32918: ERM authorized values should be in installer/data/mysql/en/mandatory/auth_values.yml (11.79 KB, patch)
2023-02-22 12:38 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 32918: (follow-up) Add new lines for formatting consistency (6.73 KB, patch)
2023-02-22 12:38 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Caroline Cyr La Rose 2023-02-08 21:14:45 UTC
Currently, the authorized values for the ERM categories are in 

installer/data/mysql/mandatory/auth_val_cat.sql

which is the file for authorized value categories, and not translatable.

These should be moved to 

installer/data/mysql/en/mandatory/auth_values.yml

so that each language can translate them.
Comment 1 Caroline Cyr La Rose 2023-02-08 22:22:15 UTC
Created attachment 146413 [details] [review]
Bug 32918: ERM authorized values should be in installer/data/mysql/en/mandatory/auth_values.yml

This patch moves the authorized value insertions for ERM categories into
the language-specific auth_values.yml file.

To test:
1. Count the number of authorized values in the mandatory categories

select count(*) from authorised_values where category in ('YES_NO', 'PAYMENT_TYPE', 'HSBND_FREQ', 'ERM_AGREEMENT_STATUS', 'ERM_AGREEMENT_CLOSURE_REASON', 'ERM_AGREEMENT_RENEWAL_PRIORITY', 'ERM_USER_ROLES', 'ERM_LICENSE_TYPE', 'ERM_LICENSE_STATUS', 'ERM_AGREEMENT_LICENSE_STATUS', 'ERM_AGREEMENT_LICENSE_LOCATION', 'ERM_PACKAGE_TYPE', 'ERM_PACKAGE_CONTENT_TYPE', 'ERM_TITLE_PUBLICATION_TYPE', 'COUNTRY', 'LANG', 'qualif');

--> There should be 929

2. Delete the authorized values from these categories

delete from authorised_values where category in ('YES_NO', 'PAYMENT_TYPE', 'HSBND_FREQ', 'ERM_AGREEMENT_STATUS', 'ERM_AGREEMENT_CLOSURE_REASON', 'ERM_AGREEMENT_RENEWAL_PRIORITY', 'ERM_USER_ROLES', 'ERM_LICENSE_TYPE', 'ERM_LICENSE_STATUS', 'ERM_AGREEMENT_LICENSE_STATUS', 'ERM_AGREEMENT_LICENSE_LOCATION', 'ERM_PACKAGE_TYPE', 'ERM_PACKAGE_CONTENT_TYPE', 'ERM_TITLE_PUBLICATION_TYPE', 'COUNTRY', 'LANG', 'qualif');

3. Apply patch
4. Load the mandatory authorized values

./misc/load_yaml.pl --file installer/data/mysql/en/mandatory/auth_values.yml --load

5. Redo step 1
   --> There should be the same number (929)
6. Update translations

cd misc/translator
./translate update xx-XX

7. Search the po/xx-XX-installer.po file for any of the loaded
   authorized values

   For example,

   grep AbstractAndIndex po/xx-XX-installer.po
   grep "Abstract and index" po/xx-XX-installer.po

   --> authorized values and descriptions should be translatable
Comment 2 Caroline Cyr La Rose 2023-02-09 16:13:59 UTC
Created attachment 146438 [details] [review]
Bug 32918: ERM authorized values should be in installer/data/mysql/en/mandatory/auth_values.yml

This patch moves the authorized value insertions for ERM categories into
the language-specific auth_values.yml file.

To test:
1. Count the number of authorized values in the mandatory categories

select count(*) from authorised_values where category in ('YES_NO', 'PAYMENT_TYPE', 'HSBND_FREQ', 'ERM_AGREEMENT_STATUS', 'ERM_AGREEMENT_CLOSURE_REASON', 'ERM_AGREEMENT_RENEWAL_PRIORITY', 'ERM_USER_ROLES', 'ERM_LICENSE_TYPE', 'ERM_LICENSE_STATUS', 'ERM_AGREEMENT_LICENSE_STATUS', 'ERM_AGREEMENT_LICENSE_LOCATION', 'ERM_PACKAGE_TYPE', 'ERM_PACKAGE_CONTENT_TYPE', 'ERM_TITLE_PUBLICATION_TYPE', 'COUNTRY', 'LANG', 'qualif');

--> There should be 929

2. Delete the authorized values from these categories

delete from authorised_values where category in ('YES_NO', 'PAYMENT_TYPE', 'HSBND_FREQ', 'ERM_AGREEMENT_STATUS', 'ERM_AGREEMENT_CLOSURE_REASON', 'ERM_AGREEMENT_RENEWAL_PRIORITY', 'ERM_USER_ROLES', 'ERM_LICENSE_TYPE', 'ERM_LICENSE_STATUS', 'ERM_AGREEMENT_LICENSE_STATUS', 'ERM_AGREEMENT_LICENSE_LOCATION', 'ERM_PACKAGE_TYPE', 'ERM_PACKAGE_CONTENT_TYPE', 'ERM_TITLE_PUBLICATION_TYPE', 'COUNTRY', 'LANG', 'qualif');

3. Apply patch
4. Load the mandatory authorized values

./misc/load_yaml.pl --file installer/data/mysql/en/mandatory/auth_values.yml --load

5. Redo step 1
   --> There should be the same number (929)
6. Update translations

cd misc/translator
./translate update xx-XX

7. Search the po/xx-XX-installer.po file for any of the loaded
   authorized values

   For example,

   grep "Abstract and index" po/xx-XX-installer.po

   --> descriptions should be translatable
Comment 3 Caroline Cyr La Rose 2023-02-09 16:17:19 UTC
I had originally made the authorized values themselves translatable since they are English words, and for historical and legal reasons, that doesn't always fly here. 

Unfortunately, some of them trigger actions (like the 'closed' ERM_AGREEMENT_STATUS makes the 'Closure reason' drop down active in agreements), so we can't translate them... at least not all of them. Since I'm not sure which ones trigger actions, I removed all of them from the translations. Now, only the descriptions are translatable.
Comment 4 Katrin Fischer 2023-02-20 22:55:25 UTC
(In reply to Caroline Cyr La Rose from comment #3)
> I had originally made the authorized values themselves translatable since
> they are English words, and for historical and legal reasons, that doesn't
> always fly here. 
> 
> Unfortunately, some of them trigger actions (like the 'closed'
> ERM_AGREEMENT_STATUS makes the 'Closure reason' drop down active in
> agreements), so we can't translate them... at least not all of them. Since
> I'm not sure which ones trigger actions, I removed all of them from the
> translations. Now, only the descriptions are translatable.

Looking at the values I wish they'd follow a bit more closely recommendations for authorised values, not using _ (we do recommend against these for locations and collections for search reasons) and using capital letters. It would also make it easier to see that these are CODES and not words.

But... as Caroline said, we cannot change this easily and it's an oversight that is hard to fix now (and certainly should not be fixed here.
Comment 5 Katrin Fischer 2023-02-20 23:01:06 UTC
Created attachment 146983 [details] [review]
Bug 32918: ERM authorized values should be in installer/data/mysql/en/mandatory/auth_values.yml

This patch moves the authorized value insertions for ERM categories into
the language-specific auth_values.yml file.

To test:
1. Count the number of authorized values in the mandatory categories

select count(*) from authorised_values where category in ('YES_NO', 'PAYMENT_TYPE', 'HSBND_FREQ', 'ERM_AGREEMENT_STATUS', 'ERM_AGREEMENT_CLOSURE_REASON', 'ERM_AGREEMENT_RENEWAL_PRIORITY', 'ERM_USER_ROLES', 'ERM_LICENSE_TYPE', 'ERM_LICENSE_STATUS', 'ERM_AGREEMENT_LICENSE_STATUS', 'ERM_AGREEMENT_LICENSE_LOCATION', 'ERM_PACKAGE_TYPE', 'ERM_PACKAGE_CONTENT_TYPE', 'ERM_TITLE_PUBLICATION_TYPE', 'COUNTRY', 'LANG', 'qualif');

--> There should be 929

2. Delete the authorized values from these categories

delete from authorised_values where category in ('YES_NO', 'PAYMENT_TYPE', 'HSBND_FREQ', 'ERM_AGREEMENT_STATUS', 'ERM_AGREEMENT_CLOSURE_REASON', 'ERM_AGREEMENT_RENEWAL_PRIORITY', 'ERM_USER_ROLES', 'ERM_LICENSE_TYPE', 'ERM_LICENSE_STATUS', 'ERM_AGREEMENT_LICENSE_STATUS', 'ERM_AGREEMENT_LICENSE_LOCATION', 'ERM_PACKAGE_TYPE', 'ERM_PACKAGE_CONTENT_TYPE', 'ERM_TITLE_PUBLICATION_TYPE', 'COUNTRY', 'LANG', 'qualif');

3. Apply patch
4. Load the mandatory authorized values

./misc/load_yaml.pl --file installer/data/mysql/en/mandatory/auth_values.yml --load

5. Redo step 1
   --> There should be the same number (929)
6. Update translations

cd misc/translator
./translate update xx-XX

7. Search the po/xx-XX-installer.po file for any of the loaded
   authorized values

   For example,

   grep "Abstract and index" po/xx-XX-installer.po

   --> descriptions should be translatable

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 Katrin Fischer 2023-02-20 23:01:08 UTC
Created attachment 146984 [details] [review]
Bug 32918: (follow-up) Add new lines for formatting consistency

This adds new lines between each authorised value for better
readability and to match the formatting of the rest of the file.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 7 Jonathan Druart 2023-02-22 12:38:41 UTC
Created attachment 147132 [details] [review]
Bug 32918: ERM authorized values should be in installer/data/mysql/en/mandatory/auth_values.yml

This patch moves the authorized value insertions for ERM categories into
the language-specific auth_values.yml file.

To test:
1. Count the number of authorized values in the mandatory categories

select count(*) from authorised_values where category in ('YES_NO', 'PAYMENT_TYPE', 'HSBND_FREQ', 'ERM_AGREEMENT_STATUS', 'ERM_AGREEMENT_CLOSURE_REASON', 'ERM_AGREEMENT_RENEWAL_PRIORITY', 'ERM_USER_ROLES', 'ERM_LICENSE_TYPE', 'ERM_LICENSE_STATUS', 'ERM_AGREEMENT_LICENSE_STATUS', 'ERM_AGREEMENT_LICENSE_LOCATION', 'ERM_PACKAGE_TYPE', 'ERM_PACKAGE_CONTENT_TYPE', 'ERM_TITLE_PUBLICATION_TYPE', 'COUNTRY', 'LANG', 'qualif');

--> There should be 929

2. Delete the authorized values from these categories

delete from authorised_values where category in ('YES_NO', 'PAYMENT_TYPE', 'HSBND_FREQ', 'ERM_AGREEMENT_STATUS', 'ERM_AGREEMENT_CLOSURE_REASON', 'ERM_AGREEMENT_RENEWAL_PRIORITY', 'ERM_USER_ROLES', 'ERM_LICENSE_TYPE', 'ERM_LICENSE_STATUS', 'ERM_AGREEMENT_LICENSE_STATUS', 'ERM_AGREEMENT_LICENSE_LOCATION', 'ERM_PACKAGE_TYPE', 'ERM_PACKAGE_CONTENT_TYPE', 'ERM_TITLE_PUBLICATION_TYPE', 'COUNTRY', 'LANG', 'qualif');

3. Apply patch
4. Load the mandatory authorized values

./misc/load_yaml.pl --file installer/data/mysql/en/mandatory/auth_values.yml --load

5. Redo step 1
   --> There should be the same number (929)
6. Update translations

cd misc/translator
./translate update xx-XX

7. Search the po/xx-XX-installer.po file for any of the loaded
   authorized values

   For example,

   grep "Abstract and index" po/xx-XX-installer.po

   --> descriptions should be translatable

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 8 Jonathan Druart 2023-02-22 12:38:44 UTC
Created attachment 147133 [details] [review]
Bug 32918: (follow-up) Add new lines for formatting consistency

This adds new lines between each authorised value for better
readability and to match the formatting of the rest of the file.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 9 Tomás Cohen Arazi (tcohen) 2023-02-22 13:11:23 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 10 Martin Renvoize (ashimema) 2023-02-27 13:38:44 UTC
Many hands makes light work, thankyou everyone!

Pushed to 22.11.x for the next release
Comment 11 Lucas Gass (lukeg) 2023-03-08 13:12:46 UTC
Not needed for 22.05.x, no backport.