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

Return to bug 16223