Compare commits

...

13 Commits

Author SHA1 Message Date
Jonathan Druart f4dcabc3bd Bug 29478: Compiled CSS 2 years ago
Jonathan Druart a91325387b Bug 29478: (follow-up) Today should select now for pastinclusive 2 years ago
Jonathan Druart 03884cc9f9 Bug 29478: Today should select now for pastinclusive 2 years ago
Owen Leonard 58cec67dbd Bug 29478: (follow-up) Provide default style for shortcut buttons 2 years ago
Jonathan Druart 622b4c019b Bug 29478: Flatpickr - Restore 'Today' button 2 years ago
Jonathan Druart 6cc3e618d8 Bug 29500: Flatpickr - accept original date in the past and not others 2 years ago
Jonathan Druart 4f5670c889 Bug 29394: Remove futuredate for renew 2 years ago
Jonathan Druart 7ed705056d Bug 29394: adjust request.tt 2 years ago
Owen Leonard 8fb01c0453 Bug 29394: (follow-up) Pass correct time format and other corrections 2 years ago
Jonathan Druart bcfd3849a9 Bug 29394: Remove flatpickr instantiations from most of the tt files 2 years ago
Katrin Fischer 106f791e61 Bug 29010: (QA follow-up) Change inputmode from numeric to decimal 2 years ago
Thomas Klausner 0673c73c5f Bug 29010: fix pattern in search_field.weight 3 years ago
Jonathan Druart df87d3ab23 Bug 17600: Fix opac/unapi 2 years ago
  1. 2
      koha-tmpl/intranet-tmpl/lib/flatpickr/shortcut-buttons-flatpickr.min.js
  2. 2
      koha-tmpl/intranet-tmpl/prog/css/calendar.css
  3. 2
      koha-tmpl/intranet-tmpl/prog/css/installer.css
  4. 33
      koha-tmpl/intranet-tmpl/prog/css/src/_flatpickr.scss
  5. 2
      koha-tmpl/intranet-tmpl/prog/css/staff-global.css
  6. 2
      koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc
  7. 87
      koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc
  8. 4
      koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc
  9. 2
      koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt
  10. 2
      koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
  11. 10
      koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt
  12. 21
      koha-tmpl/intranet-tmpl/prog/en/modules/circ/renew.tt
  13. 11
      koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt
  14. 7
      koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt
  15. 2
      koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt
  16. 2
      koha-tmpl/intranet-tmpl/prog/en/modules/reports/borrowers_out.tt
  17. 11
      koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt
  18. 2
      koha-tmpl/intranet-tmpl/prog/en/modules/tools/scheduler.tt
  19. 2
      opac/unapi

2
koha-tmpl/intranet-tmpl/lib/flatpickr/shortcut-buttons-flatpickr.min.js

@ -0,0 +1,2 @@
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ShortcutButtonsPlugin=e():t.ShortcutButtonsPlugin=e()}(window,function(){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:o})},n.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const o={theme:"light"};e.ShortcutButtonsPlugin=function(t){const e=Object.assign({},o,t);return t=>{let n;function o(n){n.stopPropagation(),n.preventDefault();const o=n.target;if("button"!==o.tagName.toLowerCase()||void 0===e.onClick)return;const r=parseInt(o.dataset.index,10),c=Array.isArray(e.onClick)?e.onClick:[e.onClick];for(const e of c)"function"==typeof e&&e(r,t)}return{onReady:()=>{if((n=document.createElement("div")).classList.add("shortcut-buttons-flatpickr-wrapper",e.theme),void 0!==e.label&&e.label.length){const t=document.createElement("div");t.classList.add("shortcut-buttons-flatpickr-label"),t.textContent=e.label,n.appendChild(t)}const r=document.createElement("div");r.classList.add("shortcut-buttons-flatpickr-buttons"),(Array.isArray(e.button)?e.button:[e.button]).forEach((t,e)=>{const n=document.createElement("button");n.classList.add("shortcut-buttons-flatpickr-button"),n.textContent=t.label,n.dataset.index=String(e),r.appendChild(n)}),n.appendChild(r),t.calendarContainer.appendChild(n),n.addEventListener("click",o)},onDestroy:()=>{n.removeEventListener("click",o),n=void 0}}}}}]).ShortcutButtonsPlugin});
//# sourceMappingURL=shortcut-buttons-flatpickr.min.js.map

