Bugzilla – Attachment 13608 Details for
Bug 8588
Duplicate field IDs cause problems with SQL report parameter entry
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8588 [3.8.x] Duplicate field IDs cause problems with SQL report parameter entry
Bug-8588-38x-Duplicate-field-IDs-cause-problems-wi.patch (text/plain), 5.02 KB, created by
Owen Leonard
on 2012-11-21 17:36:13 UTC
(
hide
)
Description:
Bug 8588 [3.8.x] Duplicate field IDs cause problems with SQL report parameter entry
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2012-11-21 17:36:13 UTC
Size:
5.02 KB
patch
obsolete
>From 226b1d45f546b9216c11eb02125ced43125f189a Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Wed, 21 Nov 2012 12:31:41 -0500 >Subject: [PATCH] Bug 8588 [3.8.x] Duplicate field IDs cause problems with SQL > report parameter entry >Content-Type: text/plain; charset="utf-8" > >Reimplemented for 3.8.x: Changes to markup and script to >enable unique ids on form fields. These changes allow for >working label+input pairs on one or more text and select >inputs and multiple working datepickers. > >To test, create a report with more than one date parameter, >at least one text parameter, and one or more authorised >value parameters. The datepickers should each work properly, >and labels should by clickable. >--- > .../en/modules/reports/guided_reports_start.tt | 22 +++++++++++++------- > reports/guided_reports.pl | 8 +++++-- > 2 files changed, 20 insertions(+), 10 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 bec1619..7343e13 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 >@@ -487,24 +487,30 @@ canned reports and writing custom SQL reports.</p> > <input type='hidden' name='reports' value="[% reports %]" /> > <h1>Enter parameters for report [% name %]:</h1> > [% IF ( notes ) %]<p>[% notes %]</p>[% END %] >+ <fieldset class="rows"> >+ <ol> > [% FOREACH sql_param IN sql_params %] > [% IF sql_param.input == 'date' %] >- <p> >- [% sql_param.entry %]: <input id="date_[% sql_param_entry %]" type="text" value="" size="10" name="sql_params"> >- <img id="date_picker_[% sql_param_entry %]" alt="Show calendar" src="/intranet-tmpl/prog/en/lib/calendar/cal.gif"> >+ <li><label for="date_[% sql_param_entry %][% loop.count %]"> >+ [% sql_param.entry %]:</label> <input id="date_[% sql_param_entry %][% loop.count %]" type="text" value="" size="10" name="sql_params" /> >+ <img id="date_picker_[% sql_param_entry %][% loop.count %]" alt="Show calendar" src="/intranet-tmpl/prog/en/lib/calendar/cal.gif" /> > <script type="text/javascript"> > Calendar.setup( { >- inputField : "date_[% sql_param_entry %]", >+ inputField : "date_[% sql_param_entry %][% loop.count %]", > ifFormat : "%Y-%m-%d", >- button : "date_picker_[% sql_param_entry %]" >+ button : "date_picker_[% sql_param_entry %][% loop.count %]" > } ); > </script> >- </p> >+ </li> >+ [% ELSIF ( sql_param.input == 'text' ) %] >+ <li><label for="sql_params[% loop.count %]">[% sql_param.entry %]: </label><input id="sql_params[% loop.count %]" type="text" name="sql_params" /></li> > [% ELSE %] >- <p>[% sql_param.entry %]: [% sql_param.input %]</p> >+ <li><label for="sql_params_[% sql_param.labelid %]">[% sql_param.entry %]:</label> [% sql_param.input %]</li> > [% END %] > [% END %] >- <input type='submit' value='Run the report'/> >+ </ol> >+ </fieldset> >+ <fieldset class="action"><input type="submit" value="Run the report"/></fieldset> > </form> > [% END %] > >diff --git a/reports/guided_reports.pl b/reports/guided_reports.pl >index 394b415..4bbf44e 100755 >--- a/reports/guided_reports.pl >+++ b/reports/guided_reports.pl >@@ -425,6 +425,7 @@ elsif ($phase eq 'Run this report'){ > for(my $i=0;$i<($#split/2);$i++) { > my ($text,$authorised_value) = split /\|/,$split[$i*2+1]; > my $input; >+ my $labelid; > if ($authorised_value eq "date") { > $input = 'date'; > } >@@ -480,8 +481,11 @@ elsif ($phase eq 'Run this report'){ > $authorised_lib{$value} = $lib; > } > } >+ $labelid = $text; >+ $labelid =~ s/\W//g; > $input =CGI::scrolling_list( # FIXME: factor out scrolling_list > -name => "sql_params", >+ -id => "sql_params_".$labelid, > -values => \@authorised_values, > # -default => $value, > -labels => \%authorised_lib, >@@ -492,9 +496,9 @@ elsif ($phase eq 'Run this report'){ > ); > > } else { >- $input = "<input type='text' name='sql_params'/>"; >+ $input = "text"; > } >- push @tmpl_parameters, {'entry' => $text, 'input' => $input }; >+ push @tmpl_parameters, {'entry' => $text, 'input' => $input, 'labelid' => $labelid }; > } > $template->param('sql' => $sql, > 'name' => $name, >-- >1.7.9.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 8588
:
11426
|
11438
| 13608