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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (-19 / +18 lines)
Lines 8-14 Link Here
8
[% PROCESS 'member-main-address-style.inc' %]
8
[% PROCESS 'member-main-address-style.inc' %]
9
[% PROCESS 'member-alt-address-style.inc' %]
9
[% PROCESS 'member-alt-address-style.inc' %]
10
[% PROCESS 'member-alt-contact-style.inc' %]
10
[% PROCESS 'member-alt-contact-style.inc' %]
11
[% PROCESS 'patron_restrictions.inc' %]
11
[% PROCESS 'restriction-types.inc' %]
12
[% SET footerjs = 1 %]
12
[% SET footerjs = 1 %]
13
[% INCLUDE 'doc-head-open.inc' %]
13
[% INCLUDE 'doc-head-open.inc' %]
14
    <title>
14
    <title>
Lines 1405-1411 legend:hover { Link Here
1405
1405
1406
                                    <fieldset class="rows" id="memberentry_restrictions">
1406
                                    <fieldset class="rows" id="memberentry_restrictions">
1407
                                        <legend id="restrictions_lgd">Patron restrictions</legend>
1407
                                        <legend id="restrictions_lgd">Patron restrictions</legend>
1408
                                        [% IF ( debarments ) %]
1408
                                        [% IF ( patron.restrictions.count ) %]
1409
                                            <table>
1409
                                            <table>
1410
                                                <thead>
1410
                                                <thead>
1411
                                                    <tr>
1411
                                                    <tr>
Lines 1419-1446 legend:hover { Link Here
1419
                                                    </tr>
1419
                                                    </tr>
1420
                                                </thead>
1420
                                                </thead>
1421
                                                <tbody>
1421
                                                <tbody>
1422
                                                    [% FOREACH d IN debarments %]
1422
                                                    [% FOREACH restriction IN patron.restrictions %]
1423
                                                        [% dtype = d.type %]
1424
                                                        <tr>
1423
                                                        <tr>
1425
                                                            <td>[% restriction_types.$dtype.display_text | html %]</td>
1424
                                                            <td>[% PROCESS restriction_type_description restriction_type=restriction.type %]</td>
1426
                                                            <td>
1425
                                                            <td>
1427
                                                                [% IF d.comment.search('OVERDUES_PROCESS') %]
1426
                                                                [% IF restriction.comment.search('OVERDUES_PROCESS') %]
1428
                                                                    Restriction added by overdues process [% d.comment.remove('OVERDUES_PROCESS ') | $raw %]
1427
                                                                    Restriction added by overdues process [% restriction.comment.remove('OVERDUES_PROCESS ') | $raw %]
1429
                                                                [% ELSE %]
1428
                                                                [% ELSE %]
1430
                                                                    [% d.comment | $raw %]
1429
                                                                    [% restriction.comment | $raw %]
1431
                                                                [% END %]
1430
                                                                [% END %]
1432
                                                            </td>
1431
                                                            </td>
1433
                                                            <td>
1432
                                                            <td>
1434
                                                                [% IF d.expiration %]
1433
                                                                [% IF restriction.expiration %]
1435
                                                                    [% d.expiration | $KohaDates %]
1434
                                                                    [% restriction.expiration | $KohaDates %]
1436
                                                                [% ELSE %]
1435
                                                                [% ELSE %]
1437
                                                                    <em>Indefinite</em>
1436
                                                                    <em>Indefinite</em>
1438
                                                                [% END %]
1437
                                                                [% END %]
1439
                                                            </td>
1438
                                                            </td>
1440
                                                            <td>[% d.created | $KohaDates %]</td>
1439
                                                            <td>[% restriction.created | $KohaDates %]</td>
1441
                                                            [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
1440
                                                            [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
1442
                                                                <td>
1441
                                                                <td>
1443
                                                                    <input type="checkbox" id="debarment_[% d.borrower_debarment_id | html %]" name="remove_debarment" value="[% d.borrower_debarment_id | html %]" />
1442
                                                                    <input type="checkbox" id="debarment_[% restriction.borrower_debarment_id | html %]" name="remove_debarment" value="[% restriction.borrower_debarment_id | html %]" />
1444
                                                                </td>
1443
                                                                </td>
1445
                                                            [% END %]
1444
                                                            [% END %]
1446
                                                        </tr>
1445
                                                        </tr>
Lines 1449-1458 legend:hover { Link Here
1449
                                            </table>
1448
                                            </table>
1450
                                        [% ELSE %]
1449
                                        [% ELSE %]
1451
                                            <p>Patron is currently unrestricted.</p>
1450
                                            <p>Patron is currently unrestricted.</p>
1452
                                        [% END # /IF ( debarments ) %]
1451
                                        [% END # /IF ( patron.restrictions.count ) %]
1453
1452
1454
                                        [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
1453
                                        [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
1455
                                            <p><a href="#" id="add_manual_restriction">Add manual restriction</a></p>
1454
                                        <p><a href="#" id="add_manual_restriction"><i class="fa fa-plus"></i> Add manual restriction</a></p>
1456
                                            <fieldset id="manual_restriction_form">
1455
                                            <fieldset id="manual_restriction_form">
1457
                                                <input type="hidden" id="add_debarment" name="add_debarment" value="0" />
1456
                                                <input type="hidden" id="add_debarment" name="add_debarment" value="0" />
1458
                                                <legend id="manual_restriction_lgd">Add manual restriction</legend>
1457
                                                <legend id="manual_restriction_lgd">Add manual restriction</legend>
Lines 1461-1472 legend:hover { Link Here
1461
                                                    <li>
1460
                                                    <li>
1462
                                                        <label for="debarred_type">Type:</label>
1461
                                                        <label for="debarred_type">Type:</label>
1463
                                                        <select name="debarred_type">
1462
                                                        <select name="debarred_type">
1464
                                                            [% FOREACH code IN restriction_types.keys %]
1463
                                                            [% FOREACH restriction_type IN restriction_types %]
1465
                                                                [% IF !restriction_types.$code.is_system %]
1464
                                                                [% IF !restriction_type.is_system %]
1466
                                                                    [% IF restriction_types.$code.is_default %]
1465
                                                                    [% IF restriction_type.is_default %]
1467
                                                                    <option value="[% code | html %]" selected>[% PROCESS restriction_type_description restriction=restriction_types.$code %]</option>
1466
                                                                    <option value="[% code | html %]" selected>[% PROCESS restriction_type_description %]</option>
1468
                                                                    [% ELSE %]
1467
                                                                    [% ELSE %]
1469
                                                                    <option value="[% code | html %]">[% PROCESS restriction_type_description restriction=restriction_types.$code %]</option>
1468
                                                                    <option value="[% code | html %]">[% PROCESS restriction_type_description %]</option>
1470
                                                                    [% END %]
1469
                                                                    [% END %]
1471
                                                                [% END %]
1470
                                                                [% END %]
1472
                                                            [% END %]
1471
                                                            [% END %]
(-)a/members/memberentry.pl (-4 / +2 lines)
Lines 35-41 use C4::Form::MessagingPreferences; Link Here
35
use Koha::AuthUtils;
35
use Koha::AuthUtils;
36
use Koha::AuthorisedValues;
36
use Koha::AuthorisedValues;
37
use Koha::Email;
37
use Koha::Email;
38
use Koha::Patron::Debarments qw( AddDebarment DelDebarment GetDebarments );
38
use Koha::Patron::Debarments qw( AddDebarment DelDebarment );
39
use Koha::Patron::Restriction::Types;
39
use Koha::Patron::Restriction::Types;
40
use Koha::Cities;
40
use Koha::Cities;
41
use Koha::DateUtils qw( dt_from_string );
41
use Koha::DateUtils qw( dt_from_string );
Lines 118-125 foreach my $id ( @delete_guarantor ) { Link Here
118
118
119
## Deal with debarments
119
## Deal with debarments
120
$template->param(
120
$template->param(
121
    debarments => scalar GetDebarments( { borrowernumber => $borrowernumber } ),
121
    restriction_types => scalar Koha::Patron::Restriction::Types->search()
122
    restriction_types => scalar Koha::Patron::Restriction::Types->keyed_on_code()
123
);
122
);
124
my @debarments_to_remove = $input->multi_param('remove_debarment');
123
my @debarments_to_remove = $input->multi_param('remove_debarment');
125
foreach my $d ( @debarments_to_remove ) {
124
foreach my $d ( @debarments_to_remove ) {
126
- 

Return to bug 31095