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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt (-4 / +4 lines)
Lines 149-156 Link Here
149
                                                <th class="title-string">Expiry date</th>
149
                                                <th class="title-string">Expiry date</th>
150
                                                <th>Circulation note</th>
150
                                                <th>Circulation note</th>
151
                                                <th>Opac Note</th>
151
                                                <th>Opac Note</th>
152
                                                <th>Debarred till</th>
152
                                                <th>Restriction expiration</th>
153
                                                <th>Debarred comment</th>
153
                                                <th>Restriction comment</th>
154
                                                [% FOREACH attrh IN attributes_header %]
154
                                                [% FOREACH attrh IN attributes_header %]
155
                                                    <th>[% attrh.attribute | html %]</th>
155
                                                    <th>[% attrh.attribute | html %]</th>
156
                                                [% END %]
156
                                                [% END %]
Lines 234-242 Link Here
234
                                                [% CASE 'opacnote' %]
234
                                                [% CASE 'opacnote' %]
235
                                                OPAC note:
235
                                                OPAC note:
236
                                                [% CASE 'debarred' %]
236
                                                [% CASE 'debarred' %]
237
                                                Debarred till:
237
                                                Restriction expiration:
238
                                                [% CASE 'debarredcomment' %]
238
                                                [% CASE 'debarredcomment' %]
239
                                                Debarred comment:
239
                                                Restriction comment:
240
                                            [% END %]
240
                                            [% END %]
241
                                            </label>
241
                                            </label>
242
                                            [% IF ( field.type == 'text' ) %]
242
                                            [% IF ( field.type == 'text' ) %]
(-)a/tools/modborrowers.pl (-1 / +22 lines)
Lines 38-43 use Koha::DateUtils qw( dt_from_string ); Link Here
38
use Koha::List::Patron;
38
use Koha::List::Patron;
39
use Koha::Libraries;
39
use Koha::Libraries;
40
use Koha::Patron::Categories;
40
use Koha::Patron::Categories;
41
use Koha::Patron::Debarments;
41
use Koha::Patrons;
42
use Koha::Patrons;
42
43
43
my $input = new CGI;
44
my $input = new CGI;
Lines 306-311 if ( $op eq 'do' ) { Link Here
306
    for my $borrowernumber ( @borrowernumbers ) {
307
    for my $borrowernumber ( @borrowernumbers ) {
307
        # If at least one field are filled, we want to modify the borrower
308
        # If at least one field are filled, we want to modify the borrower
308
        if ( defined $infos ) {
309
        if ( defined $infos ) {
310
            # If a debarred date or debarred comment has been submitted make a new debarment
311
            if ( $infos->{debarred} || $infos->{debarredcomment} ) {
312
                AddDebarment(
313
                    {
314
                        borrowernumber => $borrowernumber,
315
                        type           => 'MANUAL',
316
                        comment        => $infos->{debarredcomment},
317
                        expiration     => $infos->{debarred},
318
                    });
319
            }
320
321
            # If debarment date or debarment comment are disabled then remove all debarrments
322
            if ( grep { /debarred/ } @disabled ) {
323
                eval {
324
                   my $debarrments = GetDebarments( { borrowernumber => $borrowernumber } );
325
                   foreach my $debarment (@$debarrments) {
326
                      DelDebarment( $debarment->{'borrower_debarment_id'} );
327
                   }
328
                };
329
            }
330
309
            $infos->{borrowernumber} = $borrowernumber;
331
            $infos->{borrowernumber} = $borrowernumber;
310
            eval { Koha::Patrons->find( $borrowernumber )->set($infos)->store; };
332
            eval { Koha::Patrons->find( $borrowernumber )->set($infos)->store; };
311
            if ( $@ ) { # FIXME We could provide better error handling here
333
            if ( $@ ) { # FIXME We could provide better error handling here
312
- 

Return to bug 13552