Bugzilla – Attachment 53872 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.10 KB, created by
Aleisha Amohia
on 2016-08-02 05:51:21 UTC
(
hide
)
Description:
Bug 17016: Button to clear all fields in budget planning
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2016-08-02 05:51:21 UTC
Size:
3.10 KB
patch
obsolete
>From 585298dc9b805b0f02da87da8a82d3bd591ac08f 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 > >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 >--- > .../intranet-tmpl/prog/en/modules/admin/aqplan.tt | 30 +++++++++++++++++++--- > 1 file changed, 26 insertions(+), 4 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 66f6b9f..a33d705 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tt >@@ -37,6 +37,26 @@ > alert(alertString2); > } > } >+ >+ function clear_edit() { >+ var cancel = confirm(_("Are you sure you want to cancel your changes?")); >+ if ( !cancel ) return; >+ var edit_row = $("#edit_row"); >+ $(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); >+ } >+ }); >+ $(edit_row).find("select").prop('disabled', false); >+ $(edit_row).find("select option:first").attr("selected", "selected"); >+ $(edit_row).find("td:last input[name='clear']").remove(); >+ } >+ > $(document).ready(function() { > $("#selections input").on("change",function(e){ > var num = $(this).attr("id"); >@@ -114,13 +134,14 @@ > [% authvals_ro.code %]</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="edit_row"> > [% IF ( budget_line.budget_lock ) %] > <td class="locked" title="Fund locked"> > [% ELSE %] >@@ -186,9 +207,10 @@ > </table> > </td> > >- <td> >+ <td class="actions"> > [% UNLESS ( budget_line.budget_lock ) %] >- <input type="button" onclick="autoFillRow('[% budget_line.budget_id %]')" value="Auto-fill row"/> >+ <button onclick="autoFillRow('[% budget_line.budget_id %]')" class="btn btn-mini"><i class="fa fa-pencil-square-o"></i> Auto-fill row</button> >+ <button onclick="return clear_edit();" class="btn btn-mini"><i class="fa fa-undo"></i> Clear</button> > [% ELSE %] > <div style="color:red;">not owned</div> > [% END %] >-- >2.1.4
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