Bug 31566: 'Patrons selected' counter doubles on 'Select all'
authorOwen Leonard <oleonard@myacpl.org>
Fri, 23 Sep 2022 15:22:34 +0000 (15:22 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Mon, 3 Oct 2022 16:36:45 +0000 (13:36 -0300)
commitaa49b1bed9d131a6081b17e8217c8e9ed4b849e6
treec5dc544d3122896b7ce3c729f6ca4762ac0d7deb
parent1524afa8c716e0d7bf7379360d865fcb0544fa8d
Bug 31566: 'Patrons selected' counter doubles on 'Select all'

This patch refines the JavaScript which is run when the "Select all"
or "Clear all" controls are clicked. The script now checks to see
whether the checkbox is checked before triggering the change function.

To test, apply the patch and perform a patron search in the staff
interface which will return multiple results.

- After the patron search results are displayed, test the "Select
  all" control. The visible search results should all be checked,
  and the "Patrons selected" counter at the top should be
  incremented correctly.
- Clicking the "Select all" control again should have no effect.
  The "Patrons selected" counter should not increment again.
- Test the "Clear all" control to confirm that checkboxes are
  unchecked and the counter updates correctly.
- Test with multiple pages of patron search results to confirm
  that the controls work correctly on any page of results..

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt