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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc (-53 / +62 lines)
Lines 1-64 Link Here
1
<script type="text/javascript">
1
<script type="text/javascript">
2
   //<![CDATA[
2
   //<![CDATA[
3
3
        $(document).ready(function(e){
4
        function confirm_remove_restriction() {
4
            $("#remove_restriction").on("click",function(){
5
            return confirm(_("Remove restriction?"));
5
                return confirm(_("Remove restriction?"));
6
        }
6
            });
7
7
            var mrform = $("#manual_restriction_form");
8
            var mrlink = $("#add_manual_restriction");
9
            mrform.hide();
10
            mrlink.on("click",function(e){
11
                $(this).hide();
12
                mrform.show();
13
                e.preventDefault();
14
            });
15
            $("#cancel_manual_restriction").on("click",function(e){
16
                mrlink.show();
17
                mrform.hide();
18
                e.preventDefault();
19
            });
20
        })
8
    //]]>
21
    //]]>
9
</script>
22
</script>
10
23
11
<div id="reldebarments">
24
<div id="reldebarments">
12
    [% UNLESS debarments %]<p>Patron is currently unrestricted.</p>[% END %]
25
    [% IF ( debarments.size < 1 ) %]
13
26
        <p>Patron is currently unrestricted.</p>
14
    <table>
27
    [% ELSE %]
15
        <thead>
28
        <table>
16
            <tr>
29
            <thead>
17
                 <th>Type</th>
18
                 <th>Comment</th>
19
                 <th>Expiration</th>
20
                 [% IF ( CAN_user_borrowers ) %]
21
                     <th>&nbsp;</th>
22
                 [% END %]
23
            </tr>
24
        </thead>
25
26
        <tbody>
27
            [% FOREACH d IN debarments %]
28
                <tr>
30
                <tr>
29
                    <td>[% d.type %]</td>
31
                     <th>Type</th>
30
                    <td>[% d.comment %]</td>
32
                     <th>Comment</th>
31
                    <td>[% IF d.expiration %] [% d.expiration | $KohaDates %] [% ELSE %] <i>Indefinite</i> [% END %]</td>
33
                     <th>Expiration</th>
32
                    [% IF ( CAN_user_borrowers )%]
34
                     [% IF ( CAN_user_borrowers ) %]
33
                        <td>
35
                         <th>&nbsp;</th>
34
                            <a href="/cgi-bin/koha/members/mod_debarment.pl?borrowernumber=[% borrowernumber %]&amp;borrower_debarment_id=[% d.borrower_debarment_id %]&amp;action=del" onclick="return confirm_remove_restriction()">
36
                     [% END %]
35
                                Remove
36
                            </a>
37
                        </td>
38
                    [% END %]
39
                </tr>
37
                </tr>
40
            [% END %]
38
            </thead>
41
        </tbody>
39
            <tbody>
42
40
                [% FOREACH d IN debarments %]
43
        [% IF ( CAN_user_borrowers )%]
44
            <form method="post" action="/cgi-bin/koha/members/mod_debarment.pl">
45
                <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
46
                <input type="hidden" name="action" value="add" />
47
48
                <tfoot>
49
                    <tr>
41
                    <tr>
50
                        <td>MANUAL</td>
42
                        <td>[% d.type %]</td>
51
                        <td><input type="text" name="comment" /></td>
43
                        <td>[% d.comment %]</td>
52
                        <td>
44
                        <td>[% IF d.expiration %] [% d.expiration | $KohaDates %] [% ELSE %] <i>Indefinite</i> [% END %]</td>
53
                            <input name="expiration" id="expiration" size="10" readonly="readonly" value="" class="datepicker" />
45
                        [% IF ( CAN_user_borrowers )%]
54
                            <a href='#' onclick="document.getElementById('expiration').value='';">Clear Date</a>
46
                            <td>
55
                        </td>
47
                                <a id="remove_restriction" href="/cgi-bin/koha/members/mod_debarment.pl?borrowernumber=[% borrowernumber %]&amp;borrower_debarment_id=[% d.borrower_debarment_id %]&amp;action=del">
56
                        <td>
48
                                    Remove
57
                            <input type="submit" value="Add restriction" />
49
                                </a>
58
                        </td>
50
                            </td>
51
                        [% END %]
59
                    </tr>
52
                    </tr>
60
                </tfoot>
53
                [% END %]
61
            </form>
54
            </tbody>
62
        [% END %]
55
        </table>
63
    </table>
56
    [% END %]
57
    <p><a href="#" id="add_manual_restriction">Add manual restriction</a></p>
58
    [% IF ( CAN_user_borrowers )%]
59
        <form method="post" action="/cgi-bin/koha/members/mod_debarment.pl" class="clearfix">
60
            <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
61
            <input type="hidden" name="action" value="add" />
62
            <fieldset class="rows" id="manual_restriction_form">
63
                <legend>Add manual restriction</legend>
64
                <ol>
65
                    <li><label for="rcomment">Comment:</label> <input type="text" id="rcomment" name="comment" /></li>
66
                    <li><label for="rexpiration">Expiration:</label> <input name="expiration" id="rexpiration" size="10" readonly="readonly" value="" class="datepicker" />
67
                        <a href='#' onclick="document.getElementById('expiration').value='';">Clear date</a></li>
68
                </ol>
69
            <fieldset class="action"><input type="submit" value="Add restriction" /> <a href="#" class="cancel" id="cancel_manual_restriction">Cancel</a></fieldset>
70
            </fieldset>
71
        </form>
72
    [% END %]
64
</div>
73
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (-39 / +56 lines)
Lines 39-44 Link Here
39
        [% END %]
39
        [% END %]
40
        $("#dateofbirth").datepicker({ maxDate: "-1D" });
