Bugzilla – Attachment 12507 Details for
Bug 8821
Receive shipment page should hide inactive funds like new order form does
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8821 - Receive shipment page should hide inactive funds like new order form
Bug-8821---Receive-shipment-page-should-hide-inact.patch (text/plain), 4.28 KB, created by
Owen Leonard
on 2012-09-25 19:48:49 UTC
(
hide
)
Description:
Bug 8821 - Receive shipment page should hide inactive funds like new order form
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2012-09-25 19:48:49 UTC
Size:
4.28 KB
patch
obsolete
>From fd7e731fd2d90615e8f8d8d891563324ab588322 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Tue, 25 Sep 2012 15:38:23 -0400 >Subject: [PATCH] Bug 8821 - Receive shipment page should hide inactive funds > like new order form >Content-Type: text/plain; charset="utf-8" > >This patch adapts the fund-handling code from neworderempty.pl >in order to limit the display of funds by default to active ones, >with the option to check a box to display all funds. > >To test, make sure you have both active and inactive funds. >Start the process of receiving a shipment. The "fund" option >in the receive shipment form should show only active funds. >Checking the "show all" checkbox should allow you to choose >from both active and inactive funds. >--- > acqui/parcels.pl | 23 +++++++++++++++----- > .../intranet-tmpl/prog/en/modules/acqui/parcels.tt | 23 ++++++++++++++++---- > 2 files changed, 36 insertions(+), 10 deletions(-) > >diff --git a/acqui/parcels.pl b/acqui/parcels.pl >index 4f2849d..8fbb883 100755 >--- a/acqui/parcels.pl >+++ b/acqui/parcels.pl >@@ -161,13 +161,24 @@ if ($count_parcels) { > $template->param( searchresults => $loopres, count => $count_parcels ); > } > >-my $budgets = GetBudgets(); >-my @budgets_loop; >-foreach my $budget (@$budgets) { >- next unless CanUserUseBudget($loggedinuser, $budget, $flags); >- push @budgets_loop, $budget; >+# build budget list >+my $budget_loop = []; >+my $budgets = GetBudgetHierarchy; >+foreach my $r (@{$budgets}) { >+ next unless (CanUserUseBudget($loggedinuser, $r, $flags)); >+ if (!defined $r->{budget_amount} || $r->{budget_amount} == 0) { >+ next; >+ } >+ push @{$budget_loop}, { >+ b_id => $r->{budget_id}, >+ b_txt => $r->{budget_name}, >+ b_active => $r->{budget_period_active}, >+ }; > } > >+@{$budget_loop} = >+ sort { uc( $a->{b_txt}) cmp uc( $b->{b_txt}) } @{$budget_loop}; >+ > $template->param( > orderby => $order, > filter => $code, >@@ -179,7 +190,7 @@ $template->param( > shipmentdate_today => C4::Dates->new()->output(), > booksellerid => $booksellerid, > GST => C4::Context->preference('gist'), >- budgets => \@budgets_loop, >+ budget_loop => $budget_loop, > ); > > output_html_with_http_headers $input, $cookie, $template->output; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt >index 616139c..ba3fa37 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt >@@ -12,6 +12,15 @@ > var parcelst = $("#parcelst").dataTable($.extend(true, {}, dataTablesDefaults, { > "sPaginationType": "four_button" > } ) ); >+ $('#showallfunds').click(function() { >+ if ( $('#shipmentcost_budgetid .b_inactive').is(":visible") ) >+ { >+ $('#shipmentcost_budgetid .b_inactive').hide(); >+ } >+ else { >+ $('#shipmentcost_budgetid .b_inactive').show(); >+ } >+ }); > }); > //]]> > </script> >@@ -136,13 +145,19 @@ > <input type="text" id="shipmentcost" name="shipmentcost" size="10" /> > </li> > <li> >- <label for="shipmentcost_budgetid">Budget: </label> >+ <label for="shipmentcost_budgetid">Fund: </label> > <select id="shipmentcost_budgetid" name="shipmentcost_budgetid"> >- <option value="">No budget</option> >- [% FOREACH budget IN budgets %] >- <option value="[% budget.budget_id %]">[% budget.budget_name %]</option> >+ <option value="">No fund</option> >+ [% FOREACH budget_loo IN budget_loop %] >+ [% IF ( budget_loo.b_active ) %] >+ <option value="[% budget_loo.b_id %]">[% budget_loo.b_txt %]</option> >+ [% ELSE %] >+ <option value="[% budget_loo.b_id %]" class="b_inactive" style="display : none;">[% budget_loo.b_txt %]</option> > [% END %] >+ [% END %] > </select> >+ <label for="showallfunds" style="float:none;width:auto;"> Show all:</label> >+ <input type="checkbox" id="showallfunds" /> > </li> > </ol> > </fieldset> >-- >1.7.9.5
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 8821
:
12507
|
19793
|
20074
|
20630