2
koha-tmpl/intranet-tmpl/prog/css/calendar.css

File diff suppressed because one or more lines are too long

2
koha-tmpl/intranet-tmpl/prog/css/installer.css

File diff suppressed because one or more lines are too long

33
koha-tmpl/intranet-tmpl/prog/css/src/_flatpickr.scss

@ -963,3 +963,36 @@ span.flatpickr-weekday {
.flatpickr_wrapper {
white-space: nowrap;
}
/* Shortcut buttons plugin */
.shortcut-buttons-flatpickr-wrapper {
display: flex;
justify-content: center;
padding: 5px;
.shortcut-buttons-flatpickr-label {
align-content: center;
display: flex;
justify-content: center;
flex-direction: column;
padding: 0 5px;
}
.shortcut-buttons-flatpickr-buttons {
display: flex;
flex-flow: row wrap;
.shortcut-buttons-flatpickr-button {
background: transparent none;
border: 0;
color: #004D99;
font-size: 90%;
margin: 2px;
&:hover {
color: #538200;
}
}
}
}

2
koha-tmpl/intranet-tmpl/prog/css/staff-global.css

File diff suppressed because one or more lines are too long

2
koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc

@ -62,7 +62,7 @@
<li><label for="rcomment">Comment:</label> <input type="text" id="rcomment" name="comment" /></li>
<li>
<label for="rexpiration">Expiration:</label>
<input name="expiration" id="rexpiration" size="20" value="" class="flatpickr futuredate" type="text" />
<input name="expiration" id="rexpiration" size="20" value="" class="flatpickr" data-flatpickr-futuredate="true" type="text" />
</li>
</ol>
<fieldset class="action"><input type="submit" value="Add restriction" /> <a href="#" class="cancel" id="cancel_manual_restriction">Cancel</a></fieldset>

87
koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc

@ -34,6 +34,7 @@
<!-- / calendar.inc -->
[% Asset.js("js/calendar.js") | $raw %]
[% Asset.js("lib/flatpickr/flatpickr.min.js") | $raw %]
[% Asset.js("lib/flatpickr/shortcut-buttons-flatpickr.min.js") | $raw %]
<script>
flatpickr.l10ns.default.weekdays = flatpickr_weekdays;
flatpickr.l10ns.default.months = flatpickr_months;
@ -78,20 +79,96 @@
var endPicker = document.querySelector("#"+thisInput.dataset.date_to)._flatpickr;
endPicker.set('minDate', selectedDates[0]);
}
let = on_close_focus = $(thisInput).data('flatpickr-on-close-focus');
if ( on_close_focus ) {
$(on_close_focus).focus();
}
},
plugins: [
ShortcutButtonsPlugin({
button: [
{
label: __("Yesterday")
},
{
label: __("Today")
},
{
label: __("Tomorrow")
}
],
label: __("or"),
onClick: (index, fp) => {
let date;
let hh = 23, mm = 59;
switch (index) {
case 0:
date = new Date().fp_incr(-1);
break;
case 1:
date = new Date();
if ( $(fp.input).data("flatpickr-pastinclusive") === true ) {
hh = date.getHours();
mm = date.getMinutes();
}
break;
case 2:
date = new Date().fp_incr(1);
break;
}
date.setHours(hh, mm, 0, 0);
fp.setDate(date);
}
})
]
});
$(document).ready(function(){
$(".flatpickr").each(function(){
let options = {};
let refresh_max_date = 0;
if( $(this).data("flatpickr-futuredate") === true ) {
let original_date = $(this).val();
if ( original_date ) {
original_date = Date_from_syspref( original_date ).getTime();
let tomorrow = new Date().fp_incr(1).getTime();
if( $(this).hasClass("futuredate") ) {
options['minDate'] = new Date().fp_incr(1);
options['allowInvalidPreload'] = true;
options['enable'] = [function(date){
date = date.getTime();
if ( date == original_date ) return true;
if ( date >= tomorrow) return true;
}];
}
else {
options['minDate'] = new Date().fp_incr(1);
}
}
if( $(this).hasClass("pastdate") ) {
if( $(this).data("flatpickr-pastinclusive") === true ) {
options['maxDate'] = new Date(); /* Not today or hh:mm will be 00:00 */
refresh_max_date = 1;
}
if( $(this).data("flatpickr-pastdate") === true ) {
options['maxDate'] = new Date().fp_incr(-1);
}
$(this).flatpickr(options);
if ( $(this).data('flatpickr-enable-time') === true ) {
options['enableTime'] = true;
options['dateFormat'] = flatpickr_dateformat_string + " " + flatpickr_timeformat_string;
}
let fp = $(this).flatpickr(options);
if ( refresh_max_date ) {
/* Refresh the maxDate every 30 secondes to make sure the user will not
be stuck with the minute passed.
Adding 1 minute to not introduce a gap.
Example: last update at 40s, a new minute passed at 00.
Between 00 and 10s the user won't be able click 'Today'.
*/
setInterval(() => {
let now = new Date();
fp.set("maxDate", now.setMinutes(now.getMinutes() + 1));
}, 30000);
}
});
});
</script>

4
koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc

@ -114,7 +114,7 @@
[% END %]
</td>
<td>
<input type="text" class="flatpickr futuredate" value="[% hold.expirationdate | $KohaDates %]" size="10" name="expirationdate" />
<input type="text" class="flatpickr" data-flatpickr-futuredate="true" value="[% hold.expirationdate | $KohaDates %]" size="10" name="expirationdate" />
</td>
<td>
[%- IF ( hold.found ) -%]
@ -211,7 +211,7 @@
[% IF Koha.Preference('AutoResumeSuspendedHolds') %]
<label for="suspend_until_[% hold.reserve_id | html %]">[% IF ( hold.suspend ) %] on [% ELSE %] until [% END %]</label>
<input type="text" name="suspend_until_[% hold.reserve_id | html %]" id="suspend_until_[% hold.reserve_id | html %]" size="10" value="[% hold.suspend_until | $KohaDates %]" class="suspend_until_datepicker" />
<input type="text" name="suspend_until_[% hold.reserve_id | html %]" id="suspend_until_[% hold.reserve_id | html %]" size="10" value="[% hold.suspend_until | $KohaDates %]" class="flatpickr" data-flatpickr-futuredate="true" />
[%- ELSE -%]
<input type="hidden" name="suspend_until_[% hold.reserve_id | html %]" id="suspend_until_[% hold.reserve_id | html %]" value=""/>
[%- END -%]

2
koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt

@ -214,7 +214,7 @@ a.add, a.delete {
</td>
<td data-order="[% search_field.weight | html %]">
[% IF search_field.mapped_biblios %]
<input type="text" inputmode="numeric" pattern="[0-9]*" name="search_field_weight" value="[% search_field.weight | html %]" />
<input type="text" inputmode="decimal" pattern="[0-9\.]*" name="search_field_weight" value="[% search_field.weight | html %]" />
[% ELSE %]
<input type="text" name="search_field_weight" value="">
[% END %]

2
koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt

@ -875,7 +875,7 @@
[% IF Koha.Preference('AutoResumeSuspendedHolds') %]
<label for="suspend_until">until</label>
<input type="text" size="10" id="suspend_until" name="suspend_until" class="flatpickr futuredate"/>
<input type="text" size="10" id="suspend_until" name="suspend_until" class="flatpickr" data-flatpickr-futuredate="true" />
<span class="hint">Specify date on which to resume [% INCLUDE 'date-format.inc' %]: </span>
[% END %]
</form>

10
koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt

@ -112,7 +112,7 @@
<fieldset class="rows">
<legend>Due date: </legend>
<label for="duedatespec">Hard due date [% INCLUDE 'date-format.inc' %]:</label>
<input type="text" size="20" id="duedatespec" name="duedatespec" value="[% duedatespec | $KohaDates with_hours => 1 %]" />
<input type="text" size="20" id="duedatespec" name="duedatespec" value="[% duedatespec | $KohaDates with_hours => 1 %]" class="flatpickr" data-flatpickr-enable-time="true" />
</fieldset>
[% END %]
<input type="hidden" name="op" value="show" />
@ -357,14 +357,6 @@
],
"bPaginate": false
}));
[% IF Koha.Preference('SpecifyDueDate') %]
$("#duedatespec").flatpickr({
enableTime: true,
dateFormat: flatpickr_dateformat_string + " " + flatpickr_timeformat_string,
defaultDate: new Date().setHours(23, 59, 0, 0) /* Today a 11:59PM */
});
[% END %]
});
</script>

