Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%--
- /*
- **
- ** myProcess, proprietary property of AMPLEXOR
- ** (c) Copyright, AMPLEXOR Adriatic d.o.o. 2002-2020
- ** All rights reserved.
- **
- ** May be used only in accordance with the terms and conditions of the
- ** license agreement governing use of AMPLEXOR software
- ** between you and AMPLEXOR or AMPLEXOR's authorized reseller.
- ** Not to be changed without prior written permission of AMPLEXOR.
- ** Any other use is strictly prohibited.
- **
- ** $Revision: 1.178 $
- ** $Date: 2020/03/29 15:37:25 $
- ** $Author: Amplexor\TotB $
- **
- */
- --%>
- <%@ page language="java" errorPage="/jsp/error/start.jsp" %>
- <%@ page import="com.documentum.fc.client.*" %>
- <%@ page import="com.documentum.fc.common.*" %>
- <%@ page import="com.google.common.collect.Sets"%>
- <%@ page import="com.infotehna.myprocess.*" %>
- <%@ page import="com.infotehna.myprocess.manageusers.*" %>
- <%@ page import="com.infotehna.myprocess.profiling.*" %>
- <%@ page import="com.infotehna.myprocess.beans.*" %>
- <%@ page import="com.infotehna.utils.*" %>
- <%@ page import="com.infotehna.myprocess.documentum.*" %>
- <%@ page import="java.util.*" %>
- <%@ page import="com.infotehna.session.*"%>
- <%@ page import="org.apache.commons.lang.StringEscapeUtils" %>
- <%@ page import="com.google.gson.Gson" %>
- <%@ page import="com.infotehna.myprocess.jobs.PeriodicalReviewJob" %>
- <%@ page import="com.infotehna.myprocess.onedrive.OneDriveUtility" %>
- <%@ page import="com.google.common.collect.Lists" %>
- <%@ include file="../../../include/context.jsp" %>
- <%@ include file="../../../include/auth.jsp" %>
- <!DOCTYPE html>
- <html>
- <head>
- <title>myProcess</title>
- <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
- <meta http-equiv="Expires" content="0">
- <meta http-equiv="pragma" content="no-cache">
- <link rel="stylesheet" type="text/css" href="<%= contextPath + cssPath %>body.css"/>
- <link rel="stylesheet" href="<%= contextPath + cssPath %>dialog.css" type="text/css"/>
- <link rel="stylesheet" href="<%= contextPath + cssPath %>mpc.css" type="text/css"/>
- <link rel="stylesheet" type="text/css" href="<%= contextPath + scriptsPath %>dojo/dijit/themes/claro/claro.css"/>
- <script>var contextPath = '<%= contextPath %>';</script>
- <script>var jspPath = '<%= jspPath %>';
- var dojoConfig = {locale: "en-us"};
- </script>
- <script type="text/javascript" src="<%= contextPath + scriptsPath %>dojo/dojo/dojo.js" djConfig="aliases:[['utils/helpers', '<%= contextPath + scriptsPath %>utils/helpers.js']], paths:{'utils': '../../utils', 'modules': '../../modules' }, parseOnLoad: false, isDebug: false, locale: 'en-us'"></script>
- <script src="<%= contextPath + scriptsPath %>wizard.js" type="text/javascript"></script>
- <script src="<%= contextPath + scriptsPath %>dialog.js" type="text/javascript"></script>
- <script src="<%= contextPath + scriptsPath %>tabs.js" type="text/javascript"></script>
- <style>
- td {
- padding-bottom: 2px;
- }
- </style>
- <script>
- var localState = {},
- localCache = {},
- numberOfOptions = 26,
- isDataInitialized = false,
- isCurrentUserChecked = false;
- function onDialogInit() {
- var roles = dojo.fromJson(listOfRoles);
- dojo.forEach(roles, function(role) {
- localState[role] = {
- page: 1,
- pageSize: 50,
- activeConnection: null
- };
- });
- }
- </script>
- <%!
- /**
- * Returns list of roles that current user can see.
- *
- * @param dfcSession Session
- * @param object Sysobject object
- * @param pb Profile
- * @param language Language
- * @return ArrayList of roles that current user can see.
- */
- private ArrayList<String> getRolesThatCurrentUserCanSee(IDfSession dfcSession, SysObject object, ProfileBean pb, String language) {
- ArrayList<String> canSeeRoles = new ArrayList<>();
- String username = "";
- try {
- username = dfcSession.getLoginUserName();
- ProfileUtil pu = new ProfileUtil(language, dfcSession);
- ArrayList<String> currentUserRoles = pu.getUsersRolesForObjectFromDocbase(object);
- for (int i = 0; (currentUserRoles != null && i < currentUserRoles.size()); i++) {
- String roleId = currentUserRoles.get(i);
- ArrayList<String> roleDependency = pb.getDependencyForRole(roleId);
- for (int j = 0; (roleDependency != null && j < roleDependency.size()); j++) {
- String rdId = roleDependency.get(j);
- if (!canSeeRoles.contains(rdId)) {
- canSeeRoles.add(rdId);
- }
- }
- }
- } catch(Exception e) {
- Logger.getLogger().error("Error while checking which roles current user can see/manage : " + e);
- }
- return canSeeRoles;
- }
- %>
- <%
- Logger.getLogger().trace("START");
- // get language
- String language = (String) request.getParameter("language");
- if (language == null || language.equals("") || language.equals("null")) {
- language = (String) session.getAttribute("language");
- }
- if (language == null || language.equals("") || language.equals("null")) {
- language = "en_US";
- }
- String skipProfileSelect = request.getParameter("skipProfileSelect");
- if (skipProfileSelect == null || skipProfileSelect.equals("") || skipProfileSelect.equals("false")) {
- skipProfileSelect = "false";
- } else {
- skipProfileSelect = "true";
- }
- String lcsName = request.getParameter("lcsName");
- if (lcsName == null) {
- lcsName = "";
- }
- // automation parameters
- boolean isAutomationWizard = Boolean.parseBoolean(request.getParameter("isAutomationWizard"));
- boolean isB2BMessageWizard = Boolean.parseBoolean(request.getParameter("isB2BMessageWizard"));
- String automationPerformer = "";
- String automationLogLevel = "";
- String automationRule = "";
- String automationBlockingRule = "";
- String automationObjectIds = "";
- String automationDescription = "";
- String automationWorkspaceViewRefresh = "";
- String B2BEntityIds = "";
- String B2BExplicitEntityIds = "";
- String B2BconfigId = "";
- String B2BSendDirectly = "";
- if (isAutomationWizard) {
- automationPerformer = request.getParameter("automationPerformer");
- if (automationPerformer == null) {
- automationPerformer = "";
- }
- automationLogLevel = request.getParameter("automationLogLevel");
- if (automationLogLevel == null) {
- automationLogLevel = "";
- }
- automationRule = request.getParameter("automationRule");
- if (automationRule == null) {
- automationRule = "";
- }
- automationBlockingRule = request.getParameter("automationBlockingRule");
- if (automationBlockingRule == null) {
- automationBlockingRule = "";
- }
- automationObjectIds = request.getParameter("automationObjectIds");
- if (automationObjectIds == null) {
- automationObjectIds = "";
- }
- automationDescription = request.getParameter("automationDescription");
- if (automationDescription == null) {
- automationDescription = "";
- }
- automationWorkspaceViewRefresh = request.getParameter("automationWorkspaceViewRefresh");
- if (automationWorkspaceViewRefresh == null) {
- automationWorkspaceViewRefresh = "";
- }
- }
- if (isB2BMessageWizard) {
- B2BEntityIds = request.getParameter("B2BEntityIds");
- if (B2BEntityIds == null) {
- B2BEntityIds = "";
- }
- B2BExplicitEntityIds = request.getParameter("B2BExplicitEntityIds");
- if (B2BExplicitEntityIds == null) {
- B2BExplicitEntityIds = "";
- }
- B2BconfigId = request.getParameter("B2BconfigId");
- if (B2BconfigId == null) {
- B2BconfigId = "";
- }
- B2BSendDirectly = request.getParameter("B2BSendDirectly");
- if (B2BSendDirectly == null) {
- B2BSendDirectly = "";
- }
- }
- boolean controlNum = false;
- String fromFinishTaskProxy = "";
- String minUsersText = uiStrings.getLocalizedString("STR_MIN_USERS");
- String maxUsersText = uiStrings.getLocalizedString("STR_MAX_USERS");
- final String STR_PREVIOUS_PAGE = uiStrings.getLocalizedString("STR_PREVIOUS_PAGE");
- final String STR_NEXT_PAGE = uiStrings.getLocalizedString("STR_NEXT_PAGE");
- final String STR_LOADING = uiStrings.getLocalizedString("STR_LOADING");
- Hashtable<String, String> finishTaskParams = new Hashtable<>();
- Hashtable<String, Integer> rolesLess = new Hashtable<>();
- Hashtable<String, Integer> rolesMore = new Hashtable<>();
- Hashtable<String, ArrayList<String>> minMaxUsersAll = new Hashtable<>();
- String wizardType = request.getParameter("wizardType");
- boolean forceHiddenRoleValidation = Boolean.valueOf(request.getParameter("forceHiddenRoleValidation"));
- String objectId = request.getParameter("id");
- if (wizardType == null) {
- if (objectId == null || objectId.equals("")) {
- finishTaskParams = (Hashtable<String, String>)session.getAttribute("finishTaskParams");
- session.removeAttribute("finishTaskParams");
- if (finishTaskParams == null) {
- throw new Exception(uiStrings.getLocalizedString("STR_NO_OBJECT_SELECTED_MSG"));
- } else {
- fromFinishTaskProxy = "true";
- objectId = (String)finishTaskParams.get("objectId");
- rolesLess = (Hashtable<String, Integer>)session.getAttribute("rolesLess");
- rolesMore = (Hashtable<String, Integer>)session.getAttribute("rolesMore");
- minMaxUsersAll = (Hashtable<String, ArrayList<String>>)session.getAttribute("minMaxUsersAll");
- session.removeAttribute("rolesLess");
- session.removeAttribute("rolesMore");
- session.removeAttribute("minMaxUsersAll");
- minUsersText = uiStrings.getLocalizedString("STR_MIN_USERS_FOR_ACTIVITY");
- maxUsersText = uiStrings.getLocalizedString("STR_MAX_USERS_FOR_ACTIVITY");
- }
- }
- StringTokenizer tokenizer = new StringTokenizer(objectId, "~");
- while (tokenizer.hasMoreTokens()) {
- String id = tokenizer.nextToken();
- SysObject selectedObject = new SysObject(id, dfcSession);
- if (selectedObject.isCheckedOut() && !selectedObject.isCheckedOutBy(dfcSession.getLoginUserName())) {
- String msg = uiStrings.getLocalizedString("STR_CANNOT_PERFORM_OPERATION") + ". " + uiStrings.getLocalizedString("STR_OBJECT_IS_CHECKED_OUT_BY_ANOTHER_USER") + ".";
- request.setAttribute("msgboxTitle", uiStrings.getLocalizedString("STR_MANAGE_USERS"));
- request.setAttribute("msgboxText", msg);
- request.setAttribute("msgboxWidth", "300");
- request.setAttribute("msgboxHeight", "135");
- request.setAttribute("msgboxIcon", "other/exclamation_32.gif");
- request.setAttribute("msgboxButtons", new Integer(MSGBOX_OK));
- request.setAttribute("msgboxActionUrl", "msgbox/refresh.jsp");
- request.setAttribute("msgboxTarget", "_self");
- RequestDispatcher rd = application.getRequestDispatcher(jspPath + "msgbox/start.jsp");
- rd.forward(request, response);
- return;
- }
- }
- }
- //wizard specific paramaters
- String generateTOC = null;
- String tocParentId = null;
- String rootObjectId = null;
- String omitDocsIds = null;
- String firstWizard = null;
- String selectedObjectIds = null;
- String editVirtualDocument = null;
- String parentWndName = null;
- String showRelatedAction = null;
- String targetViewId = null;
- String frameId = null;
- String containmentId = null;
- String isSimple = null;
- String isOpenTasksReport = null;
- String fromDate = null;
- String toDate = null;
- String tasksSelect = null;
- String profs = null;
- String auths = null;
- String objName = null;
- String tmpId = null;
- String tmpType = null;
- String pdfPassword = null;
- String isSaveSearch = null;
- Properties saveSearch = null;
- String isBulkImportAtt = null;
- //TODO: provjeriti HashTable bulkImportAttributes
- String alreadyInWizard3ForCurrentFile = null;
- String applyAttributesToAllFilesInAllFolders = null;
- String validationFailedMsg = null;
- boolean fromWizard4 = false;
- String checkFolder = null;
- String chooseSourceWizardForSettings = null;
- String fromCloneAdvanced = null;
- String isCloneAction = null;
- String prepareForClone = null;
- String createSnapshot = null;
- String isFromInsert = null;
- String chosenWizard = null;
- String objectTypeId = null;
- String profileId = null;
- String templateId = null;
- String classifyAsNewRelease = null;
- String newContentObject = null;
- String isWithoutTemplate = null;
- String lcsId = null;
- String requestBlankPDFRendition = null;
- String isMSO = null;
- String importProps = null;
- String folderId = null;
- String filePath = null;
- String contentType = null;
- String superType = null;
- String shortWizard = null;
- String fileName = null;
- String defaultPdfPageSize = null;
- String firstObjectId = null;
- String relations = null;
- String chronicleId = null;
- String putDocumentAsChildInRelation = null;
- String firstTimeInWizardRelations = null;
- String newRelease = null;
- String forMRP = null;
- String keepCurrentLCStates = null;
- String keepCurrentObjectNames = null;
- String newDossier = null;
- String moduleIds = null;
- String previousStep = null;
- String copyBinders = null;
- String copyBindingText = null;
- String copyVDRoot = null;
- String createFolders = null;
- String applyToVD = null;
- String applyToAllBindingTexts = null;
- String applyPropsToVD = null;
- String issueChangeRequestRA = null;
- String cancelBtnAction = null;
- ArrayList<Object> forwardToUrls = null;
- String showPreview = null;
- String barcode = null;
- String barcodeValue = null;
- String mapCounterStartValue = null;
- String replaceObjectContent = null;
- String replacementTemplateId = null;
- String deleteObjectContent = null;
- String pasteEx = null;
- String pasteInVD = null;
- String importObjectId = null;
- String vdStructureReview = null;
- String vdStructureChange = null;
- String vdStructureStep = null;
- String vdStructureOptions = null;
- String documentSelectionAttribute = null;
- String frmAction = null;
- String wizardQuickFinishEnabled = null;
- boolean wizardQuickFinishEnabledBoolean = true;
- String wfPriority = request.getParameter("wfPriority");
- WizardBean wb = null;
- boolean validationFailed = false;
- String dialogInitStr = "";
- StringBuffer paramsBuff = new StringBuffer();
- OrgUnits ouManager = OrgUnits.getInstance(language);
- Persons perManager = Persons.getInstance(language);
- Profiles pManager = Profiles.getInstance(language);
- Roles rManager = Roles.getInstance(language);
- Hashtable<String, ArrayList<String>> rolesAndUsers = new Hashtable<>();
- boolean firstTimeInManageUsers = true;
- WizardUtility wu = new WizardUtility(language, dfcSession);
- Hashtable<Object, Object> paramsAndValues = new Hashtable<Object, Object>();
- StringBuffer rolesIds = new StringBuffer();
- boolean isTargetFolder = false;
- boolean isBulkImport = false;
- boolean bulkImportReadFromCSV = false;
- Hashtable<Object, Object> bulkImportAttributes = null;
- String previousProfileId = "";
- String initialLoad = "";
- if (wizardType != null) {
- objectId = request.getParameter("objectId");
- if (objectId == null) {
- objectId = "";
- }
- generateTOC = request.getParameter("generateTOC");
- if (generateTOC == null) {
- generateTOC = "";
- }
- tocParentId = request.getParameter("tocParentId");
- if (tocParentId == null) {
- tocParentId = "";
- }
- Logger.getLogger().debug("tocParentId = " + tocParentId);
- rootObjectId = request.getParameter("rootObjectId");
- if (rootObjectId == null) {
- rootObjectId = "";
- }
- omitDocsIds = request.getParameter("omitDocsIds");
- if (omitDocsIds == null) {
- omitDocsIds = "";
- }
- firstWizard = request.getParameter("firstWizard");
- if (firstWizard == null) {
- firstWizard = "";
- }
- selectedObjectIds = request.getParameter("selectedObjectIds");
- if (selectedObjectIds == null) {
- selectedObjectIds = request.getParameter("id");
- if (selectedObjectIds == null) {
- selectedObjectIds = "";
- }
- }
- editVirtualDocument = request.getParameter("editVirtualDocument");
- if (editVirtualDocument == null) {
- editVirtualDocument = "";
- }
- Logger.getLogger().trace("editVirtualDocument = " + editVirtualDocument);
- parentWndName = request.getParameter("parentWndName");
- if (parentWndName == null) {
- parentWndName = "";
- }
- Logger.getLogger().trace("parentWndName = " + parentWndName);
- showRelatedAction = request.getParameter("showRelatedAction");
- if (showRelatedAction == null) {
- showRelatedAction = "";
- }
- Logger.getLogger().trace("showRelatedAction = " + showRelatedAction);
- targetViewId = request.getParameter("targetViewId");
- if (targetViewId == null) {
- targetViewId = "";
- }
- Logger.getLogger().trace("targetViewId = " + targetViewId);
- frameId = request.getParameter("frameId");
- if (frameId == null) {
- frameId = "";
- }
- Logger.getLogger().trace("frameId = " + frameId);
- containmentId = request.getParameter("containmentId");
- if (containmentId == null) {
- containmentId = "";
- }
- isSimple = request.getParameter("isSimple");
- if (isSimple == null) {
- isSimple = "";
- }
- Logger.getLogger().trace("isSimple = " + isSimple);
- isOpenTasksReport = request.getParameter("isOpenTasksReport");
- if (isOpenTasksReport == null) {
- isOpenTasksReport = "";
- }
- fromDate = request.getParameter("fromDate");
- if (fromDate == null) {
- fromDate = "";
- }
- toDate = request.getParameter("toDate");
- if (toDate == null) {
- toDate = "";
- }
- tasksSelect = request.getParameter("tasksSelect");
- if (tasksSelect == null) {
- tasksSelect = "";
- }
- profs = request.getParameter("profs");
- if (profs == null) {
- profs = "";
- }
- auths = request.getParameter("auths");
- if (auths == null) {
- auths = "";
- }
- objName = request.getParameter("objName");
- if (objName == null) {
- objName = "";
- }
- tmpId = request.getParameter("tmpId");
- if (tmpId == null) {
- tmpId = "";
- }
- tmpType = request.getParameter("tmpType");
- if (tmpType == null) {
- tmpType = "";
- }
- //gvu begin elips 931 - import password protected pdf
- pdfPassword = request.getParameter("pdfPassword");
- if (pdfPassword == null) {
- pdfPassword = "";
- }
- //gvu end elips 931 - import password protected pdf
- //save search
- isSaveSearch = request.getParameter("saveSearch");
- if (isSaveSearch == null) {
- isSaveSearch = "";
- }
- saveSearch = new Properties();
- if (isSaveSearch.equals("true")) {
- Enumeration<String> paramNames = request.getParameterNames();
- while (paramNames.hasMoreElements()) {
- String paramName = paramNames.nextElement();
- String paramValue = request.getParameter(paramName);
- if (paramName.endsWith("~saveSearch")) {
- String tmpName = paramName.substring(0, paramName.indexOf("~"));
- saveSearch.setProperty(tmpName, paramValue);
- }
- }
- }
- // Added for bulkimport purpose
- isBulkImportAtt = (String)session.getAttribute("isBulkImport");
- if (isBulkImportAtt != null && isBulkImportAtt.equals("true")) {
- isBulkImport = true;
- }
- FileUploadBean fileToUpload = (FileUploadBean) session.getAttribute("fileInUploadProcess");
- if (fileToUpload != null) {
- bulkImportAttributes = fileToUpload.getAttributes();
- if (bulkImportAttributes != null) {
- bulkImportReadFromCSV = true;
- }
- }
- alreadyInWizard3ForCurrentFile = (String)session.getAttribute("alreadyInWizard3ForCurrentFile");
- if(alreadyInWizard3ForCurrentFile == null) {
- alreadyInWizard3ForCurrentFile = "";
- }
- applyAttributesToAllFilesInAllFolders = (String)session.getAttribute("applyAttributesToAllFilesInAllFolders");
- if(applyAttributesToAllFilesInAllFolders == null || applyAttributesToAllFilesInAllFolders.equals("")) {
- applyAttributesToAllFilesInAllFolders = "false";
- }
- // validation failed?
- validationFailedMsg = request.getParameter("validationFailedMsg");
- if (validationFailedMsg == null || validationFailedMsg.equals("null") || validationFailedMsg.equals("")) {
- validationFailedMsg = (String)request.getAttribute("validationFailedMsg");
- }
- if (validationFailedMsg == null || validationFailedMsg.equals("null")) {
- validationFailedMsg = "";
- }
- request.removeAttribute("validationFailedMsg");
- validationFailed = !validationFailedMsg.equals("");
- // from wizard4
- fromWizard4 = (request.getParameter("fromWizard4") != null && request.getParameter("fromWizard4").equals("true"));
- checkFolder = request.getParameter("checkFolder");
- chooseSourceWizardForSettings = request.getParameter("chooseSourceWizardForSettings");
- if (chooseSourceWizardForSettings == null) {
- chooseSourceWizardForSettings = "";
- }
- fromCloneAdvanced = request.getParameter("fromCloneAdvanced");
- if (fromCloneAdvanced == null) {
- fromCloneAdvanced = "";
- }
- isCloneAction = request.getParameter("isCloneAction");
- if (isCloneAction == null) {
- isCloneAction = "";
- }
- prepareForClone = request.getParameter("prepareForClone");
- if (prepareForClone == null) {
- prepareForClone = "";
- }
- createSnapshot = request.getParameter("createSnapshot");
- if (createSnapshot == null) {
- createSnapshot = "";
- }
- isFromInsert = request.getParameter("isFromInsert");
- if (isFromInsert == null || isFromInsert.equals("")) {
- isFromInsert = "false";
- }
- chosenWizard = request.getParameter("chosenWizard");
- if (chosenWizard == null) {
- chosenWizard = "";
- }
- if (!chooseSourceWizardForSettings.equals("true") || chosenWizard.equals("") || chosenWizard.equals("null")) {
- chosenWizard = wizardType;
- }
- objectTypeId = request.getParameter("objectTypeId");
- profileId = request.getParameter("profileId");
- templateId = request.getParameter("templateId");
- //pmi, classify as new release
- classifyAsNewRelease = request.getParameter("classifyAsNewRelease");
- if (classifyAsNewRelease == null) {
- classifyAsNewRelease = "false";
- }
- newContentObject = request.getParameter("newContentObject");
- if (newContentObject == null) {
- newContentObject = "";
- }
- isWithoutTemplate = request.getParameter("isWithoutTemplate");
- if (isWithoutTemplate == null) {
- isWithoutTemplate = "false";
- }
- Logger.getLogger().debug("profileId = " + profileId);
- lcsId = request.getParameter("lcsId");
- requestBlankPDFRendition = request.getParameter("requestBlankPDFRendition");
- if (requestBlankPDFRendition == null) {
- requestBlankPDFRendition = "false";
- }
- isMSO = request.getParameter("isMSO");
- if (isMSO == null || isMSO.equals("")) {
- isMSO = "false";
- }
- importProps = request.getParameter("importProps");
- if (importProps == null || importProps.equals("")) {
- importProps = "false";
- }
- folderId = request.getParameter("folderId");
- filePath = request.getParameter("filePath");
- contentType = request.getParameter("contentType");
- superType = request.getParameter("superType");
- shortWizard = request.getParameter("shortWizard");
- boolean isVD = false;
- fileName = request.getParameter("fileName");
- if (fileName == null) {
- fileName = "";
- }
- defaultPdfPageSize = request.getParameter("defaultPdfPageSize");
- if (defaultPdfPageSize == null) {
- defaultPdfPageSize = "";
- }
- if (generateTOC.equals("1")) {
- objectId = tocParentId;
- }
- firstObjectId = objectId;
- if (objectId != null && objectId.indexOf("~") != -1) {
- firstObjectId = objectId.substring(0, objectId.indexOf("~"));
- }
- if (contentType == null) {
- contentType = "";
- }
- relations = request.getParameter("relations");
- if (relations == null) {
- relations = "";
- }
- chronicleId = request.getParameter("chronicleId");
- if (chronicleId == null) {
- chronicleId = "";
- }
- putDocumentAsChildInRelation = request.getParameter("putDocumentAsChildInRelation");
- if (putDocumentAsChildInRelation == null || putDocumentAsChildInRelation.equals("") || putDocumentAsChildInRelation.equals("null")) {
- putDocumentAsChildInRelation = null;
- }
- firstTimeInWizardRelations = request.getParameter("firstTimeInWizardRelations");
- // Only for newRelease action
- newRelease = request.getParameter("newRelease");
- if (newRelease == null) {
- newRelease = "";
- }
- forMRP = request.getParameter("forMRP");
- if (forMRP == null) {
- forMRP = "";
- }
- keepCurrentLCStates = request.getParameter("keepCurrentLCStates");
- if (keepCurrentLCStates == null) {
- keepCurrentLCStates = "";
- }
- keepCurrentObjectNames = request.getParameter("keepCurrentObjectNames");
- if (keepCurrentObjectNames == null) {
- keepCurrentObjectNames = "";
- }
- // Only for "new dossier" action
- newDossier = request.getParameter("newDossier");
- if (newDossier == null) {
- newDossier = "";
- }
- moduleIds = request.getParameter("moduleIds");
- if (moduleIds == null || moduleIds.equals("null")) {
- moduleIds = "";
- }
- previousStep = request.getParameter("previousStep");
- copyBinders = request.getParameter("copyBinders");
- if (copyBinders == null || copyBinders.equals("")) {
- copyBinders = "false";
- }
- copyBindingText = request.getParameter("copyBindingText");
- if (copyBindingText == null || copyBindingText.equals("")) {
- copyBindingText = "false";
- }
- copyVDRoot = request.getParameter("copyVDRoot");
- if (copyVDRoot == null || copyVDRoot.equals("")) {
- copyVDRoot = "false";
- }
- createFolders = request.getParameter("createFolders");
- if (createFolders == null || createFolders.equals("")) {
- createFolders = "false";
- }
- applyToVD = request.getParameter("applyToVD");
- if (applyToVD == null || applyToVD.equals("")) {
- applyToVD = String.valueOf(Profiles.getInstance(language).getProfileById(profileId).getApplyToAllVDDescendants());
- }
- applyToAllBindingTexts = request.getParameter("applyToAllBindingTexts");
- if (applyToAllBindingTexts == null || applyToAllBindingTexts.equals("")) {
- applyToAllBindingTexts = String.valueOf(Profiles.getInstance(language).getProfileById(profileId).getApplyToAllBindingTexts());
- }
- applyPropsToVD = request.getParameter("applyPropsToVD");
- if (applyPropsToVD == null) {
- applyPropsToVD = "";
- }
- issueChangeRequestRA = request.getParameter("issueChangeRequestRA");
- if (issueChangeRequestRA == null) {
- issueChangeRequestRA = "";
- }
- session.setAttribute("selectedObjectId", objectId);
- // barcode classify
- cancelBtnAction = "closeDialog();";
- cancelBtnAction = "top.operationProgressStart(); document.location.href='" + contextPath + jspPath + "wizard/cancelWizard.jsp'";//hli
- if (isBulkImport) {
- cancelBtnAction = "closePreview(); top.operationProgressStart(); document.location.href='" + contextPath + jspPath + "wizard/cancelWizard.jsp'";
- }
- forwardToUrls = (ArrayList<Object>) session.getAttribute("forwardToUrls");
- if (forwardToUrls != null && !forwardToUrls.isEmpty()) {
- cancelBtnAction = "top.operationProgressStart(); document.location.href='" + contextPath + jspPath + "wizard/cancelWizard.jsp'";
- }
- showPreview = "";
- showPreview = request.getParameter("showPreview");
- if (showPreview == null || showPreview.equals("null")) {
- showPreview = "";
- }
- if (showPreview.equals("true")) {
- cancelBtnAction = "closePreview(); closeDialog();";
- }
- barcode = request.getParameter("barcode");
- barcodeValue = "";
- if (wizardType.equals("classify") && !(barcode != null && barcode.equals("true"))) {
- cancelBtnAction = "closePreview();top.operationProgressStart(); document.location.href='" + contextPath + jspPath + "wizard/cancelWizard.jsp'";
- }
- if (barcode != null && barcode.equals("true")) {
- cancelBtnAction = "closePreview(); top.operationProgressStart(); document.location.href='" + contextPath + jspPath + "wizard/cancelWizard.jsp'";
- barcodeValue = request.getParameter("barcodeValue");
- } else {
- barcode = "";
- }
- mapCounterStartValue = request.getParameter("mapCounterStartValue");
- if (mapCounterStartValue == null || mapCounterStartValue.equals("null")) {
- mapCounterStartValue = "";
- }
- replaceObjectContent = request.getParameter("replaceObjectContent");
- if (replaceObjectContent == null || replaceObjectContent.equals("null") || replaceObjectContent.equals("")) {
- replaceObjectContent = "";
- }
- replacementTemplateId = request.getParameter("replacementTemplateId");
- if (replacementTemplateId == null || replacementTemplateId.equals("null")) {
- replacementTemplateId = "";
- }
- deleteObjectContent = request.getParameter("deleteObjectContent");
- if (deleteObjectContent == null || deleteObjectContent.equals("null") || deleteObjectContent.equals("")) {
- deleteObjectContent = "";
- }
- pasteEx = request.getParameter("pasteEx");
- if (pasteEx == null || pasteEx.equals("")) {
- pasteEx = "false";
- }
- pasteInVD = request.getParameter("pasteInVD");
- if (pasteInVD == null || pasteInVD.equals("")) {
- pasteInVD = "false";
- }
- importObjectId = (String) session.getAttribute("importObjectId");
- if (importObjectId == null || importObjectId.equals("null")) {
- importObjectId = "";
- }
- // VD structure options for Clone Advanced / New Release Advanced
- vdStructureReview = request.getParameter("vdStructureReview");
- if (vdStructureReview == null) {
- vdStructureReview = "";
- }
- vdStructureChange = request.getParameter("vdStructureChange");
- if (vdStructureChange == null) {
- vdStructureChange = "";
- }
- vdStructureStep = request.getParameter("vdStructureStep");
- if (vdStructureStep == null) {
- vdStructureStep = "";
- }
- vdStructureOptions = request.getParameter("vdStructureOptions");
- if (vdStructureOptions == null) {
- vdStructureOptions = "";
- }
- documentSelectionAttribute = request.getParameter("documentSelectionAttribute");
- if (documentSelectionAttribute == null) {
- documentSelectionAttribute = "";
- }
- frmAction = request.getParameter("frmAction");
- if (frmAction == null) {
- frmAction = "";
- }
- previousProfileId = request.getParameter("previousProfileId");
- if (previousProfileId == null) {
- previousProfileId = "";
- }
- initialLoad = request.getParameter("initialLoad");
- if (initialLoad == null) {
- initialLoad = "";
- }
- wizardQuickFinishEnabled = request.getParameter("wizardQuickFinishEnabled");
- wizardQuickFinishEnabledBoolean = true;
- if (wizardQuickFinishEnabled != null && wizardQuickFinishEnabled.equalsIgnoreCase("false")) {
- wizardQuickFinishEnabledBoolean = false;
- }
- rolesAndUsers = wu.getSelectedRolesAndUsers(request, chosenWizard, language, profileId, applyAttributesToAllFilesInAllFolders, alreadyInWizard3ForCurrentFile, isBulkImport, bulkImportReadFromCSV);
- paramsAndValues = wu.getWizardParametersValues(request);
- firstTimeInManageUsers = wu.getFirstTimeInManageUsers();
- if (isBulkImport && alreadyInWizard3ForCurrentFile.equals("0") && !applyAttributesToAllFilesInAllFolders.equalsIgnoreCase("true")){
- if (!bulkImportReadFromCSV) {
- firstTimeInManageUsers = true;
- }
- }
- Enumeration<String> paramNames = request.getParameterNames();
- while (paramNames.hasMoreElements()) {
- String paramName = paramNames.nextElement();
- if (paramName.endsWith("~attribute") || paramName.endsWith("~multiselect") || paramName.endsWith("~usersgroups") || paramName.endsWith("~filter") || paramName.endsWith("~importattribute")) {
- String paramValue = request.getParameter(paramName);
- if (paramValue.contains("\"")) {
- paramValue = paramValue.replaceAll("\"",""");
- }
- if (paramValue != null && !paramValue.equals("")) {
- paramValue = paramValue.trim();
- }
- paramsBuff.append("<input type=\"hidden\" name=\"" + paramName + "\" value=\"" + paramValue + "\">\n");
- }
- }
- }
- int wizType = WizardUtility.getWizardTypeAsInt(wizardType);
- int chosenWizType = WizardUtility.getWizardTypeAsInt(chosenWizard);
- // coming from finish_task_ex???
- boolean fromFTE = false;
- String fromFinishTaskEx = request.getParameter("fromFinishTaskEx");
- if (fromFinishTaskEx != null && fromFinishTaskEx.equals("true")) {
- fromFTE = true;
- }
- String FTE_objectId = objectId;
- String FTE_taskId = request.getParameter("taskId");
- if (FTE_taskId == null) {
- FTE_taskId = "";
- }
- String FTE_roles = request.getParameter("roles");
- if (FTE_roles == null) {
- FTE_roles = "";
- }
- boolean FTE_fromApprove = (request.getParameter("fromApprove") != null && request.getParameter("fromApprove").equals("true"));
- boolean FTE_fromReject = (request.getParameter("fromReject") != null && request.getParameter("fromReject").equals("true"));
- boolean enabledProperties = (request.getParameter("properties") != null && request.getParameter("properties").equals("true"));
- String isPreselected = "";
- isPreselected = request.getParameter("preselected");
- if (isPreselected == null || isPreselected.equals("")){
- isPreselected = "true";
- }
- boolean FTE_fromFinishAndReject = (request.getParameter("fromFinishAndReject") != null && request.getParameter("fromFinishAndReject").equals("true"));
- // coming from multiple manage users???
- boolean fromMultipleMU = (request.getParameter("fromMultipleMU") != null && request.getParameter("fromMultipleMU").equals("true"));
- String commonRoles = request.getParameter("commonRoles");
- if (commonRoles == null) {
- commonRoles = "";
- }
- boolean hasVD = (request.getParameter("hasVD") != null && request.getParameter("hasVD").equals("true"));
- boolean checkApplyToAllRelDoc = (request.getParameter("checkApplyToAllRelDoc") != null && request.getParameter("checkApplyToAllRelDoc").equals("true"));
- boolean displayApplyCheckboxesMU = (request.getParameter("displayApplyCheckboxes") != null && request.getParameter("displayApplyCheckboxes").equals("true"));
- boolean displayApplyCheckboxes = false;
- boolean displayApplyCheckboxesForRelatedVDs = Boolean.parseBoolean(request.getParameter("displayApplyCheckboxesForRelatedVDs"));
- boolean relatedCollaboration = false;
- boolean vdCollaboration = false;
- boolean relatedVdCollaboration = false;
- String applyToAllVDDescendantsOfRelatedDocumentsChecked = "";
- boolean allowApplyToAllVDDescendantsOfRelatedDocuments = false;
- boolean applyToAllVDDescendantsOfRelatedDocuments = false;
- boolean applyToAllBindingTextsOfRelatedDocuments = false;
- boolean displayVdDescendOptionsDropdown = true;
- // coming from promote/demote and finish ex???
- String FT_fromFinishTask = request.getParameter("FT_fromFinishTask");
- if (FT_fromFinishTask == null) {
- FT_fromFinishTask = "";
- }
- String FT_extendedPromoteOrDemote = request.getParameter("FT_extendedPromoteOrDemote");
- if (FT_extendedPromoteOrDemote == null) {
- FT_extendedPromoteOrDemote = "";
- }
- boolean fromPromoteDemoteAndFinishEx = (FT_fromFinishTask.equals("true") && (FT_extendedPromoteOrDemote.equals("true") || FT_extendedPromoteOrDemote.equals("false")));
- String FT_nextTask = request.getParameter("FT_nextTask");
- if (FT_nextTask == null) {
- FT_nextTask = "";
- }
- String FT_id = request.getParameter("FT_id");
- if (FT_id == null) {
- FT_id = "";
- }
- String FT_objectId = request.getParameter("FT_objectId");
- if (FT_objectId == null) {
- FT_objectId = "";
- }
- String FT_profileId = request.getParameter("FT_profileId");
- if (FT_profileId == null) {
- FT_profileId = "";
- }
- String FT_lcsId = request.getParameter("FT_lcsId");
- if (FT_lcsId == null) {
- FT_lcsId = "";
- }
- String FT_wfLCSId = request.getParameter("FT_wfLCSId");
- if (FT_wfLCSId == null) {
- FT_wfLCSId = "";
- }
- String FT_signoffUsername = request.getParameter("FT_signoffUsername");
- if (FT_signoffUsername == null) {
- FT_signoffUsername = "";
- }
- String FT_userFunction = request.getParameter("FT_userFunction");
- if (FT_userFunction == null) {
- FT_userFunction = "";
- }
- String FT_signoffPassword = request.getParameter("FT_signoffPassword");
- if (FT_signoffPassword == null) {
- FT_signoffPassword = "";
- }
- String FT_signoffReason = request.getParameter("FT_signoffReason");
- if (FT_signoffReason == null) {
- FT_signoffReason = "";
- }
- String FT_signoffRequired = request.getParameter("FT_signoffRequired");
- if (FT_signoffRequired == null) {
- FT_signoffRequired = "";
- }
- String promoteIsNextStateSelected = request.getParameter("promoteIsNextStateSelected");
- if (promoteIsNextStateSelected == null) {
- promoteIsNextStateSelected = request.getParameter("isNextStateSelected");
- }
- if (promoteIsNextStateSelected == null) {
- promoteIsNextStateSelected = "";
- }
- String promoteDemoteId = request.getParameter("promoteDemoteId");
- if (promoteDemoteId == null) {
- promoteDemoteId = request.getParameter("id");
- }
- if (promoteDemoteId == null) {
- promoteDemoteId = "";
- }
- String promoteToLCS = request.getParameter("promoteToLCS");
- if (promoteToLCS == null) {
- promoteToLCS = "";
- }
- String promoteOnDate = request.getParameter("promoteOnDate");
- if (promoteOnDate == null) {
- promoteOnDate = "";
- }
- String promoteDemoteWfPriority = request.getParameter("promoteDemoteWfPriority");
- if (promoteDemoteWfPriority == null) {
- promoteDemoteWfPriority = request.getParameter("workflow");
- }
- if (promoteDemoteWfPriority == null) {
- promoteDemoteWfPriority = "";
- }
- String promoteRoles = request.getParameter("promoteRoles");
- if (promoteRoles == null) {
- promoteRoles = "";
- }
- boolean fromPromoteAndFinishEx = (!promoteRoles.equals(""));
- String schedulePromote = request.getParameter("schedulePromote");
- if (schedulePromote == null) {
- schedulePromote = "";
- }
- String demoteToLCS = request.getParameter("demoteToLCS");
- if (demoteToLCS == null) {
- demoteToLCS = "";
- }
- String demoteRoles = request.getParameter("demoteRoles");
- if (demoteRoles == null) {
- demoteRoles = "";
- }
- boolean fromDemoteAndFinishEx = (!demoteRoles.equals(""));
- if (!fromMultipleMU) {
- ArrayList<String> selectedObjects = MyProcessUtils.trimString(objectId, "~");
- objectId = selectedObjects.get(0);
- }
- String nextObjectId = request.getParameter("nextObjectId");
- String forwardToUrl = request.getParameter("forwardToUrl");
- String target = request.getParameter("target");
- String refresh = request.getParameter("refresh");
- String takeOver = request.getParameter("takeOver");
- String notificationTakeOver = request.getParameter("notificationTakeOver");
- String to = request.getParameter("to");
- if (nextObjectId == null) {
- nextObjectId = "";
- }
- if (forwardToUrl == null) {
- forwardToUrl = "";
- }
- if (target == null) {
- target = "";
- }
- if (refresh == null) {
- refresh = "";
- }
- if (takeOver == null) {
- takeOver = "";
- }
- if (notificationTakeOver == null) {
- notificationTakeOver = "";
- }
- if (to == null) {
- to = "";
- }
- ProfileBean pb = null;
- LifeCycleStateBean lcsb = null;
- SysObject object = null;
- boolean isVD = false;
- String applyToAllRelatedDocumentsChecked = "";
- String applyToAllRelatedDocumentsDefaultValue = ProfileBean.APPLY_TO_ALL_RELATED_DOCUMENTS_DV_APPEND;
- String applySettingsToVDDescendants = "false"; //dma-task 1545 sets if box will be shown when users are changed
- Hashtable<String, String> allRolesAndUsers = new Hashtable<>();
- ArrayList<RoleBean> roles = null;
- Hashtable<String, String> hiddenRoles = new Hashtable<>();
- Hashtable<String, ArrayList<String>> defaultAndPersistentRolesAndUsers = new Hashtable<>();
- if (wizardType != null && ((wizType == WizardBean.CLASSIFY_WIZARD || newRelease.equals("true") || wizType == WizardBean.CREATE_WIZARD) && templateId != null && !templateId.equals(""))) {
- try {
- // getting object
- IDfSysObject objectTemp = (IDfSysObject) dfcSession.getObject(new DfId(templateId));
- if (objectTemp == null) {
- throw new Exception ("Object with id '" + templateId + "' doesn't exist!");
- }
- // Checking if document is virtual document
- if (objectTemp.isVirtualDocument() && objectTemp.getLinkCount()>0) {
- isVD = true;
- }
- }
- catch (Exception ex) {
- Logger.getLogger().warning("Error while checking if document is virtual!\n" + ex);
- }
- }
- boolean isCollaborativeEditStarted = false;
- if (wizardType == null) {
- if (!fromMultipleMU) {
- try {
- // getting object
- object = new SysObject(objectId, dfcSession);
- object.fetch("");
- // Checking if document is virtual document
- if (object.isVirtualDocument() && object.getLinkCount() > 0) {
- isVD = true;
- }
- // getting object's profile
- profileId = ProfileUtil.getProfileIdForObject(object);
- if (profileId == null) {
- MessageBox.warning(language, request, uiStrings.getLocalizedString("STR_NO_PROFILE_DEFINED") + ".", uiStrings.getLocalizedString("STR_MANAGE_USERS"));
- RequestDispatcher rd = application.getRequestDispatcher(jspPath + "msgbox/start.jsp");
- rd.forward(request, response);
- return;
- }
- pb = pManager.getProfileById(profileId);
- if (pb == null) {
- throw new Exception("Profile " + profileId + " doesn't exist!");
- }
- if (pb.getApplySettingsToVDDescendants()) {
- applySettingsToVDDescendants = "true";
- }
- applySettingsToVDDescendants += "";//dma variable won't initailize without this
- lcsb = pb.getLcStateByName(object.getCurrentStateName());
- if (pb.getApplyToAllRelatedDocuments()) {
- applyToAllRelatedDocumentsChecked = "checked";
- }
- applyToAllRelatedDocumentsDefaultValue = pb.getApplyToAllRelatedDocumentsDefaultValue();
- rolesAndUsers = ProfileUtil.getAllRolesAndUsersForObjectFromDocbase(object);
- } catch (Exception ex) {
- Logger.getLogger().error("Cannot edit roles for users!\n" + ex);
- throw new Exception ("Cannot edit roles for users!<br>" + ex);
- }
- } else {
- if (checkApplyToAllRelDoc) applyToAllRelatedDocumentsChecked = "checked";
- }
- OneDriveUtility oneDriveUtility = new OneDriveUtility(dfcSession);
- isCollaborativeEditStarted = oneDriveUtility.isCollaborativeEditStarted(Sets.newHashSet(MyProcessUtils.trimString(objectId, "~")));
- } else {
- wb = pManager.getProfileById(profileId).getWizard();
- pb = pManager.getProfileById(profileId);
- roles = wb.getRoles(wizType);
- defaultAndPersistentRolesAndUsers = wu.getDeaultAndPersistentUsers(profileId, pManager, roles, paramsAndValues);
- allRolesAndUsers = wu.getUsersForRoles(profileId, wizType, language, rolesAndUsers, defaultAndPersistentRolesAndUsers, isTargetFolder, firstTimeInManageUsers, paramsAndValues);
- PreselectedProfileSettingsBean preselectedSettingsBean = (PreselectedProfileSettingsBean)session.getAttribute("preselectedProfileSettings");
- if (preselectedSettingsBean == null) {
- preselectedSettingsBean = new PreselectedProfileSettingsBean();
- }
- if (allRolesAndUsers != null && !allRolesAndUsers.isEmpty()) {
- Enumeration<String> allRoles = allRolesAndUsers.keys();
- while (allRoles.hasMoreElements()) {
- String roleId = allRoles.nextElement();
- if (pb.isRoleHiddenInWizards(roleId)) {
- hiddenRoles.put(roleId, allRolesAndUsers.get(roleId));
- }
- }
- }
- wu.addRolesAndUsers(preselectedSettingsBean, wizType, rolesAndUsers, wb, perManager, ouManager);
- boolean isEmptyString = true;
- for (int i = 0; (roles != null && i < roles.size()); i++) {
- RoleBean rb = roles.get(i);
- String roleId = rb.getId();
- if (hiddenRoles.containsKey(roleId)) {
- continue;
- }
- if (!isEmptyString) {
- rolesIds.append(",");
- }
- rolesIds.append("'");
- rolesIds.append(roleId);
- rolesIds.append("'");
- isEmptyString = false;
- }
- boolean foundRolesOnObject = false;
- String sourceObjId = null;
- if (wizType == WizardBean.IMPORT_WIZARD && (objectId == null || objectId.equals("")) && importObjectId != null && !importObjectId.equals("")) {
- objectId = importObjectId;
- }
- if (!pasteInVD.equals("true")) {
- if (newRelease.equals("true") || (wb.getCopyRolesStatus(chosenWizType) == WizardBean.COPY_OBJECT_ROLES || wb.getCopyRolesStatus(chosenWizType) == WizardBean.COPY_OTHER_ROLES) && !objectId.equals("") && firstTimeInManageUsers) {
- ArrayList<String> selectedObjects = MyProcessUtils.trimString(objectId, "~");
- objectId = selectedObjects.get(0);
- sourceObjId = objectId;
- } else if ((wb.getCopyRolesStatus(chosenWizType) == WizardBean.COPY_FOLDER_ROLES || wb.getCopyRolesStatus(chosenWizType) == WizardBean.COPY_OTHER_ROLES) && !folderId.equals("") && firstTimeInManageUsers) {
- sourceObjId = folderId;
- }
- } else {
- String tmpObjectId = (String) session.getAttribute("objectId");
- if ((wb.getCopyRolesStatus(chosenWizType) == WizardBean.COPY_TARGET_VD_ROLES) && tmpObjectId != null && !tmpObjectId.equals("") && firstTimeInManageUsers) {
- ArrayList<String> documentsIds = MyProcessUtils.trimString(tmpObjectId, "~");
- objectId = documentsIds.get(0);
- sourceObjId = objectId;
- Logger.getLogger().debug("Using roles of target VD object ('" + objectId + "').");
- } else if (newRelease.equals("true") || (wb.getCopyRolesStatus(chosenWizType) == WizardBean.COPY_OBJECT_ROLES || wb.getCopyRolesStatus(chosenWizType) == WizardBean.COPY_OTHER_ROLES) && !objectId.equals("") && firstTimeInManageUsers) {
- ArrayList<String> selectedObjects = MyProcessUtils.trimString(objectId, "~");
- objectId = selectedObjects.get(0);
- sourceObjId = objectId;
- Logger.getLogger().debug("Using roles of source object ('" + objectId + "').");
- }
- }
- SysObject srcObject = null;
- try {
- if (sourceObjId != null) {
- // getting object
- srcObject = new SysObject(sourceObjId, dfcSession);
- SysObject folderObj = null;
- if (folderId != null && !folderId.equals("") && !folderId.equals(dfcSession.getDocbaseId()) && wb.getCopyRolesStatus(chosenWizType) == WizardBean.COPY_OTHER_ROLES && wb.getCopyOtherTargetFolderRoles(chosenWizType) != null) {
- folderObj = new SysObject(folderId, dfcSession);
- }
- if (firstTimeInManageUsers) {
- if (folderObj != null) {
- isTargetFolder = true;
- rolesAndUsers = ProfileUtil.getAllRolesAndUsersForObjectFromDocbase(folderObj);
- foundRolesOnObject = true;
- } else {
- rolesAndUsers = ProfileUtil.getAllRolesAndUsersForObjectFromDocbase(srcObject);
- foundRolesOnObject = true;
- }
- }
- }
- } catch (Exception ex) {
- Logger.getLogger().warning("Cannot read roles for users!\n" + ex);
- }
- // bulk import
- if (isBulkImport && bulkImportReadFromCSV && alreadyInWizard3ForCurrentFile.equals("0")) {
- if (bulkImportAttributes.containsKey("roles_and_persons")) {
- String rolesAndPersons = (String)bulkImportAttributes.get("roles_and_persons");
- // check if string attribute roles_and_persons in csv file is valid
- if (!WizardUtility.checkValidityOfRolesAndPersonsStrings(rolesAndPersons, "#", "@")) {
- QueueCreateDocument.removeSessionParameters(session);//hli
- request.setAttribute("msgboxTitle", uiStrings.getLocalizedString("STR_WIZARD3_ERROR"));
- request.setAttribute("msgboxText", uiStrings.getLocalizedString("STR_ROLES_AND_PERSONS_INVALID"));
- request.setAttribute("msgboxIcon", "other/exclamation_32.gif");
- request.setAttribute("msgboxButtons", new Integer(MSGBOX_OK));
- request.setAttribute("msgboxActionUrl", "msgbox/refresh.jsp");
- request.setAttribute("msgboxTarget", "_self");
- RequestDispatcher rd = application.getRequestDispatcher(jspPath + "msgbox/start.jsp");
- rd.forward(request, response);
- return;
- }
- Hashtable<String, ArrayList<String>> bulkImportRolePersons = new Hashtable<>();
- StringTokenizer rolesAndPersonsTokenizer = new StringTokenizer(rolesAndPersons, "#");
- while (rolesAndPersonsTokenizer.hasMoreTokens()) {
- String roleAndPersons = rolesAndPersonsTokenizer.nextToken();
- StringTokenizer roleAndPersonsTokenizer = new StringTokenizer(roleAndPersons, "@");
- while (roleAndPersonsTokenizer.hasMoreTokens()) {
- String roleName = roleAndPersonsTokenizer.nextToken();
- String persons = roleAndPersonsTokenizer.nextToken();
- ArrayList<String> bulkImportPersons = new ArrayList<>();
- // check if string attribute roles_and_persons in csv file is valid
- if (persons.endsWith("~") || persons.startsWith("~")) {
- QueueCreateDocument.removeSessionParameters(session);
- request.setAttribute("msgboxTitle", uiStrings.getLocalizedString("STR_WIZARD3_ERROR"));
- request.setAttribute("msgboxText", uiStrings.getLocalizedString("STR_ROLES_AND_PERSONS_INVALID"));
- request.setAttribute("msgboxIcon", "other/exclamation_32.gif");
- request.setAttribute("msgboxButtons", new Integer(MSGBOX_OK));
- request.setAttribute("msgboxActionUrl", "msgbox/refresh.jsp");
- request.setAttribute("msgboxTarget", "_self");
- RequestDispatcher rd = application.getRequestDispatcher(jspPath + "msgbox/start.jsp");
- rd.forward(request, response);
- return;
- }
- StringTokenizer personsTokenizer = new StringTokenizer(persons, "~");
- while (personsTokenizer.hasMoreTokens()) {
- String personName = personsTokenizer.nextToken();
- bulkImportPersons.add(personName);
- }
- bulkImportRolePersons.put(roleName, bulkImportPersons);
- }
- }
- ProfileBean prb = pManager.getProfileById(profileId);
- for (int i = 0; (roles != null && i < roles.size()); i++) {
- RoleBean rb = roles.get(i);
- String roleId = rb.getId();
- String roleName = rb.getNameInLanguage(language);
- if (bulkImportRolePersons.containsKey(roleName)) {
- ArrayList<String> personNames = new ArrayList<>();
- Hashtable<String, String> allUsers = new Hashtable<>();
- Hashtable<String, String> groups = new Hashtable<>();
- Hashtable<String, String> groupUsers = new Hashtable<>();
- boolean isAllAllowed = false;
- List<String> allowed = Optional.ofNullable(prb.getAllRoleAllowed(roleId)).orElse(Lists.newArrayList());
- if (allowed.contains("ALL_USERS") || allowed.contains("ALL_GROUPS")) {
- isAllAllowed = true;
- } else {
- allUsers = WizardUtility.getAllUsersForRole(language, dfcSession, profileId, roleId);
- groups = WizardUtility.getAllGroupsForRole(language, dfcSession, profileId, roleId);
- Enumeration<String> en = groups.keys();
- while (en.hasMoreElements()){
- String groupName = en.nextElement();
- String groupId = groups.get(groupName);
- Hashtable<String, String> currentGroupUsers = WizardUtility.getAllUsersForRoleAndGroup(language, dfcSession, profileId, roleId, groupId);
- groupUsers.putAll(currentGroupUsers);
- }
- }
- ArrayList<String> bulkRolePersons = (ArrayList<String>)bulkImportRolePersons.get(roleName);
- for (int index = 0; (bulkRolePersons != null && index < bulkRolePersons.size()); index++) {
- String bulkPerson = bulkRolePersons.get(index);
- if (!personNames.contains(bulkPerson)
- && ((allUsers.containsKey(bulkPerson) || groupUsers.containsKey(bulkPerson) || groups.containsKey(bulkPerson))
- || (isAllAllowed && (perManager.getByName(bulkPerson) != null || ouManager.getByName(bulkPerson) != null)))) {
- // replace names in local language with groupnames
- // groups have names in local languages while
- // Documentum groupname consists of small letters only
- if (groups.containsKey(bulkPerson) || isAllAllowed) {
- // group
- ArrayList<OrgUnitBean> orgs = ouManager.getAllOrgUnitsForDocbaseSortedByName(dfcSession.getDocbaseId());
- for (int j = 0; (orgs != null && j < orgs.size()); j++) {
- OrgUnitBean oub = orgs.get(j);
- if (oub.getNameEx().equals(bulkPerson)){
- bulkPerson = oub.getGroupName();
- break;
- }
- }
- }
- personNames.add(bulkPerson);
- }
- }
- rolesAndUsers.put(roleId, personNames);
- }
- }
- }
- }
- // issue change request ra (pliva action):
- // source approver ---> target approver
- // source coordinator ---> target author
- // current user ---> target coordinator
- // other roles ---> either default+persistent users or copy users from source object (depending on profile configuration)
- if (firstTimeInManageUsers && issueChangeRequestRA.equals("true")) {
- SysObject crraSourceObj = new SysObject(firstObjectId, dfcSession);
- String crraProfileId = ProfileUtil.getProfileIdForObjectEx(crraSourceObj, true);
- if (crraProfileId != null && pManager.getProfileById(crraProfileId) != null) {
- ProfileBean crraPB = pManager.getProfileById(crraProfileId);
- Hashtable<String, ArrayList<String>> crraSourceObjRolesAndUsers = ProfileUtil.getAllRolesAndUsersForObjectFromDocbase(crraSourceObj);
- RoleBean sourceApproverRB = ProfileUtil.getRoleApprower(crraPB, language);
- RoleBean targetApproverRB = ProfileUtil.getRoleApprower(pManager.getProfileById(profileId), language);
- if (sourceApproverRB != null && targetApproverRB != null) {
- ArrayList<String> personNames = rolesAndUsers.get(targetApproverRB.getId());
- if (personNames != null && crraSourceObjRolesAndUsers != null && crraSourceObjRolesAndUsers.containsKey(sourceApproverRB.getId())) {
- personNames = crraSourceObjRolesAndUsers.get(sourceApproverRB.getId());
- rolesAndUsers.put(targetApproverRB.getId(), personNames);
- }
- }
- RoleBean sourceCoordinatorRB = ProfileUtil.getRoleCoordinator(crraPB, language);
- RoleBean targetAuthorRB = ProfileUtil.getRoleAuthor(pManager.getProfileById(profileId), language);
- if (sourceCoordinatorRB != null && targetAuthorRB != null) {
- ArrayList<String> personNames = rolesAndUsers.get(targetAuthorRB.getId());
- if (personNames != null && crraSourceObjRolesAndUsers != null && crraSourceObjRolesAndUsers.containsKey(sourceCoordinatorRB.getId())) {
- personNames = crraSourceObjRolesAndUsers.get(sourceCoordinatorRB.getId());
- rolesAndUsers.put(targetAuthorRB.getId(), personNames);
- }
- }
- RoleBean targetCoordinatorRB = ProfileUtil.getRoleCoordinator(pManager.getProfileById(profileId), language);
- if (targetCoordinatorRB != null) {
- ArrayList<String> personNames = rolesAndUsers.get(targetCoordinatorRB.getId());
- if (personNames != null) {
- personNames.clear();
- personNames.add(dfcSession.getLoginUserName());
- }
- }
- }
- }
- }
- allowApplyToAllVDDescendantsOfRelatedDocuments = (pb != null && pb.getAllowApplyToAllVDDescendantsOfRelatedDocuments()) ? true : false;
- applyToAllVDDescendantsOfRelatedDocuments = (pb != null && pb.getApplyToAllVDDescendantsOfRelatedDocuments()) ? true : false;
- applyToAllBindingTextsOfRelatedDocuments = (pb != null && pb.getApplyToAllBindingTextsOfRelatedDocuments()) ? true : false;
- String currentDocbase = dfcSession.getDocbaseId();
- IDfUser cUser = dfcSession.getUser("");
- String currentUser = cUser.getUserName();
- String currentUserGroup = cUser.getUserGroupName();
- IDfGroup cGroup = null;
- String currentUserGroupId = "";
- String currUserId = cUser.getObjectId().getId();
- String userNameEx = currentUser;
- boolean showDescription = Boolean.valueOf(Configuration.instance.getProperty("showDescription", "false")).booleanValue();
- if (showDescription) {
- ArrayList<PersonBean> allPersons = perManager.getAllPersonsForDocbaseSortedByName(dfcSession.getDocbaseId());
- for (int j = 0; (allPersons != null && j < allPersons.size()); j++) {
- PersonBean curr = allPersons.get(j);
- if (currUserId.equals(curr.getId())) {
- userNameEx = curr.getNameEx();
- break;
- }
- }
- }
- PersonalizationData pdManager = PersonalizationData.getInstance();
- PersonalizationDataBean pdb = pdManager.getPersonalizationDataBeanById(dfcSession.getUser("").getUserName());
- if (pdb.getSelectUserGroupByDefault() && currentUserGroup != null && !currentUserGroup.equals("")) {
- cGroup = dfcSession.getGroup(currentUserGroup);
- if (cGroup != null) {
- currentUserGroupId = cGroup.getObjectId().toString();
- }
- }
- ArrayList<String> absentPersons = perManager.getAbsentPersons(dfcSession);
- Gson gson = new Gson();
- if (wizardType == null) {
- if (!fromFTE && !fromPromoteDemoteAndFinishEx && !fromFinishTaskProxy.equals("true")) {
- if (fromMultipleMU) {
- // hidden roles are extracted from common roles that are displayed here
- } else {
- // display all roles except hidden ones
- ArrayList<String> canSeeRoles = getRolesThatCurrentUserCanSee(dfcSession, object, pb, language);
- ArrayList<RoleBean> pbRoles = pb.getRolesSortedByName();
- for (int i = 0; (pbRoles != null && i < pbRoles.size()); i++) {
- RoleBean rb = pbRoles.get(i);
- String roleId = rb.getId();
- if (!canSeeRoles.contains(roleId)) {
- String personsIds = "";
- if (rolesAndUsers != null) {
- ArrayList<String> rolePersons = rolesAndUsers.get(roleId);
- for (int j = 0; (rolePersons != null && j < rolePersons.size()); j++) {
- String personName = rolePersons.get(j);
- String id = "";
- PersonBean perb = perManager.getPersonByName(personName, dfcSession.getDocbaseId());
- if (perb != null) {
- id = perb.getId();
- } else {
- OrgUnitBean oub = ouManager.getOrgUnitByGroupName(personName, dfcSession.getDocbaseId());
- if (oub != null) {
- id = oub.getId();
- }
- }
- if (!id.equals("")) {
- if (j == 0) {
- personsIds = id;
- } else {
- personsIds += "~" + id;
- }
- }
- }
- }
- hiddenRoles.put(roleId, personsIds);
- }
- }
- }
- } else {
- // display only roles performers (usually only one) (if current user can see/change them)
- ArrayList<String> canSeeRoles = getRolesThatCurrentUserCanSee(dfcSession, object, pb, language);
- ArrayList<String> rolesList = new ArrayList<>();
- if (fromFTE && !FTE_roles.equals("")) {
- rolesList = MyProcessUtils.trimString(FTE_roles, "~");
- } else if (fromPromoteDemoteAndFinishEx) {
- if (fromPromoteAndFinishEx) {
- rolesList = MyProcessUtils.trimString(promoteRoles, "~");
- } else if (fromDemoteAndFinishEx) {
- rolesList = MyProcessUtils.trimString(demoteRoles, "~");
- }
- }
- if (fromFinishTaskProxy.equals("true")) {
- if (rolesLess != null && rolesLess.size() > 0) {
- for (Enumeration<String> en = rolesLess.keys(); en.hasMoreElements(); ) {
- String tmpRoleId = en.nextElement();
- rolesList.add(tmpRoleId);
- }
- }
- if (rolesMore != null && rolesMore.size() > 0) {
- for (Enumeration<String> en = rolesMore.keys(); en.hasMoreElements(); ) {
- String tmpRoleId = en.nextElement();
- rolesList.add(tmpRoleId);
- }
- }
- }
- ArrayList<RoleBean> pbRoles = pb.getRolesSortedByName();
- for (int i = 0; (pbRoles != null && i < pbRoles.size()); i++) {
- RoleBean rb = pbRoles.get(i);
- String roleId = rb.getId();
- if (!rolesList.contains(roleId) || !canSeeRoles.contains(roleId)) {
- String personsIds = "";
- if (rolesAndUsers != null) {
- ArrayList<String> rolePersons = rolesAndUsers.get(roleId);
- for (int j = 0; (rolePersons != null && j < rolePersons.size()); j++) {
- String personName = rolePersons.get(j);
- String id = "";
- PersonBean perb = perManager.getPersonByName(personName, dfcSession.getDocbaseId());
- if (perb != null) {
- id = perb.getId();
- } else {
- OrgUnitBean oub = ouManager.getOrgUnitByGroupName(personName, dfcSession.getDocbaseId());
- if (oub != null) {
- id = oub.getId();
- }
- }
- if (!id.equals("")) {
- if (j == 0) {
- personsIds = id;
- } else {
- personsIds += "~" + id;
- }
- }
- }
- }
- hiddenRoles.put(roleId, personsIds);
- }
- }
- boolean noRolesToDisplay = true;
- StringTokenizer rolesTokenizer = null;
- if (fromFTE) {
- rolesTokenizer = new StringTokenizer(FTE_roles, "~");
- } else if (fromPromoteDemoteAndFinishEx) {
- if (fromPromoteAndFinishEx) {
- rolesTokenizer = new StringTokenizer(promoteRoles, "~");
- } else if (fromDemoteAndFinishEx) {
- rolesTokenizer = new StringTokenizer(demoteRoles, "~");
- }
- } else if (fromFinishTaskProxy.equals("true")) {
- String tmpRolesStr = MyProcessUtils.arrayToString(rolesList, "~");
- rolesTokenizer = new StringTokenizer(tmpRolesStr, "~");
- }
- while (rolesTokenizer != null && rolesTokenizer.hasMoreTokens()) {
- String roleId = rolesTokenizer.nextToken();
- if (!hiddenRoles.containsKey(roleId)) {
- noRolesToDisplay = false;
- break;
- }
- }
- if (noRolesToDisplay) {
- if (fromFTE) {
- %>
- <html>
- <head>
- </head>
- <body onload="document.forms['forwardForm'].submit();">
- <form name="forwardForm" action="<%= contextPath + jspPath %>info_center/actions/task_finish/start.jsp">
- <input type="hidden" name="id" value="<%= FTE_taskId %>">
- <input type="hidden" name="fromApprove" value="<%= FTE_fromApprove %>">
- <input type="hidden" name="fromReject" value="<%= FTE_fromReject %>">
- <input type="hidden" name="properties" value="<%= enabledProperties %>">
- <input type="hidden" name="preselected" value="<%= isPreselected %>">
- <input type="hidden" name="fromFinishAndReject" value="<%= FTE_fromFinishAndReject %>">
- </form>
- </body>
- </html>
- <%
- } else if (fromPromoteDemoteAndFinishEx) {
- String promoteDemoteUrl = contextPath + jspPath;
- if (fromPromoteAndFinishEx) {
- promoteDemoteUrl += "explorer/actions/promote/check.jsp";
- } else if (fromDemoteAndFinishEx) {
- promoteDemoteUrl += "msgbox/start.jsp";
- }
- %>
- <html>
- <head>
- </head>
- <body onload="document.forms['forwardForm'].submit();">
- <form name="forwardForm" action="<%= promoteDemoteUrl %>">
- <input type="hidden" name="FT_fromFinishTask" value="<%= FT_fromFinishTask %>">
- <input type="hidden" name="FT_extendedPromoteOrDemote" value="<%= FT_extendedPromoteOrDemote %>">
- <input type="hidden" name="FT_nextTask" value="<%= FT_nextTask %>">
- <input type="hidden" name="FT_id" value="<%= FT_id %>">
- <input type="hidden" name="FT_objectId" value="<%= FT_objectId %>">
- <input type="hidden" name="FT_profileId" value="<%= FT_profileId %>">
- <input type="hidden" name="FT_lcsId" value="<%= FT_lcsId %>">
- <input type="hidden" name="FT_wfLCSId" value="<%= FT_wfLCSId %>">
- <input type="hidden" name="FT_signoffUsername" value="<%= FT_signoffUsername %>">
- <input type="hidden" name="FT_userFunction" value="<%= FT_userFunction %>">
- <input type="hidden" name="FT_signoffPassword" value="<%= FT_signoffPassword %>">
- <input type="hidden" name="FT_signoffReason" value="<%= FT_signoffReason %>">
- <input type="hidden" name="FT_signoffRequired" value="<%= FT_signoffRequired %>">
- <input type="hidden" name="id" value="<%= promoteDemoteId %>">
- <input type="hidden" name="workflow" value="<%= promoteDemoteWfPriority %>">
- <% if (fromPromoteAndFinishEx) { %>
- <input type="hidden" name="isNextStateSelected" value="<%= promoteIsNextStateSelected %>">
- <input type="hidden" name="promoteToLCS" value="<%= promoteToLCS %>">
- <input type="hidden" name="promoteOnDate" value="<%= promoteOnDate %>">
- <input type="hidden" name="schedulePromote" value="<%= schedulePromote %>">
- <input type="hidden" name="todo" value="promote">
- <% } else if (fromDemoteAndFinishEx) {%>
- <input type="hidden" name="demoteToLCS" value="<%= demoteToLCS %>">
- <input type="hidden" name="todo" value="demote">
- <input type="hidden" name="msgboxTitle" value="<%= uiStrings.getLocalizedString("STR_DEMOTE") %>">
- <input type="hidden" name="msgboxText" value="<%= uiStrings.getLocalizedString("STR_DEMOTE_MSG") + "?" %>">
- <input type="hidden" name="msgboxIcon" value="other/question_32.gif">
- <input type="hidden" name="msgboxButtons" value="<%= new Integer(MSGBOX_YES_NO_CLOSE) %>">
- <input type="hidden" name="msgboxActionUrl" value="explorer/actions/demote/demote_finish.jsp">
- <input type="hidden" name="msgboxTarget" value="_self">
- <% } %>
- </form>
- </body>
- </html>
- <%
- }
- return;
- }
- }
- }
- ArrayList<OrgUnitBean> orgs = ouManager.getAllOrgUnitsForDocbaseSortedByName(dfcSession.getDocbaseId());
- String personIdsJson = ManageUsers.getPersonIdsMappedAsJson(orgs);
- %>
- <script>
- var STR_USER_IS_PERFORMER_WARNING = "<%= StringEscapeUtils.escapeJavaScript(uiStrings.getLocalizedString("STR_USER_IS_PERFORMER_WARNING")) %>";
- <%
- // generate arrays for checking users as task performers
- boolean checkUserAsPerformer = false;
- if (!fromFTE && !fromPromoteDemoteAndFinishEx && !fromMultipleMU && wizardType == null) {
- if (pb != null && !object.getPolicyId().isNull() && !object.getPolicyId().getId().equals("0000000000000000")) {
- Hashtable<String, ArrayList<String>> roleToPerformers = new Hashtable<>();
- IDfCollection coll = null;
- try {
- DfQuery query = new MpDfQuery();
- query.setDQL("select distinct dmi_workitem.r_object_id as workitem_id, dmi_workitem.r_performer_name as performer_name from dmi_workitem, dmi_package where dmi_workitem.r_runtime_state<>2 and dmi_workitem.r_workflow_id = dmi_package.r_workflow_id and any dmi_package.r_component_id in ('" + objectId + "')");
- coll = query.execute(dfcSession, DfQuery.DF_EXECREAD_QUERY);
- while (coll != null && coll.next()) {
- checkUserAsPerformer = true;
- String workitemId = coll.getString("workitem_id");
- String performerName = coll.getString("performer_name");
- IDfWorkitem workitem = null;
- try {
- workitem = (IDfWorkitem)dfcSession.getObject(new DfId(workitemId));
- } catch (Exception ex) {
- Logger.getLogger().trace("Cannot fetch workitem with id='" + workitemId + "' : " + ex);
- continue;
- }
- IDfWorkflow workflow = null;
- try {
- workflow = (IDfWorkflow)dfcSession.getObject(workitem.getWorkflowId());
- } catch (Exception ex) {
- Logger.getLogger().trace("Cannot fetch workflow with id='" + workitem.getWorkflowId().getId() + "' : " + ex);
- continue;
- }
- String processId = ((IDfProcess)dfcSession.getObject(workflow.getProcessId())).getObjectId().getId();
- String activityId = workitem.getActDefId().getId();
- String lcId = "";
- if (workflow.getObjectName().contains(PeriodicalReviewJob.PERIODICAL_REVIEW_JOB_NAME)) {
- wfPriority = LifeCycleStateBean.WF_PRIORITY_NORMAL;
- lcId = LifeCycleStateBean.PERIODICAL_REVIEW_STATE_ID;
- } else {
- wfPriority = ProfileUtil.getWorkflowPriorityForObject(object);
- lcId = lcsb.getId();
- }
- RoleBean rolePerformer = pb.getActivityRolePerformer(lcId, processId, wfPriority, activityId);
- if (rolePerformer != null) {
- String performerId = "";
- if (perManager.getPersonByName(performerName, dfcSession.getDocbaseId()) != null) {
- performerId = perManager.getPersonByName(performerName, dfcSession.getDocbaseId()).getId();
- } else if (ouManager.getOrgUnitByGroupName(performerName, dfcSession.getDocbaseId()) != null) {
- performerId = ouManager.getOrgUnitByGroupName(performerName, dfcSession.getDocbaseId()).getId();
- }
- if (!performerId.equals("")) {
- ArrayList<String> collectedUsers = roleToPerformers.get(rolePerformer.getId());
- if (collectedUsers == null) {
- collectedUsers = new ArrayList<>();
- }
- if (!collectedUsers.contains(performerId)) {
- collectedUsers.add(performerId);
- roleToPerformers.put(rolePerformer.getId(), collectedUsers);
- }
- }
- }
- }
- } catch(Exception e) {
- Logger.getLogger().error("Error while generating arrays for checking users as task performers : " + e);
- } finally {
- if (coll != null) {
- coll.close();
- }
- }
- // construct JS arrays
- Enumeration<String> rolesPerformerIds = roleToPerformers.keys();
- while (rolesPerformerIds.hasMoreElements()) {
- StringBuffer buff = new StringBuffer();
- String roleId = (String)rolesPerformerIds.nextElement();
- buff.append("var role_" + roleId + "_performers = new Array(");
- ArrayList<String> performers = roleToPerformers.get(roleId);
- for (int i = 0; (performers != null && i < performers.size()); i++) {
- String performerId = performers.get(i);
- if (i != 0) {
- buff.append(",");
- }
- buff.append("'" + performerId + "'");
- }
- buff.append(");");
- out.println(buff.toString());
- }
- if (!rolesPerformerIds.toString().equals("")) {
- if ((isVD && (copyBinders != null && copyBinders.equals("true") || prepareForClone != null && prepareForClone.equalsIgnoreCase("true")))) {
- dialogInitStr = "initTabsEx('wizardDialog', 'mpcWizard', 900, null, 44);";
- } else {
- dialogInitStr = "initTabsEx('wizardDialog', 'mpcWizard', 900, null, 44);";
- }
- }
- }
- }
- %>
- function checkUserAsPerformer(roleId) {
- <% if (checkUserAsPerformer) { %>
- var arrRef = null;
- try {
- arrRef = eval("role_" + roleId + "_performers");
- } catch(e) {
- arrRef = null;
- }
- if (arrRef) {
- for (var i=0; i<document.forms[0].elements['persons_' + roleId].options.length; i++) {
- if (document.forms[0].elements['persons_' + roleId].options[i].selected) {
- var personId = document.forms[0].elements['persons_' + roleId].options[i].value;
- var alertWarning = false;
- for (var j=0; j < arrRef.length; j++) {
- if (personId == arrRef[j]) {
- alertWarning = true;
- break;
- }
- }
- if (alertWarning) {
- var reply = confirm(STR_USER_IS_PERFORMER_WARNING);
- return reply;
- }
- }
- }
- }
- return true;
- <% } else { %>
- return true;
- <% } %>
- }
- var numberOfUsersMsg = "<%= StringEscapeUtils.escapeJavaScript(uiStrings.getLocalizedString("STR_NUMBER_OF_USERS_MSG")) %>: ";
- function toggleApplyToBindingText() {
- var buttonDiv = document.getElementById('buttonDiv'),
- mpcNameElement = document.getElementById('mpcWizard');
- if (document.forms[0].elements['vdDescendOptions'] && document.forms[0].elements['vdDescendOptions'].value && document.forms[0].elements['vdDescendOptions'].value !== 'no_operation') {
- document.getElementById('applyBindingTextTd').style.display = 'inline-block';
- document.forms[0].elements['applyToAllBindingTexts'].checked = true;
- } else if (document.forms[0].elements['applyToVD'] && document.forms[0].elements['applyToVD'].checked) {
- document.getElementById('applyBindingTextTd').style.display = 'inline-block';
- document.forms[0].elements['applyToAllBindingTexts'].checked = true;
- } else {
- document.forms[0].elements['applyToAllBindingTexts'].checked = false;
- document.getElementById('applyBindingTextTd').style.display = 'none'; // using display instead of visibility because this node should not be included in buttonDiv height measurement
- }
- mpcNameElement.style.bottom = (buttonDiv.offsetHeight + 10) + 'px';
- }
- function toggleApplyToVDOfRelatedDocs(){
- if(document.forms[0].elements['applyToAllRelatedDocuments'].checked) {
- document.getElementById('applyToVDOfRelatedDocumentsTable').style.visibility = 'visible';
- toggleApplyToBindingTextOfRelatedDocuments();
- } else {
- document.getElementById('applyToVDOfRelatedDocumentsTable').style.visibility = 'hidden';
- document.getElementById('applyBindingTextOfRelatedDocumentsTd').style.visibility = 'hidden';
- }
- }
- function toggleApplyToBindingTextOfRelatedDocuments() {
- if(document.forms[0].elements['applyToVDOfRelatedDocuments'].checked) {
- document.getElementById('applyBindingTextOfRelatedDocumentsTd').style.visibility = 'visible';
- document.forms[0].elements['applyToAllBindingTextsOfRelatedDocuments'].checked = true;
- } else {
- document.forms[0].elements['applyToAllBindingTextsOfRelatedDocuments'].checked = false;
- document.getElementById('applyBindingTextOfRelatedDocumentsTd').style.visibility = 'hidden';
- }
- }
- function toggleAppendReplace() {
- if(document.forms[0].elements['applyToAllRelatedDocuments'].checked) {
- document.getElementById('appendReplaceSpan').style.visibility = 'visible';
- } else {
- document.getElementById('appendReplaceSpan').style.visibility = 'hidden';
- }
- }
- function initCheckboxes() {
- if (document.forms[0].elements['applyToAllRelatedDocuments']) {
- toggleAppendReplace();
- }
- if (document.forms[0].elements['applyToVD'] || document.forms[0].elements['vdDescendOptions']) {
- toggleApplyToBindingText();
- }
- if (document.forms[0].elements['applyToAllRelatedDocuments'] && document.getElementById('applyToVDOfRelatedDocumentsTable')) {
- toggleApplyToVDOfRelatedDocs();
- }
- }
- function checkIfChangeDescendants () {
- var skipBox = document.forms[0].elements['applySettingsToVDDescendants'].value,
- showBox = false,
- replaceAbsentElement = document.forms['wizard3Form'].elements['replaceAbsentUsers'],
- oldValues = document.forms['wizard3Form'].elements['oldValues'].value,
- newValues = document.forms['wizard3Form'].elements['newValues'].value,
- hasAbsentUser = document.forms['wizard3Form'].elements['hasAbsentUser'].value,
- replaceAbsent;
- if (replaceAbsentElement) {
- replaceAbsent = replaceAbsentElement.checked;
- }
- if (checkVdDescendOption()) {
- if (document.forms[0].elements['applyToVdDescendants'].value === 'true' || (document.forms[0].elements['applyToVD'] && document.forms[0].elements['applyToVD'].checked === true) || (document.forms[0].elements['applyToAllDocuments'] && document.forms[0].elements['applyToAllDocuments'].checked === true)) {
- showBox = true;
- }
- if (showBox === true) {
- if (skipBox === 'false') {
- if (checkNumberOfUsers('<%= personIdsJson %>')) {
- previousNesxtStep('<%= contextPath + jspPath %>explorer/actions/manageUsers/confirmChanges.jsp');
- }
- } else {
- if (checkNumberOfUsers('<%= personIdsJson %>')) {
- previousNesxtStep('<%= contextPath + jspPath %>explorer/actions/manageUsers/manageUsers_finish.jsp');
- }
- }
- } else {
- if (checkNumberOfUsers('<%= personIdsJson %>')) {
- previousNesxtStep('<%= contextPath + jspPath %>explorer/actions/manageUsers/manageUsers_finish.jsp');
- }
- }
- }
- }
- function disableDropDown() {
- if (document.forms[0].elements['vdDescendOptions'] && document.forms[0].elements['vdDescendOptions'].options.length === 1) {
- document.forms[0].elements['vdDescendOptions'].disabled = true;
- }
- }
- function checkVdDescendOption() {
- var flag = true;
- if (document.forms[0].elements['vdDescendOptions']) {
- if (!document.forms[0].elements['vdDescendOptions'].value) {
- flag = false;
- } else if (document.forms[0].elements['vdDescendOptions'].value && document.forms[0].elements['vdDescendOptions'].value !== 'no_operation') {
- document.forms[0].elements['applyToVdDescendants'].value = 'true';
- }
- }
- if (!flag) {
- document.forms['msgboxForm'].elements['msgboxTitle'].value = '<%= uiStrings.getJavascriptEscapedLocalizedString("STR_MANAGE_USERS_WARNING_TITLE") %>';
- document.forms['msgboxForm'].elements['msgboxText'].value = '<%= uiStrings.getJavascriptEscapedLocalizedString("STR_YOU_MUST_SELECT_VD_DESCEND_OPTION") %>';
- top.stopWizardQuickFinish();
- new top.ModalWindow('<%= contextPath + jspPath %>explorer/empty_frame.jsp');
- document.forms['msgboxForm'].target = top.modalFrame.name;
- document.forms['msgboxForm'].submit();
- top.modalFrame.window.focus();
- }
- return flag;
- }
- function showCollaborationMessage(title, message) {
- require(["modules/message_dialog"], function(messageDialog) {
- var CONTEXT_PATH = '<%= contextPath %>',
- MESSAGE_IMAGES_PATH = '<%= imagesPath %>',
- STR_OK = '<%= uiStrings.getJavascriptEscapedLocalizedString("STR_OK") %>',
- errorStingElement;
- function onButtonClick(actionId) {
- var browseButton;
- if (actionId === null) {
- return;
- } else {
- messageDialog.closeDialog();
- }
- }
- actionButtons = [{actionId: 'ok', label: STR_OK}];
- errorStingElement = document.createElement('div');
- errorStingElement.innerHTML = message;
- errorStingElement.className = 'message-dialog-content-element';
- messageDialog.init({
- imagesPath: MESSAGE_IMAGES_PATH,
- contextPath: CONTEXT_PATH,
- width: 400,
- content: {element: errorStingElement},
- title: title,
- buttons: actionButtons,
- onButtonClick: onButtonClick,
- closeDisabled: false
- });
- });
- }
- function isCollaboration(isCollaborationRole, isCollaborationStarted) {
- if (isCollaborationRole === true && isCollaborationStarted === true) {
- showCollaborationMessage('<%= uiStrings.getJavascriptEscapedLocalizedString("STR_COLLABORATION_IN_PROGRESS") %>', '<%= uiStrings.getJavascriptEscapedLocalizedString("STR_COLLABORATION_IN_PROGRESS_CANNOT_CHANGE_ROLE") %>');
- return true;
- } else {
- return false;
- }
- }
- </script>
- </head>
- <%
- ArrayList<String> listRoles = new ArrayList<>();
- HashSet<String> ids = new HashSet<String>();
- StringBuffer displayedRolesIds = new StringBuffer();
- String title = "";
- String helpId = "";
- // collect all absent users (to avoid single query for each user - too slow)
- ArrayList<String> allAbsentUsersIds = new ArrayList<>();
- IDfCollection absentColl = null;
- try {
- DfQuery absentQuery = new MpDfQuery();
- absentQuery.setDQL("select r_object_id from dm_user where r_is_group = false and workflow_disabled = true");
- absentColl = absentQuery.execute(dfcSession, DfQuery.DF_EXECREAD_QUERY);
- while (absentColl != null && absentColl.next()) {
- allAbsentUsersIds.add(absentColl.getString("r_object_id"));
- }
- } catch(Exception ex) {
- Logger.getLogger().error("Error while collecting absent users : " + ex);
- } finally {
- if (absentColl != null) {
- absentColl.close();
- }
- }
- if (wizardType == null) {
- title = uiStrings.getLocalizedString("STR_MANAGE_USERS");
- helpId = "1068";
- if (!fromMultipleMU) {
- roles = pb.getRolesSortedByName();
- for (int i = 0; (roles != null && i < roles.size()); i++) {
- RoleBean rb = roles.get(i);
- String roleId = rb.getId();
- if (hiddenRoles.containsKey(roleId)) {
- continue;
- }
- if (rolesIds.length() > 0) {
- rolesIds.append(",");
- displayedRolesIds.append("~");
- }
- rolesIds.append("'" + roleId + "'");
- displayedRolesIds.append(roleId);
- }
- } else {
- roles = new ArrayList<>();
- StringTokenizer rolesTok = new StringTokenizer(commonRoles, "~");
- while (rolesTok.hasMoreTokens()) {
- String roleId = rolesTok.nextToken();
- roles.add(rManager.getRoleById(roleId));
- // hidden roles are extracted from common roles
- rolesIds.append("'" + roleId + "'");
- displayedRolesIds.append(roleId);
- if (rolesTok.hasMoreTokens()) {
- rolesIds.append(",");
- displayedRolesIds.append("~");
- }
- }
- }
- } else {
- if (isAutomationWizard) {
- title = "STR_START_AUTOMATION_JOB";
- } else {
- title = "STR_" + chosenWizard.toUpperCase() + "_DOCUMENT";
- }
- if (generateTOC.equals("1")){
- title = "STR_GENERATE_TOC";
- }
- if (newRelease.equals("true")) {
- if (wizType == WizardBean.CREATE_WIZARD) {
- title = "STR_NEW_RELEASE";
- } else if (wizType == WizardBean.IMPORT_WIZARD) {
- title = "STR_IMPORT_AS_NEW_RELEASE";
- }
- } else if (newDossier.equals("true")) {
- title = "STR_NEW_DOSSIER";
- } else if (issueChangeRequestRA.equals("true")) {
- title = "STR_ISSUE_CHANGE_REQUEST_BY_RA";
- }
- if (chosenWizard.equals("create")) {
- helpId = "1037";
- } else if (chosenWizard.equals("import")) {
- helpId = "1038";
- } else if (chosenWizard.equals("classify")) {
- helpId = "1067";
- }
- title = uiStrings.getLocalizedString(title);
- if (isAutomationWizard) {
- title += " - " + automationDescription;
- } else if (!(generateTOC.equals("1"))){
- title += " - " + pb.getNameInLanguage(language);
- } else {
- helpId = "1184";
- }
- if (!firstTimeInManageUsers) {
- ArrayList<String> rolePersons = new ArrayList<>();
- if (rolesAndUsers != null && !rolesAndUsers.isEmpty()) {
- Enumeration<String> allRoles = rolesAndUsers.keys();
- while (allRoles.hasMoreElements()) {
- String personsIds = "";
- String roleId = allRoles.nextElement();
- rolePersons = rolesAndUsers.get(roleId);
- for (int j = 0; (rolePersons != null && j < rolePersons.size()); j++) {
- String personName = rolePersons.get(j);
- String id = "";
- PersonBean perb = perManager.getPersonByName(personName, dfcSession.getDocbaseId());
- if (perb != null) {
- id = perb.getId();
- } else {
- OrgUnitBean oub = ouManager.getOrgUnitByGroupName(personName, dfcSession.getDocbaseId());
- if (oub != null) {
- id = oub.getId();
- }
- }
- if (!id.equals("")) {
- if (j == 0) {
- personsIds = id;
- } else {
- personsIds += "~" + id;
- }
- }
- }
- allRolesAndUsers.put(roleId, personsIds);
- }
- }
- } else {
- if (firstTimeInManageUsers) {
- allRolesAndUsers = wu.getUsersForRoles(profileId, wizType, language, rolesAndUsers, defaultAndPersistentRolesAndUsers, isTargetFolder, firstTimeInManageUsers, paramsAndValues);
- }
- }
- if (allRolesAndUsers != null && !allRolesAndUsers.isEmpty()) {
- Enumeration<String> allRoles = allRolesAndUsers.keys();
- while (allRoles.hasMoreElements()) {
- String roleId = allRoles.nextElement();
- if (pb.isRoleHiddenInWizards(roleId)) {
- hiddenRoles.put(roleId, allRolesAndUsers.get(roleId));
- }
- }
- }
- }
- %>
- <body class="dialog claro" onResize="initTabsEx('rolesDialog', 'mpcWizard', 980, null, 80, undefined, false, 29);" onMouseMove="bodyMouseMove();">
- <form name="wizard3Form" method="post" action="<%= contextPath + jspPath %>explorer/actions/manageUsers/manageUsers_finish.jsp">
- <%
- boolean hasVisibleRoles = false;
- for (int r = 0; (roles != null && r < roles.size()); r++) {
- RoleBean rb = roles.get(r);
- String roleId = rb.getId();
- String value = "";
- if (hiddenRoles.containsKey(roleId)) {
- value = hiddenRoles.get(roleId);
- } else {
- hasVisibleRoles = true;
- }
- out.println("<input dir=\"auto\" type=\"hidden\" name=\"role_" + roleId + "\" value=\"" + value + "\">");
- }
- %>
- <input type="hidden" name="isAutomationWizard" value="<%= isAutomationWizard %>">
- <input type="hidden" name="isB2BMessageWizard" value="<%= isB2BMessageWizard %>">
- <input type="hidden" name="automationPerformer" value="<%= automationPerformer %>">
- <input type="hidden" name="automationLogLevel" value="<%= automationLogLevel %>">
- <input type="hidden" name="automationRule" value="<%= automationRule %>">
- <input type="hidden" name="automationBlockingRule" value="<%= automationBlockingRule %>">
- <input type="hidden" name="automationObjectIds" value="<%= automationObjectIds %>">
- <input type="hidden" name="automationDescription" value="<%= automationDescription %>">
- <input type="hidden" name="automationWorkspaceViewRefresh" value="<%= automationWorkspaceViewRefresh %>">
- <input type="hidden" name="B2BEntityIds" value="<%= B2BEntityIds %>">
- <input type="hidden" name="B2BExplicitEntityIds" value="<%= B2BExplicitEntityIds %>">
- <input type="hidden" name="B2BconfigId" value="<%= B2BconfigId %>">
- <input type="hidden" name="B2BSendDirectly" value="<%= B2BSendDirectly %>">
- <input type="hidden" name="oldValues" value="">
- <input type="hidden" name="newValues" value="">
- <input type="hidden" name="hasAbsentUser" value="">
- <input type="hidden" name="previousProfileId" value="<%= previousProfileId %>">
- <input type="hidden" name="initialLoad" value="<%= initialLoad %>">
- <input type="hidden" name="applyToVdDescendants" value="">
- <% if (wizardType == null) { %>
- <input type="hidden" name="fromFinishTaskEx" value="<%= fromFTE %>">
- <input type="hidden" name="FTE_taskId" value="<%= FTE_taskId %>">
- <input type="hidden" name="FTE_fromApprove" value="<%= FTE_fromApprove %>">
- <input type="hidden" name="FTE_fromReject" value="<%= FTE_fromReject %>">
- <input type="hidden" name="properties" value="<%= enabledProperties %>">
- <input type="hidden" name="preselected" value="<%= isPreselected %>">
- <input type="hidden" name="fromFinishAndReject" value="<%= FTE_fromFinishAndReject %>">
- <input type="hidden" name="objectId" value="<%= objectId %>">
- <input type="hidden" name="fromMultipleMU" value="<%= fromMultipleMU %>">
- <input type="hidden" name="displayedRoles" value="<%= displayedRolesIds %>">
- <input type="hidden" name="commonRoles" value="<%= commonRoles %>">
- <input type="hidden" name="actionId" value='<%= request.getParameter("actionId") %>'>
- <input type="hidden" name="contextMenuType" value='<%= request.getParameter("contextMenuType") %>'>
- <!-- promote/demote and finish ex -->
- <input type="hidden" name="FT_fromFinishTask" value="<%= FT_fromFinishTask %>">
- <input type="hidden" name="FT_extendedPromoteOrDemote" value="<%= FT_extendedPromoteOrDemote %>">
- <input type="hidden" name="FT_nextTask" value="<%= FT_nextTask %>">
- <input type="hidden" name="FT_id" value="<%= FT_id %>">
- <input type="hidden" name="FT_objectId" value="<%= FT_objectId %>">
- <input type="hidden" name="FT_profileId" value="<%= FT_profileId %>">
- <input type="hidden" name="FT_lcsId" value="<%= FT_lcsId %>">
- <input type="hidden" name="FT_wfLCSId" value="<%= FT_wfLCSId %>">
- <input type="hidden" name="FT_signoffUsername" value="<%= FT_signoffUsername %>">
- <input type="hidden" name="FT_userFunction" value="<%= FT_userFunction %>">
- <input type="hidden" name="FT_signoffPassword" value="<%= FT_signoffPassword %>">
- <input type="hidden" name="FT_signoffReason" value="<%= FT_signoffReason %>">
- <input type="hidden" name="FT_signoffRequired" value="<%= FT_signoffRequired %>">
- <input type="hidden" name="promoteDemoteId" value="<%= promoteDemoteId %>">
- <input type="hidden" name="promoteIsNextStateSelected" value="<%= promoteIsNextStateSelected %>">
- <input type="hidden" name="promoteToLCS" value="<%= promoteToLCS %>">
- <input type="hidden" name="promoteOnDate" value="<%= promoteOnDate %>">
- <input type="hidden" name="promoteDemoteWfPriority" value="<%= promoteDemoteWfPriority %>">
- <input type="hidden" name="schedulePromote" value="<%= schedulePromote %>">
- <input type="hidden" name="promoteRoles" value="<%= promoteRoles %>">
- <input type="hidden" name="demoteToLCS" value="<%= demoteToLCS %>">
- <input type="hidden" name="demoteRoles" value="<%= demoteRoles %>">
- <!-- used for returning if user validation fails -->
- <input type="hidden" name="id" value="<%= objectId %>">
- <input type="hidden" name="fromFinishTaskEx" value="<%= fromFTE %>">
- <input type="hidden" name="taskId" value="<%= FTE_taskId %>">
- <input type="hidden" name="roles" value="<%= FTE_roles %>">
- <input type="hidden" name="fromApprove" value="<%= FTE_fromApprove %>">
- <input type="hidden" name="fromReject" value="<%= FTE_fromReject %>">
- <input type="hidden" name="fromFinishAndReject" value="<%= FTE_fromFinishAndReject %>">
- <input type="hidden" name="fromMultipleMU" value="<%= fromMultipleMU %>">
- <input type="hidden" name="takeOver" value="<%= takeOver %>">
- <input type="hidden" name="notificationTakeOver" value="<%= notificationTakeOver %>">
- <input type="hidden" name="to" value="<%= to %>">
- <input type="hidden" name="commonRoles" value="<%= commonRoles %>">
- <input type="hidden" name="hasVD" value="<%= hasVD %>">
- <input type="hidden" name="nextObjectId" value="<%= nextObjectId %>">
- <input type="hidden" name="forwardToUrl" value="<%= forwardToUrl %>">
- <input type="hidden" name="target" value="<%= target %>">
- <input type="hidden" name="refresh" value="<%= refresh %>">
- <input type="hidden" name="applySettingsToVDDescendants" value="<%= applySettingsToVDDescendants %>">
- <input type="hidden" name="fromFinishTaskProxy" value="<%= fromFinishTaskProxy %>">
- <%
- if (fromFinishTaskProxy.equals("true")) {
- for (Enumeration<String> en = finishTaskParams.keys(); en.hasMoreElements(); ) {
- String paramName = en.nextElement();
- String paramValue = finishTaskParams.get(paramName);
- %>
- <input type="hidden" name="FTP_<%= paramName %>" value="<%= paramValue %>">
- <%
- }
- }
- // Determine whether to display "apply" checkboxes.
- if (!fromMultipleMU) {
- ArrayList<String> rolesAllowed = null;
- if (lcsb != null && !lcsb.getApplyCheckboxesOnUsersAndRolesAllowedCheckProfileSettings()) {
- rolesAllowed = lcsb.getApplyCheckboxesOnUsersAndRolesAllowed();
- } else {
- rolesAllowed = pb.getApplyCheckboxesOnUsersAndRolesAllowed();
- }
- ProfileUtil pu = new ProfileUtil(language, dfcSession);
- ArrayList<String> currentUserRoles = pu.getUsersRolesForObjectFromDocbase(object);
- for (int i = 0; (currentUserRoles != null && i < currentUserRoles.size()); i++) {
- String roleId = currentUserRoles.get(i);
- if (rolesAllowed != null && rolesAllowed.contains(roleId)) {
- displayApplyCheckboxes = true;
- break;
- }
- }
- } else {
- displayApplyCheckboxes = displayApplyCheckboxesMU;
- }
- if (!hasVisibleRoles) {
- displayApplyCheckboxes = false;
- }
- if (pb != null && pb.getAllowedVdDescendOptions() != null && pb.getAllowedVdDescendOptions().isEmpty()) {
- displayVdDescendOptionsDropdown = false;
- }
- if (displayApplyCheckboxes) {
- // check for collaboration in progress
- IDfSession adminSession = DocbaseUtility.getAdminSession();
- relatedCollaboration = OneDriveUtility.isCollaborativeEditStartedOnRelatedOrVirtualDocuments(adminSession, objectId, true, false, false);
- if (relatedCollaboration) {
- applyToAllRelatedDocumentsChecked = "disabled";
- }
- if (isVD && displayVdDescendOptionsDropdown || hasVD && fromMultipleMU) {
- vdCollaboration = OneDriveUtility.isCollaborativeEditStartedOnRelatedOrVirtualDocuments(adminSession, objectId, false, true, false);
- }
- if (allowApplyToAllVDDescendantsOfRelatedDocuments || fromMultipleMU && displayApplyCheckboxesForRelatedVDs) {
- relatedVdCollaboration = OneDriveUtility.isCollaborativeEditStartedOnRelatedOrVirtualDocuments(adminSession, objectId, false, false, true);
- }
- }
- if (relatedVdCollaboration) {
- applyToAllVDDescendantsOfRelatedDocumentsChecked = "disabled";
- } else if (applyToAllVDDescendantsOfRelatedDocuments) {
- applyToAllVDDescendantsOfRelatedDocumentsChecked = "checked";
- }
- %>
- <input type="hidden" name="checkApplyToAllRelDoc" value="<%= checkApplyToAllRelDoc %>">
- <input type="hidden" name="displayApplyCheckboxes" value="<%= displayApplyCheckboxes %>">
- <input type="hidden" name="displayApplyCheckboxesForRelatedVDs" value="<%= displayApplyCheckboxesForRelatedVDs %>">
- <% } else { %>
- <input type="hidden" name="wizardType" value="<%= wizardType %>">
- <input type="hidden" name="objectTypeId" value="<%= objectTypeId %>">
- <input type="hidden" name="profileId" value="<%= profileId %>">
- <input type="hidden" name="templateId" value="<%= templateId %>">
- <input type="hidden" name="generateTOC" value="<%= generateTOC %>">
- <input type="hidden" name="tocParentId" value="<%= tocParentId %>">
- <input type="hidden" name="omitDocsIds" value="<%= omitDocsIds %>">
- <input type="hidden" name="rootObjectId" value="<%= rootObjectId %>">
- <input type="hidden" name="firstWizard" value="<%= firstWizard %>">
- <input type="hidden" name="lcsId" value="<%= lcsId %>">
- <input type="hidden" name="requestBlankPDFRendition" value="<%= requestBlankPDFRendition %>">
- <input type="hidden" name="folderId" value="<%= folderId %>">
- <input type="hidden" name="filePath" value="<%= filePath %>">
- <input type="hidden" name="fileName" value="<%= fileName %>">
- <input type="hidden" name="contentType" value="<%= contentType %>">
- <input type="hidden" name="objectId" value="<%= objectId %>">
- <input type="hidden" name="chronicleId" value="<%= chronicleId %>">
- <input type="hidden" name="relations" value="<%= relations %>">
- <input type="hidden" name="newRelease" value="<%= newRelease %>">
- <input type="hidden" name="forMRP" value="<%= forMRP %>">
- <input type="hidden" name="keepCurrentLCStates" value="<%= keepCurrentLCStates %>">
- <input type="hidden" name="keepCurrentObjectNames" value="<%= keepCurrentObjectNames %>">
- <input type="hidden" name="moduleIds" value="<%= moduleIds %>">
- <input type="hidden" name="newDossier" value="<%= newDossier %>">
- <input type="hidden" name="superType" value="<%= superType %>">
- <input type="hidden" name="previousStep" value="3">
- <input type="hidden" name="shortWizard" value="<%= shortWizard %>">
- <input type="hidden" name="copyBinders" value="<%= copyBinders %>">
- <input type="hidden" name="copyBindingText" value="<%= copyBindingText %>">
- <input type="hidden" name="copyVDRoot" value="<%= copyVDRoot %>">
- <input type="hidden" name="createFolders" value="<%= createFolders %>">
- <input type="hidden" name="wfPriority" value="<%= request.getParameter("wfPriority") %>">
- <input type="hidden" name="barcode" value="<%= barcode %>">
- <input type="hidden" name="barcodeValue" value="<%= barcodeValue %>">
- <input type="hidden" name="showPreview" value="<%= showPreview %>">
- <input type="hidden" name="mapCounterStartValue" value="<%= mapCounterStartValue %>">
- <input type="hidden" name="putDocumentAsChildInRelation" value="<%= putDocumentAsChildInRelation %>">
- <input type="hidden" name="checkFolder" value="<%= checkFolder %>">
- <input type="hidden" name="deleteObjectContent" value="<%= deleteObjectContent %>">
- <input type="hidden" name="replaceObjectContent" value="<%= replaceObjectContent %>">
- <input type="hidden" name="replacementTemplateId" value="<%= replacementTemplateId %>">
- <input type="hidden" name="issueChangeRequestRA" value="<%= issueChangeRequestRA %>">
- <input type="hidden" name="chooseSourceWizardForSettings" value="<%= chooseSourceWizardForSettings %>">
- <input type="hidden" name="fromCloneAdvanced" value="<%= fromCloneAdvanced %>">
- <input type="hidden" name="chosenWizard" value="<%= chosenWizard %>">
- <input type="hidden" name="pasteEx" value="<%= pasteEx %>">
- <input type="hidden" name="pasteInVD" value="<%= pasteInVD %>">
- <input type="hidden" name="isCloneAction" value="<%= isCloneAction %>">
- <input type="hidden" name="createSnapshot" value="<%= createSnapshot %>">
- <input type="hidden" name="defaultPdfPageSize" value="<%= defaultPdfPageSize %>">
- <input type="hidden" name="containmentId" value="<%= containmentId %>">
- <input type="hidden" name="editVirtualDocument" value="<%= editVirtualDocument %>">
- <input type="hidden" name="parentWndName" value="<%= parentWndName %>">
- <input type="hidden" name="showRelatedAction" value="<%= showRelatedAction %>">
- <input type="hidden" name="targetViewId" value="<%= targetViewId %>">
- <input type="hidden" name="frameId" value="<%= frameId %>">
- <input type="hidden" name="isFromInsert" value="<%= isFromInsert %>">
- <input type="hidden" name="prepareForClone" value="<%= prepareForClone %>">
- <input type="hidden" name="isSimple" value="<%= isSimple %>">
- <input type="hidden" name="profs" value="<%= profs %>">
- <input type="hidden" name="tasksSelect" value="<%= tasksSelect %>">
- <input type="hidden" name="auths" value="<%= auths %>">
- <input type="hidden" name="fromDate" value="<%= fromDate %>">
- <input type="hidden" name="toDate" value="<%= toDate %>">
- <input type="hidden" name="objName" value="<%= objName %>">
- <input type="hidden" name="id" value="<%= tmpId %>">
- <input type="hidden" name="tmpObjectTypeId" value="<%= tmpType %>">
- <input type="hidden" name="isOpenTasksReport" value="<%= isOpenTasksReport %>">
- <input type="hidden" name="pdfPassword" value="<%= pdfPassword %>">
- <input type="hidden" name="applyPropsToVD" value="<%= applyPropsToVD %>">
- <!-- pmi, classify as new release -->
- <input type="hidden" name="classifyAsNewRelease" value="<%= classifyAsNewRelease %>">
- <input type="hidden" name="newContentObject" value="<%= newContentObject %>">
- <input type="hidden" name="isWithoutTemplate" value="<%= isWithoutTemplate %>">
- <input type="hidden" name="isMSO" value="<%= isMSO %>">
- <input type="hidden" name="importProps" value="<%= importProps %>">
- <input type="hidden" name="vdStructureReview" value="<%= vdStructureReview %>">
- <input type="hidden" name="vdStructureChange" value="<%= vdStructureChange %>">
- <input type="hidden" name="vdStructureStep" value="<%= vdStructureStep%>">
- <input type="hidden" name="vdStructureOptions" value='<%= vdStructureOptions %>'>
- <input type="hidden" name="frmAction" value="<%= frmAction %>">
- <input type="hidden" name="wizardQuickFinishEnabled" value="<%= wizardQuickFinishEnabled %>">
- <input type="hidden" name="documentSelectionAttribute" value="<%= documentSelectionAttribute %>">
- <input type="hidden" name="selectedObjectIds" value="<%= selectedObjectIds %>">
- <input type="hidden" name="skipProfileSelect" value="<%= skipProfileSelect %>">
- <input type="hidden" name="lcsName" value="<%= lcsName %>">
- <%
- if (firstTimeInWizardRelations != null && !firstTimeInWizardRelations.equals("")) {
- %>
- <input type="hidden" name="firstTimeInWizardRelations" value="<%= firstTimeInWizardRelations %>">
- <%
- }
- if (isSaveSearch != null && isSaveSearch.equals("true")) {
- %>
- <input type="hidden" name="saveSearch" value="true">
- <%
- for (Enumeration<?> en = saveSearch.propertyNames(); en.hasMoreElements(); ) {
- String name = (String)en.nextElement();
- String value = saveSearch.getProperty(name);
- %>
- <input type="hidden" name="<%= name %>~saveSearch" value="<%= StringEscapeUtils.escapeHtml(value) %>">
- <%
- }
- }
- out.println(paramsBuff.toString());
- if (alreadyInWizard3ForCurrentFile.equals("0") || alreadyInWizard3ForCurrentFile.equals("")) {
- alreadyInWizard3ForCurrentFile = "1";
- session.setAttribute("alreadyInWizard3ForCurrentFile", alreadyInWizard3ForCurrentFile);
- }
- } %>
- <div id="rolesDialog" class="dialogForm dialog-custom">
- <div id="titleBar" class="dialogTitleBar" onmousedown="startMoveDialog(this.parentElement);" onmouseup="stopMoveDialog(this.parentElement);" onmousemove="dialogMouseMove();">
- <%= title %>
- </div>
- <div>
- <div data-node-type="tab-container" data-manual-initialization="true" class="mp-tab-container" id="mpcWizard" style="visibility: hidden;">
- <%
- if (!hasVisibleRoles) {
- if (!forceHiddenRoleValidation && wizardType != null) {
- %>
- <script>
- var automationParameters = "<%= StringEscapeUtils.escapeJavaScript("&isAutomationWizard=" + isAutomationWizard + "&automationPerformer=" + automationPerformer +
- "&automationLogLevel=" + automationLogLevel + "&automationRule=" + automationRule + "&automationBlockingRule=" + automationBlockingRule +
- "&automationObjectIds=" + automationObjectIds + "&automationDescription=" + automationDescription + "&automationWorkspaceViewRefresh=" + automationWorkspaceViewRefresh +
- "&B2BEntityIds=" + B2BEntityIds + "&B2BExplicitEntityIds=" + B2BExplicitEntityIds + "&B2BconfigId=" + B2BconfigId + "&B2BSendDirectly=" + B2BSendDirectly +
- "&isB2BMessageWizard=" + isB2BMessageWizard) %>";
- setSelectedTab(1);
- previousNesxtStep("/myprocess/jsp/wizard/validateUsers.jsp?manageRelatedDocuments=<%= wb.hasRelations(chosenWizType) %>&skipManageUsers=true" + automationParameters);
- </script>
- <%
- } else {
- %>
- <div data-node-type="page-container" class="mp-page-container" id="tabNoRoles" TABTITLE="NoRoles" TABTEXT="<%= uiStrings.getLocalizedString("STR_NO_ROLES") %>">
- <table style="border:0px; width:100%">
- <br>
- <br>
- <br>
- <br>
- <tr>
- <td class="labelFieldCenter">
- <%= uiStrings.getLocalizedString("STR_NOT_ALLOWED_TO_VIEW_MANAGE_ANY_ROLE") %>
- </td>
- </tr>
- </table>
- </div>
- <%
- }
- } else {
- int minUsers = 0;
- int maxUsers = -1;
- if (roles != null) {
- roles = rManager.sortRolesByName(roles);
- }
- for (int i = 0; (roles != null && i < roles.size()); i++) {
- RoleBean rb = (RoleBean)roles.get(i);
- String roleId = rb.getId();
- if (hiddenRoles.containsKey(roleId)) {
- continue;
- }
- Logger.getLogger().trace("roleId = " + roleId);
- String roleName = rb.getNameInLanguage(language);
- String roleDescription = rb.getDescriptionInLanguage(language);
- if (!fromMultipleMU) {
- if (lcsb != null && lcsb.getMinUsersForRole(roleId) != LifeCycleStateBean.MIN_MAX_USERS_CHECK_PROFILE_SETTINGS) {
- minUsers = lcsb.getMinUsersForRole(roleId);
- } else {
- minUsers = pb.getMinUsersForRole(roleId);
- }
- if (lcsb != null && lcsb.getMaxUsersForRole(roleId) != LifeCycleStateBean.MIN_MAX_USERS_CHECK_PROFILE_SETTINGS) {
- maxUsers = lcsb.getMaxUsersForRole(roleId);
- } else {
- maxUsers = pb.getMaxUsersForRole(roleId);
- }
- }
- if (fromFinishTaskProxy.equals("true")) {
- ArrayList<String> minMaxUsers = minMaxUsersAll.get(roleId);
- String minUsersStr = minMaxUsers.get(0);
- if (minUsersStr == null) {
- minUsersStr = "-1";
- }
- String maxUsersStr = minMaxUsers.get(1);
- if (maxUsersStr == null) {
- maxUsersStr = "-1";
- }
- Integer tmpMinUsers = new Integer(minUsersStr);
- Integer tmpMaxUsers = new Integer(maxUsersStr);
- minUsers = tmpMinUsers.intValue();
- maxUsers = tmpMaxUsers.intValue();
- }
- listRoles.add(roleId);
- boolean isCollaborationRole = false;
- if (rb.isCoordinator() || rb.isAuthor()) {
- isCollaborationRole = true;
- }
- %>
- <div data-node-type="page-container" data-force-tab-visibility="true" class="mp-page-container" id="tab<%= roleId %>" roleId="<%= roleId %>" currUserId="<%= currUserId %>" TABTITLE="<%= roleDescription %>" TABTEXT="<%= roleName %>" onfocus="disableUserButt('wizard3Form', 'persons_<%= roleId %>', 'addCurrUser_<%= roleId %>', 'remCurrUser_<%= roleId %>', null, '<%= currUserId %>', checkIfCurrentUserIsAllowed('<%= roleId %>'));">
- <table style="border:0px; width:100%; height:100%">
- <tr style="height:100%">
- <td nowrap>
- <table style="border:0px; width:100%; height:10px; cellpadding:2px">
- <tr style="height:10px">
- <td colspan="3" class="labelFieldLeft"><%= uiStrings.getLocalizedString("STR_ORG_UNITS") %>:</td>
- </tr>
- <tr style="height:10px">
- <td colspan="3" class="controlFieldLeft">
- <!-- GROUPS -->
- <select style="width: 100%;" id="orgUnits_<%= roleId %>" name="orgUnits_<%= roleId %>" class="controlLeft" onchange="refreshUsers('orgUnits_<%= roleId %>', 'personsValues_<%= roleId %>', '<%= roleId %>');"></select>
- </td>
- </tr>
- <tr style="height:10px">
- <td colspan="3" class="labelFieldLeft">
- <%= uiStrings.getLocalizedString("STR_USERS_AND_GROUPS") %>:
- </td>
- </tr>
- <tr style="height:10px">
- <td colspan="3">
- <table cellpadding="0" cellspacing="0" style="width:100%; height:100%">
- <tr>
- <%-- pmi, dma-task 3662 added filterButt --%>
- <td nowrap style="width:45%;">
- <table cellpadding="0" cellspacing="0" style="width:100%; height:100%">
- <tbody>
- <tr>
- <td style="width: 100%;"><input dir="auto" type="text" name="filterByStr<%= roleId %>" value="" class="selectText" style="width: 100%;" onKeyPress="if (event.keyCode == 13) getUnselectedData('orgUnits_<%= roleId %>', 'personsValues_<%= roleId %>', '<%= roleId %>', 'filterButt');"/></td>
- <td style="width: 80px;"> <button class="button" style="width: 80px; margin-top: 0px;" name="filterButt" onmousedown="getUnselectedData('orgUnits_<%= roleId %>', 'personsValues_<%= roleId %>', '<%= roleId %>', 'filterButt'); return false;" onclick="return false;" onmouseup="return false;"><%= uiStrings.getLocalizedString("STR_FILTER") %></button></td>
- </tr>
- </tbody>
- </table>
- </td>
- <td style="width: 100px;"> </td>
- <td nowrap align="right" style="width: 45%;">
- <button class="button" style="width: 135px;" name="addCurrUser_<%= roleId %>" onClick="if (isCollaboration(<%= isCollaborationRole %>, <%= isCollaborativeEditStarted %>)) return false; addCurrUser('wizard3Form', 'persons_<%= roleId %>', 'addCurrUser_<%= roleId %>', 'remCurrUser_<%= roleId %>', '<%= currUserId %>', '<%= StringEscapeUtils.escapeJavaScript(userNameEx) %>', checkIfCurrentUserIsAllowed('<%= roleId %>')); return false;" onmouseup="return false;"><%= uiStrings.getLocalizedString("STR_ADD_CURR_USER") %></button>
- <button class="button" style="width: 158px;" name="remCurrUser_<%= roleId %>" onClick="if (isCollaboration(<%= isCollaborationRole %>, <%= isCollaborativeEditStarted %>)) return false; if (checkUserAsPerformer('<%= roleId %>')) { remCurrUser('wizard3Form', 'persons_<%= roleId %>', 'personsValues_<%= roleId %>', 'addCurrUser_<%= roleId %>', 'remCurrUser_<%= roleId %>', null, '<%= currUserId %>', '<%= StringEscapeUtils.escapeJavaScript(userNameEx) %>', checkIfCurrentUserIsAllowed('<%= roleId %>'));} return false;" onmouseup="return false;"><%= uiStrings.getLocalizedString("STR_REM_CURR_USER") %></button>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- <table style="border:0px; width:100%; height:82%">
- <tr>
- <td class="controlFieldRight" style="width: 50%; position: relative;" >
- <div id="loading_<%= roleId %>" style="border: 0px solid #000; left: 0px; position: absolute; width: 100%; height: 99%; text-align: center;">
- <table style="height: 100%; width: 100%;">
- <tr>
- <td class="loading-overlay-inline" style="vertical-align: middle; text-align: center; background-color: #ffffff;"><%= STR_LOADING %></td>
- </tr>
- </table>
- </div>
- <select style="height:100%; width:100%;" name="personsValues_<%= roleId %>" multiple removeNotAllowed="true" addNotAllowed="true" class="controlLeft" size="30" onchange="enableButts('wizard3Form', 'addPersonBtn_<%= roleId %>')" onDblClick="if (isCollaboration(<%= isCollaborationRole %>, <%= isCollaborativeEditStarted %>)) return false; onOptionAdd('wizard3Form', 'personsValues_<%= roleId %>', 'persons_<%= roleId %>', 'addPersonBtn_<%= roleId %>', null); disableUserButt('wizard3Form', 'persons_<%= roleId %>', 'addCurrUser_<%= roleId %>', 'remCurrUser_<%= roleId %>', null, '<%= currUserId %>', checkIfCurrentUserIsAllowed('<%= roleId %>'));" onClick="onOptionAdd('wizard3Form', 'personsValues_<%= roleId %>', 'persons_<%= roleId %>', 'addPersonBtn_<%= roleId %>', null, true);">
- </select>
- </td>
- <td class="controlFieldCenter" style="width:100px; height: 400px">
- <table>
- <tr>
- <td style="width:10px">
-
- </td>
- <td valign="center">
- <input type="button" disabled name="addPersonBtn_<%= roleId %>" value=">>" onClick="if (isCollaboration(<%= isCollaborationRole %>, <%= isCollaborativeEditStarted %>)) return false; addOption('wizard3Form', 'personsValues_<%= roleId %>', 'persons_<%= roleId %>', 'addPersonBtn_<%= roleId %>', null); disableUserButt('wizard3Form', 'persons_<%= roleId %>', 'addCurrUser_<%= roleId %>', 'remCurrUser_<%= roleId %>', null, '<%= currUserId %>', checkIfCurrentUserIsAllowed('<%= roleId %>')); return false;" onmouseup="return false;" class="button" style="width:60px; height:24px;">
- </td>
- <td style="width:10px">
-
- </td>
- </tr>
- </table>
- <table>
- <tr>
- <td style="width:10px">
-
- </td>
- <td valign="center">
- <input type="button" disabled name="removePersonBtn_<%= roleId %>" value="<<" onClick="if (isCollaboration(<%= isCollaborationRole %>, <%= isCollaborativeEditStarted %>)) return false; if (checkUserAsPerformer('<%= roleId %>')) { addOption('wizard3Form', 'persons_<%= roleId %>', 'personsValues_<%= roleId %>', 'removePersonBtn_<%= roleId %>', null); disableUserButt('wizard3Form', 'persons_<%= roleId %>', 'addCurrUser_<%= roleId %>', 'remCurrUser_<%= roleId %>', null, '<%= currUserId %>', checkIfCurrentUserIsAllowed('<%= roleId %>'));} return false;" onmouseup="return false;" class="button" style="width:60px; height:24px;">
- </td>
- <td style="width:10px">
-
- </td>
- </tr>
- </table>
- </td>
- <td class="controlFieldLeft" style="width: 50%;" >
- <select style="height:100%; width:100%;" name="persons_<%= roleId %>" checkForExisting="true" multiple class="controlLeft" size="30" <% if (fromMultipleMU) out.print("addWhere=\"end\""); %> onchange="enableButtsRespectiveToForbiddenOptions('wizard3Form', 'removePersonBtn_<%= roleId %>', 'persons_<%= roleId %>')" onDblClick="if (isCollaboration(<%= isCollaborationRole %>, <%= isCollaborativeEditStarted %>)) return false; if (checkUserAsPerformer('<%= roleId %>')) { addOption('wizard3Form', 'persons_<%= roleId %>', 'personsValues_<%= roleId %>', 'removePersonBtn_<%= roleId %>', null); disableUserButt('wizard3Form', 'persons_<%= roleId %>', 'addCurrUser_<%= roleId %>', 'remCurrUser_<%= roleId %>', null, '<%= currUserId %>', checkIfCurrentUserIsAllowed('<%= roleId %>'));}" roleName="<%= roleName %>" <% if (minUsers != 0) out.print(" minUsers=\"" + minUsers + "\" "); if (maxUsers != -1) out.print(" maxUsers=\"" + maxUsers + "\" "); %>>
- <%
- if (wizardType == null) {
- if (!fromMultipleMU && rolesAndUsers != null && !rolesAndUsers.isEmpty()) {
- ArrayList<String> rolePersons = rolesAndUsers.get(roleId);
- if (rolePersons != null && !rolePersons.isEmpty()) {
- ArrayList<String> personNames = new ArrayList<>();
- Hashtable<String, String> personIds = new Hashtable<>();
- Hashtable<String, String> counts = new Hashtable<>();
- for (int p = 0; p < rolePersons.size(); p++) {
- String personName = rolePersons.get(p);
- String personId = "";
- String count = "";
- PersonBean pBean = perManager.getPersonByName(personName, dfcSession.getDocbaseId());
- if (pBean != null) {
- personName = pBean.getNameEx();
- personId = pBean.getId();
- count = "1";
- } else {
- OrgUnitBean ouBean = ouManager.getOrgUnitByGroupName(personName, dfcSession.getDocbaseId());
- if (ouBean != null) {
- personName = ouBean.getNameEx();
- personId = ouBean.getId();
- count = String.valueOf(ouBean.getNumberOfPersons());
- }
- }
- if (!personId.equals("")) {
- personNames.add(personName);
- personIds.put(personName, personId);
- counts.put(personName, count);
- }
- }
- Collections.sort(personNames, String.CASE_INSENSITIVE_ORDER);
- int counter = 0;
- for (int p = 0; p < personNames.size(); p++) {
- String personName = personNames.get(p);
- String personId = personIds.get(personName);
- String count = counts.get(personName);
- String display = personName;
- PersonBean perb = perManager.getPersonById(personId);
- OrgUnitBean ouBean = ouManager.getOrgUnitById(personId);
- if (perb != null && allAbsentUsersIds.contains(perb.getId())) {
- String replacement = perb.getUserDelegation();
- if (replacement == null) {
- replacement = "";
- }
- PersonBean replacePB = perManager.getPersonByName(replacement, perb.getDocbaseId());
- if (replacePB == null || allAbsentUsersIds.contains(replacePB.getId())) {
- display += " (" + uiStrings.getLocalizedString("STR_ABSENT") + ", " + uiStrings.getLocalizedString("STR_NO_REPLACEMENT_DEFINED") + ")";
- } else {
- display += " (" + uiStrings.getLocalizedString("STR_ABSENT") + ", " + uiStrings.getLocalizedString("STR_REPLACED_BY") + " " + replacePB.getNameEx() + ")";
- }
- }
- boolean allowed = true;
- if (ouBean != null) {
- allowed = ouBean.isAllowed(dfcSession);
- }
- %>
- <option dir="auto" forbidden=<%=!allowed %> value="<%= personId %>" count="<%= count %>"><%= display %></option>
- <%
- }
- }
- }
- } else {
- ArrayList<String> rolePersons = new ArrayList<>();
- if (allRolesAndUsers != null && !allRolesAndUsers.isEmpty()) {
- String rolePersonsIds = allRolesAndUsers.get(roleId);
- String[] allIds = rolePersonsIds.split("~");
- for (int p = 0; p < allIds.length; p++) {
- rolePersons.add(allIds[p]);
- }
- }
- if ((rolesAndUsers != null && !rolesAndUsers.isEmpty()) || (defaultAndPersistentRolesAndUsers != null && !defaultAndPersistentRolesAndUsers.isEmpty())) {
- Logger.getLogger().trace("1. roleId = " + roleId);
- if (rolePersons != null && !rolePersons.isEmpty()) {
- ArrayList<String> personNames = new ArrayList<>();
- Hashtable<String, String> personIds = new Hashtable<>();
- Hashtable<String, String> counts = new Hashtable<>();
- for (int p = 0; p < rolePersons.size(); p++) {
- String personId = rolePersons.get(p);
- String personName = "";
- String count = "";
- PersonBean pBean = perManager.getPersonById(personId);
- if (pBean != null) {
- personName = pBean.getNameEx();
- personId = pBean.getId();
- count = "1";
- } else {
- OrgUnitBean ouBean = ouManager.getOrgUnitById(personId);
- if (ouBean != null) {
- personName = ouBean.getNameEx();
- personId = ouBean.getId();
- count = String.valueOf(ouBean.getNumberOfPersons());
- }
- }
- if (!personId.equals("")) {
- personNames.add(personName);
- personIds.put(personName, personId);
- counts.put(personName, count);
- }
- }
- Collections.sort(personNames);
- for (int p = 0; p < personNames.size(); p++) {
- String personName = personNames.get(p);
- String personId = personIds.get(personName);
- String count = counts.get(personName);
- String display = personName;
- PersonBean perb = perManager.getPersonById(personId);
- OrgUnitBean ouBean = ouManager.getOrgUnitByGroupName(personName, dfcSession.getDocbaseId());
- if (perb != null && allAbsentUsersIds.contains(perb.getId())) {
- String replacement = perb.getUserDelegation();
- if (replacement == null) {
- replacement = "";
- }
- PersonBean replacePB = perManager.getPersonByName(replacement, perb.getDocbaseId());
- if (replacePB == null || allAbsentUsersIds.contains(replacePB.getId())) {
- display += " (" + uiStrings.getLocalizedString("STR_ABSENT") + ", " + uiStrings.getLocalizedString("STR_NO_REPLACEMENT_DEFINED") + ")";
- } else {
- display += " (" + uiStrings.getLocalizedString("STR_ABSENT") + ", " + uiStrings.getLocalizedString("STR_REPLACED_BY") + " " + replacePB.getNameEx() + ")";
- }
- }
- boolean allowed = true;
- if (ouBean != null) {
- allowed = ouBean.isAllowed(dfcSession);
- }
- %>
- <option dir="auto" forbidden=<%=!allowed %> value="<%= personId %>" count="<%= count %>"><%= display %></option>
- <%
- }
- }
- }
- }
- %>
- </select>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <% if (fromMultipleMU) { %>
- <tr>
- <td colspan="3" class="labelFieldLeft">
- <input type="checkbox" name="append_<%= roleId %>" onclick="document.forms[0].elements['min_<%= roleId %>'].disabled = this.checked;" value="true"><%= uiStrings.getLocalizedString("STR_MANAGE_USERS_MULTIPLE_APPEND") %>
- </td>
- </tr>
- <tr>
- <td colspan="3">
- <table class="controlRow">
- <tr>
- <td class="labelFieldLeft" style="width: 50%;">
- <%= uiStrings.getLocalizedString("STR_MANAGE_USERS_MULTIPLE_MAX") %>:
- </td>
- <td class="controlFieldCenter" style="width:100px;">
- </td>
- <td class="labelFieldLeft" style="width: 50%;">
- <%= uiStrings.getLocalizedString("STR_MANAGE_USERS_MULTIPLE_MIN") %>:
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td colspan="3">
- <table class="controlRow">
- <tr>
- <td class="controlFieldLeft" style="width: 50%;">
- <select name="max_<%= roleId %>" class="controlLeft">
- <option value="LEAVE"><%= uiStrings.getLocalizedString("STR_MAX_LEAVE") %></option>
- <option value="TRIM"><%= uiStrings.getLocalizedString("STR_MAX_TRIM") %></option>
- </select>
- </td>
- <td class="controlFieldCenter" style="width:100px;">
- </td>
- <td class="controlFieldLeft" style="width: 50%;">
- <select name="min_<%= roleId %>" class="controlLeft">
- <option value="LEAVE"><%= uiStrings.getLocalizedString("STR_MIN_LEAVE") %></option>
- <option value="APPEND"><%= uiStrings.getLocalizedString("STR_MIN_APPEND") %></option>
- </select>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <%
- }
- %>
- <tr style="height:40px">
- <td>
- <table>
- <%
- String minUsersOutput = " ";
- String minUsersNoOutput = "";
- if (minUsers != 0) {
- minUsersNoOutput = String.valueOf(minUsers);
- minUsersOutput = minUsersText + ": ";
- }
- String maxUsersOutput = " ";
- String maxUsersNoOutput = "";
- if (maxUsers != -1) {
- maxUsersNoOutput = String.valueOf(maxUsers);
- maxUsersOutput = maxUsersText + ": ";
- }
- if (minUsers != 0) {
- %>
- <tr>
- <td class="labelFieldLeft" nowrap><%= minUsersOutput %></td><td class="labelFieldRight"><%= minUsersNoOutput %></td>
- </tr>
- <tr>
- <td class="labelFieldLeft" nowrap><%= maxUsersOutput %></td><td class="labelFieldRight"><%= maxUsersNoOutput %></td>
- </tr>
- <%
- }
- else {
- %>
- <tr>
- <td class="labelFieldLeft" nowrap><%= maxUsersOutput %></td><td class="labelFieldRight"><%= maxUsersNoOutput %></td>
- </tr>
- <tr>
- <td class="labelFieldLeft" nowrap><%= minUsersOutput %></td><td class="labelFieldRight"><%= minUsersNoOutput %></td>
- </tr>
- <%
- }
- %>
- </table>
- </td>
- </tr>
- </table>
- </div>
- <%
- }
- }
- %>
- </div>
- </div>
- <%
- if (wizardType == null) { %>
- <div id="buttonDiv" style="position:absolute; width:100%;">
- <table class="controlRow" cellpadding="3">
- <tr>
- <%
- String controlTitle = "";
- if (fromMultipleMU) {
- controlTitle = uiStrings.getLocalizedString("STR_APPLY_TO_ALL_RELATED_DOCUMENTS_MULTIPLE_MU");
- } else {
- controlTitle = uiStrings.getLocalizedString("STR_APPLY_TO_ALL_RELATED_DOCUMENTS");
- }
- if (relatedCollaboration) {
- controlTitle = "<span class=\"span-disabled\">" + controlTitle + " (" + uiStrings.getLocalizedString("STR_COLLABORATION_IN_PROGRESS") + ")</span>";
- }
- String width = "25%";
- if (!displayApplyCheckboxes) {
- width = "100%";
- } else if (!isVD && !(fromMultipleMU && hasVD)) {
- width = "50%";
- }
- %>
- <td style="width: 80%;">
- <div class="scrollBars" style="width: 100%;">
- <div>
- <% if (isVD && displayVdDescendOptionsDropdown && displayApplyCheckboxes) { %>
- <div class="labelFieldLeft" style="vertical-align: top; display: inline-block;">
- <label>
- <% if (vdCollaboration) { %>
- <span class="span-disabled"> <%= uiStrings.getLocalizedString("STR_CHOOSE_VD_DESCEND_OPTION") %> (<%= uiStrings.getLocalizedString("STR_COLLABORATION_IN_PROGRESS") %>)</span>
- <select name="vdDescendOptions" class="controlFieldLeft" style="vertical-align: middle;" onChange="toggleApplyToBindingText();">
- <option value="no_operation" selected="selected"><%= uiStrings.getLocalizedString(ProfileBean.allVdDescendOptions.get("no_operation")) %></option>
- </select>
- <% } else { %>
- <%= uiStrings.getLocalizedString("STR_CHOOSE_VD_DESCEND_OPTION") %>
- <select name="vdDescendOptions" class="controlFieldLeft" style="vertical-align: middle;" onChange="toggleApplyToBindingText();">
- <% if (pb != null) {
- if (pb.getAllowedVdDescendOptions() != null) {
- if (pb.getAllowedVdDescendOptions().size() > 1 && pb.getDefaultVdDescendOption().equals("")) {
- %>
- <option value=""></option>
- <%
- }
- for (int i = 0; i < pb.getAllowedVdDescendOptions().size(); i++) {
- String key = pb.getAllowedVdDescendOptions().get(i);
- %>
- <option value="<%= key %>" <% if (key.equals(pb.getDefaultVdDescendOption())) { out.print("selected"); } %>><%= uiStrings.getLocalizedString(ProfileBean.allVdDescendOptions.get(key)) %></option>
- <%
- }
- } else {
- %>
- <option value="no_operation" <% if (!pb.getApplyToAllVDDescendants()) { out.print("selected"); } %>><%= uiStrings.getLocalizedString(ProfileBean.allVdDescendOptions.get("no_operation")) %></option>
- <option value="replace_all" <% if (pb.getApplyToAllVDDescendants()) { out.print("selected"); } %>><%= uiStrings.getLocalizedString(ProfileBean.allVdDescendOptions.get("replace_all")) %></option>
- <%
- }
- } else {
- %>
- <option value="no_operation" selected><%= uiStrings.getLocalizedString(ProfileBean.allVdDescendOptions.get("no_operation")) %></option>
- <option value="replace_all"><%= uiStrings.getLocalizedString(ProfileBean.allVdDescendOptions.get("replace_all")) %></option>
- <%
- }
- %>
- </select>
- <% } %>
- </label>
- </div>
- <% } else if (fromMultipleMU && hasVD && displayApplyCheckboxes) { %>
- <div class="labelFieldLeft" style="vertical-align: top; white-space: nowrap; display: inline-block;">
- <label>
- <input type="checkbox" name="applyToVD" value="true" onClick="toggleApplyToBindingText();" style="vertical-align: middle;" <% if (vdCollaboration) { out.print("disabled"); } %>>
- <%
- if (vdCollaboration) {
- out.print("<span class=\"span-disabled\">" + uiStrings.getLocalizedString("STR_APPLY_TO_ALL_VD_DESCENDANTS_MULTIPLE_MU") + " (" + uiStrings.getLocalizedString("STR_COLLABORATION_IN_PROGRESS") + ")</span>");
- } else {
- out.print(uiStrings.getLocalizedString("STR_APPLY_TO_ALL_VD_DESCENDANTS_MULTIPLE_MU"));
- }
- %>
- </label>
- </div>
- <% } %>
- <div class="labelFieldLeft" id="applyBindingTextTd" style="display: none; vertical-align: top; white-space: nowrap;">
- <label>
- <input type="checkbox" name="applyToAllBindingTexts" value="true" style="vertical-align: middle;" <% if (pb != null && pb.getApplyToAllBindingTexts()) out.print("checked"); %> >
- <%= uiStrings.getLocalizedString("STR_APPLY_TO_ALL_BINDING_TEXTS") %>
- </label>
- </div>
- </div>
- <% if (displayApplyCheckboxes) { %>
- <div class="labelFieldLeft" style="vertical-align: top; white-space: nowrap; width: <%= width %>;">
- <label>
- <input type="checkbox" name="replaceAbsentUsers" value="true" style="vertical-align: middle;" <% if (!hasVisibleRoles) out.print("disabled"); %> <% if (pb != null && pb.getReplaceAbsentInWizardsAndManageUsers()) out.print("checked"); %>>
- <%= uiStrings.getLocalizedString("STR_REPLACE_ABSENT_USERS") %>
- </label>
- </div>
- <% } %>
- <%if (fromMultipleMU && hasVD && displayApplyCheckboxes && !vdCollaboration) { %>
- <div class="labelFieldLeft" style="vertical-align: top; white-space: nowrap; width: <%= width %>;">
- <label>
- <input type="checkbox" name="applyToAllDocuments" value="true" style="vertical-align: middle;" <% if (pb != null && pb.getApplyToAllDocuments()) out.print("checked"); %>>
- <%= uiStrings.getLocalizedString("STR_APPLY_TO_ALL_VD_DOCUMENTS_MULTIPLE_MU") %>
- </label>
- </div>
- <%} else if (isVD && displayApplyCheckboxes && !vdCollaboration){%>
- <div class="labelFieldLeft" style="vertical-align: top; white-space: nowrap; width: <%= width %>;">
- <label>
- <input type="checkbox" name="applyToAllDocuments" value="true" style="vertical-align: middle;" <% if (pb != null && pb.getApplyToAllDocuments()) out.print("checked"); %>>
- <%= uiStrings.getLocalizedString("STR_APPLY_TO_ALL_VD_DOCUMENTS") %>
- </label>
- </div>
- <%}%>
- <% if (displayApplyCheckboxes) { %>
- <div style="white-space: nowrap;">
- <div class="labelFieldLeft" style="vertical-align: top; white-space: nowrap; display: inline-block;">
- <label>
- <input type="checkbox" name="applyToAllRelatedDocuments" value="true" style="vertical-align: middle;" <%= applyToAllRelatedDocumentsChecked %> <% if (allowApplyToAllVDDescendantsOfRelatedDocuments || (fromMultipleMU && displayApplyCheckboxesForRelatedVDs)) out.print("onclick=\"toggleApplyToVDOfRelatedDocs();toggleAppendReplace();\""); else out.print("onclick=\"toggleAppendReplace();\"");%>>
- <%= controlTitle %>
- </label>
- </div>
- <div style="padding-left: 5px; white-space: nowrap; display: inline-block;">
- <div id="appendReplaceSpan" style="visibility: hidden;">
- <div class="controlFieldLeft" style="display: inline-block;">
- <label>
- (
- <input type="radio" name="applyToAllRelatedDocumentsMethod" style="vertical-align: middle; margin: 0px;" value="<%= WizardBean.APPLY_USERS_ROLES_TO_ALL_RELATED_APPEND %>" <% if (applyToAllRelatedDocumentsDefaultValue.equals(ProfileBean.APPLY_TO_ALL_RELATED_DOCUMENTS_DV_APPEND)) out.print("checked"); %>>
- <%= uiStrings.getLocalizedString("STR_APPEND") %>
- </label>
- </div>
- <div class="labelFieldRight" style="display: inline-block;"> </div>
- <div class="controlFieldLeft" style="display: inline-block;">
- <label>
- <input type="radio" name="applyToAllRelatedDocumentsMethod" style="vertical-align: middle; margin: 0px;" value="<%= WizardBean.APPLY_USERS_ROLES_TO_ALL_RELATED_REPLACE %>"<% if (applyToAllRelatedDocumentsDefaultValue.equals(ProfileBean.APPLY_TO_ALL_RELATED_DOCUMENTS_DV_REPLACE)) out.print("checked"); %>>
- <%= uiStrings.getLocalizedString("STR_REPLACE") %>)
- </label>
- </div>
- </div>
- </div>
- </div>
- <% if (allowApplyToAllVDDescendantsOfRelatedDocuments || (fromMultipleMU && displayApplyCheckboxesForRelatedVDs)) { %>
- <div id="applyToVDOfRelatedDocumentsTable" style="visibility: hidden;">
- <div class="labelFieldLeft" style="vertical-align: top; white-space: nowrap; display: inline-block;">
- <label>
- <input type="checkbox" name="applyToVDOfRelatedDocuments" value="true" style="vertical-align: middle;" <%= applyToAllVDDescendantsOfRelatedDocumentsChecked %> onClick="toggleApplyToBindingTextOfRelatedDocuments();">
- <%
- if (relatedVdCollaboration) {
- out.print("<span class=\"span-disabled\">" + uiStrings.getLocalizedString("STR_APPLY_TO_ALL_VD_DESCENDANTS_OF_RELATED_DOCUMENTS") + " (" + uiStrings.getLocalizedString("STR_COLLABORATION_IN_PROGRESS") + ")");
- } else {
- out.print(uiStrings.getLocalizedString("STR_APPLY_TO_ALL_VD_DESCENDANTS_OF_RELATED_DOCUMENTS"));
- }
- %>
- </label>
- </div>
- <div class="labelFieldLeft" id="applyBindingTextOfRelatedDocumentsTd" style="visibility: hidden; vertical-align: top; white-space: nowrap; display: inline-block;">
- <label>
- <input type="checkbox" name="applyToAllBindingTextsOfRelatedDocuments" value="true" style="vertical-align: middle;" <% if (applyToAllBindingTextsOfRelatedDocuments) out.print("checked"); %> >
- <%= uiStrings.getLocalizedString("STR_APPLY_TO_ALL_BINDING_TEXTS_OF_RELATED_DOCUMENTS") %>
- </label>
- </div>
- </div>
- <% } %>
- <% } %>
- </div>
- </td>
- <td style="width: 20%; text-align: right; vertical-align: bottom; white-space: nowrap;">
- <input type="button" name="cancelButt" class="button secondary-button" value="<%=uiStrings.getLocalizedString("STR_CANCEL")%>" style="width:60px; height:24px" onclick="cancelActiveConnections(); closeDialog(); return false;"> <input type="button" name="finishButt" <% if (!hasVisibleRoles) out.print("disabled"); %> class="button primary-button" value="<%=uiStrings.getLocalizedString("STR_OK")%>" style="width:60px; height:24px" onclick="checkIfHaveChanges();checkIfChangeDescendants(); return false;">
- </td>
- </tr>
- </table>
- </div>
- <% } else { %>
- <div id="buttonDiv" style="position:absolute; width:100%;">
- <table class="controlRow" cellpadding="3">
- <tr>
- <td style="width: 65%;">
- <div class="scrollBars" style="width: 100%;">
- <div>
- <%
- if (isVD && displayVdDescendOptionsDropdown && (copyBinders.equals("true") || prepareForClone.equalsIgnoreCase("true"))) {
- %>
- <div class="hLabelFieldLeft" style="vertical-align: middle; display: inline-block;">
- <label>
- <%= uiStrings.getLocalizedString("STR_CHOOSE_VD_DESCEND_OPTION") %>
- <select name="vdDescendOptions" class="controlFieldLeft" style="vertical-align: middle;" onChange="toggleApplyToBindingText();">
- <% if (pb != null) {
- if (pb.getAllowedVdDescendOptions() != null) {
- if (pb.getAllowedVdDescendOptions().size() > 1 && pb.getDefaultVdDescendOption().equals("")) {
- %>
- <option value=""></option>
- <%
- }
- for (int i = 0; i < pb.getAllowedVdDescendOptions().size(); i++) {
- String key = pb.getAllowedVdDescendOptions().get(i);
- %>
- <option value="<%= key %>" <% if (key.equals(pb.getDefaultVdDescendOption())) { out.print("selected"); } %>><%= uiStrings.getLocalizedString(ProfileBean.allVdDescendOptions.get(key)) %></option>
- <%
- }
- } else {
- %>
- <option value="no_operation" <% if (!pb.getApplyToAllVDDescendants()) { out.print("selected"); } %>><%= uiStrings.getLocalizedString(ProfileBean.allVdDescendOptions.get("no_operation")) %></option>
- <option value="replace_all" <% if (pb.getApplyToAllVDDescendants()) { out.print("selected"); } %>><%= uiStrings.getLocalizedString(ProfileBean.allVdDescendOptions.get("replace_all")) %></option>
- <%
- }
- } else {
- %>
- <option value="no_operation" selected><%= uiStrings.getLocalizedString(ProfileBean.allVdDescendOptions.get("no_operation")) %></option>
- <option value="replace_all"><%= uiStrings.getLocalizedString(ProfileBean.allVdDescendOptions.get("replace_all")) %></option>
- <%
- }
- %>
- </select>
- </label>
- </div>
- <div id="applyBindingTextTd" style="display: none;">
- <div class="hLabelFieldLeft" style="width: 30px; white-space: nowrap; vertical-align: middle;">
- <label>
- <input type="checkbox" name="applyToAllBindingTexts" style="height: 18px; vertical-align: middle;" value="true" <% if (Profiles.getInstance(language).getProfileById(profileId).getApplyToAllBindingTexts()) out.print("checked"); %>>
- <%= uiStrings.getLocalizedString("STR_APPLY_TO_ALL_BINDING_TEXTS") %>
- </label>
- </div>
- </div>
- <%
- }
- %>
- <div class="hLabelFieldLeft" style="width: 30px; white-space: nowrap; vertical-align: middle;">
- <label>
- <input type="checkbox" name="replaceAbsentUsers" value="true" style="height: 18px; vertical-align: middle;" <% if (Profiles.getInstance(language).getProfileById(profileId).getReplaceAbsentInWizardsAndManageUsers()) out.print("checked"); %>>
- <%= uiStrings.getLocalizedString("STR_REPLACE_ABSENT_USERS") %>
- </label>
- </div>
- </div>
- </div>
- </td>
- <td nowrap style="vertical-align: top; text-align: right; width: 35%;">
- <script>
- function wizardFinish(flag) {
- disableSubmitButton();
- if (checkNumberOfUsers('<%= personIdsJson %>') && checkVdDescendOption()) {
- checkIfHaveChanges();
- setSelectedTab(1);
- previousNesxtStep('<%= contextPath + jspPath %>wizard/validateUsers.jsp?manageRelatedDocuments=' + flag);
- } else {
- enableSubmitButton();
- }
- }
- </script>
- <%
- if (wb.hasRelations(chosenWizType)) {
- %>
- <input type="button" name="backButt" class="button" value="<%= uiStrings.getLocalizedString("STR_BACK_BUTTON") %>" style="min-width: 60px; height: 24px;" onclick="setSelectedTab(1); previousNesxtStep('<%= contextPath + jspPath %>actions/properties/objectPropertiesNew.jsp');"> <input type="button" name="finishButt" class="button" value="<%= uiStrings.getLocalizedString("STR_FORWARD_BUTTON") %>" style="min-width: 60px; height: 24px;" onclick="wizardFinish(true)"> <input type="button" name="cancelButt" class="button secondary-button" value="<%= uiStrings.getLocalizedString("STR_CANCEL") %>" style="min-width: 60px; height: 24px;" onclick="<%= cancelBtnAction %>"><% if (wizardQuickFinishEnabledBoolean) { %> <input type="button" name="quickFinishButt" class="button primary-button" value="<%= uiStrings.getLocalizedString("STR_FINISH") %>" style="min-width:60px; height: 24px;" onclick="startWizardQuickFinish();"/><% } %>
- <%
- } else {
- %>
- <input type="button" name="backButt" class="button" value="<%= uiStrings.getLocalizedString("STR_BACK_BUTTON") %>" style="min-width: 60px; height: 24px;" onclick="setSelectedTab(1); previousNesxtStep('<%= contextPath + jspPath %>actions/properties/objectPropertiesNew.jsp?rootObjectId=<%= rootObjectId %>');"> <input type="button" name="cancelButt" class="button secondary-button" value="<%= uiStrings.getLocalizedString("STR_CANCEL") %>" style="min-width: 60px; height: 24px;" onclick="<%= cancelBtnAction %>"> <input type="button" name="finishButt" class="button primary-button" value="<%= uiStrings.getLocalizedString("STR_FINISH") %>" style="min-width: 60px; height: 24px;" onclick="wizardFinish(false)">
- <%
- }
- %>
- </td>
- </tr>
- </table>
- </div>
- <% } %>
- </div>
- </form>
- <form id="usersForm" name="usersForm" method="post" action="<%= contextPath + jspPath %>wizard/users.jsp" target="backgroundActivitiesFrame">
- <input type="hidden" name="isAutomationWizard" value="<%= isAutomationWizard %>">
- <input type="hidden" name="isB2BMessageWizard" value="<%= isB2BMessageWizard %>">
- <input type="hidden" name="automationPerformer" value="<%= automationPerformer %>">
- <input type="hidden" name="automationLogLevel" value="<%= automationLogLevel %>">
- <input type="hidden" name="automationRule" value="<%= automationRule %>">
- <input type="hidden" name="automationBlockingRule" value="<%= automationBlockingRule %>">
- <input type="hidden" name="automationObjectIds" value="<%= automationObjectIds %>">
- <input type="hidden" name="automationDescription" value="<%= automationDescription %>">
- <input type="hidden" name="automationWorkspaceViewRefresh" value="<%= automationWorkspaceViewRefresh %>">
- <input type="hidden" name="B2BEntityIds" value="<%= B2BEntityIds %>">
- <input type="hidden" name="B2BExplicitEntityIds" value="<%= B2BExplicitEntityIds %>">
- <input type="hidden" name="B2BconfigId" value="<%= B2BconfigId %>">
- <input type="hidden" name="B2BSendDirectly" value="<%= B2BSendDirectly %>">
- <input type="hidden" name="isPagingActive" value="true">
- <input type="hidden" name="start" value="0">
- <input type="hidden" name="count" value="50">
- <input type="hidden" name="currentUserId" value="<%= currUserId%>">
- <input type="hidden" name="groupId" value="<%= currentUserGroupId%>">
- <input type="hidden" name="formName" value="wizard3Form">
- <input type="hidden" name="elemName" value="">
- <input type="hidden" name="hidePrivateGroups" value="true">
- <input type="hidden" name="filterBy" value="">
- <input type="hidden" name="showReplacementForAbsent" value="true">
- <input type="hidden" name="hideInactiveUsers" value="true">
- <input type="hidden" name="profileId" value="<%= profileId %>">
- <input type="hidden" name="roleId" value="">
- <input type="hidden" name="objectId" value="<%= objectId %>">
- <% if (wizardType != null) {
- Enumeration<Object> enumer = paramsAndValues.keys();
- while (enumer.hasMoreElements()) {
- String paramName = (String)enumer.nextElement();
- String paramValue = (String)paramsAndValues.get(paramName);
- %>
- <input type="hidden" name="attr_<%= paramName %>" value="<%= paramValue %>">
- <%
- }
- }
- %>
- </form>
- <form name="msgboxForm" method="post" action="<%= contextPath + jspPath %>msgbox/start.jsp">
- <input type="hidden" name="msgboxTitle" value="">
- <input type="hidden" name="msgboxText" value="">
- <input type="hidden" name="msgboxWidth" value="400">
- <input type="hidden" name="msgboxHeight" value="200">
- <input type="hidden" name="msgboxIcon" value="other/exclamation_32.gif">
- <input type="hidden" name="msgboxButtons" value="<%= new Integer(MSGBOX_OK) %>">
- </form>
- <%
- // pmi
- int counter = 0;
- if (listRoles.size() > 0) {
- String listOfRoles = "";
- for(counter=0; counter<listRoles.size(); counter++) {
- listOfRoles = listOfRoles + "~" + listRoles.get(counter);
- }
- %>
- <script>
- function checkIfHaveChanges() {
- var allRoles = "<%= listRoles%>",
- newValues = "",
- absentUsers = <%= gson.toJson(absentPersons) %>,
- hasAbsentInput = document.forms['wizard3Form'].elements['hasAbsentUser'],
- roleValue, hasAbsent;
- allRoles = allRoles.slice(1, allRoles.length -1);
- var listRoles = allRoles.split(", ");
- for (var i = 0; i < listRoles.length; i++) {
- var role = "persons_" + listRoles[i];
- var tempUser = "";
- for (var j = 0; j < document.forms['wizard3Form'].elements[role].options.length; j++) {
- roleValue = document.forms['wizard3Form'].elements[role].options[j].value;
- tempUser = tempUser + ", " + roleValue;
- if (absentUsers.indexOf(roleValue) > -1 && !hasAbsent) {
- hasAbsent = true;
- hasAbsentInput.value = 'true';
- }
- }
- tempUser = tempUser.slice(2, tempUser.length);
- newValues = newValues + "~~" + listRoles[i] + "~" + tempUser;
- }
- newValues = newValues.slice(2, newValues.length);
- document.forms['wizard3Form'].elements['newValues'].value = newValues;
- }
- </script>
- <%
- }
- %>
- <script>
- var listOfRoles = "[<%= rolesIds.toString() %>]",
- currentUserGroupId = "<%= currentUserGroupId %>",
- objectId = "<%= objectId %>",
- profileId = "<%= profileId %>",
- language = "<%= language %>",
- currUserId = "<%= currUserId %>",
- paramsAndValues = '<%= StringEscapeUtils.escapeJavaScript(gson.toJson(paramsAndValues)) %>';
- function copyOldValues() {
- <%
- if (listRoles.size() > 0) {
- %>
- var allRoles = "<%= listRoles %>";
- var oldValues = "";
- allRoles = allRoles.slice(1, allRoles.length -1);
- var listRoles = allRoles.split(", ");
- for (var i = 0; i < listRoles.length; i++) {
- var role = "persons_" + listRoles[i];
- var tempUser = "";
- for (var j = 0; j < document.forms['wizard3Form'].elements[role].options.length; j++) {
- tempUser = tempUser + ", " + document.forms['wizard3Form'].elements[role].options[j].value;
- }
- tempUser = tempUser.slice(2, tempUser.length);
- oldValues = oldValues + "~~" + listRoles[i] + "~" + tempUser;
- }
- oldValues = oldValues.slice(2, oldValues.length);
- document.forms['wizard3Form'].elements['oldValues'].value = oldValues;
- <%
- }
- %>
- }
- dojo.require("dijit.form.ComboBox");
- dojo.require("dojo.data.ItemFileWriteStore");
- dojo.registerModulePath("scripts", "../..");
- dojo.require("scripts.ManageUsersDataStore");
- // retrieves data for unselected list (left side) of multiselect from server
- function getUnselectedData(selectName, elemName, flagId, filter) {
- var usersForm = document.forms['usersForm'];
- if (flagId != null) {
- usersForm.filterBy.value = document.forms[0].elements['filterByStr' + flagId].value;
- } else {
- usersForm.filterBy.value = document.forms[0].elements['filterByStr'].value;
- }
- usersForm.elemName.value = elemName;
- if (usersForm.elements['roleId']) {
- usersForm.elements['roleId'].value = flagId;
- }
- if (filter) {
- usersForm.start.value = '0';
- localState[flagId].page = 1;
- } else {
- if (localState[flagId].page < 3) {
- usersForm.start.value = ((localState[flagId].page - 1) * localState[flagId].pageSize) + '';
- } else {
- usersForm.start.value = ((localState[flagId].page - 1) * localState[flagId].pageSize) - (localState[flagId].page - 2) + '';
- }
- }
- if (dijit.byId('orgUnits_' + flagId).item === null && dijit.byId('orgUnits_' + flagId)._selectedItem) {
- document.forms['usersForm'].groupId.value = dijit.byId('orgUnits_' + flagId)._selectedItem.value;
- } else if (dijit.byId('orgUnits_' + flagId).item) {
- document.forms['usersForm'].groupId.value = dijit.byId('orgUnits_' + flagId).item.i.value;
- }
- var loadingNode = dojo.byId('loading_' + flagId);
- var xhrArgs = {
- form: dojo.byId("usersForm"),
- handleAs: "text",
- load: function(data) {
- var d = dojo.fromJson(data);
- localState[flagId].activeConnection = null;
- localState[flagId].isCurrentUserAllowed = d.isCurrentUserAllowed;
- if (!isCurrentUserChecked) {
- dojo.byId('tab' + flagId).onfocus();
- isCurrentUserChecked = true;
- }
- buildOptions(flagId, elemName, d.items);
- disableUserButt('wizard3Form', 'persons_' + flagId, 'addCurrUser_' + flagId, 'remCurrUser_' + flagId, null, currUserId, checkIfCurrentUserIsAllowed(flagId));
- dojo.fadeOut({
- node: loadingNode,
- onEnd: function() {
- dojo.style(loadingNode, "display", "none");
- },
- duration: 500
- }).play();
- },
- error: function(error) {
- }
- };
- dojo.style(loadingNode, "display", "block");
- dojo.fadeIn({
- node: loadingNode,
- duration: 10
- }).play();
- // if we have a connection active, it should be closed before creating a new one
- if (localState[flagId].activeConnection !== null) {
- localState[flagId].activeConnection.cancel();
- }
- var deferred = dojo.xhrPost(xhrArgs);
- localState[flagId].activeConnection = deferred;
- };
- // creates option elements for unselected list (called after successfull data retrieval from server)
- function buildOptions(roleId, elemName, inputArr) {
- var html = '',
- page = localState[roleId].page,
- pageSize = localState[roleId].pageSize,
- form = document.forms['wizard3Form'],
- selectNode = form.elements[elemName];
- selectNode.innerHTML = "";
- setTimeout(function() {
- var counter = 0;
- if (page > 1) {
- // PREVIOUS PAGE OPTION
- selectNode.options[counter] = new Option();
- selectNode.options[counter].value = "--";
- selectNode.options[counter].text = '<%= STR_PREVIOUS_PAGE %>';
- counter++;
- }
- for (var i = 0; i < inputArr.length; i = i + 3) {
- if (pageSize > counter) {
- var id = inputArr[i];
- var name = inputArr[i+1];
- var count = inputArr[i+2];
- selectNode.options[counter] = new Option();
- selectNode.options[counter].value = id;
- selectNode.options[counter].text = name;
- selectNode.options[counter].setAttribute('count', count);
- selectNode.options[counter].setAttribute('dir', 'auto');
- counter++;
- } else {
- // NEXT PAGE OPTION
- selectNode.options[counter] = new Option();
- selectNode.options[counter].value = "++";
- selectNode.options[counter].text = '<%= STR_NEXT_PAGE %>';
- break;
- }
- }
- }, 50);
- }
- dojo.addOnLoad(function() {
- var roles = dojo.fromJson(listOfRoles),
- personsValuesNode, personsNode;
- if (roles.length) {
- dojo.byId('tab' + roles[0]).onfocus();
- for (var i = 0; i < roles.length; i++) {
- personsValuesNode = document.getElementsByName('personsValues_' + roles[i])[0];
- personsValuesNode.style.height = personsValuesNode.offsetHeight + 'px';
- personsNode = document.getElementsByName('persons_' + roles[i])[0];
- personsNode.style.height = personsNode.offsetHeight + 'px';
- }
- }
- // create store and combobox for each role
- dojo.forEach(roles, function(role) {
- var jsonStore = new custom.ManageUsersDataStore({
- url: contextPath + "/jsp/explorer/actions/manageusers",
- profileId: profileId,
- objectId: objectId,
- currentUserGroupId: currentUserGroupId,
- roleId: role,
- language: language,
- paramsAndValues: paramsAndValues
- });
- var cb = new dijit.form.ComboBox({
- style: "width: 100%;",
- store: jsonStore,
- pageSize: 20,
- activePage: 1,
- autoComplete: false,
- searchDelay: 500,
- isDefaultInitialized: false,
- isLocalizationInitialized: false,
- onChange: function(newValue) {
- localState[role].page = 1;
- var val = newValue,
- id = "",
- matcher = new RegExp("^" + val + "$");
- dojo.forEach(this.store._items, function(item) {
- if (item.i.name === val) {
- id = item.i.value;
- }
- });
- if (this._selectedItem.name === val) {
- id = this._selectedItem.value;
- }
- if (id === '') {
- this._selectedItem.value = '';
- }
- document.forms['usersForm'].groupId.value = id;
- getUnselectedData('orgUnits_' + role, 'personsValues_' + role, role);
- },
- isLoaded: function() {
- return true;
- },
- _openResultList: function() {
- if (!this.isLocalizationInitialized) {
- // handle previous and next button localization
- this.dropDown.previousButton.innerHTML = '<%= STR_PREVIOUS_PAGE %>';
- this.dropDown.nextButton.innerHTML = '<%= STR_NEXT_PAGE %>';
- this.isLocalizationInitialized = true;
- }
- this.inherited("_openResultList", arguments);
- },
- _showResultList: function() {
- var self = this;
- if (this.isInitialized) { // check to see if we can open dropdown or not
- this.inherited("_showResultList", arguments);
- } else {
- this._resolveData();
- }
- },
- postCreate: function() {
- var self = this;
- this.isInitialized = false;
- dojo.connect(this.store, "_filterResponse", function(data) {
- if (!self.isDefaultInitialized) {
- if (data.selectedItem) {
- self._selectedItem = data.selectedItem;
- self.set('displayedValue', data.selectedItem.name);
- } else {
- if (data.items.length) {
- var firstItem = data.items[0];
- self._selectedItem = firstItem;
- self.set('displayedValue', firstItem.name);
- }
- }
- self.isDefaultInitialized = true;
- }
- });
- this.loadingNode = dojo.place("<div style='position: absolute; top: 0px; bottom: 0px; left: 0px; width: 100%; background-color: #fff; text-align: center;'><%= STR_LOADING %></div>", this.domNode, "last");
- this.inherited("postCreate", arguments);
- },
- _resolveData: function() {
- var self = this;
- // hide loading indicator
- dojo.fadeOut({
- node: self.loadingNode,
- onEnd: function() {
- dojo.style(self.loadingNode, "display", "none");
- },
- duration: 500
- }).play();
- self.isInitialized = true;
- }
- }, 'orgUnits_' + role);
- // trigger combobox data load
- cb.loadDropDown();
- cb.focusNode.setAttribute('dir', 'auto')
- });
- });
- function getItemOnLoad(element) {
- var id = "";
- dojo.forEach(element.store._items, function(item) {
- if (item.i.name === element.displayedValue) {
- id = item.i.value;
- }
- });
- return id;
- }
- function onOptionAdd(formName, srcName, destName, addNameButt, srcPropName, isSingleClick) {
- var srcFormRef = document.forms[formName].elements[srcName],
- roleId = srcName.split('_')[1];
- for (i = srcFormRef.length - 1; i >= 0; i--) {
- if (srcFormRef.options[i].selected && srcFormRef.options[i].value === '++') {
- localState[roleId].page = localState[roleId].page + 1;
- getUnselectedData('', srcName, roleId);
- break;
- } else if (srcFormRef.options[i].selected && srcFormRef.options[i].value === '--') {
- localState[roleId].page = localState[roleId].page - 1;
- getUnselectedData('', srcName, roleId);
- break;
- }
- }
- if (isSingleClick === undefined) {
- addOption(formName, srcName, destName, addNameButt, srcPropName);
- }
- }
- // check if current user is allowed in passed role
- // returning specific format required by 'disableUserButt' function defined in dialog.js
- function checkIfCurrentUserIsAllowed(roleId) {
- if (localState && localState[roleId]) {
- var isAllowed = localState[roleId].isCurrentUserAllowed,
- currentUserId = '<%= currUserId %>';
- if (isAllowed) {
- return '[' + currentUserId + ']';
- } else {
- return '[]';
- }
- } else {
- return '[]';
- }
- }
- function cancelActiveConnections() {
- for (var key in localState) {
- if (localState.hasOwnProperty(key)) {
- if (localState[key].activeConnection !== null) {
- localState[key].activeConnection.cancel();
- }
- }
- }
- }
- <% if (wizardType == null) { %>
- document.addEventListener("DOMContentLoaded", function() {
- initDoc3(<%= rolesIds.toString() %>);
- if (window.name === 'backgroundActivitiesFrame') {
- var backDiv = top.document.getElementById('backgroundActivitiesDiv'),
- backFrame;
- if (backDiv) {
- backDiv.style.visibility = 'visible';
- backDiv.style.display = 'block';
- backDiv.style.zIndex = 99999999999999;
- backFrame = backDiv.firstElementChild;
- }
- if (backFrame) {
- backFrame.style.visibility = 'visible';
- }
- }
- initTabsEx('rolesDialog', 'mpcWizard', 980, null, 80, onDialogInit, false, 29);
- document.getElementById('mpcWizard').initializeTabs();
- initCheckboxes();
- copyOldValues();
- disableDropDown();
- top.operationProgressEnd();
- }, false);
- <% } else { %>
- var validationFailedMsg = "<%= StringEscapeUtils.escapeJavaScript(validationFailedMsg) %>";
- var numberOfUsersMsg = "<%= StringEscapeUtils.escapeJavaScript(uiStrings.getLocalizedString("STR_NUMBER_OF_USERS_MSG")) %>: ";
- function toggleApplyToBindingText() {
- var t = 1;
- }
- function initApplyToVD() {
- if (document.forms[0].elements['vdDescendOptions']) {
- document.all['applyBindingTextTd'].style.visibility = 'visible';
- document.all['applyBindingTextTd'].style.display = 'table-row';
- }
- }
- function closePreview() {
- var tmpPreviewWindow = getPreviewWindow();
- if (tmpPreviewWindow != null) {
- tmpPreviewWindow.close();
- try {
- for(var i = 0; i < top.previewWindows.length; i++) {
- if (top.previewWindows[i] == tmpPreviewWindow) {
- top.previewWindows.splice(i, 1);
- }
- }
- } catch (e) {}
- var scrW = window.screen.availWidth;
- var scrH = window.screen.availHeight;
- top.resizeTo(scrW, scrH);
- top.moveTo(0, 0);
- }
- }
- function getPreviewWindow() {
- try {
- for (var i = 0; top.previewWindows != undefined && i < top.previewWindows.length; i++) {
- if (top.previewWindows[i].name == "previewWindowName") {
- return top.previewWindows[i];
- }
- }
- } catch (e) {
- return null;
- }
- return null;
- }
- function disableSubmitButton() {
- var buttonOk = document.forms['wizard3Form'].elements['finishButt'];
- buttonOk.disabled = true;
- return true;
- }
- function enableSubmitButton() {
- var buttonOk = document.forms['wizard3Form'].elements['finishButt'];
- buttonOk.disabled = false;
- return true;
- }
- function startWizardQuickFinish() {
- top.startWizardQuickFinish();
- tryAutoSubmit();
- }
- function tryAutoSubmit() {
- if (top && (top.isQuickFinishActive)) {
- document.getElementsByName('finishButt')[0].onclick();
- }
- }
- document.addEventListener("DOMContentLoaded", function() {
- var isBulkImport = <%= isBulkImport %>,
- fileName = '<%= StringEscapeUtils.escapeJavaScript(fileName) %>';
- initDoc3(<%= rolesIds.toString() %>);
- <%= dialogInitStr %>initApplyToVD();
- initTabsEx('rolesDialog', 'mpcWizard', 980, null, 80, onDialogInit, false, 29);
- document.getElementById('mpcWizard').initializeTabs();
- copyOldValues();
- disableDropDown();
- top.operationProgressEnd();
- if (isBulkImport && fileName) {
- document.getElementById('titleBar').innerHTML += ' - ' + fileName;
- }
- <% if (validationFailed) {
- out.print("top.stopWizardQuickFinish(); alert(validationFailedMsg);");
- } else { %> tryAutoSubmit(); <% } %>
- }, false);
- <% } %>
- </script>
- </body>
- </html>
- <%
- Logger.getLogger().trace("END");
- %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement