|
|
@ -402,17 +402,17 @@ function attachEvents() {
|
|
|
|
|
|
|
|
|
|
|
|
var shareGroupNewRoleFromSelectionLink = $("a#share-group-new-role-from-selection");
|
|
|
|
var shareGroupNewRoleFromSelectionLink = $("a#share-group-new-role-from-selection");
|
|
|
|
shareGroupNewRoleFromSelectionLink.click(function () {
|
|
|
|
shareGroupNewRoleFromSelectionLink.click(function () {
|
|
|
|
var roles = [];
|
|
|
|
var roles = $("#roles").val();
|
|
|
|
$('.modal .roleCheckBoxes').each(
|
|
|
|
if (roles && roles.length >= 2) {
|
|
|
|
function () {
|
|
|
|
|
|
|
|
if ($(this).is(':checked')) {
|
|
|
|
|
|
|
|
roles.push($(this).data('role-name'));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
addNewRole(roles);
|
|
|
|
addNewRole(roles);
|
|
|
|
// $(modalPopupContent).html($('#share-group-w3-modal-content').html());
|
|
|
|
} else {
|
|
|
|
// createNewRole(roles);
|
|
|
|
var errorMsgWrapper = "#notification-error-msg";
|
|
|
|
|
|
|
|
var errorMsg = "#notification-error-msg span";
|
|
|
|
|
|
|
|
$(errorMsg).text("To create a new role with the combination of roles, at least two roles should be" +
|
|
|
|
|
|
|
|
" selected.");
|
|
|
|
|
|
|
|
$(errorMsgWrapper).removeClass("hidden");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
@ -534,8 +534,8 @@ function listAllRoles(groupId) {
|
|
|
|
html += '</select>';
|
|
|
|
html += '</select>';
|
|
|
|
$("#rolesListing").html(html);
|
|
|
|
$("#rolesListing").html(html);
|
|
|
|
markAlreadySavedUsersRoles(groupId);
|
|
|
|
markAlreadySavedUsersRoles(groupId);
|
|
|
|
$("select.select2[multiple=multiple]").select2({
|
|
|
|
$("select.select2[multiple=multiple]").select2({tags: false}).on("select2:select", function () {
|
|
|
|
tags: false
|
|
|
|
$("#notification-error-msg").addClass("hidden");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$("#rolesListing").html("No roles available");
|
|
|
|
$("#rolesListing").html("No roles available");
|
|
|
@ -633,9 +633,6 @@ function displayErrors(jqXHR) {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$(modalPopupContent).html($('#group-unexpected-error-content').html());
|
|
|
|
$(modalPopupContent).html($('#group-unexpected-error-content').html());
|
|
|
|
if (jqXHR.responseText) {
|
|
|
|
|
|
|
|
$('#unexp-error-msg').html(jqXHR.responseText.replace(new RegExp("\"", 'g'), ""));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$("a#group-unexpected-error-link").click(function () {
|
|
|
|
$("a#group-unexpected-error-link").click(function () {
|
|
|
|
hidePopup();
|
|
|
|
hidePopup();
|
|
|
|
});
|
|
|
|
});
|
|
|
|