From 40bc7679793db9e819c5bac859d0ff063168f696 Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Sat, 8 Jan 2022 19:41:37 -0500 Subject: [PATCH] Trying again to get the succes count in the toast --- Open-ILS/src/templates/staff/cat/item/index.tt2 | 2 +- Open-ILS/web/js/ui/default/staff/cat/item/app.js | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Open-ILS/src/templates/staff/cat/item/index.tt2 b/Open-ILS/src/templates/staff/cat/item/index.tt2 index f200f6e308..00636307c8 100644 --- a/Open-ILS/src/templates/staff/cat/item/index.tt2 +++ b/Open-ILS/src/templates/staff/cat/item/index.tt2 @@ -33,7 +33,7 @@ s.OVERRIDE_TRANSFER_COPIES_TO_MARKED_VOLUME_BODY = "[% l('Reason(s) include: [_1]', '{{evt_desc}}') %]"; s.SUCCESS_UPDATE_INVENTORY = - "[% l('Updated most recent inventory data for selected items.') %]"; + "[% l('Updated most recent inventory data for [_1] items.', '{{success_count}}') %]"; s.FAIL_UPDATE_INVENTORY = "[% l('Failed to update recent inventory data for selected items.')%]"; s.ITEM_SUCCESSFULLY_MODIFIED = 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 0a9371ad1d..3426fc65b0 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 @@ -318,13 +318,13 @@ function($scope , $q , $window , $location , $timeout , egCore , egNet , egGridD * List view - grid stuff */ .controller('ListCtrl', - ['$scope','$q','$routeParams','$location','$timeout','$window','egCore', + ['$scope','$q','$sce','$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, + function($scope , $q , $sce, $routeParams , $location , $timeout , $window , egCore , egGridDataProvider , itemSvc , egUser , $uibModal , egCirc , egConfirmDialog, egProgressDialog, ngToast) { var copyId = []; var cp_list = $routeParams.idList; @@ -562,7 +562,10 @@ function($scope , $q , $window , $location , $timeout , egCore , egNet , egGridD var copy_list = gatherSelectedHoldingsIds(); itemSvc.updateInventory(copy_list, $scope.gridControls.allItems()).then(function(res) { if (res[0]) { - ngToast.create(egCore.strings.SUCCESS_UPDATE_INVENTORY); + $scope.success_count = res[0]; + ngToast.create({ + content: $sce.trustAsHtml(egCore.strings.SUCCESS_UPDATE_INVENTORY) + compileContent: true}); } else { ngToast.warning(egCore.strings.FAIL_UPDATE_INVENTORY); } -- 2.11.0