[% l('Move user into this group?') %]
</h4>
<h4 ng-if="outbound" class="modal-title">
- [% l("Move selected users to the following user's group?") %]
+ <span ng-show="selected.length">[% l("Move selected users to the following user's group?") %]</span>
+ <span ng-hide="selected.length">[% l("No users selected for move.") %]</span>
</h4>
</div>
<div class="modal-body">
</a>
</div>
<div class="modal-footer">
- <button class="btn btn-primary" ng-click="ok()">[% l('Move User') %]</button>
+ <button ng-disabled="outbound && !selected.length" class="btn btn-primary" ng-click="ok()">[% l('Move User') %]</button>
<button class="btn btn-warning" ng-click="cancel()">[% l('Cancel') %]</button>
</div>
</div>
$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})
'$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 =
}
]
}).result.then(function() {
- if (selected) {
+ if (outbound) {
moveUsersToGroup(user, selected);
} else {
addUserToGroup(user);
// 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;