View | Details | Raw Unified | Return to bug 8588
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt (-8 / +14 lines)
Lines 487-510 canned reports and writing custom SQL reports.</p> Link Here
487
        <input type='hidden' name='reports' value="[% reports %]" />
487
        <input type='hidden' name='reports' value="[% reports %]" />
488
        <h1>Enter parameters for report [% name %]:</h1>
488
        <h1>Enter parameters for report [% name %]:</h1>
489
        [% IF ( notes ) %]<p>[% notes %]</p>[% END %]
489
        [% IF ( notes ) %]<p>[% notes %]</p>[% END %]
490
        <fieldset class="rows">
491
            <ol>
490
        [% FOREACH sql_param IN sql_params %]
492
        [% FOREACH sql_param IN sql_params %]
491
            [% IF sql_param.input == 'date' %]
493
            [% IF sql_param.input == 'date' %]
492
                <p>
494
                <li><label for="date_[% sql_param_entry %][% loop.count %]">
493
                [% sql_param.entry %]: <input id="date_[% sql_param_entry %]" type="text" value="" size="10" name="sql_params">
495
                [% sql_param.entry %]:</label> <input id="date_[% sql_param_entry %][% loop.count %]" type="text" value="" size="10" name="sql_params" />
494
                <img id="date_picker_[% sql_param_entry %]" alt="Show calendar" src="/intranet-tmpl/prog/en/lib/calendar/cal.gif">
496
                <img id="date_picker_[% sql_param_entry %][% loop.count %]" alt="Show calendar" src="/intranet-tmpl/prog/en/lib/calendar/cal.gif" />
495
                <script type="text/javascript">
497
                <script type="text/javascript">
496
                      Calendar.setup( {
498
                      Calendar.setup( {
497
                         inputField : "date_[% sql_param_entry %]",
499
                         inputField : "date_[% sql_param_entry %][% loop.count %]",
498
                         ifFormat : "%Y-%m-%d",
500
                         ifFormat : "%Y-%m-%d",
499
                         button : "date_picker_[% sql_param_entry %]"
501
                         button : "date_picker_[% sql_param_entry %][% loop.count %]"
500
                      } );
502
                      } );
501
                </script>
503
                </script>
502
                </p>
504
                </li>
505
            [% ELSIF ( sql_param.input == 'text' ) %]
506
                <li><label for="sql_params[% loop.count %]">[% sql_param.entry %]: </label><input id="sql_params[% loop.count %]" type="text" name="sql_params" /></li>
503
            [% ELSE %]
507
            [% ELSE %]
504
                <p>[% sql_param.entry %]: [% sql_param.input %]</p>
508
                <li><label for="sql_params_[% sql_param.labelid %]">[% sql_param.entry %]:</label> [% sql_param.input %]</li>
505
            [% END %]
509
            [% END %]
506
        [% END %]
510
        [% END %]
507
        <input type='submit' value='Run the report'/>
511
        </ol>
512
        </fieldset>
513
        <fieldset class="action"><input type="submit" value="Run the report"/></fieldset>
508
    </form>
514
    </form>
509
[% END %]
515
[% END %]
510
516
(-)a/reports/guided_reports.pl (-3 / +6 lines)
Lines 425-430 elsif ($phase eq 'Run this report'){ Link Here
425
        for(my $i=0;$i<($#split/2);$i++) {
425
        for(my $i=0;$i<($#split/2);$i++) {
426
            my ($text,$authorised_value) = split /\|/,$split[$i*2+1];
426
            my ($text,$authorised_value) = split /\|/,$split[$i*2+1];
427
            my $input;
427
            my $input;
428
            my $labelid;
428
            if ($authorised_value eq "date") {
429
            if ($authorised_value eq "date") {
429
               $input = 'date';
430
               $input = 'date';
430
            }
431
            }
Lines 480-487 elsif ($phase eq 'Run this report'){ Link Here
480
                        $authorised_lib{$value} = $lib;
481
                        $authorised_lib{$value} = $lib;
481
                    }
482
                    }
482
                }
483
                }
484
                $labelid = $text;
485
                $labelid =~ s/\W//g;
483
                $input =CGI::scrolling_list(      # FIXME: factor out scrolling_list
486
                $input =CGI::scrolling_list(      # FIXME: factor out scrolling_list
484
                    -name     => "sql_params",
487
                    -name     => "sql_params",
488
                    -id       => "sql_params_".$labelid,
485
                    -values   => \@authorised_values,
489
                    -values   => \@authorised_values,
486
#                     -default  => $value,
490
#                     -default  => $value,
487
                    -labels   => \%authorised_lib,
491
                    -labels   => \%authorised_lib,
Lines 492-500 elsif ($phase eq 'Run this report'){ Link Here
492
                );
496
                );
493
497
494
            } else {
498
            } else {
495
                $input = "<input type='text' name='sql_params'/>";
499
                $input = "text";
496
            }
500
            }
497
            push @tmpl_parameters, {'entry' => $text, 'input' => $input };
501
            push @tmpl_parameters, {'entry' => $text, 'input' => $input, 'labelid' => $labelid };
498
        }
502
        }
499
        $template->param('sql'         => $sql,
503
        $template->param('sql'         => $sql,
500
                        'name'         => $name,
504
                        'name'         => $name,
501
- 

Return to bug 8588