From 7959d06ec606de50a8cec45ce2ad2f9c6e9d7eb4 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 16 Jun 2016 09:28:01 -0400 Subject: [PATCH] Bug 16754 - Use validation plugin when adding or editing budgets Content-Type: text/plain; charset="utf-8" This patch removes the custom javascript form validation from the budget edit template and replaces it with validation via the validation plugin. I did not reproduce the date comparison portion of the script because it didn't work correctly in many cases. The datepicker enforces the requirement that the budget start date precedes the budget end date. Also changed: I added the "Required" text next to required fields. To test, apply the patch and test the budget creation process for adding, editing, and duplicating budgets. In all cases: - The start date and end date should be required - The description should be required - The budget amount should be required to be a number --- .../prog/en/modules/admin/aqbudgetperiods.tt | 103 +++++---------------- 1 file changed, 25 insertions(+), 78 deletions(-) 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 ecedbea..c312875 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt @@ -37,74 +37,6 @@ [% END %] @@ -252,13 +194,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

-
+
@@ -268,18 +210,21 @@
  • -
    [% INCLUDE 'date-format.inc' %]
    + Required +
    [% INCLUDE 'date-format.inc' %]
  • -
    [% INCLUDE 'date-format.inc' %]
    + Required +
    [% INCLUDE 'date-format.inc' %]
  • + Required
  • @@ -308,7 +253,7 @@
  • - Cancel + Cancel
    @@ -323,7 +268,7 @@ [% ELSE %]

    Add budget

    [% END %] -
    +
    @@ -334,13 +279,15 @@
  • -
    [% INCLUDE 'date-format.inc' %]
    + Required +
    [% INCLUDE 'date-format.inc' %]
  • -
    [% INCLUDE 'date-format.inc' %]
    + Required +
    [% INCLUDE 'date-format.inc' %]
  • @@ -349,6 +296,7 @@ + Required
  • @@ -378,8 +326,7 @@
    - - + [% IF ( budget_period_id ) %] Cancel [% ELSE %] -- 2.1.4