From 72830baa57aa4e6a81b5b96a545fa95b661b3352 Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Fri, 30 Jan 2015 13:05:26 -0500 Subject: [PATCH] LP#1402797 Be explicit about which direction users are moving between groups, and provide an informational message when none are selected but should be Signed-off-by: Mike Rylander Signed-off-by: Bill Erickson --- .../staff/circ/patron/t_move_to_group_dialog.tt2 | 5 +++-- Open-ILS/web/js/ui/default/staff/circ/patron/app.js | 15 ++++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Open-ILS/src/templates/staff/circ/patron/t_move_to_group_dialog.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_move_to_group_dialog.tt2 index 96e97332e7..ee04de0e1a 100644 --- a/Open-ILS/src/templates/staff/circ/patron/t_move_to_group_dialog.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/t_move_to_group_dialog.tt2 @@ -6,7 +6,8 @@ [% l('Move user into this group?') %] diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/app.js b/Open-ILS/web/js/ui/default/staff/circ/patron/app.js index d3c0adde3c..e6b22c09a7 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/patron/app.js +++ b/Open-ILS/web/js/ui/default/staff/circ/patron/app.js @@ -1411,7 +1411,7 @@ function($scope, $routeParams , $q , $window , $location , egCore , $q.all(promises).then(function() {grid.refresh()}); } - function showMoveToGroupConfirm(barcode, selected) { + function showMoveToGroupConfirm(barcode, selected, outbound) { // find the user egCore.pcrud.search('ac', {barcode : barcode}) @@ -1430,7 +1430,8 @@ function($scope, $routeParams , $q , $window , $location , egCore , '$scope','$modalInstance', function($scope , $modalInstance) { $scope.user = user; - $scope.outbound = Boolean(selected); + $scope.selected = selected; + $scope.outbound = outbound; $scope.ok = function(count) { $modalInstance.close() } $scope.cancel = @@ -1438,7 +1439,7 @@ function($scope, $routeParams , $q , $window , $location , egCore , } ] }).result.then(function() { - if (selected) { + if (outbound) { moveUsersToGroup(user, selected); } else { addUserToGroup(user); @@ -1450,18 +1451,18 @@ function($scope, $routeParams , $q , $window , $location , egCore , // selected == move selected patrons to another patron's group // !selected == patron from a different group moves into our group - function moveToGroup(selected) { + function moveToGroup(selected, outbound) { egPromptDialog.open( egCore.strings.GROUP_ADD_USER, '', {ok : function(value) { if (value) - showMoveToGroupConfirm(value, selected); + showMoveToGroupConfirm(value, selected, outbound); }} ); } - $scope.moveToGroup = function() { moveToGroup() }; - $scope.moveToAnotherGroup = function(selected) { moveToGroup(selected) }; + $scope.moveToGroup = function() { moveToGroup([], false) }; + $scope.moveToAnotherGroup = function(selected) { moveToGroup(selected, true) }; $scope.cloneUser = function(selected) { if (!selected.length) return; -- 2.11.0