40
        $("#dateofbirth").datepicker({ maxDate: "-1D" });
41
        $("#entryform").preventDoubleFormSubmit();
41
        $("#entryform").preventDoubleFormSubmit();
42
43
        var mrform = $("#manual_restriction_form");
44
        var mrlink = $("#add_manual_restriction");
45
        mrform.hide();
46
        mrlink.on("click",function(e){
47
            $(this).hide();
48
            mrform.show();
49
            e.preventDefault();
50
        });
51
        $("#cancel_manual_restriction").on("click",function(e){
52
            $('#debarred_expiration').val('');
53
            $('#add_debarment').prop('checked', false);
54
            $('#debarred_comment').val('');
55
            mrlink.show();
56
            mrform.hide();
57
            e.preventDefault();
58
        });
42
    });
59
    });
43
60
44
    function clear_entry(node) {
61
    function clear_entry(node) {
Lines 1163-1212 Link Here
1163
1180
1164
			</ol>
1181
			</ol>
1165
			</fieldset>
1182
			</fieldset>
1166
    
1183
1167
              <fieldset class="rows">
1184
              <fieldset class="rows">
1168
                <legend>Patron restrictions</legend>
1185
                <legend>Patron restrictions</legend>
1169
1186
1170
                [% UNLESS debarments %]<p>Patron is currently unrestricted.</p>[% END %]
1187
                [% IF ( debarments.size < 1 ) %]
1171
1188
                    <p>Patron is currently unrestricted.</p>
1172
                <table>
1189
                [% ELSE %]
1173
                    <thead>
1190
                    <table>
1174
                        <tr>
1191
                        <thead>
1175
                             <th>Type</th>
1176
                             <th>Comment</th>
1177
                             <th>Expiration</th>
1178
                             <th>Remove?</th>
1179
                        </tr>
1180
                    </thead>
1181
1182
                    <tbody>
1183
                        [% FOREACH d IN debarments %]
1184
                            <tr>
1192
                            <tr>
1185
                                <td>[% d.type %]</td>
1193
                                 <th>Type</th>
1186
                                <td>[% d.comment %]</td>
1194
                                 <th>Comment</th>
1187
                                <td>[% IF d.expiration %] [% d.expiration | $KohaDates %] [% ELSE %] <i>Indefinite</i> [% END %]</td>
1195
                                 <th>Expiration</th>
1188
                                <td>
1196
                                 <th>Remove?</th>
1189
                                    <input type="checkbox" id="debarment_[% d.borrower_debarment_id %]" name="remove_debarment" value="[% d.borrower_debarment_id %]" />
1190
                                </td>
1191
                            </tr>
1197
                            </tr>
1192
                        [% END %]
1198
                        </thead>
1193
                    </tbody>
1199
1200
                        <tbody>
1201
                            [% FOREACH d IN debarments %]
1202
                                <tr>
1203
                                    <td>[% d.type %]</td>
1204
                                    <td>[% d.comment %]</td>
1205
                                    <td>[% IF d.expiration %] [% d.expiration | $KohaDates %] [% ELSE %] <i>Indefinite</i> [% END %]</td>
1206
                                    <td>
1207
                                        <input type="checkbox" id="debarment_[% d.borrower_debarment_id %]" name="remove_debarment" value="[% d.borrower_debarment_id %]" />
1208
                                    </td>
1209
                                </tr>
1210
                            [% END %]
1211
                        </tbody>
1212
                    </table>
1213
                [% END %]
1214
                    <p><a href="#" id="add_manual_restriction">Add manual restriction</a></p>
1215
                    <fieldset id="manual_restriction_form">
1216
                        <input type="hidden" id="add_debarment" name="add_debarment" value="1" />
1217
                        <legend>Add manual restriction</legend>
1218
                        <ol>
1219
                            <li><label for="debarred_comment">Comment: </label><input type="text" id="debarred_comment" name="debarred_comment" onchange="$('#add_debarment').prop('checked', true);" /></li>
1220
                            <li><label for="debarred_expiration">Expiration: </label><input name="debarred_expiration" id="debarred_expiration" size="10" readonly="readonly" value="" class="datepicker" onchange="$('#add_debarment').prop('checked', true);" />
1221
                                    <a href='javascript:void(0)' onclick="$('#debarred_expiration').val('');">Clear date</a></li>
1194
1222
1195
                    <tfoot>
1223
                        </ol>
1196
                        <tr>
1224
                        <p>
1197
                            <td>
1225
                            <a class="cancel" id="cancel_manual_restriction" href="#" onclick="">Cancel</a>
1198
                                Add new
1226
                        </p>
1199
                                <input type="checkbox" id="add_debarment" name="add_debarment" value="1" />
1227
                    </fieldset>
1200
                            </td>
1201
                            <td><input type="text" id="debarred_comment" name="debarred_comment" onchange="$('#add_debarment').prop('checked', true);" /></td>
1202
                            <td>
1203
                                <input name="debarred_expiration" id="debarred_expiration" size="10" readonly="readonly" value="" class="datepicker" onchange="$('#add_debarment').prop('checked', true);" />
1204
                                <a href='javascript:void(0)' onclick="$('#debarred_expiration').val('');">Clear date</a>
1205
                            </td>
1206
                            <td><a class="btn" href='javascript:void(0)' onclick="$('#debarred_expiration').val(''); $('#add_debarment').prop('checked', false); $('#debarred_comment').val('');">Clear new restriction</a></td>
1207
                        </tr>
1208
                    </tfoot>
1209
                </table>
1210
            </fieldset>
1228
            </fieldset>
1211
		[% END %]
1229
		[% END %]
1212
1230
1213
- 

Return to bug 2720