From 6fd8d353d068580682420fbbfc666c25518cba4d Mon Sep 17 00:00:00 2001
From: Owen Leonard <oleonard@myacpl.org>
Date: Mon, 23 Mar 2020 20:10:15 +0000
Subject: [PATCH] Bug 24959: Fix id/label pairs in saved reports table

This patch adds a unique id attribute to each checkbox in the table of
saved reports. Also updated is the corresponding <label>'s "for"
attribute so that clicking the report id will toggle the checkbox.

To reproduce, go to Reports -> Use saved and click a number in the ID
column. Nothing happens.

After applying the patch clicking the number should check or uncheck the
corresponding checkbox.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Works Ok, no errors.
---
 .../prog/en/modules/reports/guided_reports_start.tt           | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt
index fee6ecccd6..a73aad9fdf 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt
@@ -249,12 +249,12 @@
                                                 [% UNLESS ( loop.odd ) %]<tr class="odd">[% ELSE %]<tr>[% END %]
                                                     <td class="report_checkbox">
                                                         [% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS -->
-                                                            <input type="checkbox" name="ids" value="[% savedreport.id | html %]" />
+                                                            <input type="checkbox" name="ids" id="ids[% savedreport.id | html %]" value="[% savedreport.id | html %]" />
                                                         [% END %]
                                                         <input type="hidden" class="report_sql" value="[% savedreport.savedsql |html %]">
                                                     </td>
                                                     <td class="report_id">
-                                                        <label for="ids">[% savedreport.id | html %]</label>
+                                                        <label for="ids[% savedreport.id | html %]">[% savedreport.id | html %]</label>
                                                     </td>
                                                     <td class="report_name">
                                                         [% IF ( savedreport.report_name ) %]
-- 
2.17.1