From 30bed84f700ad2d742b3b7881a6a0e35aef98201 Mon Sep 17 00:00:00 2001 From: Kyle Huckins Date: Thu, 17 May 2018 21:08:27 +0000 Subject: [PATCH] lp1749502 Holds Pull List Print Order - Ensure copy shelf location position is available for each hold on holds shelf. - Add _copy_location_position to hold_data while printing. Signed-off-by: Kyle Huckins Changes to be committed: modified: Open-ILS/src/templates/staff/share/print_templates/t_hold_pull_list.tt2 modified: Open-ILS/web/js/ui/default/staff/circ/services/holds.js Signed-off-by: Jason Stephenson Signed-off-by: Josh Stompro Signed-off-by: John Amundson --- .../print_templates/t_hold_pull_list.tt2 | 2 +- .../ui/default/staff/circ/services/holds.js | 21 ++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/templates/staff/share/print_templates/t_hold_pull_list.tt2 b/Open-ILS/src/templates/staff/share/print_templates/t_hold_pull_list.tt2 index 47be206f7a..8be65d4416 100644 --- a/Open-ILS/src/templates/staff/share/print_templates/t_hold_pull_list.tt2 +++ b/Open-ILS/src/templates/staff/share/print_templates/t_hold_pull_list.tt2 @@ -29,7 +29,7 @@ Template for printing a table of holds to pull. Fields include: - + {{hold_data.hold.hold_type}} {{hold_data.title}} {{hold_data.author}} diff --git a/Open-ILS/web/js/ui/default/staff/circ/services/holds.js b/Open-ILS/web/js/ui/default/staff/circ/services/holds.js index f76d92b014..0401ac20f6 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/services/holds.js +++ b/Open-ILS/web/js/ui/default/staff/circ/services/holds.js @@ -490,7 +490,7 @@ function($uibModal , $q , egCore , egConfirmDialog , egAlertDialog) { // current_copy is not always fleshed in the API if (hold.current_copy() && typeof hold.current_copy() != 'object') { hold.current_copy(hold_data.copy); - + // likewise, current_copy's status isn't fleshed in the API if(hold.current_copy().status() !== null && typeof hold.current_copy().status() != 'object') @@ -498,6 +498,25 @@ function($uibModal , $q , egCore , egConfirmDialog , egAlertDialog) { ).then(function(c) { hold.current_copy().status(c) }); } + // current_copy's shelving location position isn't always accessible + if (hold.current_copy().location()) { + console.debug('fetching hold copy location order'); + var location_id; + if (typeof hold.current_copy().location() != 'object') { + location_id = hold.current_copy().location(); + } else { + location_id = hold.current_copy().location().id(); + } + egCore.pcrud.search( + 'acplo', + {location: location_id, org: egCore.auth.user().ws_ou()}, + null, + {atomic:true} + ).then(function(orders) { + hold_data.hold._copy_location_position = orders[0].position(); + }); + } + if (volume) { //Call number affixes are not always fleshed in the API if (volume.prefix() && typeof volume.prefix() != 'object') { -- 2.43.2