From 358124ecfc6569211a6c2fcfe46f3cbf9848b6ea Mon Sep 17 00:00:00 2001 From: Josh Stompro <stompro@stompro.org> Date: Tue, 26 Feb 2019 14:21:06 -0600 Subject: [PATCH] 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 <stompro@stompro.org> Signed-off-by: Jason Stephenson <jason@sigio.com> Signed-off-by: John Amundson <jamundson@cwmars.org> --- .../share/print_templates/t_hold_pull_list.tt2 | 8 +-- .../web/js/ui/default/staff/circ/services/holds.js | 68 ++++++++++++---------- 2 files changed, 39 insertions(+), 37 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 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: <th>[% l('Title') %]</th> <th>[% l('Author') %]</th> <th>[% l('Shelf Location') %]</th> - <th>[% l('Call Number Prefix') %]</th> <th>[% l('Call Number') %]</th> - <th>[% l('Call Number Suffix') %]</th> <th>[% l('Barcode/Part') %]</th> </tr> </thead> <tbody> - <tr ng-repeat="hold_data in holds | orderBy : ['hold._copy_location_position', 'volume.prefix', 'volume.label', 'volume.suffix']"> + <tr ng-repeat="hold_data in holds | orderBy : ['hold._copy_location_position', 'copy.location.name', 'volume.prefix_sortkey', 'volume.label_sortkey', 'volume.suffix_sortkey']"> <td>{{hold_data.hold.hold_type}}</td> <td>{{hold_data.title}}</td> <td>{{hold_data.author}}</td> <td>{{hold_data.copy.location.name}}</td> - <td>{{hold_data.volume.prefix}}</td> - <td>{{hold_data.volume.label}}</td> - <td>{{hold_data.volume.suffix}}</td> + <td>{{hold_data.volume.prefix}} {{hold_data.volume.label}} {{hold_data.volume.suffix}}</td> <td>{{hold_data.copy.barcode}} {{hold_data.part.label}}</td> </tr> </tbody> 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()}); + } } } -- 2.11.0