Bugzilla – Attachment 167427 Details for
Bug 31606
Enhance acquisitions to allow ordering on next year's budget when still in current year.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[WIP] Bug 31606: Make acquisitions fund dropdown consistently show budget name
WIP-Bug-31606-Make-acquisitions-fund-dropdown-cons.patch (text/plain), 10.72 KB, created by
Aleisha Amohia
on 2024-06-05 05:13:40 UTC
(
hide
)
Description:
[WIP] Bug 31606: Make acquisitions fund dropdown consistently show budget name
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2024-06-05 05:13:40 UTC
Size:
10.72 KB
patch
obsolete
>From f3ee96bd8e55f774fd0e59469331d885166ce9f8 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Wed, 5 Jun 2024 05:12:59 +0000 >Subject: [PATCH] [WIP] Bug 31606: Make acquisitions fund dropdown consistently > show budget name > >--- > acqui/neworderempty.pl | 12 ++++--- > .../prog/en/includes/budgets_loop.inc | 28 +++++++++++++++++ > .../prog/en/modules/acqui/neworderempty.tt | 31 +------------------ > .../prog/en/modules/acqui/orderreceive.tt | 30 +----------------- > 4 files changed, 38 insertions(+), 63 deletions(-) > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/budgets_loop.inc > >diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl >index 95c31d9aa85..e19f4c00936 100755 >--- a/acqui/neworderempty.pl >+++ b/acqui/neworderempty.pl >@@ -335,11 +335,16 @@ my $patron = Koha::Patrons->find( $loggedinuser )->unblessed; > > my $budget = GetBudget($budget_id); > # build budget list >-my $budget_loop = []; >+my %budget_loops; > my $budgets = GetBudgetHierarchy; > foreach my $r (@{$budgets}) { > next unless (CanUserUseBudget($patron, $r, $userflags)); >- push @{$budget_loop}, { >+ unless ( defined $budget_loops{$r->{budget_period_id}} ){ >+ $budget_loops{$r->{budget_period_id}}->{description} = $r->{budget_period_description}; >+ $budget_loops{$r->{budget_period_id}}->{active} = $r->{budget_period_active}; >+ $budget_loops{$r->{budget_period_id}}->{funds} = []; >+ } >+ push @{$budget_loops{$r->{budget_period_id}}->{funds}}, { > b_id => $r->{budget_id}, > b_txt => $r->{budget_name}, > b_sort1_authcat => $r->{'sort1_authcat'}, >@@ -350,7 +355,6 @@ foreach my $r (@{$budgets}) { > }; > } > >- > $template->param( sort1 => $data->{'sort1'} ); > $template->param( sort2 => $data->{'sort2'} ); > >@@ -487,7 +491,7 @@ $template->param( > author => $data->{'author'}, > publicationyear => $data->{'publicationyear'} ? $data->{'publicationyear'} : $data->{'copyrightdate'}, > editionstatement => $data->{'editionstatement'}, >- budget_loop => $budget_loop, >+ budget_loop => \%budget_loops, > isbn => $data->{'isbn'}, > ean => $data->{'ean'}, > seriestitle => $data->{'seriestitle'}, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/budgets_loop.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/budgets_loop.inc >new file mode 100644 >index 00000000000..fbdff7b7996 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/budgets_loop.inc >@@ -0,0 +1,28 @@ >+[% FOREACH budget_period_id IN budget_loop.keys %] >+ [% SET budget_period = budget_loop.$budget_period_id %] >+ [% IF budget_period.active %] >+ <optgroup label="[% budget_period.description | html %]"> >+ [% ELSE %] >+ <optgroup class="inactive_budget" label="[% budget_period.description | html %] (Inactive)"> >+ [% END %] >+ [% FOREACH budget_loo IN budget_period.funds %] >+ [% level_indent_cnt = 0 %] >+ [% level_indent = "" %] >+ [% WHILE level_indent_cnt < budget_loo.b_level %] >+ [% level_indent = level_indent _ " -- " %] >+ [% level_indent_cnt = level_indent_cnt +1 %] >+ [% END %] >+ [% IF ( budget_loo.b_sel ) %] >+ [% active_count = 0 #select no other fund %] >+ <option value="[% budget_loo.b_id | html %]" selected="selected" data-sort1-authcat="[% budget_loo.b_sort1_authcat | html %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat | html %]"> >+ [% ELSIF active_count==1 && budget_loo.b_active %] >+ <option value="[% budget_loo.b_id | html %]" selected="selected" data-sort1-authcat="[% budget_loo.b_sort1_authcat | html %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat | html %]"> >+ [% ELSE %] >+ [% bdgclass=budget_loo.b_active? "": inactive_class | html %] >+ <option value="[% budget_loo.b_id | html %]" class="[% bdgclass | html %]" data-sort1-authcat="[% budget_loo.b_sort1_authcat | html %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat | html %]"> >+ [% END %] >+ [% level_indent | html %][% budget_loo.b_txt | html %][% IF !budget_loo.b_active %] (inactive)[% END %] >+ </option> >+ [% END %] >+ </optgroup> >+[% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >index a8aa424cfe2..86b8b8878bb 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >@@ -592,37 +592,8 @@ > </li> > <li> > <label class="required" for="budget_id">Fund: </label> >- [% active_count = 0 %] >- [% IF !ordernumber %] >- [% FOREACH budget_loo IN budget_loop %] >- [% active_count= active_count + budget_loo.b_active %] >- [% END %] >- [% END %] > <select class="select2" id="budget_id" name="budget_id"> >- <option value="">Select a fund</option> >- [% FOREACH budget_loo IN budget_loop %] >- [% level_indent_cnt = 0 %] >- [% level_indent = "" %] >- [% WHILE level_indent_cnt < budget_loo.b_level %] >- [% level_indent = level_indent _ " -- " %] >- [% level_indent_cnt = level_indent_cnt +1 %] >- [% END %] >- >- [% IF ( budget_loo.b_sel ) %] >- [% active_count = 0 #select no other fund %] >- <option value="[% budget_loo.b_id | html %]" selected="selected" data-sort1-authcat="[% budget_loo.b_sort1_authcat | html %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat | html %]" >- > >- [% ELSIF active_count==1 && budget_loo.b_active %] >- <option value="[% budget_loo.b_id | html %]" selected="selected" data-sort1-authcat="[% budget_loo.b_sort1_authcat | html %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat | html %]" >- > >- [% ELSE %] >- [% bdgclass=budget_loo.b_active? "": "b_inactive" | html %] >- <option value="[% budget_loo.b_id | html %]" class="[% bdgclass | html %]" data-sort1-authcat="[% budget_loo.b_sort1_authcat | html %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat | html %]" >- > >- [% END %] >- [% level_indent | html %][% budget_loo.b_txt | html %][% IF !budget_loo.b_active %] (inactive)[% END %] >- </option> >- [% END %] >+ [% INCLUDE 'budgets_loop.inc' inactive_class = "b_inactive" %] > </select> > <span class="required">Required</span> > <label for="showallbudgets" style="float:none;"> Show inactive:</label> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt >index 9e6f5f71925..0bd87f3762a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt >@@ -291,35 +291,7 @@ > <optgroup label="Current"> > <option id="selected_bookfund" selected="selected"></option> > </optgroup> >- [% FOREACH budget_period_id IN budget_loops.keys %] >- [% SET budget_period = budget_loops.$budget_period_id %] >- [% IF budget_period.active %] >- <optgroup label="[% budget_period.description | html %]"> >- [% ELSE %] >- <optgroup class="inactive_budget" label="[% budget_period.description | html %] (Inactive)"> >- [% END %] >- [% FOREACH budget_loo IN budget_period.funds %] >- [% level_indent_cnt = 0 %] >- [% level_indent = "" %] >- [% WHILE level_indent_cnt < budget_loo.b_level %] >- [% level_indent = level_indent _ " -- " %] >- [% level_indent_cnt = level_indent_cnt +1 %] >- [% END %] >- >- [% IF ( budget_loo.b_sel ) %] >- [% active_count = 0 #select no other fund %] >- <option value="[% budget_loo.b_id | html %]" selected="selected" data-sort1-authcat="[% budget_loo.b_sort1_authcat | html %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat | html %]"> >- [% ELSIF active_count==1 && budget_loo.b_active %] >- <option value="[% budget_loo.b_id | html %]" selected="selected" data-sort1-authcat="[% budget_loo.b_sort1_authcat | html %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat | html %]"> >- [% ELSE %] >- [% bdgclass=budget_loo.b_active? "": "inactive_budget" | html %] >- <option value="[% budget_loo.b_id | html %]" class="[% bdgclass | html %]" data-sort1-authcat="[% budget_loo.b_sort1_authcat | html %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat | html %]"> >- [% END %] >- [% level_indent | html %][% budget_loo.b_txt | html %][% IF !budget_loo.b_active %] (inactive)[% END %] >- </option> >- [% END %] >- </optgroup> >- [% END %] >+ [% INCLUDE 'budgets_loop.inc' inactive_class = "inactive_budget" %] > </select> > <span class="required">Required</span> > </li> >-- >2.39.2
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 31606
:
140860
|
140958
|
141004
|
148574
|
167427
|
167505
|
167522
|
167908
|
168043
|
168044
|
169264
|
169265
|
169442
|
169521
|
169767
|
169768
|
169769