fugfixes from Dombes Abbey work
[koha.git] / moditem.pl
index 46093a6..5933f85 100755 (executable)
@@ -1,9 +1,29 @@
 #!/usr/bin/perl
 
+# $Id$
+
 #script to modify/delete biblios
 #written 8/11/99
 # modified 11/11/99 by chris@katipo.co.nz
 
+
+# Copyright 2000-2002 Katipo Communications
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# 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
+
 use strict;
 
 use C4::Search;
@@ -38,14 +58,16 @@ my %inputs;
 #the value is a tab separated list, the first item being the input type
 #$inputs{'Author'}="text\t$data->{'author'}\t0";
 #$inputs{'Title'}="text\t$data->{'title'}\t1";
-my $dewey = $data->{'dewey'};                                                      
-$dewey =~ s/0+$//;                                                                 
-if ($dewey eq "000.") { $dewey = "";};                                             
-if ($dewey < 10){$dewey='00'.$dewey;}                                              
-if ($dewey < 100 && $dewey > 10){$dewey='0'.$dewey;}                               
-if ($dewey <= 0){                                                                  
-  $dewey='';                                                                       
-} 
+# FIXME - The Dewey code is a string, not a number. And "000" is a
+# perfectly acceptable value.
+my $dewey = $data->{'dewey'};
+$dewey =~ s/0+$//;
+if ($dewey eq "000.") { $dewey = "";};
+if ($dewey < 10){$dewey='00'.$dewey;}
+if ($dewey < 100 && $dewey > 10){$dewey='0'.$dewey;}
+if ($dewey <= 0){
+  $dewey='';
+}
 $dewey=~ s/\.$//;
 $inputs{'Barcode'}="text\t$item->{'barcode'}\t0";
 $inputs{'Class'}="hidden\t$data->{'classification'}$dewey$data->{'subclass'}\t2";
@@ -122,17 +144,17 @@ if ($item->{'wthdrawn'} ==0){
 }
 print <<printend
 >No</td></tr>
-<input type=hidden name=bibnum value="$data->{'biblionumber'}">        
+<input type=hidden name=bibnum value="$data->{'biblionumber'}">
 <input type=hidden name=bibitemnum value="$data->{'biblioitemnumber'}">
 <input type=hidden name=itemnumber value="$itemnum">
 <tr valign=top bgcolor=white><td></td><td>
 
-<input type=image  name=submit src=/images/save-changes.gif border=0 width=187 
+<input type=image  name=submit src=/images/save-changes.gif border=0 width=187
 height=42></td></tr>
 </table>
 </form></td></tr>
 </table>
-       
+
 printend
 ;