call_number.label
location.name
+There are also utility functions:
+
+ get_cn_for(copy) -> returns the formatted call number from the
+ Call Number Template and Call Numbers tab
+
+ get_bib_for(copy) -> returns an "MVR" with keys like title,
+ author, publisher, pubdate, series,
+ edition, and isbn
+
Line-wrapping may be done with the | wrap filter. The first
parameter is the number of characters to target for the string
width. The second parameter is the wrapping algorithm to use.
<pre class="pocket" style="border:none" ng-show="true">
{{copy.barcode}}
{{copy['call_number.label']}}
-{{copy['call_number.record.simple_record.author']}}
-{{copy['call_number.record.simple_record.title'] | wrap:28:'once':' '}}
+{{get_bib_for(copy).author }}
+{{get_bib_for(copy).title | wrap:28:'once':' '}}
</pre>
</td>
</tr>
return '...';
}
}
+ ,'get_bib_for' : function(copy) {
+ return $scope.record_details[copy['call_number.record.id']];
+ }
};
+ $scope.record_details = {};
var promises = [];
angular.forEach(data.copies, function(copy) {
promises.push(
itemSvc.fetch(null,copy).then(function(res) {
- $scope.preview_scope.copies.push(egCore.idl.toHash(res.copy, true));
+ var flat_copy = egCore.idl.toHash(res.copy, true);
+ $scope.preview_scope.copies.push(flat_copy);
+ $scope.record_details[ flat_copy['call_number.record.id'] ] = 1;
})
)
});
$q.all(promises).then(function() {
- // today, staff, current_location, etc.
- egCore.print.fleshPrintScope($scope.preview_scope);
-
- $scope.template_changed(); // load the default
- $scope.rebuild_cn_set();
+ var promises2 = [];
+ angular.forEach($scope.record_details, function(el,k,obj) {
+ promises2.push(
+ egNet.request(
+ 'open-ils.search',
+ 'open-ils.search.biblio.record.mods_slim.retrieve.authoritative',
+ k
+ ).then(function (data) {
+ obj[k] = egCore.idl.toHash(data, true);
+ })
+ );
+ });
+
+ $q.all(promises2).then(function() {
+ // today, staff, current_location, etc.
+ egCore.print.fleshPrintScope($scope.preview_scope);
+ console.log($scope.record_details);
+ $scope.template_changed(); // load the default
+ $scope.rebuild_cn_set();
+ });
- })
+ });
} else {
ngToast.danger(egCore.strings.KEY_EXPIRED);
}