@@ -, +, @@
---
.../prog/en/modules/acqui/orderreceive.tt | 36 +++++++++----------
1 file changed, 18 insertions(+), 18 deletions(-)
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt
+++ a/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 = $('')
.prop('checked', item._checked)
@@ -971,17 +978,17 @@
tr.append($('
| ').append(chb));
tr.append(''+EDIT[0].toUpperCase()+EDIT.substr(1).toLowerCase()+' | ');
tr.append(''+(item.external_id||'')+' | ');
- tr.append(''+(item.home_branch && item.home_branch.name||'')+' | ');
- tr.append(''+(item.holding_branch && item.holding_branch.name||'')+' | ');
- tr.append(''+(item._authorised_values.not_for_loan_status && item._authorised_values.not_for_loan_status.lib||'')+' | ');
- tr.append(''+(item._authorised_values.restricted_status && item._authorised_values.restricted_status.lib||'')+' | ');
- tr.append(''+(item._authorised_values.location && item._authorised_values.location.lib||'')+' | ');
+ tr.append(''+display_string( 'home_library_id', item._strings, item.home_library_id ) || ''+' | ');
+ tr.append(''+display_string( 'holding_library_id', item._strings, item.holding_library_id )+' | ');
+ tr.append(''+display_string( 'not_for_loan_status', item._strings, item.not_for_loan_status )+' | ');
+ tr.append(''+display_string( 'restricted_status', item._strings, item.restricted_status )+' | ');
+ tr.append(''+display_string( 'location', item._strings, item.location )+' | ');
tr.append(''+(item.callnumber||'')+' | ');
tr.append(''+(item.copy_number||'')+' | ');
tr.append(''+(item.inventory_number||'')+' | ');
- tr.append(''+(item._authorised_values.collection_code && item._authorised_values.collection_code.lib||'')+' | ');
- tr.append(''+(item.itemtype && item.itemtype.description || '')+' | ');
- tr.append(''+(item._authorised_values.materials_notes && item._authorised_values.materials_notes.lib||'')+' | ')
+ tr.append(''+display_string( 'collection', item._strings, item.collection )+' | ');
+ tr.append(''+display_string( 'item_type_id', item._strings, item.item_type_id )+' | ');
+ tr.append(''+display_string( 'materials_notes', item._strings, item.materials_notes )+' | ');
tr.append(''+(item.public_notes||'')+' | ');
};
@@ -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>',
--