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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-32 / +2 lines)
Lines 492-506 Link Here
492
                            [% IF ( reserve_in_future ) %]
492
                            [% IF ( reserve_in_future ) %]
493
                                <li>
493
                                <li>
494
                                    <label for="from">Hold starts on date:</label>
494
                                    <label for="from">Hold starts on date:</label>
495
                                    <input id="reserve_date" name="reserve_date" id="from" size="10" type="text" >
495
                                    <input id="reserve_date" name="reserve_date" id="from" size="10" type="text" data-start_for="expiration_date" class="flatpickr futuredate" />
496
                                    <input type="hidden" class="datepickerfrom_hidden" />
497
                                </li>
496
                                </li>
498
                            [% END %]
497
                            [% END %]
499
498
500
                            <li>
499
                            <li>
501
                                <label for="to">Hold expires on date:</label>
500
                                <label for="to">Hold expires on date:</label>
502
                                <input id="expiration_date" name="expiration_date" id="to" size="10" type="text" />
501
                                <input id="expiration_date" name="expiration_date" id="to" size="10" type="text" class="flatpickr" />
503
                                <input type="hidden" class="datepickerto_hidden" />
504
                            </li>
502
                            </li>
505
503
506
                            [% UNLESS ( multi_hold ) %]
504
                            [% UNLESS ( multi_hold ) %]
Lines 1154-1182 Link Here
1154
            [% END %]
1152
            [% END %]
1155
1153
1156
1154
1157
            var startPicker = $("#reserve_date").flatpickr({
1158
                minDate: new Date().fp_incr(1), /* Require that "Hold starts on date" be in the future */
1159
                onChange: function(selectedDates, dateStr, instance) {
1160
                    altFormat = instance.formatDate(selectedDates[0], "Y-m-d");
1161
                    $(".datepickerfrom_hidden").val( altFormat ); /* Populate hidden field with ISO-formatted date */
1162
                },
1163
                onClose: function( selectedDates, dateText, instance) {
1164
                    validate_date( selectedDates, instance );
1165
                    endPicker.set('minDate', selectedDates[0]);
1166
                }
1167
            });
1168
1169
            var endPicker = $("#expiration_date").flatpickr({
1170
                minDate: new Date().fp_incr(1), // Require that "Hold expires on date" be in the future
1171
                onChange: function(selectedDates, dateStr, instance) {
1172
                    altFormat = instance.formatDate(selectedDates[0], "Y-m-d");
1173
                    $(".datepickerto_hidden").val( altFormat ); /* Populate hidden field with ISO-formatted date */
1174
                },
1175
                onClose: function( selectedDates, dateText, instance) {
1176
                    validate_date( selectedDates, instance );
1177
                },
1178
            });
1179
1180
            var my_table = $("#requestspecific").dataTable($.extend(true, {}, dataTablesDefaults, {
1155
            var my_table = $("#requestspecific").dataTable($.extend(true, {}, dataTablesDefaults, {
1181
                'bPaginate': false,
1156
                'bPaginate': false,
1182
                "sDom": '<"top pager"ilf>t',
1157
                "sDom": '<"top pager"ilf>t',
Lines 1203-1212 Link Here
1203
                    data.patron_id = $('input[name="borrowernumber"]').val();
1178
                    data.patron_id = $('input[name="borrowernumber"]').val();
1204
                if($('textarea[name="notes"]').length)
1179
                if($('textarea[name="notes"]').length)
1205
                    data.notes = $('textarea[name="notes"]').val()||null;
1180
                    data.notes = $('textarea[name="notes"]').val()||null;
1206
                if($('.datepickerto_hidden').length)
1207
                    data.expiration_date = $('.datepickerto_hidden').val()||null;
1208
                if($('.datepickerfrom_hidden').length)
1209
                    data.hold_date = $('.datepickerfrom_hidden').val()||null;
1210
                if($('input[name="itemtype"]').length) {
1181
                if($('input[name="itemtype"]').length) {
1211
                    data.item_type = $('input[name="itemtype"]').val()||null;
1182
                    data.item_type = $('input[name="itemtype"]').val()||null;
1212
                }
1183
                }
1213
- 

Return to bug 29270