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 (-5 / +11 lines)
Lines 501-516 canned reports and writing custom SQL reports.</p> Link Here
501
        <input type='hidden' name='reports' value="[% reports %]" />
501
        <input type='hidden' name='reports' value="[% reports %]" />
502
        <h1>Enter parameters for report [% name %]:</h1>
502
        <h1>Enter parameters for report [% name %]:</h1>
503
        [% IF ( notes ) %]<p>[% notes %]</p>[% END %]
503
        [% IF ( notes ) %]<p>[% notes %]</p>[% END %]
504
        <fieldset class="rows">
505
            <ol>
504
        [% FOREACH sql_param IN sql_params %]
506
        [% FOREACH sql_param IN sql_params %]
505
            [% IF sql_param.input == 'date' %]
507
            [% IF sql_param.input == 'date' %]
506
                <p>
508
                <li>
507
                [% sql_param.entry %]: <input id="date_[% sql_param_entry %]" type="text" value="" size="10" name="sql_params" class="datepicker" />
509
                <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" class="datepicker" />
508
                </p>
510
                </li>
511
            [% ELSIF ( sql_param.input == 'text' ) %]
512
                <li><label for="sql_params[% loop.count %]">[% sql_param.entry %]: </label><input id="sql_params[% loop.count %]" type="text" name="sql_params" /></li>
509
            [% ELSE %]
513
            [% ELSE %]
510
                <p>[% sql_param.entry %]: [% sql_param.input %]</p>
514
                <li><label for="sql_params_[% sql_param.labelid %]">[% sql_param.entry %]:</label> [% sql_param.input %]</li>
511
            [% END %]
515
            [% END %]
512
        [% END %]
516
        [% END %]
513
        <input type='submit' value='Run the report'/>
517
            </ol>
518
        </fieldset>
519
        <fieldset class="action"><input type="submit" value="Run the report" /></fieldset>
514
    </form>
520
    </form>
515
[% END %]
521
[% END %]
516
522
(-)a/reports/guided_reports.pl (-3 / +6 lines)
Lines 508-513 elsif ($phase eq 'Run this report'){ Link Here
508
        for(my $i=0;$i<($#split/2);$i++) {
508
        for(my $i=0;$i<($#split/2);$i++) {
509
            my ($text,$authorised_value) = split /\|/,$split[$i*2+1];
509
            my ($text,$authorised_value) = split /\|/,$split[$i*2+1];
510
            my $input;
510
            my $input;
511
            my $labelid;
511
            if ($authorised_value eq "date") {
512
            if ($authorised_value eq "date") {
512
               $input = 'date';
513
               $input = 'date';
513
            }
514
            }
Lines 563-570 elsif ($phase eq 'Run this report'){ Link Here
563
                        $authorised_lib{$value} = $lib;
564
                        $authorised_lib{$value} = $lib;
564
                    }
565
                    }
565
                }
566
                }
567
                $labelid = $text;
568
                $labelid =~ s/\W//g;
566
                $input =CGI::scrolling_list(      # FIXME: factor out scrolling_list
569
                $input =CGI::scrolling_list(      # FIXME: factor out scrolling_list
567
                    -name     => "sql_params",
570
                    -name     => "sql_params",
571
                    -id       => "sql_params_".$labelid,
568
                    -values   => \@authorised_values,
572
                    -values   => \@authorised_values,
569
#                     -default  => $value,
573
#                     -default  => $value,
570
                    -labels   => \%authorised_lib,
574
                    -labels   => \%authorised_lib,
Lines 575-583 elsif ($phase eq 'Run this report'){ Link Here
575
                );
579
                );
576
580
577
            } else {
581
            } else {
578
                $input = "<input type='text' name='sql_params'/>";
582
                $input = "text";
579
            }
583
            }
580
            push @tmpl_parameters, {'entry' => $text, 'input' => $input };
584
            push @tmpl_parameters, {'entry' => $text, 'input' => $input, 'labelid' => $labelid };
581
        }
585
        }
582
        $template->param('sql'         => $sql,
586
        $template->param('sql'         => $sql,
583
                        'name'         => $name,
587
                        'name'         => $name,
584
- 

Return to bug 8588