diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc index 653221e4a9..1d06bca2d2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc @@ -125,6 +125,39 @@ jQuery(function($){ $.datepicker.setDefaults($.datepicker.regional['']); }); +/* jQuery Validator plugin custom method + This allows you to check that a given date falls after another. + It is required that a message be defined. + + Syntax: + $("#form_id").validate({ + rules: { + input_name_of_later_date_field: { + is_date_after: "#input_id_of_earlier_date_field" + }, + }, + messages: { + input_name_of_later_date_field: { + is_date_after: _("Validation error to be shown, i.e. End date must come after start date") + } + } + }); +*/ + +jQuery.validator.addMethod("is_date_after", +function(value, element, params) { + var from = Date_from_syspref( $(params).val() ); + var to = Date_from_syspref(value); + return to > from; +}); + +jQuery.validator.addMethod("date_on_or_after", +function(value, element, params) { + var from = Date_from_syspref( $(params).val() ); + var to = Date_from_syspref(value); + return to >= from; +}); + $(document).ready(function(){ $.datepicker.setDefaults({ diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt index 22b6d2ea81..cf7d6b3a52 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt @@ -119,13 +119,13 @@
-[% UNLESS close_form OR closed%] +[% UNLESS close_form OR closed OR duplicate_form %] [% INCLUDE 'budgets-admin-toolbar.inc' %] [% END %] [% IF ( duplicate_form ) %]

Duplicate budget

-
+
@@ -135,18 +135,21 @@
  • -
    [% INCLUDE 'date-format.inc' %]
    + Required +
    [% INCLUDE 'date-format.inc' %]
  • -
    [% INCLUDE 'date-format.inc' %]
    + Required +
    [% INCLUDE 'date-format.inc' %]
  • + Required
  • @@ -175,7 +178,8 @@
  • - Cancel + + Cancel
    @@ -190,7 +194,7 @@ [% ELSE %]

    Add budget

    [% END %] -
    +
    @@ -201,13 +205,15 @@
  • -
    [% INCLUDE 'date-format.inc' %]
    + Required +
    [% INCLUDE 'date-format.inc' %]
  • -
    [% INCLUDE 'date-format.inc' %]
    + Required +
    [% INCLUDE 'date-format.inc' %]
  • @@ -216,6 +222,7 @@ + Required
  • @@ -245,8 +252,7 @@
    - - + [% IF ( budget_period_id ) %] Cancel [% ELSE %] @@ -504,70 +510,6 @@ [% END %] [% Asset.js("js/acq.js") | $raw %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqcontract.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqcontract.tt index 8e596f21e8..b25ba7568f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqcontract.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqcontract.tt @@ -59,7 +59,7 @@ [% END %] [% IF ( add_form ) %] - + @@ -76,24 +76,27 @@
  • [% END %] -
  •   +
  •   + Required
  •  
  • -
  •   +
  •   -
    [% INCLUDE 'date-format.inc' %]
    + Required +
    [% INCLUDE 'date-format.inc' %]
  • -
  •   +
  •   -
    [% INCLUDE 'date-format.inc' %]
    + Required +
    [% INCLUDE 'date-format.inc' %]
  • - Cancel + Cancel
    [% END %] @@ -184,43 +187,23 @@ [% INCLUDE 'calendar.inc' %] [% Asset.js("js/acq.js") | $raw %] [% END %] [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tt index 941854a21b..79c3dbac8c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tt @@ -5,7 +5,7 @@ [% INCLUDE 'doc-head-open.inc' %] Koha › Administration › Budgets › Funds › Planning for [% budget_period_description | html %] by [% authcat | html %] [% INCLUDE 'doc-head-close.inc' %] - + @@ -99,7 +99,7 @@ [% line.estimated_amount | html %]  [% ELSE %] - + [% END %] @@ -137,7 +137,7 @@ [% UNLESS ( budget_line.budget_lock ) %] - + [% ELSE %]
    not owned
    [% END %] @@ -151,7 +151,7 @@ [% IF ( budget_period_locked ) %] [% ELSE %] -
    +
    [% END %] @@ -276,41 +276,10 @@
    [% MACRO jsinclude BLOCK %] - [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %] [% Asset.js("js/acq.js") | $raw %] [% END %] [% INCLUDE 'intranet-bottom.inc' %]