replicated the panel for assign role in new panel remove roles
missing implementation server side
This commit is contained in:
parent
1b01f461ec
commit
51620bc664
2
pom.xml
2
pom.xml
|
@ -13,7 +13,7 @@
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<groupId>org.gcube.portlets.admin</groupId>
|
<groupId>org.gcube.portlets.admin</groupId>
|
||||||
<artifactId>UsersManagementPortlet</artifactId>
|
<artifactId>UsersManagementPortlet-portlet</artifactId>
|
||||||
<packaging>war</packaging>
|
<packaging>war</packaging>
|
||||||
<name>UsersManagement Portlet</name>
|
<name>UsersManagement Portlet</name>
|
||||||
<description>UsersManagementPortlet portlet</description>
|
<description>UsersManagementPortlet portlet</description>
|
||||||
|
|
|
@ -85,6 +85,7 @@ div#usersManagementPortletContainer textarea#userNamesList {
|
||||||
display : none !important;
|
display : none !important;
|
||||||
}
|
}
|
||||||
div#usersManagementPortletContainer textarea#userNamesListInAssignRolesModal,
|
div#usersManagementPortletContainer textarea#userNamesListInAssignRolesModal,
|
||||||
|
div#usersManagementPortletContainer textarea#userNamesListInRemoveRolesModal,
|
||||||
div#usersManagementPortletContainer textarea#userNamesListInAssignUsersToGroupsModal {
|
div#usersManagementPortletContainer textarea#userNamesListInAssignUsersToGroupsModal {
|
||||||
width :100% !important;
|
width :100% !important;
|
||||||
display : none !important;
|
display : none !important;
|
||||||
|
|
|
@ -49,6 +49,7 @@ div#usersManagementPortletContainer div#changeUsersRolesModal div.modal-body div
|
||||||
}
|
}
|
||||||
div#usersManagementPortletContainer div#changeUsersRolesModal div.modal-body label:not(#deleteTheRolesLabel),
|
div#usersManagementPortletContainer div#changeUsersRolesModal div.modal-body label:not(#deleteTheRolesLabel),
|
||||||
div#usersManagementPortletContainer div#assignUsersRolesModal div.modal-body label:not(#deleteTheRolesLabelInAssignRolesModal),
|
div#usersManagementPortletContainer div#assignUsersRolesModal div.modal-body label:not(#deleteTheRolesLabelInAssignRolesModal),
|
||||||
|
div#usersManagementPortletContainer div#removeUsersRolesModal div.modal-body label:not(#deleteTheRolesLabelInAssignRolesModal),
|
||||||
div#usersManagementPortletContainer div#assignUsersToGroupsModal div.modal-body label:not(#deleteTheRolesLabelInAssignUsersToGroupsModal),
|
div#usersManagementPortletContainer div#assignUsersToGroupsModal div.modal-body label:not(#deleteTheRolesLabelInAssignUsersToGroupsModal),
|
||||||
#addGroupTeamAttributes label,
|
#addGroupTeamAttributes label,
|
||||||
#groupTeamAttributes label {
|
#groupTeamAttributes label {
|
||||||
|
@ -73,6 +74,7 @@ div#usersManagementPortletContainer div#changeUsersRolesModal div.modal-body div
|
||||||
}
|
}
|
||||||
div#usersManagementPortletContainer span#textAboveTagsInput div.row,
|
div#usersManagementPortletContainer span#textAboveTagsInput div.row,
|
||||||
div#assignUsersRolesModal span#textAboveTagsInputInAssignRolesModal div.row,
|
div#assignUsersRolesModal span#textAboveTagsInputInAssignRolesModal div.row,
|
||||||
|
div#removeUsersRolesModal span#textAboveTagsInputInAssignRolesModal div.row,
|
||||||
div#assignUsersToGroupsModal span#textAboveTagsInputInAssignUsersToGroupsModal div.row {
|
div#assignUsersToGroupsModal span#textAboveTagsInputInAssignUsersToGroupsModal div.row {
|
||||||
margin-left : 0px;
|
margin-left : 0px;
|
||||||
}
|
}
|
||||||
|
@ -91,6 +93,7 @@ div#usersManagementPortletContainer div#changeUsersRolesModal div.modal-body spa
|
||||||
}
|
}
|
||||||
div#usersManagementPortletContainer div#changeUsersRolesModal div.modal-body span#textAboveTagsInput div.row:nth-last-child(-n+2) div.text-core.span9,
|
div#usersManagementPortletContainer div#changeUsersRolesModal div.modal-body span#textAboveTagsInput div.row:nth-last-child(-n+2) div.text-core.span9,
|
||||||
div#usersManagementPortletContainer div#assignUsersRolesModal div.modal-body span#textAboveTagsInputInAssignRolesModal div.row:last-of-type div.text-core.span9,
|
div#usersManagementPortletContainer div#assignUsersRolesModal div.modal-body span#textAboveTagsInputInAssignRolesModal div.row:last-of-type div.text-core.span9,
|
||||||
|
div#usersManagementPortletContainer div#removeUsersRolesModal div.modal-body span#textAboveTagsInputInAssignRolesModal div.row:last-of-type div.text-core.span9,
|
||||||
div#usersManagementPortletContainer div#assignUsersToGroupsModal div.modal-body span#textAboveTagsInputInAssignUsersToGroupsModal div.row:last-of-type div.text-core.span9 {
|
div#usersManagementPortletContainer div#assignUsersToGroupsModal div.modal-body span#textAboveTagsInputInAssignUsersToGroupsModal div.row:last-of-type div.text-core.span9 {
|
||||||
border-radius: 0.2em;
|
border-radius: 0.2em;
|
||||||
border: 1px solid #d1d1d1;
|
border: 1px solid #d1d1d1;
|
||||||
|
@ -98,6 +101,7 @@ div#usersManagementPortletContainer div#changeUsersRolesModal div.modal-body spa
|
||||||
}
|
}
|
||||||
div#usersManagementPortletContainer div#changeUsersRolesModal div.modal-body span#textAboveTagsInput div.row:nth-last-child(-n+2),
|
div#usersManagementPortletContainer div#changeUsersRolesModal div.modal-body span#textAboveTagsInput div.row:nth-last-child(-n+2),
|
||||||
div#usersManagementPortletContainer div#assignUsersRolesModal div.modal-body span#textAboveTagsInputInAssignRolesModal div.row:last-of-type,
|
div#usersManagementPortletContainer div#assignUsersRolesModal div.modal-body span#textAboveTagsInputInAssignRolesModal div.row:last-of-type,
|
||||||
|
div#usersManagementPortletContainer div#removeUsersRolesModal div.modal-body span#textAboveTagsInputInAssignRolesModal div.row:last-of-type,
|
||||||
div#usersManagementPortletContainer div#assignUsersToGroupsModal div.modal-body span#textAboveTagsInputInAssignUsersToGroupsModal div.row:last-of-type {
|
div#usersManagementPortletContainer div#assignUsersToGroupsModal div.modal-body span#textAboveTagsInputInAssignUsersToGroupsModal div.row:last-of-type {
|
||||||
margin-top: 1.2em;
|
margin-top: 1.2em;
|
||||||
}
|
}
|
||||||
|
@ -130,7 +134,8 @@ div#usersManagementPortletContainer textarea#roleList {
|
||||||
display : none !important;
|
display : none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
div#usersManagementPortletContainer textarea#roleListInAssignRolesModal {
|
div#usersManagementPortletContainer textarea#roleListInAssignRolesModal,
|
||||||
|
div#usersManagementPortletContainer textarea#roleListInRemoveRolesModal {
|
||||||
/* margin-left : 10px; */
|
/* margin-left : 10px; */
|
||||||
width : 100% !important;
|
width : 100% !important;
|
||||||
border-radius : 7px;
|
border-radius : 7px;
|
||||||
|
|
|
@ -38,7 +38,7 @@ div#usersManagementPortletContainer table#CurrentUsersTable thead > tr th,
|
||||||
text-transform: capitalize;
|
text-transform: capitalize;
|
||||||
}
|
}
|
||||||
div#usersManagementPortletContainerSiteTeamsEditMode table#GroupTeamsTableUsers thead > tr th:after
|
div#usersManagementPortletContainerSiteTeamsEditMode table#GroupTeamsTableUsers thead > tr th:after
|
||||||
table#rejectedUsersRequestsTable thead > tr th:after,{
|
table#rejectedUsersRequestsTable thead > tr th:after {
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
div#usersManagementPortletContainer table#CurrentUsersTable thead > tr th:first-of-type,
|
div#usersManagementPortletContainer table#CurrentUsersTable thead > tr th:first-of-type,
|
||||||
|
@ -84,7 +84,7 @@ div#usersManagementPortletContainer table#CurrentUsersTable,
|
||||||
div#usersManagementPortletContainer table#CurrentUsersTable tr td:first-of-type,
|
div#usersManagementPortletContainer table#CurrentUsersTable tr td:first-of-type,
|
||||||
div#usersManagementPortletContainerSiteTeamsEditMode table#GroupTeamsTable tr td:first-of-type,
|
div#usersManagementPortletContainerSiteTeamsEditMode table#GroupTeamsTable tr td:first-of-type,
|
||||||
table#tr:not(.selected):hover td div tr td:first-of-type {
|
table#tr:not(.selected):hover td div tr td:first-of-type {
|
||||||
:white;
|
color:white;
|
||||||
}
|
}
|
||||||
.dataTable:not(#GroupTeamsTableUsers) tr td {
|
.dataTable:not(#GroupTeamsTableUsers) tr td {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
@ -201,7 +201,7 @@ div#usersManagementPortletContainer div.dataTables_info, div.dataTables_length l
|
||||||
div#usersManagementPortletContainerSiteTeamsEditMode div.dataTables_info, div.dataTables_length label, table#GroupTeamsTable > thead > tr > th,
|
div#usersManagementPortletContainerSiteTeamsEditMode div.dataTables_info, div.dataTables_length label, table#GroupTeamsTable > thead > tr > th,
|
||||||
div#usersManagementPortletContainerSiteTeamsEditMode div.dataTables_info, table#GroupTeamsTableUsers > thead > tr > th,
|
div#usersManagementPortletContainerSiteTeamsEditMode div.dataTables_info, table#GroupTeamsTableUsers > thead > tr > th,
|
||||||
table#rejectedUsersRequestsTable > thead > tr> th {
|
table#rejectedUsersRequestsTable > thead > tr> th {
|
||||||
color : #0271be; !important
|
color : #0271be !important;
|
||||||
font-weight: normal !important;
|
font-weight: normal !important;
|
||||||
padding-left: 3px;
|
padding-left: 3px;
|
||||||
margin-bottom: 0px;
|
margin-bottom: 0px;
|
||||||
|
|
|
@ -44,7 +44,7 @@ div#usersManagementPortletContainer div#userRequestsNotificationsTabletView.noti
|
||||||
div#usersManagementPortletContainer div#userRequestsNotifications:after {
|
div#usersManagementPortletContainer div#userRequestsNotifications:after {
|
||||||
/* content: 'No pending requests'; */
|
/* content: 'No pending requests'; */
|
||||||
color:#808080;
|
color:#808080;
|
||||||
font-size 0.8em;
|
font-size: 0.8 em;
|
||||||
}
|
}
|
||||||
div#usersManagementPortletContainer div#userRequestsNotifications.notificationsShown {
|
div#usersManagementPortletContainer div#userRequestsNotifications.notificationsShown {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
|
@ -257,7 +257,7 @@ div#notificationsNumberPlaceHolder:before {
|
||||||
margin-left: -135px;
|
margin-left: -135px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
color:#808080;
|
color:#808080;
|
||||||
font-size 0.8em;
|
font-size: 0.8em;
|
||||||
}
|
}
|
||||||
div#notificationsNumberPlaceHolder:hover:before {
|
div#notificationsNumberPlaceHolder:hover:before {
|
||||||
cursor: default;
|
cursor: default;
|
||||||
|
@ -267,20 +267,20 @@ div#notificationsNumberPlaceHolder:hover:before {
|
||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
padding-left: 2px;
|
padding-left: 2px;
|
||||||
color:#808080;
|
color:#808080;
|
||||||
font-size 0.8em;
|
font-size: 0.8em;
|
||||||
}
|
}
|
||||||
#notificationsTextDivTabletView{
|
#notificationsTextDivTabletView{
|
||||||
padding-top: 3px;
|
padding-top: 3px;
|
||||||
padding-left: 2px;
|
padding-left: 2px;
|
||||||
color:#808080;
|
color:#808080;
|
||||||
font-size 0.8em;
|
font-size: 0.8em;
|
||||||
}
|
}
|
||||||
#notificationsTextDivTabletView{
|
#notificationsTextDivTabletView{
|
||||||
float: left;
|
float: left;
|
||||||
margin-top: 0.9em;
|
margin-top: 0.9em;
|
||||||
padding-left: 13px;
|
padding-left: 13px;
|
||||||
color:#808080;
|
color:#808080;
|
||||||
font-size 0.8em;
|
font-size: 0.8em;
|
||||||
}
|
}
|
||||||
div#addSiteTeam {
|
div#addSiteTeam {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
|
|
@ -76,14 +76,18 @@ function constructToolbarForCurrentUsersTable(){
|
||||||
id : 'deselectAll',
|
id : 'deselectAll',
|
||||||
class: 'insideToolbar',
|
class: 'insideToolbar',
|
||||||
text : 'Deselect All'
|
text : 'Deselect All'
|
||||||
})).append($('<div></div>', {
|
// })).append($('<div></div>', {
|
||||||
id : 'editSelected',
|
// id : 'editSelected',
|
||||||
class: 'insideToolbar',
|
// class: 'insideToolbar',
|
||||||
text : 'Edit Selected'
|
// text : 'Edit Selected'
|
||||||
})).append($('<div></div>', {
|
})).append($('<div></div>', {
|
||||||
id : 'assignRolesToUser',
|
id : 'assignRolesToUser',
|
||||||
class: 'insideToolbar',
|
class: 'insideToolbar',
|
||||||
text : 'Assign Roles'
|
text : 'Assign Roles'
|
||||||
|
})).append($('<div></div>', {
|
||||||
|
id : 'removeRolesToUser',
|
||||||
|
class: 'insideToolbar',
|
||||||
|
text : 'Remove Roles'
|
||||||
})).append($('<div></div>', {
|
})).append($('<div></div>', {
|
||||||
id : 'assignUsersToGroup',
|
id : 'assignUsersToGroup',
|
||||||
class: 'insideToolbar',
|
class: 'insideToolbar',
|
||||||
|
|
|
@ -153,6 +153,12 @@ function tableEvents() {
|
||||||
$('#userNamesListInAssignRolesModal').textext({
|
$('#userNamesListInAssignRolesModal').textext({
|
||||||
plugins : ' tags'
|
plugins : ' tags'
|
||||||
});
|
});
|
||||||
|
$('#userNamesListInRemoveRolesModal').textext({
|
||||||
|
plugins : ' tags'
|
||||||
|
});
|
||||||
|
$('#roleListInRemoveRolesModal').textext({
|
||||||
|
plugins : ' tags'
|
||||||
|
});
|
||||||
$('#userNamesListInAssignUsersToGroupsModal').textext({
|
$('#userNamesListInAssignUsersToGroupsModal').textext({
|
||||||
plugins : ' tags'
|
plugins : ' tags'
|
||||||
});
|
});
|
||||||
|
@ -188,6 +194,21 @@ function tableEvents() {
|
||||||
$('#userNamesListInAssignRolesModal').parent().find('a.text-remove').html('<i class="fa fa-times"></i>')
|
$('#userNamesListInAssignRolesModal').parent().find('a.text-remove').html('<i class="fa fa-times"></i>')
|
||||||
.removeClass('text-remove').addClass('tag-remove');
|
.removeClass('text-remove').addClass('tag-remove');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#userNamesListInRemoveRolesModal').parent().find('div.text-tags').unbind().bind(
|
||||||
|
'DOMNodeInserted',
|
||||||
|
function(event) {
|
||||||
|
var element = event.target;
|
||||||
|
var tagName = $(element).prop("tagName");
|
||||||
|
if (tagName !== 'DIV')
|
||||||
|
return;
|
||||||
|
// $('#userNamesList').parent().find('div.text-tag').addClass('span4');
|
||||||
|
$('#userNamesListInRemoveRolesModal').parent().find('div.text-button').addClass(
|
||||||
|
'span12');
|
||||||
|
$('#userNamesListInRemoveRolesModal').parent().find('a.text-remove').html('<i class="fa fa-times"></i>')
|
||||||
|
.removeClass('text-remove').addClass('tag-remove');
|
||||||
|
});
|
||||||
|
|
||||||
$('#userNamesList').parent().find('div.text-tags').unbind().bind(
|
$('#userNamesList').parent().find('div.text-tags').unbind().bind(
|
||||||
'DOMNodeInserted',
|
'DOMNodeInserted',
|
||||||
function(event) {
|
function(event) {
|
||||||
|
@ -302,7 +323,6 @@ function tableEvents() {
|
||||||
'click', function() {
|
'click', function() {
|
||||||
$(this).closest('.text-tag').remove();
|
$(this).closest('.text-tag').remove();
|
||||||
});
|
});
|
||||||
var matched = false;
|
|
||||||
var tagsTextt = $('#roleListInAssignRolesModal').parent().find(
|
var tagsTextt = $('#roleListInAssignRolesModal').parent().find(
|
||||||
'div.text-tag.span5');
|
'div.text-tag.span5');
|
||||||
for (var i = 0; i < tagsTextt.length; i++) {
|
for (var i = 0; i < tagsTextt.length; i++) {
|
||||||
|
@ -313,6 +333,33 @@ function tableEvents() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#roleListInRemoveRolesModal').parent().find('div.text-tags').off().bind(
|
||||||
|
'DOMNodeInserted',
|
||||||
|
function(event) {
|
||||||
|
var element = event.target;
|
||||||
|
var tagName = $(element).prop("tagName");
|
||||||
|
if (tagName !== 'DIV')
|
||||||
|
return;
|
||||||
|
// $('#roleList').parent().find('div.text-tag').addClass('span5');
|
||||||
|
$('#roleListInRemoveRolesModal').parent().find('div.text-button').addClass(
|
||||||
|
'span12');
|
||||||
|
$('#roleListInRemoveRolesModal').parent().find('a.text-remove').html('<i class="fa fa-times"></i>')
|
||||||
|
.removeClass('text-remove').addClass('tag-remove');
|
||||||
|
$('textarea#roleListInRemoveRolesModal').parent().find('a.tag-remove').off().on(
|
||||||
|
'click', function() {
|
||||||
|
$(this).closest('.text-tag').remove();
|
||||||
|
});
|
||||||
|
var tagsTextt = $('#roleListInRemoveRolesModal').parent().find(
|
||||||
|
'div.text-tag.span5');
|
||||||
|
for (var i = 0; i < tagsTextt.length; i++) {
|
||||||
|
for (var j = i + 1; j < tagsTextt.length; j++) {
|
||||||
|
if ($(tagsTextt[i]).text() === $(tagsTextt[j]).text()) {
|
||||||
|
tagsTextt[j].remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
displaySiteRolesOnHover();
|
displaySiteRolesOnHover();
|
||||||
|
|
||||||
|
@ -486,6 +533,7 @@ function tableEvents() {
|
||||||
usersEmails.push(email.substring(5, email.length - 6));
|
usersEmails.push(email.substring(5, email.length - 6));
|
||||||
var userUuid = usersTableDataForEditing[i][0].UserId;
|
var userUuid = usersTableDataForEditing[i][0].UserId;
|
||||||
userTableUUIDsForEditing.push(userUuid);
|
userTableUUIDsForEditing.push(userUuid);
|
||||||
|
console.log(usersEmails);
|
||||||
}
|
}
|
||||||
var tags = $('textarea#userNamesListInAssignRolesModal').parent().find(
|
var tags = $('textarea#userNamesListInAssignRolesModal').parent().find(
|
||||||
'div.text-tags div.text-tag');
|
'div.text-tags div.text-tag');
|
||||||
|
@ -505,6 +553,41 @@ function tableEvents() {
|
||||||
$(this).closest('.text-tag').remove();
|
$(this).closest('.text-tag').remove();
|
||||||
showCheckBoxForSingleTagInAssignRolesModal();
|
showCheckBoxForSingleTagInAssignRolesModal();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}).on('click', 'div#toolbar.shownToolbar div#removeRolesToUser',
|
||||||
|
function() {
|
||||||
|
$('#removeUsersRolesModal').modal('show');
|
||||||
|
//remove previous tags
|
||||||
|
$('#roleListInRemoveRolesModal').parent().find('.text-tag').remove();
|
||||||
|
currentUsersTableRows = [];
|
||||||
|
var usersEmails = [];
|
||||||
|
for (var i = 0; i < usersTableDataForEditing.length; i++) {
|
||||||
|
var email = usersTableDataForEditing[i][0].Email;
|
||||||
|
currentUsersTableRows
|
||||||
|
.push(usersTableDataForEditing[i].rowIndex);
|
||||||
|
usersEmails.push(email.substring(5, email.length - 6));
|
||||||
|
var userUuid = usersTableDataForEditing[i][0].UserId;
|
||||||
|
userTableUUIDsForEditing.push(userUuid);
|
||||||
|
}
|
||||||
|
var tags = $('textarea#userNamesListInRemoveRolesModal').parent().find(
|
||||||
|
'div.text-tags div.text-tag');
|
||||||
|
if (tags.length > 0)
|
||||||
|
tags.remove();// Remove previous tags
|
||||||
|
$('textarea#userNamesListInRemoveRolesModal').textext()[0].tags().addTags(
|
||||||
|
usersEmails);
|
||||||
|
|
||||||
|
for (var j = 0; j < userTableUUIDsForEditing.length; j++) {
|
||||||
|
var value = userTableUUIDsForEditing[j].toString();
|
||||||
|
$($('#userNamesListInRemoveRolesModal').parent().find('.text-tag')[j]).data(
|
||||||
|
'userUUID', value.substring(5, value.length - 6));
|
||||||
|
}
|
||||||
|
showCheckBoxForSingleTagInRemoveRolesModal();
|
||||||
|
$('textarea#userNamesListInRemoveRolesModal').parent().find('a.tag-remove').off()
|
||||||
|
.on('click', function() {
|
||||||
|
$(this).closest('.text-tag').remove();
|
||||||
|
showCheckBoxForSingleTagInAssignRolesModal();
|
||||||
|
});
|
||||||
|
|
||||||
}).on('click', 'div#toolbar.shownToolbar div#assignUsersToGroup',
|
}).on('click', 'div#toolbar.shownToolbar div#assignUsersToGroup',
|
||||||
function() {
|
function() {
|
||||||
|
@ -652,6 +735,27 @@ function tableEvents() {
|
||||||
deletePreviousRoles = false;
|
deletePreviousRoles = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function showCheckBoxForSingleTagInRemoveRolesModal() {
|
||||||
|
var currentTags = $('textarea#userNamesListInRemoveRolesModal').parent().find(
|
||||||
|
'div.text-tags div.text-tag');
|
||||||
|
// appendCheckboxHere.append($('<br>')).append(labelForSingleTag).append(checkBoxForSingleTag);
|
||||||
|
if (currentTags.length == 1) {
|
||||||
|
$('div#singleTagSectionInAssignRolesModal').removeClass('hiddenSection');
|
||||||
|
$('div#multipleTagsSectionInAssignRolesModal').addClass('hiddenSection');
|
||||||
|
displayRolesForSingleUserInRemoveRolesModal();
|
||||||
|
} else {
|
||||||
|
$('div#singleTagSectionInAssignRolesModal').addClass('hiddenSection');
|
||||||
|
$('div#multipleTagsSectionInAssignRolesModal').removeClass('hiddenSection');
|
||||||
|
}
|
||||||
|
if (!$('#singleTagSectionInAssignRolesModal').hasClass('hiddenSection')) {
|
||||||
|
deletePreviousRoles = $('#singleTagInAssignRolesModal').prop('checked');
|
||||||
|
$('#singleTagInAssignRolesModal').prop('checked', false);
|
||||||
|
} else {
|
||||||
|
deletePreviousRoles = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function displayRolesForSingleUserInAssignRolesModal() {
|
function displayRolesForSingleUserInAssignRolesModal() {
|
||||||
|
|
||||||
|
@ -666,6 +770,21 @@ function tableEvents() {
|
||||||
$('textarea#roleListInAssignRolesModal').textext()[0].tags().addTags(rolesArray);
|
$('textarea#roleListInAssignRolesModal').textext()[0].tags().addTags(rolesArray);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function displayRolesForSingleUserInRemoveRolesModal() {
|
||||||
|
|
||||||
|
var singleRow = $('table#CurrentUsersTable tbody tr.selected')[0];
|
||||||
|
var table = $('table#CurrentUsersTable');
|
||||||
|
var roles = table.dataTable().fnGetData(singleRow).Roles;
|
||||||
|
var teams = table.dataTable().fnGetData(singleRow).Teams;
|
||||||
|
var teamsText = $(teams).text();
|
||||||
|
var rolesText = $(roles).text();//roles is an HTML element, not a jquery one
|
||||||
|
if(rolesText !== "-"){//"-" means no role
|
||||||
|
var rolesArray = rolesText.split(",");
|
||||||
|
$('textarea#roleListInRemoveRolesModal').textext()[0].tags().addTags(rolesArray);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function showCheckBoxForSingleTagInAssignUsersToGroupsModal() {
|
function showCheckBoxForSingleTagInAssignUsersToGroupsModal() {
|
||||||
var currentTags = $('textarea#userNamesListInAssignUsersToGroupsModal').parent().find(
|
var currentTags = $('textarea#userNamesListInAssignUsersToGroupsModal').parent().find(
|
||||||
|
@ -1040,6 +1159,7 @@ function tableEvents() {
|
||||||
fetchAllCurrentUsers(mode, deleteUsers, ajaxData, roles, teams, deletePreviousRoles2, [], false, ASSIGN_ROLES_TO_USERS);
|
fetchAllCurrentUsers(mode, deleteUsers, ajaxData, roles, teams, deletePreviousRoles2, [], false, ASSIGN_ROLES_TO_USERS);
|
||||||
$('table#CurrentUsersTable tr.selected').removeClass('selected');
|
$('table#CurrentUsersTable tr.selected').removeClass('selected');
|
||||||
$('#assignUsersRolesModal').modal('hide');
|
$('#assignUsersRolesModal').modal('hide');
|
||||||
|
$('#removeUsersRolesModal').modal('hide');
|
||||||
// $('div#toolbar').addClass('hiddenToolbar').removeClass('shownToolbar');
|
// $('div#toolbar').addClass('hiddenToolbar').removeClass('shownToolbar');
|
||||||
$('span#numOfSelLectedRows').text('');
|
$('span#numOfSelLectedRows').text('');
|
||||||
$('#CurrentUsersTable th:first').removeClass('none');
|
$('#CurrentUsersTable th:first').removeClass('none');
|
||||||
|
|
|
@ -206,13 +206,13 @@
|
||||||
<button id="closeUsersRolesModal" class="btn btn-link btn-large" data-dismiss="modal" aria-hidden="true">Cancel</button>
|
<button id="closeUsersRolesModal" class="btn btn-link btn-large" data-dismiss="modal" aria-hidden="true">Cancel</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- ASSIGN USER ROLE MODAL-->
|
||||||
<div id="assignUsersRolesModal" class="modal fade in" hidden="true" tabindex="-1" role="dialog"> <!-- style="width:700px;"> -->
|
<div id="assignUsersRolesModal" class="modal fade in" hidden="true" tabindex="-1" role="dialog"> <!-- style="width:700px;"> -->
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<div id="changeUsersRolesModalHeaderDiv">
|
<div id="changeUsersRolesModalHeaderDiv">
|
||||||
<div class="modalHeaderContainer">
|
<div class="modalHeaderContainer">
|
||||||
<span id="theHeader">Assign roles to selected users</span>
|
<span id="theHeader">Assign roles to selected users</span>
|
||||||
<div class="modalSubHeader">Assign/remove roles to the selected users</div>
|
<div class="modalSubHeader">Assign roles to the selected users</div>
|
||||||
</div>
|
</div>
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -220,11 +220,6 @@
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div id="auxilliaryDivInAssignRolesModal">
|
<div id="auxilliaryDivInAssignRolesModal">
|
||||||
<span id="textAboveTagsInputInAssignRolesModal">
|
<span id="textAboveTagsInputInAssignRolesModal">
|
||||||
<div id="singleTagSectionInAssignRolesModal" class="hiddenSection">
|
|
||||||
<p id="deleteTheRolesInAssignRolesModal">Do you want to delete the user's previous roles?</p>
|
|
||||||
<label id="deleteTheRolesLabelInAssignRolesModal" for="singleTagInAssignRolesModal">Delete</label>
|
|
||||||
<input type="checkbox" id="singleTagInAssignRolesModal">
|
|
||||||
</div>
|
|
||||||
<div id="multipleTagsSectionInAssignRolesModal" class="hiddenSection alert alert-warning">
|
<div id="multipleTagsSectionInAssignRolesModal" class="hiddenSection alert alert-warning">
|
||||||
<p id="multipleUsersRole">Selected roles will be granted to all users, if they are not already associated to them.</p>
|
<p id="multipleUsersRole">Selected roles will be granted to all users, if they are not already associated to them.</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -244,6 +239,41 @@
|
||||||
<button id="closeUsersRolesModalInAssignRolesModal" class="btn btn-link btn-large" data-dismiss="modal" aria-hidden="true">Cancel</button>
|
<button id="closeUsersRolesModalInAssignRolesModal" class="btn btn-link btn-large" data-dismiss="modal" aria-hidden="true">Cancel</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- END ASSIGN USER ROLE MODAL-->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- REMOVE USER ROLE -->
|
||||||
|
<div id="removeUsersRolesModal" class="modal fade in" hidden="true" tabindex="-1" role="dialog"> <!-- style="width:700px;"> -->
|
||||||
|
<div class="modal-header">
|
||||||
|
<div id="changeUsersRolesModalHeaderDiv">
|
||||||
|
<div class="modalHeaderContainer">
|
||||||
|
<span id="theHeader">Remove roles from selected users</span>
|
||||||
|
<div class="modalSubHeader">Remove roles from selected users</div>
|
||||||
|
</div>
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<div id="auxilliaryDivInAssignRolesModal">
|
||||||
|
<span id="textAboveTagsInputInAssignRolesModal">
|
||||||
|
<div class="row usersEmailsTagsInModals">
|
||||||
|
<label class="span3" for="userNamesListInRemoveRolesModal">users selected</label>
|
||||||
|
<textarea id="userNamesListInRemoveRolesModal" class="" row="1"></textarea>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<label class="span3" for="roleListInRemoveRolesModal">roles</label>
|
||||||
|
<textarea id="roleListInRemoveRolesModal" class="" row="1"></textarea>
|
||||||
|
</div>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button id="saveUsersRolesModalInRemoveRolesModal" class="btn btn-link btn-large">Save</button>
|
||||||
|
<button id="closeUsersRolesModalInRemoveRolesModal" class="btn btn-link btn-large" data-dismiss="modal" aria-hidden="true">Cancel</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- END REMOVE USER ROLE -->
|
||||||
|
|
||||||
|
|
||||||
<div id="assignUsersToGroupsModal" class="modal fade in" hidden="true" tabindex="-1" role="dialog"> <!-- style="width:700px;"> -->
|
<div id="assignUsersToGroupsModal" class="modal fade in" hidden="true" tabindex="-1" role="dialog"> <!-- style="width:700px;"> -->
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
|
|
Loading…
Reference in New Issue