diff --git a/misc/devel/create_superlibrarian.pl b/misc/devel/create_superlibrarian.pl index 14f0813a92..a6c3e3e324 100755 --- a/misc/devel/create_superlibrarian.pl +++ b/misc/devel/create_superlibrarian.pl @@ -39,6 +39,7 @@ GetOptions( 'branchcode=s' => \$branchcode, 'categorycode=s' => \$categorycode, 'cardnumber=s' => \$cardnumber, + 'surname=s' => \$surname, ); pod2usage(1) if $help; @@ -62,6 +63,10 @@ try { Koha::Exceptions::Object::DuplicateID->throw( duplicate_id => 'cardnumber' ) if Koha::Patrons->find( { cardnumber => $cardnumber } ); + unless ($surname) { + $surname = $userid; + } + my $patron = Koha::Patron->new( { surname => $surname, @@ -115,7 +120,7 @@ create_superlibrarian.pl - create a user in Koha with superlibrarian permissions =head1 SYNOPSIS create_superlibrarian.pl - --userid --password --branchcode --categorycode --cardnumber + --userid --password --branchcode --categorycode --cardnumber --surname Options: -?|--help brief help message @@ -124,6 +129,7 @@ create_superlibrarian.pl --branchcode specify the library code --categorycode specify the patron category code --cardnumber specify the cardnumber to be set + --surname specify the surname to be set =head1 OPTIONS @@ -153,6 +159,10 @@ Patron category's code Patron's cardnumber +=item B<--surname> + +Patron's surname. If not provided, the given userid will be used. + =back =head1 DESCRIPTION