From 13887f4bec03cebd12ca6ade5a818f2550a8e9ec Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Wed, 24 Jun 2015 09:18:04 -0400 Subject: [PATCH] webstaff: Add support for item list population from the URL Signed-off-by: Mike Rylander Signed-off-by: Galen Charlton Signed-off-by: Jason Stephenson --- Open-ILS/web/js/ui/default/staff/cat/item/app.js | 25 ++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) 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 da3a6b5a68..22392ee08b 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 @@ -24,6 +24,13 @@ angular.module('egItemStatus', resolve : resolver }); + // search page shows the list view by default + $routeProvider.when('/cat/item/search/:idList', { + templateUrl: './cat/item/t_list', + controller: 'ListCtrl', + resolve : resolver + }); + $routeProvider.when('/cat/item/:id', { templateUrl: './cat/item/t_view', controller: 'ViewCtrl', @@ -132,8 +139,14 @@ function($scope , $location , egCore , egGridDataProvider , itemSvc) { * List view - grid stuff */ .controller('ListCtrl', - ['$scope','$q','$location','$timeout','egCore','egGridDataProvider','itemSvc', -function($scope , $q , $location , $timeout , egCore , egGridDataProvider , itemSvc) { + ['$scope','$q','$routeParams','$location','$timeout','egCore','egGridDataProvider','itemSvc', +function($scope , $q , $routeParams , $location , $timeout , egCore , egGridDataProvider , itemSvc) { + var copyId = []; + var cp_list = $routeParams.idList; + if (cp_list) { + copyId = cp_list.split(','); + } + $scope.context.page = 'list'; /* @@ -210,6 +223,14 @@ function($scope , $q , $location , $timeout , egCore , egGridDataProvider , item $location.path('/cat/item/' + item.id + '/triggered_events'); } + if (copyId.length > 0) { + itemSvc.fetch(null,copyId).then( + function() { + copyGrid.refresh(); + } + ); + } + }]) /** -- 2.11.0