[open-ils-commits] [GIT] Evergreen ILS branch rel_3_2 updated. 8b0f6581a9d47b738452a8cefc5e50346af0f8cc
Evergreen Git
git at git.evergreen-ils.org
Thu Mar 7 14:20:42 EST 2019
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".
The branch, rel_3_2 has been updated
via 8b0f6581a9d47b738452a8cefc5e50346af0f8cc (commit)
from 41dc957622090d1a1fb71b81556aedddb09dbac0 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 8b0f6581a9d47b738452a8cefc5e50346af0f8cc
Author: Adam Bowling <abowling at emeralddata.net>
Date: Wed Mar 6 23:06:09 2019 -0500
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 <abowling at emeralddata.net>
Signed-off-by: Tiffany Little <tlittle at georgialibraries.org>
Signed-off-by: Chris Sharp <csharp at georgialibraries.org>
diff --git a/Open-ILS/src/templates/staff/cat/item/index.tt2 b/Open-ILS/src/templates/staff/cat/item/index.tt2
index 0a782812fc..8373049e04 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 @@
<li><a href ng-click="cancel_transit()">[% l('Cancel Transit') %]</a></li>
<li><a href ng-click="update_inventory()">[% l('Update Inventory') %]</a></li>
+ <p><b>[% l('Show') %]</b></p>
+ <li><a href ng-click="findAcquisition()">[% l('Originating Acquisition') %]</a></li>
+
<p><b>[% l('Mark') %]</b></p>
<li><a href ng-click="selectedHoldingsDamaged()">[% l('Item as Damaged') %]</a></li>
<li><a href ng-click="selectedHoldingsMissing()">[% l('Item as Missing') %]</a></li>
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 7f67e46ded..acf90e4a58 100644
--- a/Open-ILS/src/templates/staff/cat/item/t_list.tt2
+++ b/Open-ILS/src/templates/staff/cat/item/t_list.tt2
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="Windows-1252"?>
<eg-grid
id-field="index"
idl-class="acp"
@@ -40,7 +41,9 @@
label="[% l('Record Holds') %]"></eg-grid-action>
<eg-grid-action handler="print_labels" group="[% l('Show') %]"
label="[% l('Print Labels') %]"></eg-grid-action>
-
+ <eg-grid-action handler="locateAcquisition" group="[% l('Show') %]"
+ label="[% l('Originating Acquisition') %]"></eg-grid-action>
+
<eg-grid-action handler="selectedHoldingsDamaged" group="[% l('Mark') %]"
label="[% l('Item as Damaged') %]"></eg-grid-action>
<eg-grid-action handler="selectedHoldingsMissing" group="[% l('Mark') %]"
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..26f21ba16e 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,41 @@ function($scope , $location , $timeout , egCore , egGridDataProvider , itemSvc)
}]);
}
+ $scope.findAcquisition = function() {
+ var acqData;
+ var promises = [];
+ $scope.openAcquisitionLineItem([$scope.args.copyId]);
+ }
+
+ $scope.openAcquisitionLineItem = function (cp_list) {
+ var hasResults = false;
+ var promises = [];
+
+ angular.forEach(cp_list, function (copyId) {
+ promises.push(
+ egNet.request(
+ 'open-ils.acq',
+ 'open-ils.acq.lineitem.retrieve.by_copy_id',
+ egCore.auth.token(),
+ copyId
+ ).then(function (acqData) {
+ if (acqData) {
+ if (acqData.a) {
+ acqData = egCore.idl.toHash(acqData);
+ var url = '/eg/acq/po/view/' + acqData.purchase_order + '/' + acqData.id;
+ $timeout(function () { $window.open(url, '_blank') });
+ hasResults = true;
+ }
+ }
+ })
+ )
+ });
+
+ $q.all(promises).then(function () {
+ !hasResults ? alert('There is no corresponding purchase order for this item.') : false;
+ });
+ }
+
$scope.requestItems = function() {
itemSvc.requestItems([$scope.args.copyId]);
}
@@ -244,10 +279,11 @@ function($scope , $location , $timeout , egCore , egGridDataProvider , itemSvc)
['$scope','$q','$routeParams','$location','$timeout','$window','egCore',
'egGridDataProvider','egItem','egUser','$uibModal','egCirc','egConfirmDialog',
'egProgressDialog', 'ngToast',
-function($scope , $q , $routeParams , $location , $timeout , $window , egCore ,
- egGridDataProvider , itemSvc , egUser , $uibModal , egCirc , egConfirmDialog,
- egProgressDialog, ngToast) {
-
+// function($scope , $q , $routeParams , $location , $timeout , $window , egCore ,
+// egGridDataProvider , itemSvc , egUser , $uibModal , egCirc , egConfirmDialog,
+// egProgressDialog, ngToast) {
+ function($scope , $q , $routeParams , $location , $timeout , $window , egCore , egGridDataProvider , itemSvc , egUser , $uibModal , egCirc , egConfirmDialog,
+ egProgressDialog, ngToast) {
var copyId = [];
var cp_list = $routeParams.idList;
if (cp_list) {
@@ -392,6 +428,17 @@ function($scope , $q , $routeParams , $location , $timeout , $window , egCore ,
itemSvc.add_copies_to_bucket(copy_list);
}
+ $scope.locateAcquisition = function() {
+ if (gatherSelectedHoldingsIds) {
+ var cp_list = gatherSelectedHoldingsIds();
+ if (cp_list) {
+ if (cp_list.length > 0) {
+ $scope.openAcquisitionLineItem(cp_list);
+ }
+ }
+ }
+ }
+
$scope.update_inventory = function() {
var copy_list = gatherSelectedHoldingsIds();
itemSvc.updateInventory(copy_list, $scope.gridControls.allItems()).then(function(res) {
-----------------------------------------------------------------------
Summary of changes:
Open-ILS/src/templates/staff/cat/item/index.tt2 | 3 ++
Open-ILS/src/templates/staff/cat/item/t_list.tt2 | 5 +-
Open-ILS/web/js/ui/default/staff/cat/item/app.js | 59 +++++++++++++++++++++---
3 files changed, 60 insertions(+), 7 deletions(-)
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list