Bug 12693

Summary: colspan calculation done by members/statistics.pl should be moved to template
Product: Koha Reporter: Owen Leonard <oleonard>
Component: PatronsAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: minor    
Priority: P5 - low CC: gmcharlt, kyle.m.hall, m.de.rooy, tomascohen, veron
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: Trivial patch Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 12693 - colspan calculation done by members/statistics.pl should be moved to template
[Signed-off] Bug 12693 - colspan calculation done by members/statistics.pl should be moved to template
Bug 12693 - colspan calculation done by members/statistics.pl should be moved to template

Description Owen Leonard 2014-08-01 18:56:16 UTC
members/statistics.pl contains some code to calculate how many columns of the main table the footer's total column should span.

As the colspan value is purely a display consideration, the logic should be moved to the template.

members/statistics.pl:    length_keys    => scalar( @statistic_column_names),
koha-tmpl/intranet-tmpl/prog/en/modules/members/statistics.tt:                        <td colspan="[% length_keys %]">TOTAL</td>
[+] Comment 1 Owen Leonard 2014-08-01 19:12:01 UTC Comment hidden (obsolete)
[+] Comment 2 Marc Véron 2014-08-05 09:11:56 UTC Comment hidden (obsolete)
Comment 3 Marcel de Rooy 2014-08-07 11:12:50 UTC
Created attachment 30572 [details] [review]
Bug 12693 - colspan calculation done by members/statistics.pl should be moved to template

It is not necessary for the patron statistics script to pass a colspan
value to the template. The number can be output using Template::Toolkit
syntax.

To test, view the statistics page for a patron. Confirm that the "Total"
cell in the footer spans the correct number of columns. Test with
various numbers of fields in the StatisticsFields system preference.

Followed test plan. Patch behaves as expected.
Signed-off-by: Marc Veron <veron@veron.ch>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 4 Tomás Cohen Arazi (tcohen) 2014-08-11 18:57:01 UTC
Patch pushed to master.

Thanks Owen!