Bug 35198 - Sort database column names alphabetically on automatic item modification page
Summary: Sort database column names alphabetically on automatic item modification page
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-31 13:47 UTC by Owen Leonard
Modified: 2023-11-14 14:50 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.11.00,23.05.06,22.11.12


Attachments
Bug 35198: Sort database column names alphabetically on automatic item modification page (4.46 KB, patch)
2023-10-31 13:54 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 35198: Sort database column names alphabetically on automatic item modification page (4.52 KB, patch)
2023-11-01 12:24 UTC, PTFS Europe Sandboxes
Details | Diff | Splinter Review
Bug 35198: Sort database column names alphabetically on automatic item modification page (4.58 KB, patch)
2023-11-01 22:49 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2023-10-31 13:47:34 UTC
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.
Comment 1 Owen Leonard 2023-10-31 13:54:25 UTC
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.
Comment 2 PTFS Europe Sandboxes 2023-11-01 12:24:38 UTC
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>
Comment 3 Andrew Auld 2023-11-01 12:25:54 UTC
Brilliant job Owen, works perfectly!
Comment 4 Katrin Fischer 2023-11-01 22:49:11 UTC
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>
Comment 5 Tomás Cohen Arazi 2023-11-08 14:43:02 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 6 Fridolin Somers 2023-11-10 21:13:31 UTC
Small enhancement, I choose to backport.

Pushed to 23.05.x for 23.05.06
Comment 7 Pedro Amorim 2023-11-14 14:50:24 UTC
Nice work everyone!

Pushed to 22.11.x for next release