From: Jason Etheridge Date: Mon, 13 Feb 2017 16:21:43 +0000 (-0500) Subject: webstaff: toward booking from Item Status X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=5ba8e09970a9df0784b3c62a8567d1393cbb0d7c;p=working%2FEvergreen.git webstaff: toward booking from Item Status Thanks Galen! also a bug fix from the XUL, handle batch involving multiple bibs Signed-off-by: Jason Etheridge --- diff --git a/Open-ILS/src/templates/staff/cat/item/t_list.tt2 b/Open-ILS/src/templates/staff/cat/item/t_list.tt2 index 087c4e043a..14d6451708 100644 --- a/Open-ILS/src/templates/staff/cat/item/t_list.tt2 +++ b/Open-ILS/src/templates/staff/cat/item/t_list.tt2 @@ -9,6 +9,10 @@ + + - - + diff --git a/Open-ILS/web/js/ui/default/staff/cat/item/app.js b/Open-ILS/web/js/ui/default/staff/cat/item/app.js index 33cc22c6e8..8958081051 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/item/app.js +++ b/Open-ILS/web/js/ui/default/staff/cat/item/app.js @@ -331,6 +331,69 @@ function($scope , $q , $routeParams , $location , $timeout , $window , egCore , }); } + $scope.make_copies_bookable = function() { + + var copies_by_record = {}; + var record_list = []; + angular.forEach( + copyGrid.selectedItems(), + function (item) { + var record_id = item['call_number.record.id']; + if (typeof copies_by_record[ record_id ] == 'undefined') { + copies_by_record[ record_id ] = []; + record_list.push( record_id ); + } + copies_by_record[ record_id ].push(item.id); + } + ); + + var promises = []; + var combined_results = []; + angular.forEach(record_list, function(record_id) { + promises.push( + egCore.net.request( + 'open-ils.booking', + 'open-ils.booking.resources.create_from_copies', + egCore.auth.token(), + copies_by_record[record_id] + ).then(function(results) { + if (results && results['brsrc']) { + combined_results = combined_results.concat(results['brsrc']); + } + }) + ); + }); + + $q.all(promises).then(function() { + if (combined_results.length > 0) { + $uibModal.open({ + template: '', + animation: true, + size: 'md', + controller: + ['$scope','$location','egCore','$uibModalInstance', + function($scope , $location , egCore , $uibModalInstance) { + + $scope.funcs = { + ses : egCore.auth.token(), + resultant_brsrc : combined_results.map(function(o) { return o[0]; }) + } + + var booking_path = '/eg/conify/global/booking/resource'; + + $scope.booking_admin_url = + $location.absUrl().replace(/\/eg\/staff.*/, booking_path); + + console.log('Loading Admin Booking URL: ' + $scope.booking_admin_url); + console.log('funcs = ',$scope.funcs); + + }] + }); + } + }); + } + + $scope.requestItems = function() { var copy_list = gatherSelectedHoldingsIds(); if (copy_list.length == 0) return;