in tree/master/cloud/src/solution/Microsoft.Legal.MatterCenter.Web/wwwroot/app/matter/createMatter.controller.js [1079:1241]
function validateUsers() {
var keepGoing = true;
var username = "";
if (cm.defaultConfilctCheck) {
if (undefined == cm.selectedConflictCheckUser || "" == cm.selectedConflictCheckUser) {
cm.errTextMsg = cm.createContent.ErrorMessageConflictUser;
//"Enter the conflict reviewers name (for auditing purposes).";
cm.errorBorder = "ccheckuser";
showErrorNotification("ccheckuser");
cm.errorPopUpBlock = true; $timeout(function(){angular.element('#errorBlock').focus();},500);
return false;
}
if (cm.conflictRadioCheck) {
if (undefined == cm.blockedUserName || "" == cm.blockedUserName) {
cm.errTextMsg = cm.createContent.ErrorMessageConflictUser1;
//"Enter users that are conflicted with this matter.";
cm.errorBorder = "cblockuser";
showErrorNotification("cblockuser");
cm.errorPopUpBlock = true; $timeout(function(){angular.element('#errorBlock').focus();},500);
return false;
}
}
}
if (cm.selectedConflictCheckUser && "" !== cm.selectedConflictCheckUser) {
username = getUserName(cm.selectedConflictCheckUser + ";", false);
if (-1 == cm.oSiteUsers.indexOf(username[0])) {
cm.errTextMsg = cm.createContent.ErrorMessageConflictUser;
//"Enter the conflict reviewers name (for auditing purposes).";
cm.errorBorder = "ccheckuser";
showErrorNotification("ccheckuser");
cm.errorPopUpBlock = true; $timeout(function(){angular.element('#errorBlock').focus();},500);
return false;
}
username = getUserName(cm.selectedConflictCheckUser + ";", true);
if (-1 == cm.oSiteUserNames.indexOf(username[0])) {
cm.errTextMsg = cm.createContent.ErrorMessageConflictUser;
//"Enter the conflict reviewers name (for auditing purposes).";
cm.errorBorder = "ccheckuser";
showErrorNotification("ccheckuser");
cm.errorPopUpBlock = true; $timeout(function(){angular.element('#errorBlock').focus();},500);
return false;
}
}
if (cm.blockedUserName && "" !== cm.blockedUserName) {
username = getUserName(cm.blockedUserName + ";", false);
username=cleanArray(username);
for (var i = 0; i < username.length; i++) {
if (-1 == cm.oSiteUsers.indexOf(username[i])) {
cm.errTextMsg = cm.createContent.ErrorMessageEntityUsers1;
//"Please enter valid team members.";
//"Enter users that are conflicted with this matter.";
cm.errorBorder = "cblockuser";
showErrorNotification("cblockuser");
cm.errorPopUpBlock = true; $timeout(function(){angular.element('#errorBlock').focus();},500);
return false;
}
}
username = getUserName(cm.blockedUserName + ";", true);
username = cleanArray(username);
for (var i = 0; i < username.length; i++) {
if (-1 == cm.oSiteUserNames.indexOf(username[i])) {
cm.errTextMsg = cm.createContent.ErrorMessageEntityUsers1;
//"Please enter valid team members.";
//"Enter users that are conflicted with this matter.";
cm.errorBorder = "cblockuser";
showErrorNotification("cblockuser");
cm.errorPopUpBlock = true; $timeout(function(){angular.element('#errorBlock').focus();},500);
return false;
}
}
}
angular.forEach(cm.assignPermissionTeams, function (team) {
if (keepGoing) {
if (team.assignedUser && team.assignedUser != "") {//For loop
var usersEmails = getUserName(team.assignedUser, false);
usersEmails = cleanArray(usersEmails);
var userAliasNames = getUserName(team.assignedUser, true);
userAliasNames = cleanArray(userAliasNames);
if (usersEmails.length !== team.teamUsers.length) {
cm.checkUserExists(team);
keepGoing = false;
return false;
} else {
for (var j = 0; j < usersEmails.length; j++) {
angular.forEach(team.teamUsers, function (teamUser) {
if (keepGoing) {
if (teamUser.userName == usersEmails[j]) {
if (teamUser.userExsists) {
if (-1 == cm.oSiteUsers.indexOf(usersEmails[j])) {
cm.errTextMsg = cm.createContent.ErrorMessageEntityUsers1;
//"Please enter valid team members.";
cm.errorBorder = "";
cm.errorPopUpBlock = true; $timeout(function(){angular.element('#errorBlock').focus();},500);
showErrorNotificationAssignTeams(cm.errTextMsg, team.assigneTeamRowNumber, "user")
cm.errorBorder = "txtUser" + team.assigneTeamRowNumber; keepGoing = false;
return false;
}
if (-1 == cm.oSiteUserNames.indexOf(userAliasNames[j])) {
cm.errTextMsg = cm.createContent.ErrorMessageEntityUsers1;
//"Please enter valid team members.";
cm.errorBorder = "";
cm.errorPopUpBlock = true; $timeout(function(){angular.element('#errorBlock').focus();},500);
showErrorNotificationAssignTeams(cm.errTextMsg, team.assigneTeamRowNumber, "user")
cm.errorBorder = "txtUser" + team.assigneTeamRowNumber; keepGoing = false;
return false;
}
if (cm.blockedUserName && cm.blockedUserName != "") {
var blockedUserEmail = getUserName(cm.blockedUserName + ";", false);
blockedUserEmail = cleanArray(blockedUserEmail);
for (var i = 0; i < blockedUserEmail.length; i++) {
if (usersEmails[j] == blockedUserEmail[i]) {
cm.errTextMsg = cm.createContent.ErrorMessageEntityUsers2;
//"Please enter individual who is not conflicted.";
cm.errorBorder = "";
cm.errorPopUpBlock = true; $timeout(function(){angular.element('#errorBlock').focus();},500);
showErrorNotificationAssignTeams(cm.errTextMsg, team.assigneTeamRowNumber, "user")
cm.errorBorder = "txtUser" + team.assigneTeamRowNumber; keepGoing = false;
return false;
}
}
}
} else {
if (!teamUser.userConfirmation) {
cm.textInputUser = team;
cm.currentExternalUser.rowNumber = team.assigneTeamRowNumber;
cm.currentExternalUser.userIndex = j;
cm.currentExternalUser.userName = teamUser.userName;
if (cm.iCurrentPage == 2) {
showNotificatoinMessages(team.assigneTeamRowNumber);
cm.notificationPopUpBlock = true;
}
keepGoing = false;
return false;
}
}
}
}
});
}
}
}
else {
showErrorNotificationAssignTeams(cm.createContent.ErrorMessageTeamMember1, team.assigneTeamRowNumber, "user")
// showErrorNotificationAssignTeams(team.assignedRole.name + " cannot be empty", team.assigneTeamRowNumber, "user")
cm.errorBorder = "txtUser" + team.assigneTeamRowNumber;
keepGoing = false;
return false;
}
}
});
if (keepGoing) {
return true;
} else {
return false;
}
}