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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc (+11 lines)
Lines 1-4 Link Here
1
[% USE raw %]
1
[% USE raw %]
2
[% USE Koha %]
2
<div id="reldebarments">
3
<div id="reldebarments">
3
    [% IF ( not debarments.defined || debarments.size < 1 ) %]
4
    [% IF ( not debarments.defined || debarments.size < 1 ) %]
4
        <p>Patron is currently unrestricted.</p>
5
        <p>Patron is currently unrestricted.</p>
Lines 51-56 Link Here
51
            <fieldset class="rows" id="manual_restriction_form">
52
            <fieldset class="rows" id="manual_restriction_form">
52
                <legend>Add manual restriction</legend>
53
                <legend>Add manual restriction</legend>
53
                <ol>
54
                <ol>
55
                    [% IF Koha.Preference('PatronRestrictionTypes') %]
56
                    <li>
57
                        <label for="debarred_type">Type:</label>
58
                        <select name="debarred_type">
59
                            [% FOREACH code IN restriction_types.keys %]
60
                                <option value="[% code | html %]">[% restriction_types.$code.display_text | html %]</option>
61
                            [% END %]
62
                        </select>
63
                    </li>
64
                    [% END %]
54
                    <li><label for="rcomment">Comment:</label> <input type="text" id="rcomment" name="comment" /></li>
65
                    <li><label for="rcomment">Comment:</label> <input type="text" id="rcomment" name="comment" /></li>
55
                    <li>
66
                    <li>
56
                        <label for="rexpiration">Expiration:</label>
67
                        <label for="rexpiration">Expiration:</label>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (+10 lines)
Lines 1397-1402 legend:hover { Link Here
1397
                                                <input type="hidden" id="add_debarment" name="add_debarment" value="0" />
1397
                                                <input type="hidden" id="add_debarment" name="add_debarment" value="0" />
1398
                                                <legend id="manual_restriction_lgd">Add manual restriction</legend>
1398
                                                <legend id="manual_restriction_lgd">Add manual restriction</legend>
1399
                                                <ol>
1399
                                                <ol>
1400
                                                    [% IF Koha.Preference('PatronRestrictionTypes') %]
1401
                                                    <li>
1402
                                                        <label for="debarred_type">Type:</label>
1403
                                                        <select name="debarred_type">
1404
                                                            [% FOREACH code IN restriction_types.keys %]
1405
                                                                <option value="[% code | html %]">[% restriction_types.$code.display_text | html %]</option>
1406
                                                            [% END %]
1407
                                                        </select>
1408
                                                    </li>
1409
                                                    [% END %]
1400
                                                    <li>
1410
                                                    <li>
1401
                                                        <label for="debarred_comment">Comment: </label>
1411
                                                        <label for="debarred_comment">Comment: </label>
1402
                                                        <input type="text" id="debarred_comment" name="debarred_comment" />
1412
                                                        <input type="text" id="debarred_comment" name="debarred_comment" />
(-)a/members/memberentry.pl (-2 / +2 lines)
Lines 136-142 if ( $input->param('add_debarment') ) { Link Here
136
    AddDebarment(
136
    AddDebarment(
137
        {
137
        {
138
            borrowernumber => $borrowernumber,
138
            borrowernumber => $borrowernumber,
139
            type           => 'MANUAL',
139
            type           => scalar $input->param('debarred_type') // 'MANUAL',
140
            comment        => scalar $input->param('debarred_comment'),
140
            comment        => scalar $input->param('debarred_comment'),
141
            expiration     => $expiration,
141
            expiration     => $expiration,
142
        }
142
        }
Lines 234-240 if ( $op eq 'insert' || $op eq 'modify' || $op eq 'save' || $op eq 'duplicate' ) Link Here
234
        qr/^\d+-DAYS/,
234
        qr/^\d+-DAYS/,
235
        qr/^patron_attr_/,
235
        qr/^patron_attr_/,
236
        qr/^csrf_token$/,
236
        qr/^csrf_token$/,
237
        qr/^add_debarment$/, qr/^debarred_comment$/,qr/^debarred_expiration$/, qr/^remove_debarment$/, # We already dealt with debarments previously
237
        qr/^add_debarment$/, qr/^debarred_comment$/,qr/^debarred_expiration$/, qr/^debarred_type$/, qr/^remove_debarment$/, # We already dealt with debarments previously
238
        qr/^housebound_chooser$/, qr/^housebound_deliverer$/,
238
        qr/^housebound_chooser$/, qr/^housebound_deliverer$/,
239
        qr/^select_city$/,
239
        qr/^select_city$/,
240
        qr/^new_guarantor_/,
240
        qr/^new_guarantor_/,
(-)a/members/mod_debarment.pl (-1 / +2 lines)
Lines 44-49 if ( $action eq 'del' ) { Link Here
44
    DelDebarment( scalar $cgi->param('borrower_debarment_id') );
44
    DelDebarment( scalar $cgi->param('borrower_debarment_id') );
45
} elsif ( $action eq 'add' ) {
45
} elsif ( $action eq 'add' ) {
46
    my $expiration = $cgi->param('expiration');
46
    my $expiration = $cgi->param('expiration');
47
    my $type = $cgi->param('debarred_type') // 'MANUAL';
47
    if ($expiration) {
48
    if ($expiration) {
48
        $expiration = dt_from_string($expiration);
49
        $expiration = dt_from_string($expiration);
49
        $expiration = $expiration->ymd();
50
        $expiration = $expiration->ymd();
Lines 51-57 if ( $action eq 'del' ) { Link Here
51
52
52
    AddDebarment(
53
    AddDebarment(
53
        {   borrowernumber => $borrowernumber,
54
        {   borrowernumber => $borrowernumber,
54
            type           => 'MANUAL',
55
            type           => $type,
55
            comment        => scalar $cgi->param('comment'),
56
            comment        => scalar $cgi->param('comment'),
56
            expiration     => $expiration,
57
            expiration     => $expiration,
57
        }
58
        }
(-)a/members/moremember.pl (-2 / +1 lines)
Lines 82-88 for (qw(gonenoaddress lost borrowernotes is_debarred)) { Link Here
82
82
83
$template->param(
83
$template->param(
84
    restriction_types => scalar Koha::RestrictionTypes->keyed_on_code()
84
    restriction_types => scalar Koha::RestrictionTypes->keyed_on_code()
85
}
85
);
86
86
87
if ( $patron->is_debarred ) {
87
if ( $patron->is_debarred ) {
88
    $template->param(
88
    $template->param(
89
- 

Return to bug 23681