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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt (+13 lines)
Lines 261-266 Link Here
261
                                                [% IF CanUpdatePasswordExpiration %]
261
                                                [% IF CanUpdatePasswordExpiration %]
262
                                                    <th>Password expiration date</th>
262
                                                    <th>Password expiration date</th>
263
                                                [% END %]
263
                                                [% END %]
264
                                                [% IF CanUpdateProtectPatron %]
265
                                                    <th>Protected</th>
266
                                                [% END %]
264
                                                <th>Circulation note</th>
267
                                                <th>Circulation note</th>
265
                                                <th>OPAC note</th>
268
                                                <th>OPAC note</th>
266
                                                <th>Message</th>
269
                                                <th>Message</th>
Lines 308-313 Link Here
308
                                                            <td data-order="9999-99-99">Never</td>
311
                                                            <td data-order="9999-99-99">Never</td>
309
                                                        [% END %]
312
                                                        [% END %]
310
                                                    [% END %]
313
                                                    [% END %]
314
                                                    [% IF CanUpdateProtectPatron %]
315
                                                        <td>
316
                                                        [% IF borrower.protected %]
317
                                                            Yes
318
                                                        [% ELSE %]
319
                                                            No
320
                                                        [% END %]
321
                                                        </td>
322
                                                    [% END %]
311
                                                    <td>[% borrower.borrowernotes | $raw | html_line_break %]</td>
323
                                                    <td>[% borrower.borrowernotes | $raw | html_line_break %]</td>
312
                                                    <td>[% borrower.opacnote | html %]</td>
324
                                                    <td>[% borrower.opacnote | html %]</td>
313
                                                    <td>
325
                                                    <td>
Lines 378-383 Link Here
378
                                                [% CASE 'debarred' %]<span>Restriction expiration:</span>
390
                                                [% CASE 'debarred' %]<span>Restriction expiration:</span>
379
                                                [% CASE 'debarredcomment' %]<span>Restriction comment:</span>
391
                                                [% CASE 'debarredcomment' %]<span>Restriction comment:</span>
380
                                                [% CASE 'password_expiration_date' %]<span>Password expiration date:</span>
392
                                                [% CASE 'password_expiration_date' %]<span>Password expiration date:</span>
393
                                                [% CASE 'protected' %]<span>Protected:</span>
381
                                            [% END %]
394
                                            [% END %]
382
                                            </label>
395
                                            </label>
383
                                            [% IF ( field.type == 'text' ) %]
396
                                            [% IF ( field.type == 'text' ) %]
(-)a/tools/modborrowers.pl (-8 / +17 lines)
Lines 22-28 Link Here
22
# Batch Edit Patrons
22
# Batch Edit Patrons
23
# Modification for patron's fields:
23
# Modification for patron's fields:
24
# surname firstname branchcode categorycode city state zipcode country sort1
24
# surname firstname branchcode categorycode city state zipcode country sort1
25
# sort2 dateenrolled dateexpiry borrowernotes
25
# sort2 dateenrolled dateexpiry borrowernotes protected
26
# And for patron attributes.
26
# And for patron attributes.
27
27
28
use Modern::Perl;
28
use Modern::Perl;
Lines 54-61 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
54
54
55
my $logged_in_user = Koha::Patrons->find($loggedinuser);
55
my $logged_in_user = Koha::Patrons->find($loggedinuser);
56
56
57
$template->param( CanUpdatePasswordExpiration => 1 ) if $logged_in_user->is_superlibrarian;
57
if ( $logged_in_user->is_superlibrarian ) {
58
58
    $template->param( CanUpdatePasswordExpiration => 1 );
59
    $template->param( CanUpdateProtectPatron      => 1 );
60
}
59
my $dbh = C4::Context->dbh;
61
my $dbh = C4::Context->dbh;
60
62
61
# Show borrower informations
63
# Show borrower informations
Lines 194-199 if ( $op eq 'cud-show' || $op eq 'show' ) { Link Here
194
    my @categories_option;
196
    my @categories_option;
195
    push @categories_option, { value => $_->categorycode, lib => $_->description } for @patron_categories;
197
    push @categories_option, { value => $_->categorycode, lib => $_->description } for @patron_categories;
196
    unshift @categories_option, { value => "", lib => "" };
198
    unshift @categories_option, { value => "", lib => "" };
199
    my @protected_option;
200
    push @protected_option, { value => 1, lib => "Yes" };
201
    push @protected_option, { value => 0, lib => "No" };
202
    unshift @protected_option, { value => "", lib => "" };
197
    my $bsort1 = GetAuthorisedValues("Bsort1");
203
    my $bsort1 = GetAuthorisedValues("Bsort1");
198
    my @sort1_option;
204
    my @sort1_option;
199
    push @sort1_option, { value => $_->{authorised_value}, lib => $_->{lib} } for @$bsort1;
205
    push @sort1_option, { value => $_->{authorised_value}, lib => $_->{lib} } for @$bsort1;
Lines 334-340 if ( $op eq 'cud-show' || $op eq 'show' ) { Link Here
334
        },
340
        },
335
    );
341
    );
336
342
337
    push @fields, { name => "password_expiration_date", type => "date" } if $logged_in_user->is_superlibrarian;
343
    if ($logged_in_user->is_superlibrarian) {
344
        push @fields, { name => "password_expiration_date", type => "date" } ;
345
        push @fields, { name => "protected", type => "select", option => \@protected_option };
346
    }
338
347
339
    $template->param( 'patron_attributes_codes',  \@patron_attributes_codes );
348
    $template->param( 'patron_attributes_codes',  \@patron_attributes_codes );
340
    $template->param( 'patron_attributes_values', \@patron_attributes_values );
349
    $template->param( 'patron_attributes_values', \@patron_attributes_values );
Lines 349-359 if ( $op eq 'cud-do' ) { Link Here
349
    my @disabled = $input->multi_param('disable_input');
358
    my @disabled = $input->multi_param('disable_input');
350
    my $infos;
359
    my $infos;
351
    for my $field (
360
    for my $field (
352
        qw/surname firstname branchcode categorycode streetnumber address address2 city state zipcode country email phone mobile fax sort1 sort2 dateenrolled dateexpiry password_expiration_date borrowernotes opacnote debarred debarredcomment/
361
        qw/surname firstname branchcode categorycode streetnumber address address2 city state zipcode country email phone mobile fax sort1 sort2 dateenrolled dateexpiry password_expiration_date borrowernotes opacnote debarred debarredcomment protected/
353
        )
362
        )
354
    {
363
    {
355
        my $value = $input->param($field);
364
        my $value = $input->param($field) if $input->param($field) ne '';
356
        $infos->{$field} = $value if $value;
365
        $infos->{$field} = $value if defined $value;
357
        $infos->{$field} = ""     if grep { $_ eq $field } @disabled;
366
        $infos->{$field} = ""     if grep { $_ eq $field } @disabled;
358
    }
367
    }
359
368
Lines 362-367 if ( $op eq 'cud-do' ) { Link Here
362
    }
371
    }
363
372
364
    delete $infos->{password_expiration_date} unless $logged_in_user->is_superlibrarian;
373
    delete $infos->{password_expiration_date} unless $logged_in_user->is_superlibrarian;
374
    delete $infos->{protected} unless $logged_in_user->is_superlibrarian;
365
375
366
    my @errors;
376
    my @errors;
367
    my @borrowernumbers = $input->multi_param('borrowernumber');
377
    my @borrowernumbers = $input->multi_param('borrowernumber');
368
- 

Return to bug 37360