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 1409-1415 legend:hover { Link Here
1409
1409
1410
                                    <fieldset class="rows" id="memberentry_restrictions">
1410
                                    <fieldset class="rows" id="memberentry_restrictions">
1411
                                        <legend id="restrictions_lgd">Patron restrictions</legend>
1411
                                        <legend id="restrictions_lgd">Patron restrictions</legend>
1412
                                        [% IF ( debarments ) %]
1412
                                        [% IF ( patron.restrictions.count ) %]
1413
                                            <table>
1413
                                            <table>
1414
                                                <thead>
1414
                                                <thead>
1415
                                                    <tr>
1415
                                                    <tr>
Lines 1423-1450 legend:hover { Link Here
1423
                                                    </tr>
1423
                                                    </tr>
1424
                                                </thead>
1424
                                                </thead>
1425
                                                <tbody>
1425
                                                <tbody>
1426
                                                    [% FOREACH d IN debarments %]
1426
                                                    [% FOREACH restriction IN patron.restrictions %]
1427
                                                        [% dtype = d.type %]
1428
                                                        <tr>
1427
                                                        <tr>
1429
                                                            <td>[% restriction_types.$dtype.display_text | html %]</td>
1428
                                                            <td>[% PROCESS restriction_type_description restriction_type=restriction.type %]</td>
1430
                                                            <td>
1429
                                                            <td>
1431
                                                                [% IF d.comment.search('OVERDUES_PROCESS') %]
1430
                                                                [% IF restriction.comment.search('OVERDUES_PROCESS') %]
1432
                                                                    Restriction added by overdues process [% d.comment.remove('OVERDUES_PROCESS ') | $raw %]
1431
                                                                    Restriction added by overdues process [% restriction.comment.remove('OVERDUES_PROCESS ') | $raw %]
1433
                                                                [% ELSE %]
1432
                                                                [% ELSE %]
1434
                                                                    [% d.comment | $raw %]
1433
                                                                    [% restriction.comment | $raw %]
1435
                                                                [% END %]
1434
                                                                [% END %]
1436
                                                            </td>
1435
                                                            </td>
1437
                                                            <td>
1436
                                                            <td>
1438
                                                                [% IF d.expiration %]
1437
                                                                [% IF restriction.expiration %]
1439
                                                                    [% d.expiration | $KohaDates %]
1438
                                                                    [% restriction.expiration | $KohaDates %]
1440
                                                                [% ELSE %]
1439
                                                                [% ELSE %]
1441
                                                                    <em>Indefinite</em>
1440
                                                                    <em>Indefinite</em>
1442
                                                                [% END %]
1441
                                                                [% END %]
1443
                                                            </td>
1442
                                                            </td>
1444
                                                            <td>[% d.created | $KohaDates %]</td>
1443
                                                            <td>[% restriction.created | $KohaDates %]</td>
1445
                                                            [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
1444
                                                            [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
1446
                                                                <td>
1445
                                                                <td>
1447
                                                                    <input type="checkbox" id="debarment_[% d.borrower_debarment_id | html %]" name="remove_debarment" value="[% d.borrower_debarment_id | html %]" />
1446
                                                                    <input type="checkbox" id="debarment_[% restriction.borrower_debarment_id | html %]" name="remove_debarment" value="[% restriction.borrower_debarment_id | html %]" />
1448
                                                                </td>
1447
                                                                </td>
1449
                                                            [% END %]
1448
                                                            [% END %]
1450
                                                        </tr>
1449
                                                        </tr>
Lines 1453-1462 legend:hover { Link Here
1453
                                            </table>
1452
                                            </table>
1454
                                        [% ELSE %]
1453
                                        [% ELSE %]
1455
                                            <p>Patron is currently unrestricted.</p>
1454
                                            <p>Patron is currently unrestricted.</p>
1456
                                        [% END # /IF ( debarments ) %]
1455
                                        [% END # /IF ( patron.restrictions.count ) %]
1457
1456
1458
                                        [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
1457
                                        [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
1459
                                            <p><a href="#" id="add_manual_restriction">Add manual restriction</a></p>
1458
                                        <p><a href="#" id="add_manual_restriction"><i class="fa fa-plus"></i> Add manual restriction</a></p>
1460
                                            <fieldset id="manual_restriction_form">
1459
                                            <fieldset id="manual_restriction_form">
1461
                                                <input type="hidden" id="add_debarment" name="add_debarment" value="0" />
1460
                                                <input type="hidden" id="add_debarment" name="add_debarment" value="0" />
1462
                                                <legend id="manual_restriction_lgd">Add manual restriction</legend>
1461
                                                <legend id="manual_restriction_lgd">Add manual restriction</legend>
Lines 1465-1476 legend:hover { Link Here
1465
                                                    <li>
1464
                                                    <li>
1466
                                                        <label for="debarred_type">Type:</label>
1465
                                                        <label for="debarred_type">Type:</label>
1467
                                                        <select name="debarred_type">
1466
                                                        <select name="debarred_type">
1468
                                                            [% FOREACH code IN restriction_types.keys %]
1467
                                                            [% FOREACH restriction_type IN restriction_types %]
1469
                                                                [% IF !restriction_types.$code.is_system %]
1468
                                                                [% IF !restriction_type.is_system %]
1470
                                                                    [% IF restriction_types.$code.is_default %]
1469
                                                                    [% IF restriction_type.is_default %]
1471
                                                                    <option value="[% code | html %]" selected>[% PROCESS restriction_type_description restriction=restriction_types.$code %]</option>
1470
                                                                    <option value="[% code | html %]" selected>[% PROCESS restriction_type_description %]</option>
1472
                                                                    [% ELSE %]
1471
                                                                    [% ELSE %]
1473
                                                                    <option value="[% code | html %]">[% PROCESS restriction_type_description restriction=restriction_types.$code %]</option>
1472
                                                                    <option value="[% code | html %]">[% PROCESS restriction_type_description %]</option>
1474
                                                                    [% END %]
1473
                                                                    [% END %]
1475
                                                                [% END %]
1474
                                                                [% END %]
1476
                                                            [% END %]
1475
                                                            [% 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