View | Details | Raw Unified | Return to bug 38549
Collapse All | Expand All

(-)a/misc/devel/create_superlibrarian.pl (-2 / +11 lines)
Lines 39-44 GetOptions( Link Here
39
    'branchcode=s'   => \$branchcode,
39
    'branchcode=s'   => \$branchcode,
40
    'categorycode=s' => \$categorycode,
40
    'categorycode=s' => \$categorycode,
41
    'cardnumber=s'   => \$cardnumber,
41
    'cardnumber=s'   => \$cardnumber,
42
    'surname=s'      => \$surname,
42
);
43
);
43
44
44
pod2usage(1) if $help;
45
pod2usage(1) if $help;
Lines 62-67 try { Link Here
62
            Koha::Exceptions::Object::DuplicateID->throw( duplicate_id => 'cardnumber' )
63
            Koha::Exceptions::Object::DuplicateID->throw( duplicate_id => 'cardnumber' )
63
                if Koha::Patrons->find( { cardnumber => $cardnumber } );
64
                if Koha::Patrons->find( { cardnumber => $cardnumber } );
64
65
66
            unless ($surname) {
67
                $surname = $userid;
68
            }
69
65
            my $patron = Koha::Patron->new(
70
            my $patron = Koha::Patron->new(
66
                {
71
                {
67
                    surname      => $surname,
72
                    surname      => $surname,
Lines 115-121 create_superlibrarian.pl - create a user in Koha with superlibrarian permissions Link Here
115
=head1 SYNOPSIS
120
=head1 SYNOPSIS
116
121
117
create_superlibrarian.pl
122
create_superlibrarian.pl
118
  --userid <userid> --password <password> --branchcode <branchcode> --categorycode <categorycode> --cardnumber <cardnumber>
123
  --userid <userid> --password <password> --branchcode <branchcode> --categorycode <categorycode> --cardnumber <cardnumber> --surname <surname>
119
124
120
 Options:
125
 Options:
121
   -?|--help        brief help message
126
   -?|--help        brief help message
Lines 124-129 create_superlibrarian.pl Link Here
124
   --branchcode     specify the library code
129
   --branchcode     specify the library code
125
   --categorycode   specify the patron category code
130
   --categorycode   specify the patron category code
126
   --cardnumber     specify the cardnumber to be set
131
   --cardnumber     specify the cardnumber to be set
132
   --surname        specify the surname to be set
127
133
128
=head1 OPTIONS
134
=head1 OPTIONS
129
135
Lines 153-158 Patron category's code Link Here
153
159
154
Patron's cardnumber
160
Patron's cardnumber
155
161
162
=item B<--surname>
163
164
Patron's surname. If not provided, the given userid will be used.
165
156
=back
166
=back
157
167
158
=head1 DESCRIPTION
168
=head1 DESCRIPTION
159
- 

Return to bug 38549