From: Adam Bowling Date: Wed, 6 Mar 2019 08:47:47 +0000 (-0500) Subject: LP #1705497 Replaces functionality in web client from legacy X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=b464723d0e5c0750f8b75f8e7ae6ba3b169bad33;p=working%2FEvergreen.git LP #1705497 Replaces functionality in web client from legacy XUL client by including a find function for originating acquisition where it exists. Signed-off-by: Adam Bowling --- diff --git a/Open-ILS/src/templates/staff/cat/item/index.tt2 b/Open-ILS/src/templates/staff/cat/item/index.tt2 index 0a782812fc..7bd48f5cda 100644 --- a/Open-ILS/src/templates/staff/cat/item/index.tt2 +++ b/Open-ILS/src/templates/staff/cat/item/index.tt2 @@ -90,6 +90,9 @@
  • [% l('Cancel Transit') %]
  • [% l('Update Inventory') %]
  • +

    [% l('Find') %]

    +
  • [% l('Originating Acquisition') %]
  • +

    [% l('Mark') %]

  • [% l('Item as Damaged') %]
  • [% l('Item as Missing') %]
  • 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 19e45f921a..6420faa891 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 @@ -52,8 +52,8 @@ angular.module('egItemStatus', * Parent scope for list and detail views */ .controller('SearchCtrl', - ['$scope','$location','$timeout','egCore','egGridDataProvider','egItem', -function($scope , $location , $timeout , egCore , egGridDataProvider , itemSvc) { + ['$scope','$q','$window','$location','$timeout','egCore','egNet','egGridDataProvider','egItem', +function($scope , $q, $window , $location , $timeout , egCore , egNet , egGridDataProvider , itemSvc) { $scope.args = {}; // search args // sub-scopes (search / detail-view) apply their version @@ -100,6 +100,35 @@ function($scope , $location , $timeout , egCore , egGridDataProvider , itemSvc) }]); } + $scope.findAcquisition = function() { + var acqData; + var promises = []; + promises.push( + egCore.pcrud.search('jub', {eg_bib_id: $scope.args.copyId}).then( + null, + null, + function (data) { + acqData = data; + } + ) + ); + + $q.all(promises).then(function() { + if (acqData) { + acqData = egCore.idl.toHash(acqData); + var url = '/eg/acq/po/view/' + acqData.purchase_order + '/' + acqData.id; + $timeout( + function() { + $window.open(url, '_blank') + }).then( + function() {$timeout(function(){$window.close()});} + ); + } else { + alert('There is no corresponding purchase order for this item.'); + } + }); + } + $scope.requestItems = function() { itemSvc.requestItems([$scope.args.copyId]); }