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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/restrictions.tt (-15 / +24 lines)
Lines 103-118 Link Here
103
                    </li>
103
                    </li>
104
                    <li>
104
                    <li>
105
                        <label for="lift_after_payment" class="required">Lift after payment: </label>
105
                        <label for="lift_after_payment" class="required">Lift after payment: </label>
106
                        <select type="text" name="lift_after_payment" id="lift_after_payment" class="required" required="required" />
106
                        <select type="text" name="lift_after_payment" id="lift_after_payment"/>
107
                            <option value="1" selected="selected">Yes</option>
107
                        [% IF restriction.lift_after_payment %]
108
                            <option value="0">No</option>
108
                            <option value="0">No</option>
109
                            <option value="1" selected="selected">Yes</option>
110
                        [% ELSE %]
111
                            <option value="0" selected="selected">No</option>
112
                            <option value="1">Yes</option>
113
                        [% END %]
109
                        </select>
114
                        </select>
110
                        <span class="required">Required</span>
111
                    </li>
115
                    </li>
112
                    <li>
116
                    <li>
113
                        <label for="fee_limit" class="required">Fee limit: </label>
117
                        <label for="fee_limit">Fee limit: </label>
114
                        <input type="text" value="[% restriction.fee_limit | html %]" inputmode="decimal" pattern="^\d+(\.\d{2})?$" min="0" name="fee_limit" id="fee_limit" class="required" required="required" />
118
                        <input type="text" value="[% restriction.fee_limit | html %]" inputmode="decimal" pattern="^\d+(\.\d{2})?$" min="0" name="fee_limit" id="fee_limit" />
115
                        <span class="required">Required</span>
116
                    </li>
119
                    </li>
117
                [% ELSE %]
120
                [% ELSE %]
118
                    <li>
121
                    <li>
Lines 126-142 Link Here
126
                        <span class="required">Required</span>
129
                        <span class="required">Required</span>
127
                    </li>
130
                    </li>
128
                    <li>
131
                    <li>
129
                        <label for="lift_after_payment" class="required">Lift after payment: </label>
132
                        <label for="lift_after_payment">Lift after payment: </label>
130
                        <select type="text" name="lift_after_payment" id="lift_after_payment" class="required" required="required" />
133
                        <select type="text" name="lift_after_payment" id="lift_after_payment" />
131
                            <option value="1" selected="selected">Yes</option>
134
                            <option value="0" selected="selected">No</option>
132
                            <option value="0">No</option>
135
                            <option value="1">Yes</option>
133
                        </select>
136
                        </select>
134
                        <span class="required">Required</span>
135
                    </li>
137
                    </li>
136
                    <li>
138
                    <li>
137
                        <label for="fee_limit" class="required">Fee limit: </label>
139
                        <label for="fee_limit">Fee limit: </label>
138
                        <input type="text" inputmode="decimal" pattern="^\d+(\.\d{2})?$" min="0" name="fee_limit" id="fee_limit" class="required" required="required" />
140
                        <input type="text" inputmode="decimal" pattern="^\d+(\.\d{2})?$" min="0" name="fee_limit" id="fee_limit" />
139
                        <span class="required">Required</span>
140
                    </li>
141
                    </li>
141
                [% END %]
142
                [% END %]
142
            </ol>
143
            </ol>
Lines 249-254 Link Here
249
            [% ex.code | $raw %]: '[% ex.display_text | $raw %]',
250
            [% ex.code | $raw %]: '[% ex.display_text | $raw %]',
250
        [% END %]
251
        [% END %]
251
        };
252
        };
253
254
        //Require fee limit if "Lift after payment" is set true
255
        $("#lift_after_payment").on("change", function(){
256
            if($(this).val() == 1){
257
                $("#fee_limit").prop("required",true).after('<span class="required">Required</span>');
258
            } else {
259
                $("#fee_limit").prop("required",false).nextAll().remove();
260
            }
261
        });
252
    </script>
262
    </script>
253
    [% Asset.js("js/restrictiontypes.js") | $raw %]
263
    [% Asset.js("js/restrictiontypes.js") | $raw %]
254
[% END %]
264
[% END %]
255
- 

Return to bug 16223