lp1749502 Prefix patch
authorKyle Huckins <khuckins@catalyte.io>
Tue, 29 May 2018 16:06:59 +0000 (16:06 +0000)
committerJason Stephenson <jason@sigio.com>
Tue, 19 Mar 2019 21:18:27 +0000 (17:18 -0400)
- Ensure prefix information is properly set

Signed-off-by: Kyle Huckins <khuckins@catalyte.io>
 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 <jason@sigio.com>
Signed-off-by: Josh Stompro <stompro@stompro.org>
Signed-off-by: John Amundson <jamundson@cwmars.org>
Open-ILS/src/templates/staff/share/print_templates/t_hold_pull_list.tt2
Open-ILS/web/js/ui/default/staff/circ/services/holds.js

index 8be65d4..5a06dde 100644 (file)
@@ -29,7 +29,7 @@ Template for printing a table of holds to pull. Fields include:
     </tr>
   </thead>
   <tbody>
-    <tr ng-repeat="hold_data in holds | orderBy : ['hold._copy_location_position', 'volume.label']">
+    <tr ng-repeat="hold_data in holds | orderBy : ['hold._copy_location_position', 'volume.prefix', 'volume.label']">
       <td>{{hold_data.hold.hold_type}}</td>
       <td>{{hold_data.title}}</td>
       <td>{{hold_data.author}}</td>
index 0401ac2..02b495f 100644 (file)
@@ -517,16 +517,18 @@ function($uibModal , $q , egCore , egConfirmDialog , egAlertDialog) {
             });
         }
 
-        if (volume) {
-            //Call number affixes are not always fleshed in the API
-            if (volume.prefix() && typeof volume.prefix() != 'object') {
-                console.debug('fetching call number prefix');
-                egCore.pcrud.retrieve('acnp',volume.prefix()).then(function(p) {volume.prefix(p)});
-            }
-            if (volume.suffix() && typeof volume.suffix() != 'object') {
-                console.debug('fetching call number prefix');
-                egCore.pcrud.retrieve('acns',volume.suffix()).then(function(s) {volume.suffix(s)});
-            }
+        //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()});
         }
     }