diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc index f13a1fa4a5..123ca8739e 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 ea68e0db1d..70a9835863 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt @@ -118,13 +118,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

-
+
@@ -134,18 +134,21 @@
  • -
    [% INCLUDE 'date-format.inc' %]
    + Required +
    [% INCLUDE 'date-format.inc' %]
  • -
    [% INCLUDE 'date-format.inc' %]
    + Required +
    [% INCLUDE 'date-format.inc' %]
  • - + + Required
  • @@ -174,7 +177,8 @@
  • - Cancel + + Cancel
    @@ -189,7 +193,7 @@ [% ELSE %]

    Add budget

    [% END %] -
    +
    @@ -200,13 +204,15 @@
  • -
    [% INCLUDE 'date-format.inc' %]
    + Required +
    [% INCLUDE 'date-format.inc' %]
  • -
    [% INCLUDE 'date-format.inc' %]
    + Required +
    [% INCLUDE 'date-format.inc' %]
  • @@ -214,7 +220,8 @@ + size="48" maxlength="80" value="[% budget_period_description | html %]" /> + Required
  • @@ -244,8 +251,7 @@
    - - + [% IF ( budget_period_id ) %] Cancel [% ELSE %] @@ -499,71 +505,7 @@ [% Asset.js("lib/jquery/plugins/treetable/jquery.treetable.js") %] [% END %] [% Asset.js("js/acq.js") %] - [% 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 4b0ab5f55c..dcb2a4f720 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 %] @@ -178,44 +181,24 @@ [% MACRO jsinclude BLOCK %] [% INCLUDE 'calendar.inc' %] [% Asset.js("js/acq.js") %] - [% 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 324e08946c..357f650946 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tt @@ -4,7 +4,7 @@ [% INCLUDE 'doc-head-open.inc' %] Koha › Administration › Budgets › Funds › Planning for [% budget_period_description %] by [% authcat %] [% INCLUDE 'doc-head-close.inc' %] - + @@ -98,7 +98,7 @@ [% line.estimated_amount %]  [% ELSE %] - + [% END %] @@ -136,7 +136,7 @@ [% UNLESS ( budget_line.budget_lock ) %] - + [% ELSE %]
    not owned
    [% END %] @@ -150,7 +150,7 @@ [% IF ( budget_period_locked ) %] [% ELSE %] -
    +
    [% END %] @@ -270,41 +270,10 @@
    [% MACRO jsinclude BLOCK %] - [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") %] [% Asset.js("js/acq.js") %] - [% END %] [% INCLUDE 'intranet-bottom.inc' %]