A new Date.pm to use for all date calculations. Mysql date calculations removed from...
[koha-ffzg.git] / C4 / Input.pm
index 430a276..07e90cb 100644 (file)
@@ -21,7 +21,6 @@ package C4::Input; #assumes C4/Input
 use strict;
 require Exporter;
 use C4::Context;
-use CGI;
 
 use vars qw($VERSION @ISA @EXPORT);
 
@@ -180,15 +179,11 @@ Returns the scrolling list with name $input_name, built on authorised Values nam
 Returns NULL if no authorised values found
 
 =cut
-#'
-#--------------------------------------
-# Determine if a number is a valid ISBN number, according to length
-#   of 10 digits and valid checksum
 sub buildCGIsort {
     use strict;
        my ($name,$input_name,$data) = @_;
        my $dbh=C4::Context->dbh;
-       my $query=qq{SELECT * FROM authorised_values WHERE category=?};
+       my $query=qq{SELECT * FROM authorised_values WHERE category=? order by lib};
        my $sth=$dbh->prepare($query);
        $sth->execute($name);
        my $CGISort;
@@ -207,7 +202,8 @@ sub buildCGIsort {
                                        -default=> $data,
                                        -size => 1,
                                        -multiple => 0);
-       } 
+       }
+       $sth->finish; 
        return $CGISort;
 }
 END { }       # module clean-up code here (global destructor)