In Cataloging -> Automatic item modifications by age, when adding or editing a rule there are several dropdowns for selecting which column in the items or biblioitems tables to use. These lists are currently not in alphabetical order, making it hard to locate the field you want. We can add the Template::Toolkit "sort" method to sort them alphabetically.
Created attachment 158120 [details] [review] Bug 35198: Sort database column names alphabetically on automatic item modification page This patch modifies the automatic item modification by age page so that the rule entry form sorts <select>s alphabetically, making it easier to find the entry you need. The [% FOR field IN... %] directives now include the "sort" method, e.g. [% FOR field IN agefields.sort %] To test, apply the patch and go to Cataloging -> Item modifications by age - Click the "Add rules" button, then the "Add rule" button. - Check the "Age field," "Conditions," and "Substitutions" dropdowns to confirm that the choices are listed alphabetically. - Fill in the form and save the rule. - Go back and edit the rule you created. Check that the dropdowns are still correct.
Created attachment 158176 [details] [review] Bug 35198: Sort database column names alphabetically on automatic item modification page This patch modifies the automatic item modification by age page so that the rule entry form sorts <select>s alphabetically, making it easier to find the entry you need. The [% FOR field IN... %] directives now include the "sort" method, e.g. [% FOR field IN agefields.sort %] To test, apply the patch and go to Cataloging -> Item modifications by age - Click the "Add rules" button, then the "Add rule" button. - Check the "Age field," "Conditions," and "Substitutions" dropdowns to confirm that the choices are listed alphabetically. - Fill in the form and save the rule. - Go back and edit the rule you created. Check that the dropdowns are still correct. Signed-off-by: Andrew Auld <andrew.auld@ptfs-europe.com>
Brilliant job Owen, works perfectly!
Created attachment 158225 [details] [review] Bug 35198: Sort database column names alphabetically on automatic item modification page This patch modifies the automatic item modification by age page so that the rule entry form sorts <select>s alphabetically, making it easier to find the entry you need. The [% FOR field IN... %] directives now include the "sort" method, e.g. [% FOR field IN agefields.sort %] To test, apply the patch and go to Cataloging -> Item modifications by age - Click the "Add rules" button, then the "Add rule" button. - Check the "Age field," "Conditions," and "Substitutions" dropdowns to confirm that the choices are listed alphabetically. - Fill in the form and save the rule. - Go back and edit the rule you created. Check that the dropdowns are still correct. Signed-off-by: Andrew Auld <andrew.auld@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Pushed to master for 23.11. Nice work everyone, thanks!
Small enhancement, I choose to backport. Pushed to 23.05.x for 23.05.06
Nice work everyone! Pushed to 22.11.x for next release