Added LSB information and copyright headers to two scripts in misc/bin. Thanks to...
[koha_gimpoz] / tools / import_borrowers.pl
index ebbff4f..6141998 100755 (executable)
@@ -1,6 +1,7 @@
 #!/usr/bin/perl
 
-# Copyright 2007 Liblime Ltd
+# Copyright 2007 Liblime
+# Parts copyright 2010 BibLibre
 #
 # This file is part of Koha.
 #
@@ -13,9 +14,9 @@
 # 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.
 
 # Script to take some borrowers data in a known format and load it into Koha
 #
@@ -147,7 +148,7 @@ if ( $uploadborrowers && length($uploadborrowers) > 0 ) {
         } elsif (@columns == @columnkeys) {
             @borrower{@columnkeys} = @columns;
             # MJR: try to fill blanks gracefully by using default values
-            foreach my $key (@criticals) {
+            foreach my $key (@columnkeys) {
                 if ($borrower{$key} !~ /\S/) {
                     $borrower{$key} = $defaults{$key};
                 }
@@ -212,7 +213,7 @@ if ( $uploadborrowers && length($uploadborrowers) > 0 ) {
         my $borrowernumber;
         my $member;
         if ( ($matchpoint eq 'cardnumber') && ($borrower{'cardnumber'}) ) {
-            $member = GetMember( $borrower{'cardnumber'}, 'cardnumber' );
+            $member = GetMember( 'cardnumber' => $borrower{'cardnumber'} );
             if ($member) {
                 $borrowernumber = $member->{'borrowernumber'};
             }