Bugzilla – Attachment 99842 Details for
Bug 17016
Button to clear all fields in budget planning
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17016: Button to clear all fields in budget planning
Bug-17016-Button-to-clear-all-fields-in-budget-pla.patch (text/plain), 3.88 KB, created by
Katrin Fischer
on 2020-02-29 22:50:29 UTC
(
hide
)
Description:
Bug 17016: Button to clear all fields in budget planning
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2020-02-29 22:50:29 UTC
Size:
3.88 KB
patch
obsolete
>From bb0ece4220232b7162d12484dc503ae823cfab8d Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Tue, 2 Aug 2016 05:47:28 +0000 >Subject: [PATCH] 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> >--- > .../intranet-tmpl/prog/en/modules/admin/aqplan.tt | 26 +++++++++++++++++++--- > 1 file changed, 23 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tt >index 7fff2ce4e7..768393f82b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tt >@@ -6,6 +6,8 @@ > <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> > </head> > > <body id="admin_aqplan" class="admin"> >@@ -63,13 +65,14 @@ > [% authvals_ro.code | html %]</th> > [% END %] > >- <th class="remaining">Fund remaining</th><th> </th> >+ <th class="remaining">Fund remaining</th> >+ <th>Actions</th> > </tr> > </thead> > > <tbody> > [% FOREACH budget_line IN budget_lines %] >- <tr> >+ <tr id="[% budget_line.budget_id | html %]"> > [% IF ( budget_line.budget_lock ) %] > <td class="locked" title="Fund locked"> > [% ELSE %] >@@ -135,9 +138,10 @@ > </table> > </td> > >- <td> >+ <td class="actions"> > [% UNLESS ( budget_line.budget_lock ) %] > <input type="button" class="auto_fill_row" data-budget-id="[% budget_line.budget_id | html %]" value="Auto-fill row"/> >+ <input type="button" class="clear_fields" data-budget-id="[% budget_line.budget_id | html %]" value="Clear"> > [% ELSE %] > <div style="color:red;">not owned</div> > [% END %] >@@ -305,6 +309,22 @@ > var budget_id = $(this).data("budget-id"); > autoFillRow( budget_id ); > }); >+ $(".clear_fields").on("click",function(){ >+ var budget_id = $(this).data("budget-id"); >+ var edit_row = $("#"+budget_id); >+ $(edit_row).find("input").each(function(){ >+ var type = $(this).attr("type"); >+ if (type != "button" && type != "submit" ) { >+ $(this).val(""); >+ $(this).prop('disabled', false); >+ } >+ if ( type == "checkbox" ) { >+ $(this).prop('checked', false); >+ } >+ }); >+ $("#budget_est_"+budget_id).text($("#budget_tot_"+budget_id).prev().text()); >+ $("#budget_est_"+budget_id).css("color","green"); >+ }); > }); > </script> > [% END %] >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 17016
:
53872
|
98049
|
98060
|
99047
|
99552
|
99557
|
99558
|
99569
| 99842 |
99843
|
99844
|
99876