2 * Shared item services for circulation
5 angular.module('egCoreMod')
7 ['egCore','egOrg','egCirc','$uibModal','$q','$timeout','$window','ngToast','egConfirmDialog','egAlertDialog',
8 function(egCore , egOrg , egCirc , $uibModal , $q , $timeout , $window , ngToast , egConfirmDialog , egAlertDialog ) {
11 copies : [], // copy barcode search results
12 index : 0 // search grid index
18 acp : ['call_number','location','status','floating','circ_modifier',
19 'age_protect','circ_lib','copy_alerts', 'creator', 'editor', 'circ_as_type', 'latest_inventory'],
20 acn : ['record','prefix','suffix','label_class'],
21 bre : ['simple_record','creator','editor'],
22 alci : ['inventory_workstation']
25 // avoid fleshing MARC on the bre
26 // note: don't add simple_record.. not sure why
27 bre : ['id','tcn_value','creator','editor', 'create_date', 'edit_date'],
37 'checkin_workstation',
45 order_by : {combcirc : 'xact_start desc'},
49 //Retrieve separate copy, aacs, and accs information
50 service.getCopy = function(barcode, id) {
52 // handle barcode completion
53 return egCirc.handle_barcode_completion(barcode)
54 .then(function(actual_barcode) {
55 return egCore.pcrud.search(
56 'acp', {barcode : actual_barcode, deleted : 'f'},
57 service.flesh).then(function(copy) {return copy});
61 return egCore.pcrud.retrieve( 'acp', id, service.flesh)
62 .then(function(copy) {return copy});
65 service.getCirc = function(id) {
66 return egCore.pcrud.search('combcirc', { target_copy : id },
67 service.circFlesh).then(function(circ) {return circ});
70 service.getSummary = function(id) {
71 return circ_summary = egCore.net.request(
73 'open-ils.circ.renewal_chain.retrieve_by_circ.summary',
74 egCore.auth.token(), id).then(
75 function(circ_summary) {return circ_summary});
78 //Combine copy, circ, and accs information
79 service.retrieveCopyData = function(barcode, id) {
82 var fetchCopy = function(barcode, id) {
83 return service.getCopy(barcode, id)
84 .then(function(copy) {
89 var fetchCirc = function(copy) {
90 return service.getCirc(copy.id())
91 .then(function(circ) {
96 var fetchSummary = function(circ) {
97 return service.getSummary(circ.id())
98 .then(function(summary) {
99 copyData.circ_summary = summary;
104 return fetchCopy(barcode, id).then(function(res) {
106 if(!res.copy) { return $q.when(); }
107 return fetchCirc(copyData.copy).then(function(res) {
109 return fetchSummary(copyData.circ).then(function() {
120 // resolved with the last received copy
121 service.fetch = function(barcode, id, noListDupes) {
127 return service.retrieveCopyData(barcode, id)
128 .then(function(copyData) {
129 if(!copyData) { return $q.when(); }
130 //Make sure we're getting a completed copyData - no plain acp or circ objects
132 // flesh circ_lib locally
133 copyData.circ.circ_lib(egCore.org.get(copyData.circ.circ_lib()));
139 // use the existing copy if possible
140 flatCopy = service.copies.filter(
141 function(c) {return c.id == copyData.copy.id()})[0];
144 // flesh acn.owning_lib
145 copyData.copy.call_number().owning_lib(egCore.org.get(copyData.copy.call_number().owning_lib()));
148 flatCopy = egCore.idl.toHash(copyData.copy, true);
151 flatCopy._circ = egCore.idl.toHash(copyData.circ, true);
152 flatCopy._circ_summary = egCore.idl.toHash(copyData.circ_summary, true);
153 flatCopy._circ_lib = copyData.circ.circ_lib();
154 flatCopy._duration = copyData.circ.duration();
155 flatCopy._circ_ws = flatCopy._circ_summary.last_renewal_workstation ?
156 flatCopy._circ_summary.last_renewal_workstation :
157 flatCopy._circ_summary.checkout_workstation ?
158 flatCopy._circ_summary.checkout_workstation :
161 flatCopy.index = service.index++;
162 flatCopy.copy_alert_count = copyData.copy.copy_alerts().filter(function(aca) {
163 return !aca.ack_time();
166 service.copies.unshift(flatCopy);
169 //Get in-house use count
170 egCore.pcrud.search('aihu',
171 {item : flatCopy.id}, {}, {idlist : true, atomic : true})
172 .then(function(uses) {
173 flatCopy._inHouseUseCount = uses.length;
174 copyData.copy._inHouseUseCount = uses.length;
177 //Get Monograph Parts
178 egCore.pcrud.search('acpm',
179 {target_copy: flatCopy.id},
180 { flesh : 1, flesh_fields : { acpm : ['part'] } },
182 .then(function(acpm_array) {
183 angular.forEach(acpm_array, function(acpm) {
184 flatCopy.parts = egCore.idl.toHash(acpm.part());
185 copyData.copy.parts = egCore.idl.toHash(acpm.part());
190 copy : copyData.copy,
191 index : flatCopy.index
198 //all_items = selected grid rows, to be updated in place
199 service.updateInventory = function(copy_list, all_items) {
200 if (copy_list.length == 0) return;
201 return egCore.net.request(
203 'open-ils.circ.circulation.update_latest_inventory',
204 egCore.auth.token(), {copy_list: copy_list}
205 ).then(function(res) {
207 if (all_items) angular.forEach(copy_list, function(copy) {
208 angular.forEach(all_items, function(item) {
209 if (copy == item.id) {
210 egCore.pcrud.search('alci', {copy: copy},
211 {flesh: 1, flesh_fields:
212 {alci: ['inventory_workstation']}
213 }).then(function(alci) {
214 //update existing grid rows
215 item["latest_inventory.inventory_date"] = alci.inventory_date();
216 item["latest_inventory.inventory_workstation.name"] =
217 alci.inventory_workstation().name();
222 return all_items || res;
227 service.add_copies_to_bucket = function(list, bucket_type) {
228 if (list.length == 0) return;
229 if (!bucket_type) bucket_type = 'copy';
231 return $uibModal.open({
232 templateUrl: './cat/catalog/t_add_to_bucket',
237 ['$scope','$uibModalInstance',
238 function($scope , $uibModalInstance) {
240 $scope.bucket_id = 0;
241 $scope.newBucketName = '';
242 $scope.allBuckets = [];
246 'open-ils.actor.container.retrieve_by_class.authoritative',
247 egCore.auth.token(), egCore.auth.user().id(),
248 bucket_type, 'staff_client'
249 ).then(function(buckets) { $scope.allBuckets = buckets; });
251 $scope.add_to_bucket = function() {
252 var promise = $q.when();
253 angular.forEach(list, function (entry) {
254 var item = bucket_type == 'copy' ? new egCore.idl.ccbi() : new egCore.idl.cbrebi();
255 item.bucket($scope.bucket_id);
256 if (bucket_type == 'copy') item.target_copy(entry);
257 if (bucket_type == 'biblio') item.target_biblio_record_entry(entry);
258 promise = promise.then(function() {
259 return egCore.net.request(
261 'open-ils.actor.container.item.create',
262 egCore.auth.token(), bucket_type, item
266 promise.then(function() {
267 $uibModalInstance.close();
271 $scope.add_to_new_bucket = function() {
272 var bucket = bucket_type == 'copy' ? new egCore.idl.ccb() : new egCore.idl.cbreb();
273 bucket.owner(egCore.auth.user().id());
274 bucket.name($scope.newBucketName);
275 bucket.description('');
276 bucket.btype('staff_client');
278 return egCore.net.request(
280 'open-ils.actor.container.create',
281 egCore.auth.token(), bucket_type, bucket
282 ).then(function(bucket) {
283 $scope.bucket_id = bucket;
284 $scope.add_to_bucket();
288 $scope.cancel = function() {
289 $uibModalInstance.dismiss();
295 service.make_copies_bookable = function(items) {
297 var copies_by_record = {};
298 var record_list = [];
302 var record_id = item['call_number.record.id'];
303 if (typeof copies_by_record[ record_id ] == 'undefined') {
304 copies_by_record[ record_id ] = [];
305 record_list.push( record_id );
307 copies_by_record[ record_id ].push(item.id);
312 var combined_results = [];
313 angular.forEach(record_list, function(record_id) {
317 'open-ils.booking.resources.create_from_copies',
319 copies_by_record[record_id]
320 ).then(function(results) {
321 if (results && results['brsrc']) {
322 combined_results = combined_results.concat(results['brsrc']);
328 $q.all(promises).then(function() {
329 if (combined_results.length > 0) {
331 template: '<eg-embed-frame url="booking_admin_url" handlers="funcs"></eg-embed-frame>',
336 ['$scope','$location','egCore','$uibModalInstance',
337 function($scope , $location , egCore , $uibModalInstance) {
340 ses : egCore.auth.token(),
341 resultant_brsrc : combined_results.map(function(o) { return o[0]; })
344 var booking_path = '/eg/conify/global/booking/resource';
346 $scope.booking_admin_url =
347 $location.absUrl().replace(/\/eg\/staff.*/, booking_path);
354 service.book_copies_now = function(barcode) {
355 location.href = "/eg2/staff/booking/create_reservation/for_resource/" + barcode;
358 service.manage_reservations = function(barcode) {
359 location.href = "/eg2/staff/booking/manage_reservations/by_resource/" + barcode;
362 service.requestItems = function(copy_list,record_list) {
363 if (copy_list.length == 0) return;
365 record_list = record_list.filter(function(v,i,s){ // dedup
366 return s.indexOf(v) == i;
370 return $uibModal.open({
371 templateUrl: './cat/catalog/t_request_items',
375 ['$scope','$uibModalInstance','egUser',
376 function($scope , $uibModalInstance , egUser) {
378 $scope.first_user_fetch = true;
382 copy_list : copy_list,
383 record_list : record_list,
384 pickup_lib: egCore.org.get(egCore.auth.user().ws_ou()),
385 user : egCore.auth.user().id(),
386 honor_user_settings :
387 egCore.hatch.getLocalItem('eg.cat.request_items.honor_user_settings')
390 egUser.get( $scope.hold_data.user ).then(function(u) {
392 $scope.barcode = u.card().barcode();
393 $scope.user_name = egUser.format_name(u);
394 $scope.hold_data.user = u.id();
397 $scope.user_name = '';
399 function user_preferred_pickup_lib(u) {
400 var pickup_lib = u.home_ou();
401 angular.forEach(u.settings(), function (s) {
402 if (s.name() == "opac.default_pickup_location") {
403 pickup_lib = s.value();
406 return egOrg.get(pickup_lib);
408 $scope.$watch('barcode', function (n) {
409 if (!$scope.first_user_fetch) {
410 egUser.getByBarcode(n).then(function(u) {
412 $scope.user_name = egUser.format_name(u);
413 $scope.hold_data.user = u.id();
414 if ($scope.hold_data.honor_user_settings) {
415 $scope.hold_data.pickup_lib = user_preferred_pickup_lib(u);
419 $scope.user_name = '';
420 delete $scope.hold_data.user;
423 $scope.first_user_fetch = false;
425 $scope.$watch('hold_data.honor_user_settings', function (n) {
426 if (n && $scope.user) {
427 $scope.hold_data.pickup_lib = user_preferred_pickup_lib($scope.user);
429 $scope.hold_data.pickup_lib = egCore.org.get(egCore.auth.user().ws_ou());
431 egCore.hatch.setLocalItem('eg.cat.request_items.honor_user_settings',n);
434 $scope.ok = function(h) {
437 hold_type : h.hold_type,
438 pickup_lib: h.pickup_lib.id(),
444 'open-ils.circ.holds.test_and_create.batch.override',
445 egCore.auth.token(), args,
446 h.hold_type == 'T' ? h.record_list : h.copy_list,
447 { 'all' : 1, 'honor_user_settings' : h.honor_user_settings }
449 console.log('request result',r);
450 if (isNaN(r.result)) {
451 if (typeof r.result.desc != 'undefined') {
452 ngToast.danger(r.result.desc);
454 if (typeof r.result.last_event != 'undefined') {
455 ngToast.danger(r.result.last_event.desc);
457 ngToast.danger(egCore.strings.FAILURE_HOLD_REQUEST);
461 ngToast.success(egCore.strings.SUCCESS_HOLD_REQUEST);
465 $uibModalInstance.close();
468 $scope.cancel = function($event) {
469 $uibModalInstance.dismiss();
470 $event.preventDefault();
476 service.attach_to_peer_bib = function(items) {
477 if (items.length == 0) return;
479 egCore.hatch.getItem('eg.cat.marked_conjoined_record').then(function(target_record) {
480 if (!target_record) return;
482 return $uibModal.open({
483 templateUrl: './cat/catalog/t_conjoined_selector',
487 ['$scope','$uibModalInstance',
488 function($scope , $uibModalInstance) {
489 $scope.update = false;
491 $scope.peer_type = null;
492 $scope.peer_type_list = [];
494 get_peer_types = function() {
496 return $q.when(egCore.env.bpt.list);
498 return egCore.pcrud.retrieveAll('bpt', null, {atomic : true})
499 .then(function(list) {
500 egCore.env.absorbList(list, 'bpt');
505 get_peer_types().then(function(list){
506 $scope.peer_type_list = list;
509 $scope.ok = function(type) {
512 angular.forEach(items, function (cp) {
513 var n = new egCore.idl.bpbcm();
515 n.peer_record(target_record);
516 n.target_copy(cp.id);
518 promises.push(egCore.pcrud.create(n).then(function(){service.add_barcode_to_list(cp.barcode)}));
521 return $q.all(promises).then(function(){$uibModalInstance.close()});
524 $scope.cancel = function($event) {
525 $uibModalInstance.dismiss();
526 $event.preventDefault();
533 service.selectedHoldingsCopyDelete = function (items) {
534 if (items.length == 0) return;
536 var copy_objects = [];
537 egCore.pcrud.search('acp',
538 {deleted : 'f', id : items.map(function(el){return el.id;}) },
539 { flesh : 1, flesh_fields : { acp : ['call_number'] } }
543 var perCnCopies = {};
553 var cn_id = cp.call_number().id();
554 if (!cnHash[cn_id]) {
555 cnHash[cn_id] = cp.call_number();
556 perCnCopies[cn_id] = [cp];
558 perCnCopies[cn_id].push(cp);
560 cp.call_number(cn_id); // prevent loops in JSON-ification
564 angular.forEach(perCnCopies, function (v, k) {
569 angular.forEach(cnHash, function (v, k) {
573 if (cnList.length == 0) return;
577 egConfirmDialog.open(
578 egCore.strings.CONFIRM_DELETE_COPIES_VOLUMES,
579 egCore.strings.CONFIRM_DELETE_COPIES_VOLUMES_MESSAGE,
580 {copies : cp_count, volumes : cn_count}
581 ).result.then(function() {
584 'open-ils.cat.asset.volume.fleshed.batch.update',
585 egCore.auth.token(), cnList, 1, flags
586 ).then(function(resp){
587 var evt = egCore.evt.parse(resp);
589 egConfirmDialog.open(
590 egCore.strings.OVERRIDE_DELETE_ITEMS_FROM_CATALOG_TITLE,
591 egCore.strings.OVERRIDE_DELETE_ITEMS_FROM_CATALOG_BODY,
592 {'evt_desc': evt.desc}
593 ).result.then(function() {
596 'open-ils.cat.asset.volume.fleshed.batch.update.override',
597 egCore.auth.token(), cnList, 1,
598 { events: ['TITLE_LAST_COPY', 'COPY_DELETE_WARNING'] }
600 angular.forEach(items, function(cp){service.add_barcode_to_list(cp.barcode)});
604 angular.forEach(items, function(cp){service.add_barcode_to_list(cp.barcode)});
611 copy_objects.push(copy);
615 service.checkin = function (items) {
616 // Recursive function that creates a promise for each item. Once the dialog
617 // window for a given item is closed the next promise is started and a
618 // new dialog is opened.
619 // This keeps multiple popups from hitting the screen at once.
620 (function checkinLoop(i) {
621 if (i < items.length) new Promise((resolve, reject) => {
622 egCirc.checkin({copy_barcode: items[i].barcode})
624 service.add_barcode_to_list(items[i].barcode);
627 }).then(checkinLoop.bind(null, i+1));
631 service.renew = function (items) {
632 angular.forEach(items, function (cp) {
633 egCirc.renew({copy_barcode:cp.barcode}).then(
634 function() { service.add_barcode_to_list(cp.barcode) }
639 service.cancel_transit = function (items) {
640 angular.forEach(items, function(cp) {
641 egCirc.find_copy_transit(null, {copy_barcode:cp.barcode})
642 .then(function(t) { return egCirc.abort_transit(t.id()) })
643 .then(function() { return service.add_barcode_to_list(cp.barcode) });
647 service.selectedHoldingsDamaged = function (items) {
648 angular.forEach(items, function(cp) {
650 egCirc.mark_damaged({
659 service.selectedHoldingsDiscard = function (items) {
660 egCirc.mark_discard(items.map(function(el){return {id : el.id, barcode : el.barcode};})).then(function(){
661 angular.forEach(items, function(cp){service.add_barcode_to_list(cp.barcode)});
665 service.selectedHoldingsMissing = function (items) {
666 return egCirc.mark_missing(
667 items.map(function(el){return {id : el.id, barcode : el.barcode};})
669 var promise = $q.when();
670 angular.forEach(items, function(cp){
671 promise = promise.then(function() {
672 return service.add_barcode_to_list(cp.barcode, true);
679 service.gatherSelectedRecordIds = function (items) {
684 if (rid_list.indexOf(item['call_number.record.id']) == -1)
685 rid_list.push(item['call_number.record.id'])
691 service.gatherSelectedVolumeIds = function (items,rid) {
696 if (rid && item['call_number.record.id'] != rid) return;
697 if (cn_id_list.indexOf(item['call_number.id']) == -1)
698 cn_id_list.push(item['call_number.id'])
704 service.gatherSelectedHoldingsIds = function (items,rid) {
709 if (rid && item['call_number.record.id'] != rid) return;
710 cp_id_list.push(item.id)
716 service.spawnHoldingsAdd = function (items,use_vols,use_copies){
717 angular.forEach(service.gatherSelectedRecordIds(items), function (r) {
719 if (use_copies) { // just a copy on existing volumes
720 angular.forEach(service.gatherSelectedVolumeIds(items,r), function (v) {
721 raw.push( {callnumber : v} );
723 } else if (use_vols) {
725 service.gatherSelectedHoldingsIds(items,r),
727 angular.forEach(items, function(item) {
729 // owning_lib may be fleshed.
730 var owner = item['call_number.owning_lib.id']
731 || item['call_number.owning_lib'];
732 raw.push({owner : owner});
739 if (raw.length == 0) raw.push({});
743 'open-ils.actor.anon_cache.set_value',
744 null, 'edit-these-copies', {
750 ).then(function(key) {
752 var url = egCore.env.basePath + 'cat/volcopy/' + key;
753 $timeout(function() { $window.open(url, '_blank') });
755 alert('Could not create anonymous cache key!');
761 service.spawnHoldingsEdit = function (items,hide_vols,hide_copies){
763 angular.forEach(items, function(i){
767 // provide record_id iff one record is selected.
768 // 0 disables record summary
769 var record_ids = service.gatherSelectedRecordIds(items);
770 var record_id = record_ids.length === 1 ? record_ids[0] : 0;
773 'open-ils.actor.anon_cache.set_value',
777 record_id: record_id,
780 hide_vols : hide_vols,
781 hide_copies : hide_copies
782 }).then(function(key) {
784 var url = egCore.env.basePath + 'cat/volcopy/' + key;
785 $timeout(function() { $window.open(url, '_blank') });
787 alert('Could not create anonymous cache key!');
792 service.replaceBarcodes = function(items) {
793 angular.forEach(items, function (cp) {
795 templateUrl: './cat/share/t_replace_barcode',
799 ['$scope','$uibModalInstance',
800 function($scope , $uibModalInstance) {
801 $scope.isModal = true;
802 $scope.focusBarcode = false;
803 $scope.focusBarcode2 = true;
804 $scope.barcode1 = cp.barcode;
806 $scope.updateBarcode = function() {
807 $scope.copyNotFound = false;
808 $scope.updateOK = false;
810 egCore.pcrud.search('acp',
811 {deleted : 'f', barcode : $scope.barcode1})
812 .then(function(copy) {
815 $scope.focusBarcode = true;
816 $scope.copyNotFound = true;
820 $scope.copyId = copy.id();
821 copy.barcode($scope.barcode2);
823 egCore.pcrud.update(copy).then(function(stat) {
824 $scope.updateOK = stat;
825 $scope.focusBarcode = true;
826 if (stat) service.add_barcode_to_list(copy.barcode());
830 $uibModalInstance.close();
833 $scope.cancel = function($event) {
834 $uibModalInstance.dismiss();
835 $event.preventDefault();
843 // this "transfers" selected copies to a new owning library,
844 // auto-creating volumes and deleting unused volumes as required.
845 service.changeItemOwningLib = function(items) {
846 var xfer_target = egCore.hatch.getLocalItem('eg.cat.transfer_target_lib');
847 if (!xfer_target || !items.length) {
850 var vols_to_move = {};
851 var copies_to_move = {};
852 angular.forEach(items, function(item) {
853 if (item['call_number.owning_lib'] != xfer_target) {
854 if (item['call_number.id'] in vols_to_move) {
855 copies_to_move[item['call_number.id']].push(item.id);
857 vols_to_move[item['call_number.id']] = {
858 label : item['call_number.label'],
859 label_class : item['call_number.label_class'],
860 record : item['call_number.record.id'],
861 prefix : item['call_number.prefix.id'],
862 suffix : item['call_number.suffix.id']
864 copies_to_move[item['call_number.id']] = new Array;
865 copies_to_move[item['call_number.id']].push(item.id);
871 angular.forEach(vols_to_move, function(vol, vol_id) {
872 promises.push(egCore.net.request(
874 'open-ils.cat.call_number.find_or_create',
882 ).then(function(resp) {
883 var evt = egCore.evt.parse(resp);
885 return egCore.net.request(
887 'open-ils.cat.transfer_copies_to_volume',
890 copies_to_move[vol_id]
898 angular.forEach(items, function(cp){service.add_barcode_to_list(cp.barcode)});
903 service.transferItems = function (items){
904 var xfer_target = egCore.hatch.getLocalItem('eg.cat.transfer_target_vol');
905 var copy_ids = service.gatherSelectedHoldingsIds(items);
906 if (xfer_target && copy_ids.length > 0) {
909 'open-ils.cat.transfer_copies_to_volume',
914 function(resp) { // oncomplete
915 var evt = egCore.evt.parse(resp);
917 egConfirmDialog.open(
918 egCore.strings.OVERRIDE_TRANSFER_COPIES_TO_MARKED_VOLUME_TITLE,
919 egCore.strings.OVERRIDE_TRANSFER_COPIES_TO_MARKED_VOLUME_BODY,
921 ).result.then(function() {
924 'open-ils.cat.transfer_copies_to_volume.override',
928 { events: ['TITLE_LAST_COPY', 'COPY_DELETE_WARNING'] }
931 angular.forEach(items, function(cp){service.add_barcode_to_list(cp.barcode)});
934 angular.forEach(items, function(cp){service.add_barcode_to_list(cp.barcode)});
944 service.mark_missing_pieces = function(copy,outer_scope) {
945 var b = copy.barcode();
946 var t = egCore.idl.toHash(copy.call_number()).record.title;
947 egConfirmDialog.open(
948 egCore.strings.CONFIRM_MARK_MISSING_TITLE,
949 egCore.strings.CONFIRM_MARK_MISSING_BODY,
950 { barcode : b, title : t }
951 ).result.then(function() {
953 // kick off mark missing
954 return egCore.net.request(
956 'open-ils.circ.mark_item_missing_pieces',
957 egCore.auth.token(), copy.id()
960 }).then(function(resp) {
961 var evt = egCore.evt.parse(resp); // should always produce event
963 if (evt.textcode == 'ACTION_CIRCULATION_NOT_FOUND') {
964 return egAlertDialog.open(
965 egCore.strings.CIRC_NOT_FOUND, {barcode : copy.barcode()});
968 var payload = evt.payload;
970 // TODO: open copy editor inline? new tab?
972 // print the missing pieces slip
973 var promise = $q.when();
975 // wait for completion, since it may spawn a confirm dialog
976 promise = egCore.print.print({
978 content_type : 'text/html',
979 content : payload.slip.template_output().data()
983 if (payload.letter) {
984 outer_scope.letter = payload.letter.template_output().data();
987 // apply patron penalty
989 promise.then(function() {
990 egCirc.create_penalty(payload.circ.usr())
997 service.print_spine_labels = function(copy_ids){
1000 'open-ils.actor.anon_cache.set_value',
1001 null, 'print-labels-these-copies', {
1004 ).then(function(key) {
1006 var url = egCore.env.basePath + 'cat/printlabels/' + key;
1007 $timeout(function() { $window.open(url, '_blank') });
1009 alert('Could not create anonymous cache key!');
1014 service.show_in_catalog = function(copy_list){
1015 angular.forEach(copy_list, function(copy){
1016 window.open('/eg2/staff/catalog/record/'+copy['call_number.record.id'], '_blank')
1022 .filter('string_pick', function() { return function(i){ return arguments[i] || ''; }; })