21
koha-tmpl/intranet-tmpl/prog/en/modules/circ/renew.tt

@ -147,7 +147,8 @@
<input type="hidden" name="override_limit" value="1" />
<input type="hidden" name="override_holds" value="1" />
<div>
<label for="renewonholdduedate">Renewal due date:</label> <input type="text" size="20" id="renewonholdduedate" name="renewonholdduedate" value="" />
<label for="renewonholdduedate">Renewal due date:</label>
<input type="text" size="20" id="renewonholdduedate" name="renewonholdduedate" value="" class="flatpickr" data-flatpickr-enable-time="true" />
</div>
<button type="submit" class="approve"><i class="fa fa-check"></i> Override and renew</button>
</form>
@ -219,7 +220,7 @@
<div class="circ-settings show">
<div class="date-select" id="renew_date_override_fields">
<div><label for="hard_due_date" class="hint">Renewal due date [% INCLUDE 'date-format.inc' %]:</label></div>
<input type="text" size="20" id="hard_due_date" name="hard_due_date" value="[% hard_due_date | $KohaDates with_hours => 1 %]" />
<input type="text" size="20" id="hard_due_date" name="hard_due_date" value="[% hard_due_date | $KohaDates with_hours => 1 %]" class="flatpickr" data-flatpickr-futuredate="true" data-flatpickr-enable-time="true" />
</div> <!-- /.date-select -->
</div>
</fieldset>
@ -251,22 +252,6 @@
});
</script>
[% END %]
<script>
$( document ).ready(function() {
var renewonholdduedate = $("#renewonholdduedate").flatpickr({
enableTime: true,
dateFormat: flatpickr_dateformat_string + " " + flatpickr_timeformat_string,
minDate: new Date().fp_incr(1)
});
[% IF Koha.Preference('SpecifyDueDate') %]
var hard_due_date = $("#hard_due_date").flatpickr({
enableTime: true,
dateFormat: flatpickr_dateformat_string + " " + flatpickr_timeformat_string,
});
[% END %]
});
</script>
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]

