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 119-134 Link Here
119
                    </li>
119
                    </li>
120
                    <li>
120
                    <li>
121
                        <label for="lift_after_payment" class="required">Lift after payment: </label>
121
                        <label for="lift_after_payment" class="required">Lift after payment: </label>
122
                        <select type="text" name="lift_after_payment" id="lift_after_payment" class="required" required="required" />
122
                        <select type="text" name="lift_after_payment" id="lift_after_payment"/>
123
                            <option value="1" selected="selected">Yes</option>
123
                        [% IF restriction.lift_after_payment %]
124
                            <option value="0">No</option>
124
                            <option value="0">No</option>
125
                            <option value="1" selected="selected">Yes</option>
126
                        [% ELSE %]
127
                            <option value="0" selected="selected">No</option>
128
                            <option value="1">Yes</option>
129
                        [% END %]
125
                        </select>
130
                        </select>
126
                        <span class="required">Required</span>
127
                    </li>
131
                    </li>
128
                    <li>
132
                    <li>
129
                        <label for="fee_limit" class="required">Fee limit: </label>
133
                        <label for="fee_limit">Fee limit: </label>
130
                        <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" />
134
                        <input type="text" value="[% restriction.fee_limit | html %]" inputmode="decimal" pattern="^\d+(\.\d{2})?$" min="0" name="fee_limit" id="fee_limit" />
131
                        <span class="required">Required</span>
132
                    </li>
135
                    </li>
133
                [% ELSE %]
136
                [% ELSE %]
134
                    <li>
137
                    <li>
Lines 142-158 Link Here
142
                        <span class="required">Required</span>
145
                        <span class="required">Required</span>
143
                    </li>
146
                    </li>
144
                    <li>
147
                    <li>
145
                        <label for="lift_after_payment" class="required">Lift after payment: </label>
148
                        <label for="lift_after_payment">Lift after payment: </label>
146
                        <select type="text" name="lift_after_payment" id="lift_after_payment" class="required" required="required" />
149
                        <select type="text" name="lift_after_payment" id="lift_after_payment" />
147
                            <option value="1" selected="selected">Yes</option>
150
                            <option value="0" selected="selected">No</option>
148
                            <option value="0">No</option>
151
                            <option value="1">Yes</option>
149
                        </select>
152
                        </select>
150
                        <span class="required">Required</span>
151
                    </li>
153
                    </li>
152
                    <li>
154
                    <li>
153
                        <label for="fee_limit" class="required">Fee limit: </label>
155
                        <label for="fee_limit">Fee limit: </label>
154
                        <input type="text" inputmode="decimal" pattern="^\d+(\.\d{2})?$" min="0" name="fee_limit" id="fee_limit" class="required" required="required" />
156
                        <input type="text" inputmode="decimal" pattern="^\d+(\.\d{2})?$" min="0" name="fee_limit" id="fee_limit" />
155
                        <span class="required">Required</span>
156
                    </li>
157
                    </li>
157
                [% END %]
158
                [% END %]
158
            </ol>
159
            </ol>
Lines 264-269 Link Here
264
            [% ex.code | $raw %]: '[% ex.display_text | $raw %]',
265
            [% ex.code | $raw %]: '[% ex.display_text | $raw %]',
265
        [% END %]
266
        [% END %]
266
        };
267
        };
268
269
        //Require fee limit if "Lift after payment" is set true
270
        $("#lift_after_payment").on("change", function(){
271
            if($(this).val() == 1){
272
                $("#fee_limit").prop("required",true).after('<span class="required">Required</span>');
273
            } else {
274
                $("#fee_limit").prop("required",false).nextAll().remove();
275
            }
276
        });
267
    </script>
277
    </script>
268
    [% Asset.js("js/restrictiontypes.js") | $raw %]
278
    [% Asset.js("js/restrictiontypes.js") | $raw %]
269
[% END %]
279
[% END %]
270
- 

Return to bug 16223