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

(-)a/Koha/Patrons/Import.pm (+5 lines)
Lines 80-85 sub import_patrons { Link Here
80
    my $update_dateexpiry               = $params->{update_dateexpiry};
80
    my $update_dateexpiry               = $params->{update_dateexpiry};
81
    my $update_dateexpiry_from_today    = $params->{update_dateexpiry_from_today};
81
    my $update_dateexpiry_from_today    = $params->{update_dateexpiry_from_today};
82
    my $update_dateexpiry_from_existing = $params->{update_dateexpiry_from_existing};
82
    my $update_dateexpiry_from_existing = $params->{update_dateexpiry_from_existing};
83
    my $preserve_categorycode           = $params->{preserve_categorycode};
83
84
84
    my $extended            = C4::Context->preference('ExtendedPatronAttributes');
85
    my $extended            = C4::Context->preference('ExtendedPatronAttributes');
85
    my $set_messaging_prefs = C4::Context->preference('EnhancedMessagingPreferences');
86
    my $set_messaging_prefs = C4::Context->preference('EnhancedMessagingPreferences');
Lines 294-299 sub import_patrons { Link Here
294
295
295
                $borrower{$col} = $member->{$col} if $col eq 'dateexpiry' && !$columns[ $csvkeycol{$col} ];
296
                $borrower{$col} = $member->{$col} if $col eq 'dateexpiry' && !$columns[ $csvkeycol{$col} ];
296
297
298
                if ( $col eq 'categorycode' && $preserve_categorycode && $member->{$col} ) {
299
                    $borrower{$col} = $member->{$col};
300
                }
301
297
                unless ( exists( $csvkeycol{$col} ) || $defaults->{$col} ) {
302
                unless ( exists( $csvkeycol{$col} ) || $defaults->{$col} ) {
298
                    $borrower{$col} = $member->{$col} if ( $member->{$col} );
303
                    $borrower{$col} = $member->{$col} if ( $member->{$col} );
299
                }
304
                }
(-)a/misc/import_patrons.pl (-1 / +7 lines)
Lines 34-39 my $overwrite_passwords; Link Here
34
my $welcome_new = 0;
34
my $welcome_new = 0;
35
my %defaults;
35
my %defaults;
36
my $ext_preserve = 0;
36
my $ext_preserve = 0;
37
my $preserve_categorycode = 0;
37
my $confirm;
38
my $confirm;
38
my $verbose = 0;
39
my $verbose = 0;
39
my $help;
40
my $help;
Lines 59-64 GetOptions( Link Here
59
    'pf|preserve-field=s'            => \@preserve_fields,
60
    'pf|preserve-field=s'            => \@preserve_fields,
60
    'v|verbose+'                     => \$verbose,
61
    'v|verbose+'                     => \$verbose,
61
    'h|help|?'                       => \$help,
62
    'h|help|?'                       => \$help,
63
    'pc|preserve-categorycode'       => \$preserve_categorycode,
62
) or pod2usage(2);
64
) or pod2usage(2);
63
65
64
pod2usage(1)                                       if $help;
66
pod2usage(1)                                       if $help;
Lines 89-94 my $return = $Import->import_patrons( Link Here
89
        update_dateexpiry_from_existing => $update_dateexpiry_from_existing,
91
        update_dateexpiry_from_existing => $update_dateexpiry_from_existing,
90
        send_welcome                    => $welcome_new,
92
        send_welcome                    => $welcome_new,
91
        dry_run                         => !$confirm,
93
        dry_run                         => !$confirm,
94
        preserve_categorycode           => $preserve_categorycode,
92
    }
95
    }
93
);
96
);
94
97
Lines 200-205 Cannot by used in conjunction with --expiration-from-existing Link Here
200
If a matching patron is found, extend the expiration date of their account using the patron's current expiration date as the base
203
If a matching patron is found, extend the expiration date of their account using the patron's current expiration date as the base
201
Cannot by used in conjunction with --expiration-from-today
204
Cannot by used in conjunction with --expiration-from-today
202
205
206
=item B<-pc|--preserve-categorycode>
207
208
Retain patron categorycode for existing patrons being overwritten
209
203
=item B<-v|--verbose>
210
=item B<-v|--verbose>
204
211
205
Be verbose
212
Be verbose
206
- 

Return to bug 35061