[Bug 16754] New: Use validation plugin when adding or editing budgets
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16754 Bug ID: 16754 Summary: Use validation plugin when adding or editing budgets Change sponsored?: --- Product: Koha Version: master Hardware: All URL: /cgi-bin/koha/admin/aqbudgetperiods.pl OS: All Status: ASSIGNED Severity: enhancement Priority: P5 - low Component: Acquisitions Assignee: oleonard@myacpl.org Reporter: oleonard@myacpl.org QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle@bywatersolutions.com, testopia@bugs.koha-community.org, veron@veron.ch There is a lot of custom form validation JavaScript in the budget editing template which can be handled instead by the jQuery validation plugin. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16754 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16754 --- Comment #1 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 52463 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=52463&action=edit Bug 16754 - Use validation plugin when adding or editing budgets 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 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16754 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |ASSIGNED --- Comment #2 from Owen Leonard <oleonard@myacpl.org> --- I see that the date comparison operation is handled better in other templates. I'm going to revise this patch to try to incorporate a working version. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16754 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #52463|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16754 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Use validation plugin when |Use validation plugin in |adding or editing budgets |budgets, planning, and | |contracts -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16754 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16754 --- Comment #3 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 52476 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=52476&action=edit 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 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. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16754 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |frederic@tamil.fr Status|Needs Signoff |Failed QA --- Comment #4 from Frédéric Demians <frederic@tamil.fr> --- There is something wrong (strange) in budget creation: - Create a new budget - Click on Save - A warning is displayed after Start date input box: This field is required. And the date picker is displayed - Pick a date. => The date is copied to the input box, but (1) it is red, and (2) the message 'This field is required' is still displayed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16754 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #5 from Owen Leonard <oleonard@myacpl.org> --- (In reply to Frédéric Demians from comment #4)
- Pick a date. => The date is copied to the input box, but (1) it is red, and (2) the message 'This field is required' is still displayed.
This is a problem not with this patch but with the way the validation plugin works together with the datepicker widget. Now that I know of the problem I can find it elsewhere too, for instance aqcontract.pl. I can try to find a solution, but I would like to do so as a separate bug if that's okay with everyone. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16754 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16754 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #52476|0 |1 is obsolete| | --- Comment #6 from Frédéric Demians <frederic@tamil.fr> --- Created attachment 54057 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=54057&action=edit 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 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: Frédéric Demians <f.demians@tamil.fr> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16754 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org Status|Signed Off |Failed QA --- Comment #7 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- I'm not sure how this is valid but, if you enter start date == end date, the validator tell you that it is not allowed. It's a change with before this patch. We could imagine a budget for only 1 day, which was allowed before, but not anymore. Feel free to contradict :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16754 --- Comment #8 from Owen Leonard <oleonard@myacpl.org> --- (In reply to Jonathan Druart from comment #7)
We could imagine a budget for only 1 day, which was allowed before, but not anymore.
That seems very unlikely. It wouldn't be difficult to add a new validation setting to allow the two dates to match, but I'm not sure it's worth it just for this form and without an indication that it's an important feature. I think this form should match others in Koha where the end date in a date span is required to be after the start. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16754 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16754 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #54057|0 |1 is obsolete| | --- Comment #9 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 79896 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=79896&action=edit 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. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16754 Michal Denar <black23@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16754 Michal Denar <black23@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #79896|0 |1 is obsolete| | --- Comment #10 from Michal Denar <black23@gmail.com> --- Created attachment 79940 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=79940&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16754 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16754 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #79940|0 |1 is obsolete| | --- Comment #11 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 80169 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80169&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16754 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com Status|Passed QA |Pushed to Master --- Comment #12 from Nick Clemens <nick@bywatersolutions.com> --- Awesome work all! Pushed to master for 18.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16754 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com Status|Pushed to Master |Pushed to Stable Severity|enhancement |minor --- Comment #13 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice bit of code tidying. Pushed to 18.05.x for 18.05.06 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16754 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #14 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- I prefer not to push to oldstable 17.11.x to avoid behavior and display changes -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16754 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to Stable |RESOLVED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16754 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #15 from David Cook <dcook@prosentient.com.au> --- It looks like this change actually broke aqplan.pl because it accidentally removed the Javascript that was used to add the "op" parameter, and the test plan didn't include testing saving budget plans. Oops! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16754 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |26496 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26496 [Bug 26496] Budget Plan save button doesn't save plans -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org