Bugzilla – Attachment 39689 Details for
Bug 14279
Remove CGI::scrolling_list from issues_avg_stats.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[Signed-off] Bug 14279: Remove CGI::scrolling_list from issues_avg_stats.pl
Signed-off-Bug-14279-Remove-CGIscrollinglist-from-.patch (text/plain), 9.60 KB, created by
Marc Véron
on 2015-05-29 14:38:01 UTC
(
hide
)
Description:
[Signed-off] Bug 14279: Remove CGI::scrolling_list from issues_avg_stats.pl
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2015-05-29 14:38:01 UTC
Size:
9.60 KB
patch
obsolete
>From c4d175063c03920bd79e90443a21d2b6deffc95e Mon Sep 17 00:00:00 2001 >From: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >Date: Tue, 26 May 2015 14:45:22 -0300 >Subject: [PATCH] [Signed-off] Bug 14279: Remove CGI::scrolling_list from > issues_avg_stats.pl >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >This patch removes scrolling_lists from this file > >To test >1) Go to Reports > Average loan time >2) Check dropdowns Patron category, Item type, Sort1/2 and Into application >will be changed >3) Apply the patch >4) Reload and check for regression > >Followed test plan. Works as expected. >Signed-off-by: Marc Véron <veron@veron.ch> >--- > .../prog/en/modules/reports/issues_avg_stats.tt | 55 ++++++++++--- > reports/issues_avg_stats.pl | 84 +++++++------------- > 2 files changed, 73 insertions(+), 66 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_avg_stats.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_avg_stats.tt >index ce4bf86..67d0a13 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_avg_stats.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_avg_stats.tt >@@ -152,32 +152,54 @@ > <td>Patron category</td> > <td><input type="radio" name="Line" value="borrowers.categorycode" /></td> > <td><input type="radio" name="Column" value="borrowers.categorycode" /></td> >- <td>[% CGIBorCat %]</td> >+ <td> >+ <select name="Filter" size="1" id="borcat"> >+ <option value=""></option> >+ [% FOREACH value IN BorCat.values %] >+ <option value="[%- value -%]">[%- BorCat.labels.$value -%]</option> >+ [% END %] >+ </select> >+ </td> > </tr> > <tr> > <td>Item type</td> > <td><input type="radio" name="Line" value="itemtype" /></td> > <td><input type="radio" name="Column" value="itemtype" /></td> >- <td >[% CGIItemType %]</td> >+ <td> >+ <select name="Filter" size="1" id="itemtypes"> >+ <option value=""></option> >+ [% FOREACH value IN ItemType.values %] >+ <option value="[%- value -%]">[%- ItemType.labels.$value -%]</option> >+ [% END %] >+ </select> >+ </td> > </tr> > <tr class="hilighted"> > <td>Library</td> > <td><input type="radio" name="Line" value="branchcode" /></td> > <td><input type="radio" name="Column" value="branchcode" /></td> >- <td><select name="Filter" size="1" id="branch"> >- <option value=""></option> >- [%- FOREACH branchloo IN branchloop %] >- <option value="[% branchloo.value %]">[% branchloo.branchname %]</option> >- [%- END %] >- </select> >- </td> >+ <td> >+ <select name="Filter" size="1" id="branch"> >+ <option value=""></option> >+ [%- FOREACH branchloo IN branchloop %] >+ <option value="[% branchloo.value %]">[% branchloo.branchname %]</option> >+ [%- END %] >+ </select> >+ </td> > </tr> > [% IF ( hassort1 ) %] > <tr class="hilighted"> > <td>Sort1</td> > <td><input type="radio" name="Line" value="borrowers.sort1" /></td> > <td><input type="radio" name="Column" value="borrowers.sort1" /></td> >- <td>[% CGISort1 %] </td> >+ <td> >+ <select name="Filter" size="1" id="sort1"> >+ <option value=""></option> >+ [%- FOREACH value IN Sort1.values %] >+ <option value="[%- value -%]">[%- value -%]</option> >+ [%- END %] >+ </select> >+ </td> > </tr> > [% END %] > [% IF ( hassort2 ) %] >@@ -185,7 +207,14 @@ > <td>Sort2</td> > <td><input type="radio" name="Line" value="borrowers.sort2" /></td> > <td><input type="radio" name="Column" value="borrowers.sort2" /></td> >- <td>[% CGISort2 %] </td> >+ <td> >+ <select name="Filter" size="1" id="sort2"> >+ <option value=""></option> >+ [%- FOREACH value IN Sort2.values %] >+ <option value="[%- value -%]">[%- value -%]</option> >+ [%- END %] >+ </select> >+ </td> > </tr> > [% END %] > </tbody> >@@ -202,7 +231,9 @@ > <label for="outputfile">To a file:</label> <input type="radio" name="output" value="file" id="outputfile" /> > <label class="inline" for="basename">Named: </label><input type="text" name="basename" id="basename" value="Export" /> > <label class="inline" for="MIME">Into an application: </label> >- [% CGIextChoice %] >+ <select name="MIME" size="1" id="MIME"> >+ <option value="CSV">CSV</option> >+ </select> > <select name="sep" id="sep" size="1"> > [% FOREACH value IN CGIsepChoice.values.sort() %] > [% IF ( value == CGIsepChoice.default ) %] >diff --git a/reports/issues_avg_stats.pl b/reports/issues_avg_stats.pl >index 90c1e4e..772acd6 100755 >--- a/reports/issues_avg_stats.pl >+++ b/reports/issues_avg_stats.pl >@@ -115,94 +115,70 @@ if ($do_it) { > } else { > my $dbh = C4::Context->dbh; > my @values; >- my %labels; >- my %select; > my $req; > $req = $dbh->prepare("select distinctrow categorycode,description from categories order by description"); > $req->execute; >- my @select; >- push @select,""; >- $select{""}=""; >+ my %labelsc; >+ my @selectc; > while (my ($value, $desc) =$req->fetchrow) { >- push @select, $value; >- $select{$value}=$desc; >+ push @selectc, $value; >+ $labelsc{$value} = $desc; > } >- my $CGIBorCat=CGI::scrolling_list( -name => 'Filter', >- -id => 'borcat', >- -values => \@select, >- -labels => \%select, >- -size => 1, >- -multiple => 0 ); >+ my $BorCat = { >+ values => \@selectc, >+ labels => \%labelsc, >+ }; > > $req = $dbh->prepare( "select distinctrow itemtype,description from itemtypes order by description"); > $req->execute; >- undef @select; >- undef %select; >- push @select,""; >- $select{""}=""; >+ my @selecti; >+ my %labelsi; > while (my ($value,$desc) =$req->fetchrow) { >- push @select, $value; >- $select{$value}=$desc; >+ push @selecti, $value; >+ $labelsi{$value}=$desc; > } >- my $CGIItemTypes=CGI::scrolling_list( -name => 'Filter', >- -id => 'itemtypes', >- -values => \@select, >- -labels => \%select, >- -size => 1, >- -multiple => 0 ); >+ my $ItemTypes = { >+ values => \@selecti, >+ labels => \%labelsi, >+ }; > > $req = $dbh->prepare("select distinctrow sort1 from borrowers where sort1 is not null order by sort1"); > $req->execute; >- undef @select; >- push @select,""; >+ my @selects1; > my $hassort1; > while (my ($value) =$req->fetchrow) { > $hassort1 =1 if ($value); >- push @select, $value; >+ push @selects1, $value; > } >- >- my $CGISort1=CGI::scrolling_list( -name => 'Filter', >- -id => 'sort1', >- -values => \@select, >- -size => 1, >- -multiple => 0 ); >+ my $Sort1 = { >+ values => \@selects1, >+ }; > > $req = $dbh->prepare("select distinctrow sort2 from borrowers where sort2 is not null order by sort2"); > $req->execute; >- undef @select; >- push @select,""; >+ my @selects2; > my $hassort2; > my $hglghtsort2; > while (my ($value) =$req->fetchrow) { > $hassort2 =1 if ($value); > $hglghtsort2= !($hassort1); >- push @select, $value; >+ push @selects2, $value; > } >- my $CGISort2=CGI::scrolling_list( -name => 'Filter', >- -id => 'sort2', >- -values => \@select, >- -size => 1, >- -multiple => 0 ); >- >- my $CGIextChoice=CGI::scrolling_list( >- -name => 'MIME', >- -id => 'MIME', >- -values => ['CSV'], # FIXME translation >- -size => 1, >- -multiple => 0 ); >+ my $Sort2 = { >+ values => \@selects2, >+ }; > > my $CGIsepChoice=GetDelimiterChoices; > > $template->param( >- CGIBorCat => $CGIBorCat, >- CGIItemType => $CGIItemTypes, >+ BorCat => $BorCat, >+ ItemType => $ItemTypes, > branchloop => GetBranchesLoop(), > hassort1 => $hassort1, > hassort2 => $hassort2, > HlghtSort2 => $hglghtsort2, >- CGISort1 => $CGISort1, >- CGISort2 => $CGISort2, >- CGIextChoice => $CGIextChoice, >+ Sort1 => $Sort1, >+ Sort2 => $Sort2, > CGIsepChoice => $CGIsepChoice > ); > output_html_with_http_headers $input, $cookie, $template->output; >-- >1.7.10.4
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 14279
:
39541
|
39689
|
39699