Bugzilla – Attachment 151431 Details for
Bug 8179
Receiving multiple order lines at once
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8179: (follow-up) Restore funds dropdown and checkbox
Bug-8179-follow-up-Restore-funds-dropdown-and-chec.patch (text/plain), 8.25 KB, created by
Tomás Cohen Arazi (tcohen)
on 2023-05-18 17:48:31 UTC
(
hide
)
Description:
Bug 8179: (follow-up) Restore funds dropdown and checkbox
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2023-05-18 17:48:31 UTC
Size:
8.25 KB
patch
obsolete
>From 5214b557279bc3b0c8b6a30a7218d94dee6b4109 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 17 May 2023 12:32:34 -0300 >Subject: [PATCH] Bug 8179: (follow-up) Restore funds dropdown and checkbox > >This patch reintroduces the dropdown that got lost in some refactoring >of the patchset. It also introduces a couple minor fixes. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > .../prog/en/modules/acqui/orderreceive.tt | 65 ++++++++++++++++--- > 1 file changed, 56 insertions(+), 9 deletions(-) > >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 1ff5f563143..b2ab673a260 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt >@@ -266,15 +266,42 @@ > <li> > <label for="bookfund" class="required">Fund: </label> > <select id="bookfund" name="bookfund"> >- <option value=""></option> >- [% FOREACH period IN budget_loop %] >- <optgroup label="[% period.description | html %]"> >- [% FOREACH fund IN period.funds %] >- <option value="[% fund.b_id | html %]">[% fund.b_txt | html %]</option> >- [% END %] >+ <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 %] > </select> >+ <span class="required">Required</span> >+ <label for="showallbudgets" style="float:none;"> Show inactive:</label> >+ <input type="checkbox" id="showallbudgets" /> > </li> > <li> > <label> </label> >@@ -492,6 +519,8 @@ > var invoice_id = "[% invoiceid | html %]"; > > $(document).ready(function(){ >+ // keep a copy for re-rendering >+ var $funds_tree = $('#bookfund').html(); > var base_query = { "order_id": {"in": [[% multiple_orders | html %]]}}; > var pending_orders_url = "/api/v1/acquisitions/orders?only_active=1"; > var options = { >@@ -1059,7 +1088,7 @@ > .filter(function(name){ > return name > }) >- .join(', ')+' (<a href="http://localhost:8081/cgi-bin/koha/suggestion/suggestion.pl?suggestionid='+row.biblio.suggestions[0].suggestionid+'&op=show">'+SUGGESTION.format(row.biblio.suggestions[0].suggestionid)+'</a>)' >+ .join(', ')+' (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid='+row.biblio.suggestions[0].suggestion_id+'&op=show">'+SUGGESTION.format(row.biblio.suggestions[0].suggestion_id)+'</a>)' > ); > } else { > $("#biblio_suggestion_suggester").parent().hide(); >@@ -1084,10 +1113,16 @@ > > var effective_create_items = row.basket.create_items || AcqCreateItem; > $("#datereceived").val(row.date_received||$date(new Date().toISOString())); >- $("#bookfund option[value='']").html(FUND_KEEP.format(row.fund.budget.budget_period_description, row.fund.name)); >- if(row.fund_id != row.fund.fund_id) { >+ // restore the full tree >+ $("#bookfund").html($funds_tree); >+ $("#selected_bookfund") >+ .html(FUND_KEEP.format(row.fund.budget.budget_period_description, row.fund.name)) >+ .attr( 'data-sort1-authcat', row.fund.sort1_authcat ) >+ .attr( 'data-sort2-authcat', row.fund.sort2_authcat ); >+ if (row.fund_id != row.fund.fund_id) { > $("#bookfund").val(row.fund_id); > } >+ $("#bookfund").select2({ width: '100%' }); > $("#current-fund").html(FUNC_CUR.format(row.fund.budget.budget_period_description, row.fund.name)); > $("#creator").html([row.creator.surname, row.creator.firstname].filter(function(name){return name}).join(', ')+" ("+row.creator.patron_id+')') > $("#quantity_to_receive").val(row.quantity).prop('readonly', !row.subscription_id); >@@ -1181,6 +1216,18 @@ > $("#invoice_currency").val(active_currency); > $("#invoice_unitprice").val(''); > } >+ >+ disabledBudgetsCopy = $('#bookfund').html(); >+ $('#bookfund .inactive_budget').remove(); >+ >+ $('#showallbudgets').click(function() { >+ if ($(this).is(":checked")) { >+ $('#bookfund').html(disabledBudgetsCopy); //Puts back all the funds >+ } >+ else { >+ $('#bookfund .inactive_budget').remove(); >+ } >+ }); > set_modal_buttons(); > }; > >-- >2.40.1
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 8179
:
9881
|
111437
|
111438
|
111439
|
111440
|
112554
|
112555
|
112556
|
112558
|
112588
|
112643
|
112644
|
112645
|
112646
|
112744
|
112745
|
112746
|
112747
|
114688
|
114689
|
114690
|
114691
|
116582
|
116583
|
116584
|
116585
|
116588
|
116589
|
116590
|
116591
|
116681
|
116682
|
116683
|
116684
|
116942
|
116943
|
116944
|
116945
|
119178
|
119179
|
119180
|
119181
|
120620
|
120621
|
120622
|
120623
|
148215
|
148216
|
148217
|
148218
|
148233
|
148284
|
148285
|
148286
|
148287
|
148288
|
148521
|
148522
|
148523
|
148524
|
148525
|
148526
|
148685
|
148981
|
148982
|
148983
|
148984
|
148985
|
148986
|
151026
|
151086
|
151087
|
151088
|
151089
|
151092
|
151093
|
151137
|
151138
|
151139
|
151140
|
151141
|
151142
|
151143
|
151144
|
151145
|
151163
|
151250
|
151367
| 151431