Browse Source

Bug 766: remove disused routine buildCGISort

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

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
3.16.x
Jonathan Druart 10 years ago
committed by Galen Charlton
parent
commit
14def333db
  1. 53
      C4/Input.pm
  2. 1
      admin/aqplan.pl
  3. 11
      members/memberentry.pl

53
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;

1
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 );

11
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) {

Loading…
Cancel
Save