Browse Source

Bug 29735: Remove flatpickr init from categories.js and holds.js

Same as bug 29394, we want the flatpickr instanciations be done at the
same place, from calendar.inc. That way they will all behave
identically.

Test plan:
Edit a patron category and confirm that the "until date" calendar has
the "yesterday" and "today" dates disabled

Place a hold on an item, go to the patron detail page, click the "holds"
tab, suspend.
That should trigger a modal that will display a calendar with
"yesterday" and "today" dates disabled

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
22.05.x
Jonathan Druart 2 years ago
committed by Fridolin Somers
parent
commit
093cffe7c1
  1. 2
      koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt
  2. 2
      koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt
  3. 2
      koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt
  4. 4
      koha-tmpl/intranet-tmpl/prog/js/categories.js
  5. 5
      koha-tmpl/intranet-tmpl/prog/js/holds.js

2
koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt

@ -157,7 +157,7 @@
</li>
<li>
<label for="enrolmentperioddate">Until date: </label>
<input type="text" class="enrollmentperiod" name="enrolmentperioddate" id="enrolmentperioddate" value="[% category.enrolmentperioddate | $KohaDates %]" />
<input type="text" class="enrollmentperiod flatpickr" data-flatpickr-futuredate="true" name="enrolmentperioddate" id="enrolmentperioddate" value="[% category.enrolmentperioddate | $KohaDates %]" />
</li>
</ol>
</fieldset>

2
koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt

@ -857,7 +857,6 @@
[% INCLUDE 'datatables.inc' %]
[% Asset.js("lib/jquery/plugins/rowGroup/dataTables.rowGroup.min.js") | $raw %]
[% INCLUDE 'columns_settings.inc' %]
[% INCLUDE 'calendar.inc' %]
[% Asset.js("lib/jquery/plugins/jquery-ui-timepicker-addon.min.js") | $raw %]
[% INCLUDE 'timepicker.inc' %]
[% INCLUDE 'select2.inc' %]
@ -887,6 +886,7 @@
[% Asset.js("js/pages/circulation.js") | $raw %]
[% Asset.js("js/checkouts.js") | $raw %]
[% Asset.js("js/holds.js") | $raw %]
[% INCLUDE 'calendar.inc' %]
[% INCLUDE 'str/members-menu.inc' %]
[% Asset.js("js/members-menu.js") | $raw %]
<script>

2
koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt

@ -1130,12 +1130,12 @@
[% MACRO jsinclude BLOCK %]
[% INCLUDE 'datatables.inc' %]
[% INCLUDE 'calendar.inc' %]
[% INCLUDE 'columns_settings.inc' %]
[% Asset.js("lib/hc-sticky.js") | $raw %]
[% Asset.js("js/circ-patron-search-results.js") | $raw %]
[% INCLUDE 'select2.inc' %]
[% Asset.js("js/holds.js") | $raw%]
[% INCLUDE 'calendar.inc' %]
<script>
var Sticky;
var biblionumber = "[% biblionumber | $raw %]";

4
koha-tmpl/intranet-tmpl/prog/js/categories.js

@ -38,10 +38,6 @@ $(document).ready(function() {
"exportColumns": [0,1,2,3,4,5,6,7,8,9,10,11,12],
}, columns_settings);
$("#enrolmentperioddate").flatpickr({
minDate: new Date().fp_incr(1)
});
if ($("#branches option:selected").length < 1) {
$("#branches option:first").attr("selected", "selected");
}

5
koha-tmpl/intranet-tmpl/prog/js/holds.js

@ -384,7 +384,7 @@ $(document).ready(function() {
<input type='hidden' id='suspend-modal-reserve_id' name='reserve_id' />\
\
<label for='suspend-modal-until'>" + __("Suspend until:") + "</label>\
<input name='suspend_until' id='suspend-modal-until' class='suspend-until' size='10' />\
<input name='suspend_until' id='suspend-modal-until' class='suspend-until flatpickr' data-flatpickr-futuredate='true' size='10' />\
\
<p><a class='btn btn-link' id='suspend-modal-clear-date' >" + __("Clear date to suspend indefinitely") + "</a></p>\
\
@ -400,9 +400,6 @@ $(document).ready(function() {
</div>\
");
$("#suspend-modal-until").flatpickr({
minDate: new Date().fp_incr(1) // Require that "until date" be in the future
});
$("#suspend-modal-clear-date").on( "click", function() { $("#suspend-modal-until").val(""); } );
$("#suspend-modal-submit").on( "click", function( e ) {

Loading…
Cancel
Save