Bugzilla – Attachment 148986 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: Adapt to new +strings embed
Bug-8179-Adapt-to-new-strings-embed.patch (text/plain), 5.30 KB, created by
Tomás Cohen Arazi (tcohen)
on 2023-03-30 13:16:18 UTC
(
hide
)
Description:
Bug 8179: Adapt to new +strings embed
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2023-03-30 13:16:18 UTC
Size:
5.30 KB
patch
obsolete
>From 1ecba7a48ac3a0df5ca5ef0dac4b178c6152f6eb Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 30 Mar 2023 15:12:38 +0200 >Subject: [PATCH] Bug 8179: Adapt to new +strings embed > >While we rebased correctly this old patchset, we still had to make sure >we are using both the +strings in embed (instead of the x-koha-av >header) and the _strings key instead of the original _authorised_values >one. > >This patch adjusts that. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > .../prog/en/modules/acqui/orderreceive.tt | 36 +++++++++---------- > 1 file changed, 18 insertions(+), 18 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 193c6b566ed..978f0d130cc 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt >@@ -962,6 +962,13 @@ > }); > [% ELSIF multiple_orders %] > >+ function display_string(key, strings, fallback) { >+ if ( strings.hasOwnProperty(key) ) { >+ return strings[key].str && escape_str(strings[key].str) || ''; >+ } >+ return fallback != null ? fallback : ''; >+ } >+ > var _build_item = function(item, tr) { > var chb = $('<input type="checkbox" name="items_to_receive" value="'+item.item_id+'" />') > .prop('checked', item._checked) >@@ -971,17 +978,17 @@ > tr.append($('<td style="text-align:center"></td>').append(chb)); > tr.append('<td><a style="cursor:pointer" onclick="PopupEditPage('+item.biblio_id+', '+item.item_id+');">'+EDIT[0].toUpperCase()+EDIT.substr(1).toLowerCase()+'</a></td>'); > tr.append('<td>'+(item.external_id||'')+'</td>'); >- tr.append('<td>'+(item.home_branch && item.home_branch.name||'')+'</td>'); >- tr.append('<td>'+(item.holding_branch && item.holding_branch.name||'')+'</td>'); >- tr.append('<td>'+(item._authorised_values.not_for_loan_status && item._authorised_values.not_for_loan_status.lib||'')+'</td>'); >- tr.append('<td>'+(item._authorised_values.restricted_status && item._authorised_values.restricted_status.lib||'')+'</td>'); >- tr.append('<td><span class="shelvingloc">'+(item._authorised_values.location && item._authorised_values.location.lib||'')+'</span></td>'); >+ tr.append('<td>'+display_string( 'home_library_id', item._strings, item.home_library_id ) || ''+'</td>'); >+ tr.append('<td>'+display_string( 'holding_library_id', item._strings, item.holding_library_id )+'</td>'); >+ tr.append('<td>'+display_string( 'not_for_loan_status', item._strings, item.not_for_loan_status )+'</td>'); >+ tr.append('<td>'+display_string( 'restricted_status', item._strings, item.restricted_status )+'</td>'); >+ tr.append('<td><span class="shelvingloc">'+display_string( 'location', item._strings, item.location )+'</span></td>'); > tr.append('<td>'+(item.callnumber||'')+'</td>'); > tr.append('<td>'+(item.copy_number||'')+'</td>'); > tr.append('<td>'+(item.inventory_number||'')+'</td>'); >- tr.append('<td>'+(item._authorised_values.collection_code && item._authorised_values.collection_code.lib||'')+'</td>'); >- tr.append('<td>'+(item.itemtype && item.itemtype.description || '')+'</td>'); >- tr.append('<td>'+(item._authorised_values.materials_notes && item._authorised_values.materials_notes.lib||'')+'</td>') >+ tr.append('<td>'+display_string( 'collection', item._strings, item.collection )+'</td>'); >+ tr.append('<td>'+display_string( 'item_type_id', item._strings, item.item_type_id )+'</td>'); >+ tr.append('<td>'+display_string( 'materials_notes', item._strings, item.materials_notes )+'</td>'); > tr.append('<td>'+(item.public_notes||'')+'</td>'); > }; > >@@ -1000,8 +1007,7 @@ > $.ajax({ > dataType: "json", > headers: { >- "x-koha-embed": "home_branch,holding_branch,itemtype", >- "x-koha-av": "1" >+ "x-koha-embed": "+strings" > }, > url: '/api/v1/items/'+itemnumber, > success: function(item) { >@@ -1045,19 +1051,13 @@ > var pending_orders_url = "/api/v1/acquisitions/orders?only_active=1"; > var options = { > "ajax": { >- "url": pending_orders_url + "&q=" + encodeURI(JSON.stringify(base_query)), >- "headers": { >- 'x-koha-av': '1' >- } >+ "url": pending_orders_url + "&q=" + encodeURI(JSON.stringify(base_query)) > }, >- "header_filter": true, > "embed": [ > "basket", > "biblio.suggestions.suggester", > "fund.budget", >- "items.home_branch", >- "items.holding_branch", >- "items.itemtype", >+ "items+strings", > "creator" > ], > 'dom': 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>', >-- >2.40.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 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