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 260-265 Link Here
260
                                                [% IF CanUpdatePasswordExpiration %]
260
                                                [% IF CanUpdatePasswordExpiration %]
261
                                                    <th>Password expiration date</th>
261
                                                    <th>Password expiration date</th>
262
                                                [% END %]
262
                                                [% END %]
263
                                                [% IF CanUpdateProtectPatron %]
264
                                                    <th>Protected</th>
265
                                                [% END %]
263
                                                <th>Circulation note</th>
266
                                                <th>Circulation note</th>
264
                                                <th>OPAC note</th>
267
                                                <th>OPAC note</th>
265
                                                <th>Restriction expiration</th>
268
                                                <th>Restriction expiration</th>
Lines 306-311 Link Here
306
                                                            <td data-order="9999-99-99">Never</td>
309
                                                            <td data-order="9999-99-99">Never</td>
307
                                                        [% END %]
310
                                                        [% END %]
308
                                                    [% END %]
311
                                                    [% END %]
312
                                                    [% IF CanUpdateProtectPatron %]
313
                                                        <td>
314
                                                        [% IF borrower.protected %]
315
                                                            Yes
316
                                                        [% ELSE %]
317
                                                            No
318
                                                        [% END %]
319
                                                        </td>
320
                                                    [% END %]
309
                                                    <td>[% borrower.borrowernotes | $raw | html_line_break %]</td>
321
                                                    <td>[% borrower.borrowernotes | $raw | html_line_break %]</td>
310
                                                    <td>[% borrower.opacnote | html %]</td>
322
                                                    <td>[% borrower.opacnote | html %]</td>
311
                                                    <td data-order="[% borrower.debarred | html %]">[% borrower.debarred | $KohaDates %]</td>
323
                                                    <td data-order="[% borrower.debarred | html %]">[% borrower.debarred | $KohaDates %]</td>
Lines 363-368 Link Here
363
                                                [% CASE 'debarred' %]<span>Restriction expiration:</span>
375
                                                [% CASE 'debarred' %]<span>Restriction expiration:</span>
364
                                                [% CASE 'debarredcomment' %]<span>Restriction comment:</span>
376
                                                [% CASE 'debarredcomment' %]<span>Restriction comment:</span>
365
                                                [% CASE 'password_expiration_date' %]<span>Password expiration date:</span>
377
                                                [% CASE 'password_expiration_date' %]<span>Password expiration date:</span>
378
                                                [% CASE 'protected' %]<span>Protected:</span>
366
                                            [% END %]
379
                                            [% END %]
367
                                            </label>
380
                                            </label>
368
                                            [% IF ( field.type == 'text' ) %]
381
                                            [% 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 51-58 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
51
51
52
my $logged_in_user = Koha::Patrons->find( $loggedinuser );
52
my $logged_in_user = Koha::Patrons->find( $loggedinuser );
53
53
54
$template->param( CanUpdatePasswordExpiration => 1 ) if $logged_in_user->is_superlibrarian;
54
if ($logged_in_user->is_superlibrarian) {
55
55
    $template->param( CanUpdatePasswordExpiration => 1 );
56
    $template->param( CanUpdateProtectPatron => 1 );
57
}
56
my $dbh       = C4::Context->dbh;
58
my $dbh       = C4::Context->dbh;
57
59
58
# Show borrower informations
60
# Show borrower informations
Lines 178-183 if ( $op eq 'cud-show' || $op eq 'show' ) { Link Here
178
    my @categories_option;
180
    my @categories_option;
179
    push @categories_option, { value => $_->categorycode, lib => $_->description } for @patron_categories;
181
    push @categories_option, { value => $_->categorycode, lib => $_->description } for @patron_categories;
180
    unshift @categories_option, { value => "", lib => "" };
182
    unshift @categories_option, { value => "", lib => "" };
183
    my @protected_option;
184
    push @protected_option, { value => 1, lib => "Yes" };
185
    push @protected_option, { value => 0, lib => "No" };
186
    unshift @protected_option, { value => "", lib => "" };
181
    my $bsort1 = GetAuthorisedValues("Bsort1");
187
    my $bsort1 = GetAuthorisedValues("Bsort1");
182
    my @sort1_option;
188
    my @sort1_option;
183
    push @sort1_option, { value => $_->{authorised_value}, lib => $_->{lib} } for @$bsort1;
189
    push @sort1_option, { value => $_->{authorised_value}, lib => $_->{lib} } for @$bsort1;
Lines 335-341 if ( $op eq 'cud-show' || $op eq 'show' ) { Link Here
335
        },
341
        },
336
    );
342
    );
337
343
338
    push @fields, { name => "password_expiration_date", type => "date" } if $logged_in_user->is_superlibrarian;
344
    if ($logged_in_user->is_superlibrarian) {
345
        push @fields, { name => "password_expiration_date", type => "date" } ;
346
        push @fields, { name => "protected", type => "select", option => \@protected_option };
347
    }
339
348
340
    $template->param('patron_attributes_codes', \@patron_attributes_codes);
349
    $template->param('patron_attributes_codes', \@patron_attributes_codes);
341
    $template->param('patron_attributes_values', \@patron_attributes_values);
350
    $template->param('patron_attributes_values', \@patron_attributes_values);
Lines 350-360 if ( $op eq 'cud-do' ) { Link Here
350
    my @disabled = $input->multi_param('disable_input');
359
    my @disabled = $input->multi_param('disable_input');
351
    my $infos;
360
    my $infos;
352
    for my $field (
361
    for my $field (
353
        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/
362
        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/
354
        )
363
        )
355
    {
364
    {
356
        my $value = $input->param($field);
365
        my $value = $input->param($field) if $input->param($field) ne '';
357
        $infos->{$field} = $value if $value;
366
        $infos->{$field} = $value if defined $value;
358
        $infos->{$field} = ""     if grep { $_ eq $field } @disabled;
367
        $infos->{$field} = ""     if grep { $_ eq $field } @disabled;
359
    }
368
    }
360
369
Lines 363-368 if ( $op eq 'cud-do' ) { Link Here
363
    }
372
    }
364
373
365
    delete $infos->{password_expiration_date} unless $logged_in_user->is_superlibrarian;
374
    delete $infos->{password_expiration_date} unless $logged_in_user->is_superlibrarian;
375
    delete $infos->{protected} unless $logged_in_user->is_superlibrarian;
366
376
367
    my @errors;
377
    my @errors;
368
    my @borrowernumbers = $input->multi_param('borrowernumber');
378
    my @borrowernumbers = $input->multi_param('borrowernumber');
369
- 

Return to bug 37360