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

(-)a/Koha/Patrons/Import.pm (+5 lines)
Lines 75-80 sub import_patrons { Link Here
75
    my $ext_preserve         = $params->{preserve_extended_attributes};
75
    my $ext_preserve         = $params->{preserve_extended_attributes};
76
    my $overwrite_cardnumber = $params->{overwrite_cardnumber};
76
    my $overwrite_cardnumber = $params->{overwrite_cardnumber};
77
    my $overwrite_passwords  = $params->{overwrite_passwords};
77
    my $overwrite_passwords  = $params->{overwrite_passwords};
78
    my $preserve_categorycode = $params->{preserve_categorycode};
78
    my $dry_run              = $params->{dry_run};
79
    my $dry_run              = $params->{dry_run};
79
    my $send_welcome         = $params->{send_welcome};
80
    my $send_welcome         = $params->{send_welcome};
80
    my $extended             = C4::Context->preference('ExtendedPatronAttributes');
81
    my $extended             = C4::Context->preference('ExtendedPatronAttributes');
Lines 285-290 sub import_patrons { Link Here
285
286
286
                $borrower{$col} = $member->{$col} if $col eq 'dateexpiry' && !$columns[ $csvkeycol{$col} ];
287
                $borrower{$col} = $member->{$col} if $col eq 'dateexpiry' && !$columns[ $csvkeycol{$col} ];
287
288
289
                if ( $col eq 'categorycode' && $preserve_categorycode && $member->{$col} ) {
290
                    $borrower{$col} = $member->{$col};
291
                }
292
288
                unless ( exists( $csvkeycol{$col} ) || $defaults->{$col} ) {
293
                unless ( exists( $csvkeycol{$col} ) || $defaults->{$col} ) {
289
                    $borrower{$col} = $member->{$col} if ( $member->{$col} );
294
                    $borrower{$col} = $member->{$col} if ( $member->{$col} );
290
                }
295
                }
(-)a/misc/import_patrons.pl (-1 / +7 lines)
Lines 33-38 my $overwrite_passwords; Link Here
33
my $welcome_new = 0;
33
my $welcome_new = 0;
34
my %defaults;
34
my %defaults;
35
my $ext_preserve = 0;
35
my $ext_preserve = 0;
36
my $preserve_categorycode = 0;
36
my $confirm;
37
my $confirm;
37
my $verbose      = 0;
38
my $verbose      = 0;
38
my $help;
39
my $help;
Lines 54-59 GetOptions( Link Here
54
    'pf|preserve-field=s'            => \@preserve_fields,
55
    'pf|preserve-field=s'            => \@preserve_fields,
55
    'v|verbose+'                     => \$verbose,
56
    'v|verbose+'                     => \$verbose,
56
    'h|help|?'                       => \$help,
57
    'h|help|?'                       => \$help,
58
    'pc|preserve-categorycode'       => \$preserve_categorycode,
57
) or pod2usage(2);
59
) or pod2usage(2);
58
60
59
pod2usage(1) if $help;
61
pod2usage(1) if $help;
Lines 77-82 my $return = $Import->import_patrons( Link Here
77
        update_dateexpiry            => $update_dateexpiry,
79
        update_dateexpiry            => $update_dateexpiry,
78
        update_dateexpiry_from_today => $update_dateexpiry_from_today,
80
        update_dateexpiry_from_today => $update_dateexpiry_from_today,
79
        send_welcome                 => $welcome_new,
81
        send_welcome                 => $welcome_new,
82
        preserve_categorycode        => $preserve_categorycode,
80
        dry_run                      => !$confirm,
83
        dry_run                      => !$confirm,
81
    }
84
    }
82
);
85
);
Lines 166-171 If a matching patron is found, extend the expiration date of their account using Link Here
166
169
167
If a matching patron is found, extend the expiration date of their account using today's date as the base
170
If a matching patron is found, extend the expiration date of their account using today's date as the base
168
171
172
=item B<-pc|--preserve-categorycode>
173
174
Retain patron categorycode for existing patrons being overwritten
175
169
=item B<-v|--verbose>
176
=item B<-v|--verbose>
170
177
171
Be verbose
178
Be verbose
172
- 

Return to bug 35061