Bugzilla – Attachment 27047 Details for
Bug 766
Omnibus: Use of CGI::scrolling_list prevents customization in template
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 766: Cleaning: buildCGISort is not in use anymore
SIGNED-OFF-Bug-766-Cleaning-buildCGISort-is-not-in.patch (text/plain), 3.82 KB, created by
Bernardo Gonzalez Kriegel
on 2014-04-11 21:47:19 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 766: Cleaning: buildCGISort is not in use anymore
Filename:
MIME Type:
Creator:
Bernardo Gonzalez Kriegel
Created:
2014-04-11 21:47:19 UTC
Size:
3.82 KB
patch
obsolete
>From 3a58be61f829df63b6f614c339601f4998e372bd Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Thu, 6 Mar 2014 17:12:26 +0100 >Subject: [PATCH] [SIGNED-OFF] Bug 766: Cleaning: buildCGISort is not in use > anymore > >buildCGISort can be deleted. > >Test plan: > git grep buildCGISort >should return no result. > >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> > >No more buildCGISort >--- > C4/Input.pm | 53 ------------------------------------------------ > admin/aqplan.pl | 1 - > members/memberentry.pl | 11 +--------- > 3 files changed, 1 insertion(+), 64 deletions(-) > >diff --git a/C4/Input.pm b/C4/Input.pm >index ba30460..3804242 100644 >--- a/C4/Input.pm >+++ b/C4/Input.pm >@@ -52,7 +52,6 @@ number or ISBN is valid. > @ISA = qw(Exporter); > @EXPORT = qw( > &checkdigit >- &buildCGIsort > ); > > =item checkdigit >@@ -109,58 +108,6 @@ sub checkdigit ($;$) { > return 0; > } # sub checkdigit > >-=item buildCGISort >- >- $CGIScrollingList = &buildCGISort($name string, $input_name string); >- >-Returns the scrolling list with name $input_name, built on authorised Values named $name. >-Returns NULL if no authorised values found >- >-=cut >- >-sub buildCGIsort { >- my ( $name, $input_name, $data ) = @_; >- my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : ""; >- >- my $dbh=C4::Context->dbh; >- my $query = qq{ >- SELECT * >- FROM authorised_values >- }; >- $query .= qq{ >- LEFT JOIN authorised_values_branches ON ( id = av_id ) >- } if $branch_limit; >- $query .= qq{ >- WHERE category = ? >- }; >- $query .= qq{ AND ( branchcode = ? OR branchcode IS NULL )} if $branch_limit; >- $query .= qq{ GROUP BY lib ORDER BY lib}; >- >- my $sth=$dbh->prepare($query); >- $sth->execute( $name, $branch_limit ? $branch_limit : () ); >- my $CGISort; >- if ($sth->rows>0){ >- my @values; >- my %labels; >- >- for (my $i =0;$i<$sth->rows;$i++){ >- my $results = $sth->fetchrow_hashref; >- push @values, $results->{authorised_value}; >- $labels{$results->{authorised_value}}=$results->{lib}; >- } >- $CGISort= CGI::scrolling_list( >- -name => $input_name, >- -id => $input_name, >- -values => \@values, >- -labels => \%labels, >- -default=> $data, >- -size => 1, >- -multiple => 0); >- } >- $sth->finish; >- return $CGISort; >-} >- > END { } # module clean-up code here (global destructor) > > 1; >diff --git a/admin/aqplan.pl b/admin/aqplan.pl >index 9cc8c59..0614bab 100755 >--- a/admin/aqplan.pl >+++ b/admin/aqplan.pl >@@ -225,7 +225,6 @@ HideCols($authcat, @hide_cols); > } > # ------------------------------------------------------------ > if ( $authcat =~ m/^Asort/ ) { >- # ----------- copied from C4::Input::buildCGIsort() > my $query = qq{ SELECT * FROM authorised_values WHERE category=? order by lib }; > my $sth = $dbh->prepare($query); > $sth->execute($authcat ); >diff --git a/members/memberentry.pl b/members/memberentry.pl >index 3b042e3..dee53c5 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -621,16 +621,7 @@ if($no_categories){ > $template->param(no_add => $no_add); > # -------------------------------------------------------------------------------------------------------- > >-my $CGIsort = buildCGIsort("Bsort1","sort1",$data{'sort1'}); >-if ($CGIsort) { >- $template->param(CGIsort1 => $CGIsort); >-} >-$template->param( sort1 => $data{'sort1'}); # shouldn't this be in an "else" statement like the 2nd one? >- >-$CGIsort = buildCGIsort("Bsort2","sort2",$data{'sort2'}); >-if ($CGIsort) { >- $template->param(CGIsort2 => $CGIsort); >-} >+$template->param( sort1 => $data{'sort1'}); > $template->param( sort2 => $data{'sort2'}); > > if ($nok) { >-- >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 766
:
18538
|
18550
|
18664
|
25904
|
25905
|
25906
|
25907
|
26401
|
27010
|
27011
|
27012
|
27013
|
27014
|
27044
|
27045
|
27046
|
27047
|
27048
|
27396
|
27400
|
27441
|
27442
|
27443
|
27444
|
27445
|
27446
|
27447
|
27448
|
27479
|
27495
|
27665
|
27666
|
27667
|
27668
|
27669
|
27670
|
27671
|
29870
|
29871
|
29872
|
29877
|
30404
|
30405
|
30406
|
30428
|
30430
|
30432
|
30510
|
30511
|
30512