<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>
// 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()});
+ }
}
}