WebContent/js/explore/spaces.js
/**
 * Handles removal of user(s) from a space
 * @author Todd Elvers & Skylar Stark
 */
Handles removal of user(s) from a space
@author Todd Elvers & Skylar Stark
Handles removal of user ( s ) from a space @author Todd Elvers & Skylar Stark
function removeUsers(selectedUsers) {
	var dialogButtons = null;
	if (isLeafSpace) {
		$('#dialog-confirm-delete-txt')
		.text('Are you sure you want to remove the user(s)?');
		dialogButtons = {
			'confirm': function() {
				removeUsersFromSpace(selectedUsers)
			},
			'cancel': function() {
				$('#dialog-confirm-delete').dialog('close');
			}
		};
	} else {
		$('#dialog-confirm-delete-txt').text(
			'do you want to remove the user(s) from ' + spaceName + ' and its hierarchy or just from ' + spaceName + '?');
		dialogButtons = {
			'space hierarchy': function() {
				log('user confirmed user deletion from space and its hierarchy');
				$('#dialog-confirm-delete').dialog('close');
				$.post(
					starexecRoot + "services/remove/user/" + spaceId,
					{selectedIds: selectedUsers, hierarchy: true},
					function(returnCode) {
						s = parseReturnCode(returnCode);
						if (s) {
							updateTable(userTable);
						}
					},
					"json"
				).error(function() {
					showMessage('error', "Internal error removing users", 5000);
				});
			},
			'space': function() {
				removeUsersFromSpace(selectedUsers)
			},
			'cancel': function() {
				$('#dialog-confirm-delete').dialog('close');
			}
		};
	}
	$('#dialog-confirm-delete').dialog({
		modal: true,
		width: 380,
		height: 200,
		buttons: dialogButtons
	});
}
function removeUsers ( selectedUsers ) { var dialogButtons = null ; if ( isLeafSpace ) { $ ( '#dialog-confirm-delete-txt' ) . text ( 'Are you sure you want to remove the user(s)?' ) ; dialogButtons = { 'confirm' : function ( ) { removeUsersFromSpace ( selectedUsers ) } , 'cancel' : function ( ) { $ ( '#dialog-confirm-delete' ) . dialog ( 'close' ) ; } } ; } else { $ ( '#dialog-confirm-delete-txt' ) . text ( 'do you want to remove the user(s) from ' + spaceName + ' and its hierarchy or just from ' + spaceName + '?' ) ; dialogButtons = { 'space hierarchy' : function ( ) { log ( 'user confirmed user deletion from space and its hierarchy' ) ; $ ( '#dialog-confirm-delete' ) . dialog ( 'close' ) ; $ . post ( starexecRoot + "services/remove/user/" + spaceId , { selectedIds : selectedUsers , hierarchy : true } , function ( returnCode ) { s = parseReturnCode ( returnCode ) ; if ( s ) { updateTable ( userTable ) ; } } , "json" ) . error ( function ( ) { showMessage ( 'error' , "Internal error removing users" , 5000 ) ; } ) ; } , 'space' : function ( ) { removeUsersFromSpace ( selectedUsers ) } , 'cancel' : function ( ) { $ ( '#dialog-confirm-delete' ) . dialog ( 'close' ) ; } } ; } $ ( '#dialog-confirm-delete' ) . dialog ( { modal : true , width : 380 , height : 200 , buttons : dialogButtons } ) ; }
Handles removal of user(s) from a space
 @author Todd Elvers & Skylar Stark
Handles removal of user ( s ) from a space @author Todd Elvers & Skylar Stark
// If the user actually confirms, close the dialog right away
 // Display the confirmation dialog
