Bug 16754: Use validation plugin in budgets, planning, and contracts
authorOwen Leonard <oleonard@myacpl.org>
Thu, 16 Jun 2016 13:28:01 +0000 (09:28 -0400)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Fri, 26 Oct 2018 12:13:59 +0000 (13:13 +0100)
commit736fcd1cb62413f6b2de3e3190da4edbe67e09a3
tree519f8a71b0e9684ec21b3135be42e506bdcf08e3
parent4b290f45cc15182afe5b5d6ddda9b2a5948de4d8
Bug 16754: Use validation plugin in budgets, planning, and contracts

This patch removes the custom javascript form validation from three
templates: Budgets, budget planning, and contracts. Validation via the
validation plugin is done instead.

This patch also removes use of event attributes like onclick and
onchange. Also changed: I added the "Required" text next to required
fields as necessary.

To test, apply the patch and go to Administration -> Budgets.

- Test the budget creation process for adding, editing, and duplicating
  budgets. In all cases:
  - The start date and end date should be required
  - You should be warned if you enter an end date which falls before the
    start date.
  - The description should be required
  - The budget amount should be required to be a number

To test the budget planning page:

Note that much of the JS removed from this template was unused. It
looked for inputs by the name 'est_total' which don't exist.

- When viewing the table of funds for a budget, select a choice from the
  'planning' toolbar menu.
  - Verify that after entering a numeric value in any cell, the
    'remaning' value at the end of the row is correctly updated.
  - Verify that after entering non-numeric data an error is displayed.
  - Verify that clicking the 'auto-fill' button at the end of the row
    works to fill any empty or zero-value fields with the remaning funds
    available.

To test the vendor contracts page:

- Go to Acquisitions -> Vendor -> Contracts
- Add or edit a contract
  - Confirm that name, start date, and end date are required.
  - Confirm that you are warned if you enter an end date which falls
    before the start date.

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 23265158fcab25f8f5188cea6f07af46812d41cc)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc
koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqcontract.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tt