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>