11
koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt

@ -808,7 +808,7 @@
<div class="date-select" id="return_date_override_fields">
<div class="hint">Specify return date [% INCLUDE 'date-format.inc' %]: </div>
<input type="text" size="20" class="pastdate" id="return_date_override" name="return_date_override" value="[% return_date_override | html %]" />
<input type="text" size="20" id="return_date_override" name="return_date_override" value="[% return_date_override | html %]" class="flatpickr" data-flatpickr-pastinclusive="true" data-flatpickr-enable-time="true" data-flatpickr-on-close-focus="#barcode" />
<div class="circ-setting">
[% IF ( return_date_override_remember ) %]
@ -1038,15 +1038,6 @@
"dom": 'B<"clearfix">t',
}, columns_settings);
$("#return_date_override").flatpickr({
enableTime: true,
dateFormat: flatpickr_dateformat_string + " " + flatpickr_timeformat_string,
maxDate: "today",
onClose: function() {
$("#barcode").focus();
}
});
$("#exemptcheck").change(function () {
if (this.checked == true) {
$("#barcode").addClass("input-warning");

7
koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt

@ -248,7 +248,7 @@
</li>
<li class="ill_checkout_due_date">
<label for="duedate" class="ill_checkout_duedate_label">Due date:</label>
<input name="duedate" id="ill_checkout_duedate_input" type="text" value="[% params.duedate | html %]"> [% INCLUDE 'date-format.inc' %]
<input name="duedate" id="ill_checkout_duedate_input" type="text" value="[% params.duedate | html %]" class="flatpickr" data-flatpickr-enable-time="true" /> [% INCLUDE 'date-format.inc' %]
<div class="hint">If you do not specify a due date, it will be set according to circulation rules</p>
</li>
</ol>
@ -840,11 +840,6 @@
// Set column settings
var columns_settings = [% TablesSettings.GetColumns( 'illrequests', 'ill-requests', 'ill-requests', 'json' ) %];
$("#ill_checkout_duedate_input").flatpickr({
enableTime: true,
dateFormat: flatpickr_dateformat_string + " " + flatpickr_timeformat_string,
});
[% IF services_json.length > 0 %]
var services = [% services_json | $raw %];
[% ELSE %]

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

@ -812,7 +812,7 @@
[% IF Koha.Preference('AutoResumeSuspendedHolds') %]
<label for="suspend_until">until</label>
<input type="text" size="10" id="suspend_until" name="suspend_until" class="flatpickr futuredate"/>
<input type="text" size="10" id="suspend_until" name="suspend_until" class="flatpickr" data-flatpickr-futuredate="true"/>
<span class="hint">Specify date on which to resume [% INCLUDE 'date-format.inc' %]: </span>
[% END %]
</fieldset>

2
koha-tmpl/intranet-tmpl/prog/en/modules/reports/borrowers_out.tt

@ -68,7 +68,7 @@
[% END %]
</select>
</li>
<li><label for="to">Not checked out since: </label> <input size="10" id="to" class="flatpickr pastdate" name="Filter" value="" type="text" />
<li><label for="to">Not checked out since: </label> <input size="10" id="to" class="flatpickr" data-flatpickr-pastdate="true" name="Filter" value="" type="text" />
</li>
</ol>
</fieldset>

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

@ -518,13 +518,13 @@
[% IF ( reserve_in_future ) %]
<li>
<label for="from">Hold starts on date:</label>
<input id="reserve_date" name="reserve_date" id="from" size="10" type="text" data-date_to="expiration_date" class="flatpickr futuredate" />
<input id="reserve_date" name="reserve_date" id="from" size="10" type="text" data-date_to="expiration_date" class="flatpickr" data-flatpickr-futuredate="true" />
</li>
[% END %]
<li>
<label for="to">Hold expires on date:</label>
<input id="expiration_date" name="expiration_date" id="to" size="10" type="text" class="flatpickr futuredate" />
<input id="expiration_date" name="expiration_date" id="to" size="10" type="text" class="flatpickr" data-flatpickr-futuredate="true" />
</li>
[% UNLESS ( multi_hold ) %]
@ -1209,13 +1209,6 @@
});
[% END %]
[% IF AutoResumeSuspendedHolds %]
$(".suspend_until_datepicker").flatpickr({
minDate: new Date().fp_incr(1) /* Require that "until date" be in the future */
});
[% END %]
var my_table = $("#requestspecific").dataTable($.extend(true, {}, dataTablesDefaults, {
'bPaginate': false,
"sDom": '<"top pager"ilf>t',

2
koha-tmpl/intranet-tmpl/prog/en/modules/tools/scheduler.tt

@ -46,7 +46,7 @@
<input type="text" name="starttime" id="starttime" value="" maxlength="5" size="5" /></li>
<li>
<label for="startdate">Date: </label>
<input type="text" size="10" id="startdate" name="startdate" class="flatpickr futuredate" value="" />
<input type="text" size="10" id="startdate" name="startdate" class="flatpickr" data-flatpickr-futuredate="true" value="" />
<div class="hint">[% INCLUDE 'date-format.inc' %]</div>
</li>
<li><label for="report">Report:</label>

2
opac/unapi

@ -38,7 +38,7 @@ an XML format such as OAI DC, RSS2, MARCXML, or MODS.
use CGI qw ( -utf8 );
use C4::Context;
use C4::Biblio;
use C4::Biblio qw( GetXmlBiblio );
use Koha::XSLT::Base;
my $cgi = CGI->new();

Loading…
Cancel
Save