From: Josh Stompro Date: Tue, 26 Feb 2019 20:21:06 +0000 (-0600) Subject: LP1749502 - Holds Pull List Print Order X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=358124ecfc6569211a6c2fcfe46f3cbf9848b6ea;p=evergreen%2Fpines.git LP1749502 - Holds Pull List Print Order - Expose call number affix sortkey data. - Use sortkey data to sort default pull list template. - Combine all call number info into one field in default pull list template. - Sorty by shelf location position if it exists, then by shelf location name if it doesn't - Only grab copy info if copy is assigned, to not break patron holds grid. - Remove some web console logging only needed for testing. Signed-off-by: Josh Stompro Signed-off-by: Jason Stephenson Signed-off-by: John Amundson --- 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 cecb3777b8..bd0586f704 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 @@ -24,21 +24,17 @@ Template for printing a table of holds to pull. Fields include: [% l('Title') %] [% l('Author') %] [% l('Shelf Location') %] - [% l('Call Number Prefix') %] [% l('Call Number') %] - [% l('Call Number Suffix') %] [% l('Barcode/Part') %] - + {{hold_data.hold.hold_type}} {{hold_data.title}} {{hold_data.author}} {{hold_data.copy.location.name}} - {{hold_data.volume.prefix}} - {{hold_data.volume.label}} - {{hold_data.volume.suffix}} + {{hold_data.volume.prefix}} {{hold_data.volume.label}} {{hold_data.volume.suffix}} {{hold_data.copy.barcode}} {{hold_data.part.label}} 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 02b495f72b..dc6f0aab3b 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,45 +490,51 @@ 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); + } + if (hold.current_copy()) { // likewise, current_copy's status isn't fleshed in the API if(hold.current_copy().status() !== null && typeof hold.current_copy().status() != 'object') egCore.pcrud.retrieve('ccs',hold.current_copy().status() ).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(); + + // 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) { + if(orders[0]){ + hold_data.hold._copy_location_position = orders[0].position(); + } else { + hold_data.hold._copy_location_position = 999; + } + }); } - 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(); - }); - } - //Call number affixes are not always fleshed in the API - if (hold_data.volume.prefix) { - console.debug('fetching call number prefix'); - console.log(hold_data.volume.prefix()); - egCore.pcrud.retrieve('acnp',hold_data.volume.prefix()) - .then(function(p) {hold_data.volume.prefix = p.label()}); - } - if (hold_data.volume.suffix) { - console.debug('fetching call number suffix'); - console.log(hold_data.volume.suffix()); - egCore.pcrud.retrieve('acns',hold_data.volume.suffix()) - .then(function(s) {hold_data.volume.suffix = s.label()}); + //Call number affixes are not always fleshed in the API + if (hold_data.volume.prefix) { + //console.debug('fetching call number prefix'); + //console.log(hold_data.volume.prefix()); + egCore.pcrud.retrieve('acnp',hold_data.volume.prefix()) + .then(function(p) {hold_data.volume.prefix = p.label(); hold_data.volume.prefix_sortkey = p.label_sortkey()}); + } + if (hold_data.volume.suffix) { + //console.debug('fetching call number suffix'); + //console.log(hold_data.volume.suffix()); + egCore.pcrud.retrieve('acns',hold_data.volume.suffix()) + .then(function(s) {hold_data.volume.suffix = s.label(); hold_data.volume.suffix_sortkey = s.label_sortkey()}); + } } }