added autocomplete="off"
[koha.git] / C4 / Input.pm
index 6f0173d..2ee07f3 100644 (file)
@@ -14,11 +14,13 @@ package C4::Input; #assumes C4/Input
 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License along with
-# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
-# Suite 330, Boston, MA  02111-1307 USA
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 use strict;
+use warnings;
+
 require Exporter;
 use C4::Context;
 use CGI;
@@ -49,7 +51,7 @@ number or ISBN is valid.
 
 @ISA = qw(Exporter);
 @EXPORT = qw(
-       &checkdigit &checkvalidisbn
+       &checkdigit
        &buildCGIsort
 );
 
@@ -107,32 +109,6 @@ sub checkdigit ($;$) {
        return 0;
 } # sub checkdigit
 
-=item checkvalidisbn           # Obsolete Function!
-
-  $valid = &checkvalidisbn($isbn);
-
-Returns a true value iff C<$isbn> is a valid ISBN: it must be ten
-digits long (counting "X" as a digit), and must have a valid check
-digit at the end.
-
-sub checkvalidisbn ($) {       # Obsolete Function!
-       my ($q) = shift or return undef;
-       $q=~s/[^Xx\d]//g;
-        /(\d{9})(X|\d)/i or
-       /(\d{12})(X|\d)/i or return 0; 
-       my $checksum = $2;
-       my $isbn     = $1;
-       my $c = 0;
-       my $max = length $isbn;
-       for (my $i=0; $i<$max; $i++) {
-               my $digit=substr($q,$i,1);
-               $c+=$digit*(10-$i);
-       }
-       $c %= 11;
-       ($c==10) and $c = 'X';
-       return ($c eq $checksum) ? 1 : 0;
-}
-
 =item buildCGISort
 
   $CGIScrollingList = &buildCGISort($name string, $input_name string);
@@ -152,22 +128,22 @@ sub buildCGIsort {
        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};
+                       push @values, $results->{authorised_value};
+                       $labels{$results->{authorised_value}}=$results->{lib};
                }
-               unshift(@values,"");
                $CGISort= CGI::scrolling_list(
-                                       -name => $input_name,
-                                       -values => \@values,
-                                       -labels => \%labels,
+                                       -name => $input_name,
+                                       -id =>   $input_name,
+                                       -values => \@values,
+                                       -labels => \%labels,
                                        -default=> $data,
-                                       -size => 1,
-                                       -multiple => 0);
+                                       -size => 1,
+                                       -multiple => 0);
        }
-       $sth->finish; 
+       $sth->finish;
        return $CGISort;
 }
 END { }       # module clean-up code here (global destructor)
@@ -179,6 +155,6 @@ __END__
 
 =head1 AUTHOR
 
-Koha Developement team <info@koha.org>
+Koha Development Team <http://koha-community.org/>
 
 =cut