Description
Aleisha Amohia
2016-08-02 05:47:22 UTC
Created attachment 53872 [details] [review] Bug 17016: Button to clear all fields in budget planning I have used the function from admin --> circ and fines rules To test: 1) Go to Admin --> Budgets 2) Click a budget 3) Click Planning -> any option 4) Test the Auto-fill button to see what it does 5) Apply patch and refresh page 6) Should now be a Clear button. Both buttons should show as font-awesome buttons with appropriate icons 7) Click Clear button. Confirm it clears all fields, which then refresh to have 0.00 etc. (default values) Sponsored-by: Catalyst IT Hi, After applying the patch both buttons appear. After clicking on the auto-fill button the fields briefly populate, but then the page refeshes and they clear back to 0.00 again. > After clicking on the auto-fill button the fields briefly populate, but then
> the page refreshes and they clear back to 0.00 again.
I get this too.
Could you please try to rework the patch so that it doesn't use an inline event attribute? We shouldn't be adding new code which uses things attributes "onclick."
The "edit_row" ID on the <tr> is problematic because it is repeated for each row in the table, thus it isn't unique. If you're looking for a hook to target each individual row you could so something like <tr id="edit_row_[% budget_line.budget_id %]">
Created attachment 98049 [details] [review] Bug 17016: Button to clear all fields in budget planning I have used the function from admin --> circ and fines rules To test: 1) Go to Admin --> Budgets 2) Click a budget 3) Click Planning -> any option 4) Test the Auto-fill button to see what it does 5) Apply patch and refresh page 6) Should now be a Clear button 7) Auto-fill the row then click Clear button. Confirm it clears all fields and sets the fund remaining back to the original amount and styles. 8) Add another fund and confirm that this still works with multiple funds. Sponsored-by: Catalyst IT Created attachment 98060 [details] [review] Bug 17016: Button to clear all fields in budget planning I have used the function from admin --> circ and fines rules To test: 1) Go to Admin --> Budgets 2) Click a budget 3) Click Planning -> any option 4) Test the Auto-fill button to see what it does 5) Apply patch and refresh page 6) Should now be a Clear button 7) Auto-fill the row then click Clear button. Confirm it clears all fields and sets the fund remaining back to the original amount and styles. 8) Add another fund and confirm that this still works with multiple funds. Sponsored-by: Catalyst IT Signed-off-by: David Nind <david@davidnind.com> Created attachment 99047 [details] [review] Bug 17016: Button to clear all fields in budget planning I have used the function from admin --> circ and fines rules To test: 1) Go to Admin --> Budgets 2) Click a budget 3) Click Planning -> any option 4) Test the Auto-fill button to see what it does 5) Apply patch and refresh page 6) Should now be a Clear button 7) Auto-fill the row then click Clear button. Confirm it clears all fields and sets the fund remaining back to the original amount and styles. 8) Add another fund and confirm that this still works with multiple funds. Sponsored-by: Catalyst IT Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com> Comment on attachment 99047 [details] [review] Bug 17016: Button to clear all fields in budget planning Review of attachment 99047 [details] [review]: ----------------------------------------------------------------- ::: koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tt @@ +6,5 @@ > <title>Koha › Administration › Budgets › Funds › Planning for [% budget_period_description | html %] by [% authcat | html %]</title> > [% INCLUDE 'doc-head-close.inc' %] > <style>td.locked { background-image: url('[% interface | html %]/[% theme | html %]/img/locked.png'); padding-left : 20px; background-repeat: no-repeat; background-position: 5px 5px; } a.control { font-size:85%;text-decoration:none; } .plan_entry { text-align: right; width:90%; }</style> > +<script> > +</script> Not needed. @@ +317,5 @@ > + if (type != "button" && type != "submit" ) { > + $(this).val(""); > + $(this).prop('disabled', false); > + } > + if ( type == "checkbox" ) { When is it a checkbox? I always see text inputs. Created attachment 99552 [details] [review] Bug 17016: (follow-up) Removing unnecessary code Created attachment 99557 [details] [review] Bug 17016: Button to clear all fields in budget planning I have used the function from admin --> circ and fines rules To test: 1) Go to Admin --> Budgets 2) Click a budget 3) Click Planning -> any option 4) Test the Auto-fill button to see what it does 5) Apply patch and refresh page 6) Should now be a Clear button 7) Auto-fill the row then click Clear button. Confirm it clears all fields and sets the fund remaining back to the original amount and styles. 8) Add another fund and confirm that this still works with multiple funds. Sponsored-by: Catalyst IT Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 99558 [details] [review] Bug 17016: (follow-up) Removing unnecessary code Signed-off-by: David Nind <david@davidnind.com> Created attachment 99569 [details] [review] Bug 17016: Clear with 0.00 instead of blank Aleisha, David, what about clearing with the previous value 0.00, instead of blank? Created attachment 99842 [details] [review] Bug 17016: Button to clear all fields in budget planning Currently there is no way to undo the 'auto-fill'. This patch adds a 'clear' option that resets the row. To test: 1) Go to Admin --> Budgets 2) Click a budget 3) Click Planning -> any option 4) Test the Auto-fill button to see what it does 5) Apply patch and refresh page 6) Should now be a Clear button 7) Auto-fill the row then click Clear button. Confirm it clears all fields and sets the fund remaining back to the original amount and styles. 8) Add another fund and confirm that this still works with multiple funds. Sponsored-by: Catalyst IT Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 99843 [details] [review] Bug 17016: (follow-up) Removing unnecessary code Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 99844 [details] [review] Bug 17016: Clear with 0.00 instead of blank Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 99876 [details] [review] Bug 17016: (follow-up) Clear with 0.00 instead of blank (Use Price) Using Price, to formatted it correctly if needed So far it will not do anything as 'on_editing => 1' we keep 0.00, but it must be improved later (when we will handle that) Thanks for the quick followup Jonathan :) Nice work everyone! Pushed to master for 20.05 enhancement not backported to 19.11.x |