Salvatore La Manna 4 anni fa
parent
commit
304e54eef0
  1. 73
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_instances/render_history_form_task.jsp
  2. 2
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_instances/workflow_logs.jspf
  3. 516
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_instances/workflow_task_action.jsp
  4. 698
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_tasks/edit_workflow_task.jsp
  5. 681
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_tasks/render_form_task.jsp
  6. 590
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_tasks/workflow_task_action.jsp

73
liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_instances/render_history_form_task.jsp

@ -1,38 +1,37 @@
<%@page import="com.liferay.portal.kernel.language.LanguageUtil"%>
<%@page import="java.io.Serializable"%>
<%@page import="java.util.Map.Entry"%>
<%@page import="java.util.ArrayList"%>
<%@ include file="/html/portlet/workflow_instances/init.jsp" %>
<%
Map<String, Serializable> parameters = (Map<String, Serializable>) renderRequest.getAttribute("parameters");
%>
<liferay-ui:search-container
emptyResultsMessage="label-portos-kaleo-there-are-no-results" >
<liferay-ui:search-container-results
results="<%= new ArrayList<Entry<String, Serializable>>(parameters.entrySet()) %>"
total="<%= parameters.size() %>" />
<liferay-ui:search-container-row
className="java.util.Map.Entry"
modelVar="entry">
<liferay-ui:search-container-column-text name="label-portos-kaleo-key">
<%=LanguageUtil.get(pageContext, (String)entry.getKey()) %>
</liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="label-portos-kaleo-value">
<%= entry.getValue() %>
</liferay-ui:search-container-column-text>
</liferay-ui:search-container-row>
<liferay-ui:search-iterator paginate="<%= false %>" />
<%@page import="com.liferay.portal.kernel.language.LanguageUtil"%>
<%@page import="java.io.Serializable"%>
<%@page import="java.util.Map.Entry"%>
<%@page import="java.util.ArrayList"%>
<%@ include file="/html/portlet/workflow_instances/init.jsp" %>
<%
Map<String, Serializable> parameters = (Map<String, Serializable>) renderRequest.getAttribute("parameters");
%>
<liferay-ui:search-container
emptyResultsMessage="label-portos-kaleo-there-are-no-results" >
<liferay-ui:search-container-results
results="<%= new ArrayList<Entry<String, Serializable>>(parameters.entrySet()) %>"
total="<%= parameters.size() %>" />
<liferay-ui:search-container-row
className="java.util.Map.Entry"
modelVar="entry">
<liferay-ui:search-container-column-text name="label-portos-kaleo-key">
<%=LanguageUtil.get(pageContext, (String)entry.getKey()) %>
</liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="label-portos-kaleo-value">
<%= entry.getValue() %>
</liferay-ui:search-container-column-text>
</liferay-ui:search-container-row>
<liferay-ui:search-iterator paginate="<%= false %>" />
</liferay-ui:search-container>

2
liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_instances/workflow_logs.jspf

@ -28,7 +28,7 @@
<tr>
<th class="head-date text-center">Data</th>
<th class="head-description">Descrizione</th>
<th class="head-activity text-center">Attività</th>
<th class="head-activity text-center">Attività</th>
<th class="head-comment text-center">Commento</th>
</tr>
</thead>

516
liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_instances/workflow_task_action.jsp

@ -1,259 +1,259 @@
<%--
/**
* Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
--%>
<%@ include file="/html/portlet/workflow_instances/init.jsp" %>
<%
String randomId = StringUtil.randomId();
ResultRow row = (ResultRow)request.getAttribute(WebKeys.SEARCH_CONTAINER_RESULT_ROW);
WorkflowTask workflowTask = (WorkflowTask)row.getObject();
%>
<liferay-ui:icon-menu>
<c:if test="<%= portletName.equals(PortletKeys.WORKFLOW_DEFINITIONS) && !workflowTask.isCompleted() && !_isAssignedToUser(workflowTask, user) %>">
<portlet:actionURL var="assignToMeURL">
<portlet:param name="struts_action" value="/workflow_instances/edit_workflow_instance_task" />
<portlet:param name="<%= Constants.CMD %>" value="<%= Constants.ASSIGN %>" />
<portlet:param name="redirect" value="<%= currentURL %>" />
<portlet:param name="workflowTaskId" value="<%= String.valueOf(workflowTask.getWorkflowTaskId()) %>" />
<portlet:param name="assigneeUserId" value="<%= String.valueOf(user.getUserId()) %>" />
</portlet:actionURL>
<liferay-ui:icon
cssClass='<%= "workflow-task-" + randomId + " task-assign-to-me-link" %>'
image="assign"
message="assign-to-me"
method="get"
url="<%= assignToMeURL %>"
/>
</c:if>
<c:if test="<%= !workflowTask.isCompleted() && _isAssignedToUser(workflowTask, user) %>">
<%
List<String> transitionNames = WorkflowTaskManagerUtil.getNextTransitionNames(company.getCompanyId(), user.getUserId(), workflowTask.getWorkflowTaskId());
for (String transitionName : transitionNames) {
String message = "proceed";
if (Validator.isNotNull(transitionName)) {
message = transitionName;
}
%>
<portlet:actionURL var="editURL">
<portlet:param name="struts_action" value="/workflow_instances/edit_workflow_instance_task" />
<portlet:param name="<%= Constants.CMD %>" value="<%= Constants.SAVE %>" />
<portlet:param name="redirect" value="<%= currentURL %>" />
<portlet:param name="workflowTaskId" value="<%= StringUtil.valueOf(workflowTask.getWorkflowTaskId()) %>" />
<portlet:param name="assigneeUserId" value="<%= StringUtil.valueOf(workflowTask.getAssigneeUserId()) %>" />
<c:if test="<%= transitionName != null %>">
<portlet:param name="transitionName" value="<%= transitionName %>" />
</c:if>
</portlet:actionURL>
<portlet:renderURL var="renderFormURL" windowState="<%= LiferayWindowState.POP_UP.toString() %>">
<portlet:param name="struts_action" value="/workflow_tasks/render_form_task" />
<portlet:param name="formName" value='<%= "fm_"+ randomId %>' />
<portlet:param name="workflowTaskId" value="<%= StringUtil.valueOf(workflowTask.getWorkflowTaskId()) %>" />
<portlet:param name="assigneeUserId" value="<%= StringUtil.valueOf(workflowTask.getAssigneeUserId()) %>" />
<c:if test="<%= transitionName != null %>">
<portlet:param name="transitionName" value="<%= transitionName %>" />
</c:if>
</portlet:renderURL>
<portlet:resourceURL var="validationURL">
<portlet:param name="struts_action" value="/workflow_tasks/render_form_task" />
<portlet:param name="workflowTaskId" value="<%= StringUtil.valueOf(workflowTask.getWorkflowTaskId()) %>" />
<portlet:param name="assigneeUserId" value="<%= StringUtil.valueOf(workflowTask.getAssigneeUserId()) %>" />
<c:if test="<%= transitionName != null %>">
<portlet:param name="transitionName" value="<%= transitionName %>" />
</c:if>
</portlet:resourceURL>
<%
Map<String, Object> data = new HashMap<String, Object>();
data.put("href-validation", validationURL);
data.put("href-render-form", renderFormURL);
%>
<liferay-ui:icon
cssClass='<%= "workflow-task-" + randomId + " task-change-status-link" %>'
image="../aui/random"
message="<%= message %>"
method="get"
url="<%= editURL %>"
data="<%= data %>"
/>
<%
}
%>
</c:if>
</liferay-ui:icon-menu>
<div class="hide" id="<%= randomId %>updateComments">
<%-- hook tref-ekaleo --%>
<div id="<%= randomId %>formError"></div>
<div id="<%= randomId %>form"></div>
<aui:input cols="105" name="comment" rows="10" type="textarea" />
</div>
<aui:script use="aui-io-plugin-deprecated,liferay-util-window">
var showPopup = function(url, title, renderFormURL, validationURL) {
var form = A.Node.create('<form />');
form.setAttribute('action', url);
form.setAttribute('method', 'POST');
var comments = A.one('#<%= randomId %>updateComments');
if (comments) {
form.append(comments);
comments.show();
}
// reset
var formDiv = A.one('#<%= randomId %>form');
if (formDiv) {
formDiv.empty();
}
var formErrorDiv = A.one('#<%= randomId %>formError');
if (formErrorDiv) {
formErrorDiv.empty();
}
var dialog = Liferay.Util.Window.getWindow(
{
dialog: {
bodyContent: form,
height: 620,
toolbars: {
footer: [
{
label: Liferay.Language.get('ok'),
on: {
click: function() {
if (!validationURL) {
submitForm(form);
} else {
A.one('#<%= randomId %>formError').empty();
A.io.request(validationURL, {
method: 'POST',
dataType: 'json',
on: {
start: function() {
A.one('#<%= randomId %>updateComments').loadingmask.show();
A.all('.modal-footer').each(function(item, index, collection) {
item.all('button').each(function(item, index, collection) {
item.set('disabled', true);
item.setStyle('opacity', 0.5);
});
});
},
complete: function() {
A.one('#<%= randomId %>updateComments').loadingmask.hide();
},
success: function() {
var responseData = this.get('responseData');
if (responseData.valid) {
submitForm(form);
} else {
var message = "<div class='alert alert-error'>" + Liferay.Language.get(responseData.message) + "</div>";
A.one('#<%= randomId %>formError').html(message);
}
A.all('.modal-footer').each(function(item, index, collection) {
item.all('button').each(function(item, index, collection) {
item.set('disabled', false);
item.setStyle('opacity', 1);
});
});
}
}
});
}
}
}
},
{
label: Liferay.Language.get('cancel'),
on: {
click: function() {
dialog.hide();
}
}
}
]
},
width: 550
},
title: title
}
);
A.one('#<%= randomId %>updateComments').plug(A.LoadingMask, {});
A.io.request(renderFormURL, {
dataType: 'html',
on: {
start: function() {
A.one('#<%= randomId %>updateComments').loadingmask.show();
A.all('.modal-footer').each(function(item, index, collection) {
item.all('button').each(function(item, index, collection) {
item.set('disabled', true);
item.setStyle('opacity', 0.5);
});
});
},
complete: function() {
A.one('#<%= randomId %>updateComments').loadingmask.hide();
},
success: function() {
var contentNode = A.one('#<%= randomId %>form');
contentNode.html(this.get('responseData'));
A.all('.modal-footer').each(function(item, index, collection) {
item.all('button').each(function(item, index, collection) {
item.set('disabled', false);
item.setStyle('opacity', 1);
});
});
}
}
});
};
A.all('.workflow-task-<%= randomId %> a').on(
'click',
function(event) {
event.preventDefault();
var icon = event.currentTarget;
var title = icon.text();
var renderFormURL = icon.attr('data-href-render-form');
var validationURL = icon.attr('data-href-validation');
showPopup(icon.attr('href'), title, renderFormURL, validationURL);
}
);
<%--
/**
* Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
--%>
<%@ include file="/html/portlet/workflow_instances/init.jsp" %>
<%
String randomId = StringUtil.randomId();
ResultRow row = (ResultRow)request.getAttribute(WebKeys.SEARCH_CONTAINER_RESULT_ROW);
WorkflowTask workflowTask = (WorkflowTask)row.getObject();
%>
<liferay-ui:icon-menu>
<c:if test="<%= portletName.equals(PortletKeys.WORKFLOW_DEFINITIONS) && !workflowTask.isCompleted() && !_isAssignedToUser(workflowTask, user) %>">
<portlet:actionURL var="assignToMeURL">
<portlet:param name="struts_action" value="/workflow_instances/edit_workflow_instance_task" />
<portlet:param name="<%= Constants.CMD %>" value="<%= Constants.ASSIGN %>" />
<portlet:param name="redirect" value="<%= currentURL %>" />
<portlet:param name="workflowTaskId" value="<%= String.valueOf(workflowTask.getWorkflowTaskId()) %>" />
<portlet:param name="assigneeUserId" value="<%= String.valueOf(user.getUserId()) %>" />
</portlet:actionURL>
<liferay-ui:icon
cssClass='<%= "workflow-task-" + randomId + " task-assign-to-me-link" %>'
image="assign"
message="assign-to-me"
method="get"
url="<%= assignToMeURL %>"
/>
</c:if>
<c:if test="<%= !workflowTask.isCompleted() && _isAssignedToUser(workflowTask, user) %>">
<%
List<String> transitionNames = WorkflowTaskManagerUtil.getNextTransitionNames(company.getCompanyId(), user.getUserId(), workflowTask.getWorkflowTaskId());
for (String transitionName : transitionNames) {
String message = "proceed";
if (Validator.isNotNull(transitionName)) {
message = transitionName;
}
%>
<portlet:actionURL var="editURL">
<portlet:param name="struts_action" value="/workflow_instances/edit_workflow_instance_task" />
<portlet:param name="<%= Constants.CMD %>" value="<%= Constants.SAVE %>" />
<portlet:param name="redirect" value="<%= currentURL %>" />
<portlet:param name="workflowTaskId" value="<%= StringUtil.valueOf(workflowTask.getWorkflowTaskId()) %>" />
<portlet:param name="assigneeUserId" value="<%= StringUtil.valueOf(workflowTask.getAssigneeUserId()) %>" />
<c:if test="<%= transitionName != null %>">
<portlet:param name="transitionName" value="<%= transitionName %>" />
</c:if>
</portlet:actionURL>
<portlet:renderURL var="renderFormURL" windowState="<%= LiferayWindowState.POP_UP.toString() %>">
<portlet:param name="struts_action" value="/workflow_tasks/render_form_task" />
<portlet:param name="formName" value='<%= "fm_"+ randomId %>' />
<portlet:param name="workflowTaskId" value="<%= StringUtil.valueOf(workflowTask.getWorkflowTaskId()) %>" />
<portlet:param name="assigneeUserId" value="<%= StringUtil.valueOf(workflowTask.getAssigneeUserId()) %>" />
<c:if test="<%= transitionName != null %>">
<portlet:param name="transitionName" value="<%= transitionName %>" />
</c:if>
</portlet:renderURL>
<portlet:resourceURL var="validationURL">
<portlet:param name="struts_action" value="/workflow_tasks/render_form_task" />
<portlet:param name="workflowTaskId" value="<%= StringUtil.valueOf(workflowTask.getWorkflowTaskId()) %>" />
<portlet:param name="assigneeUserId" value="<%= StringUtil.valueOf(workflowTask.getAssigneeUserId()) %>" />
<c:if test="<%= transitionName != null %>">
<portlet:param name="transitionName" value="<%= transitionName %>" />
</c:if>
</portlet:resourceURL>
<%
Map<String, Object> data = new HashMap<String, Object>();
data.put("href-validation", validationURL);
data.put("href-render-form", renderFormURL);
%>
<liferay-ui:icon
cssClass='<%= "workflow-task-" + randomId + " task-change-status-link" %>'
image="../aui/random"
message="<%= message %>"
method="get"
url="<%= editURL %>"
data="<%= data %>"
/>
<%
}
%>
</c:if>
</liferay-ui:icon-menu>
<div class="hide" id="<%= randomId %>updateComments">
<%-- hook tref-ekaleo --%>
<div id="<%= randomId %>formError"></div>
<div id="<%= randomId %>form"></div>
<aui:input cols="105" name="comment" rows="10" type="textarea" />
</div>
<aui:script use="aui-io-plugin-deprecated,liferay-util-window">
var showPopup = function(url, title, renderFormURL, validationURL) {
var form = A.Node.create('<form />');
form.setAttribute('action', url);
form.setAttribute('method', 'POST');
var comments = A.one('#<%= randomId %>updateComments');
if (comments) {
form.append(comments);
comments.show();
}
// reset
var formDiv = A.one('#<%= randomId %>form');
if (formDiv) {
formDiv.empty();
}
var formErrorDiv = A.one('#<%= randomId %>formError');
if (formErrorDiv) {
formErrorDiv.empty();
}
var dialog = Liferay.Util.Window.getWindow(
{
dialog: {
bodyContent: form,
height: 620,
toolbars: {
footer: [
{
label: Liferay.Language.get('ok'),
on: {
click: function() {
if (!validationURL) {
submitForm(form);
} else {
A.one('#<%= randomId %>formError').empty();
A.io.request(validationURL, {
method: 'POST',
dataType: 'json',
on: {
start: function() {
A.one('#<%= randomId %>updateComments').loadingmask.show();
A.all('.modal-footer').each(function(item, index, collection) {
item.all('button').each(function(item, index, collection) {
item.set('disabled', true);
item.setStyle('opacity', 0.5);
});
});
},
complete: function() {
A.one('#<%= randomId %>updateComments').loadingmask.hide();
},
success: function() {
var responseData = this.get('responseData');
if (responseData.valid) {
submitForm(form);
} else {
var message = "<div class='alert alert-error'>" + Liferay.Language.get(responseData.message) + "</div>";
A.one('#<%= randomId %>formError').html(message);
}
A.all('.modal-footer').each(function(item, index, collection) {
item.all('button').each(function(item, index, collection) {
item.set('disabled', false);
item.setStyle('opacity', 1);
});
});
}
}
});
}
}
}
},
{
label: Liferay.Language.get('cancel'),
on: {
click: function() {
dialog.hide();
}
}
}
]
},
width: 550
},
title: title
}
);
A.one('#<%= randomId %>updateComments').plug(A.LoadingMask, {});
A.io.request(renderFormURL, {
dataType: 'html',
on: {
start: function() {
A.one('#<%= randomId %>updateComments').loadingmask.show();
A.all('.modal-footer').each(function(item, index, collection) {
item.all('button').each(function(item, index, collection) {
item.set('disabled', true);
item.setStyle('opacity', 0.5);
});
});
},
complete: function() {
A.one('#<%= randomId %>updateComments').loadingmask.hide();
},
success: function() {
var contentNode = A.one('#<%= randomId %>form');
contentNode.html(this.get('responseData'));
A.all('.modal-footer').each(function(item, index, collection) {
item.all('button').each(function(item, index, collection) {
item.set('disabled', false);
item.setStyle('opacity', 1);
});
});
}
}
});
};
A.all('.workflow-task-<%= randomId %> a').on(
'click',
function(event) {
event.preventDefault();
var icon = event.currentTarget;
var title = icon.text();
var renderFormURL = icon.attr('data-href-render-form');
var validationURL = icon.attr('data-href-validation');
showPopup(icon.attr('href'), title, renderFormURL, validationURL);
}
);
</aui:script>

698
liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_tasks/edit_workflow_task.jsp

@ -1,350 +1,350 @@
<%--
/**
* Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
--%>
<%@page import="com.liferay.portal.kernel.util.ParamUtil"%>
<%@ include file="/html/portlet/workflow_tasks/init.jsp" %>
<%
String randomId = StringUtil.randomId();
String redirect = ParamUtil.getString(request, "redirect");
WorkflowTask workflowTask = (WorkflowTask)request.getAttribute(WebKeys.WORKFLOW_TASK);
WorkflowInstance workflowInstance = WorkflowInstanceManagerUtil.getWorkflowInstance(company.getCompanyId(), workflowTask.getWorkflowInstanceId());
Map<String, Serializable> workflowContext = workflowInstance.getWorkflowContext();
long companyId = GetterUtil.getLong((String)workflowContext.get(WorkflowConstants.CONTEXT_COMPANY_ID));
long groupId = GetterUtil.getLong((String)workflowContext.get(WorkflowConstants.CONTEXT_GROUP_ID));
String className = (String)workflowContext.get(WorkflowConstants.CONTEXT_ENTRY_CLASS_NAME);
long classPK = GetterUtil.getLong((String)workflowContext.get(WorkflowConstants.CONTEXT_ENTRY_CLASS_PK));
WorkflowHandler workflowHandler = WorkflowHandlerRegistryUtil.getWorkflowHandler(className);
AssetRenderer assetRenderer = workflowHandler.getAssetRenderer(classPK);
AssetRendererFactory assetRendererFactory = workflowHandler.getAssetRendererFactory();
AssetEntry assetEntry = null;
if (assetRenderer != null) {
assetEntry = assetRendererFactory.getAssetEntry(assetRendererFactory.getClassName(), assetRenderer.getClassPK());
}
String headerTitle = LanguageUtil.get(pageContext, workflowTask.getName());
headerTitle = headerTitle.concat(StringPool.COLON + StringPool.SPACE + workflowHandler.getTitle(classPK, locale));
boolean showEditURL = false;
if ((workflowTask.getAssigneeUserId() == user.getUserId()) && !workflowTask.isCompleted()) {
showEditURL = true;
}
PortletURL editPortletURL = workflowHandler.getURLEdit(classPK, liferayPortletRequest, liferayPortletResponse);
String viewFullContentURLString = null;
if (assetRenderer.isPreviewInContext()) {
viewFullContentURLString = assetRenderer.getURLViewInContext((LiferayPortletRequest)renderRequest, (LiferayPortletResponse)renderResponse, null);
}
else {
PortletURL viewFullContentURL = renderResponse.createRenderURL();
viewFullContentURL.setParameter("struts_action", "/workflow_tasks/view_content");
viewFullContentURL.setParameter("redirect", currentURL);
if (assetEntry != null) {
viewFullContentURL.setParameter("assetEntryId", String.valueOf(assetEntry.getEntryId()));
viewFullContentURL.setParameter("assetEntryVersionId", String.valueOf(classPK));
}
if (assetRendererFactory != null) {
viewFullContentURL.setParameter("type", assetRendererFactory.getType());
}
viewFullContentURL.setParameter("showEditURL", String.valueOf(showEditURL));
viewFullContentURL.setParameter("workflowAssetPreview", Boolean.TRUE.toString());
viewFullContentURLString = viewFullContentURL.toString();
}
request.setAttribute(WebKeys.WORKFLOW_ASSET_PREVIEW, Boolean.TRUE);
%>
<%-- <portlet:renderURL var="backURL">
<portlet:param name="struts_action" value="/workflow_tasks/view" />
</portlet:renderURL>
<liferay-ui:header
backURL="<%= backURL.toString() %>"
localizeTitle="<%= false %>"
title="<%= headerTitle %>"
/>--%>
<div class="container_gestione_attivita">
<div class="container_gestione_attivita_header">
<h2 class="container_gestione_attivita_header-title">Gestione Attività</h2>
</div>
<div class="container_gestione_attivita_body">
<div class="container_gestione_attivita_body-left">
<div class="container_gestione_attivita_body-left-dati">
<liferay-ui:error exception="<%= WorkflowTaskDueDateException.class %>" message="please-enter-a-valid-due-date" />
<div class="lfr-asset-assigned attivita_header-item">
<aui:field-wrapper label="assigned-to">
<i class="icon-user"></i>
<c:choose>
<c:when test="<%= workflowTask.isAssignedToSingleUser() %>">
<liferay-ui:input-resource url="<%= PortalUtil.getUserName(workflowTask.getAssigneeUserId(), StringPool.BLANK) %>" />
</c:when>
<c:otherwise>
<liferay-ui:input-resource url='<%= LanguageUtil.get(pageContext, "nobody") %>' />
</c:otherwise>
</c:choose>
</aui:field-wrapper>
</div>
<div class="lfr-asset-status attivita_header-item">
<aui:field-wrapper label="state">
<i class="icon-th-list"></i>
<liferay-ui:input-resource url="<%= LanguageUtil.get(pageContext, WorkflowInstanceLinkLocalServiceUtil.getState(companyId, groupId, className, classPK)) %>" />
</aui:field-wrapper>
</div>
<div class="lfr-asset-date attivita_header-item">
<aui:field-wrapper label="create-date">
<i class="icon-calendar"></i>
<liferay-ui:input-resource url="<%= dateFormatDateTime.format(workflowTask.getCreateDate()) %>" />
</aui:field-wrapper>
</div>
</div>
<c:if test="<%= Validator.isNotNull(workflowTask.getDescription()) %>">
<div class="lfr-asset-field">
<aui:field-wrapper label="description">
<%= workflowTask.getDescription() %>
</aui:field-wrapper>
</div>
</c:if>
<c:if test="<%= assetRenderer != null %>">
<%
String path = workflowHandler.render(classPK, renderRequest, renderResponse, AssetRenderer.TEMPLATE_ABSTRACT);
request.setAttribute(WebKeys.ASSET_RENDERER, assetRenderer);
request.setAttribute(WebKeys.ASSET_PUBLISHER_ABSTRACT_LENGTH, 200);
%>
<c:choose>
<c:when test="<%= path == null %>">
<%= workflowHandler.getSummary(classPK, locale) %>
</c:when>
<c:otherwise>
<liferay-util:include page="<%= path %>" portletId="<%= assetRendererFactory.getPortletId() %>" />
</c:otherwise>
</c:choose>
</c:if>
<liferay-ui:panel-container cssClass="task-panel-container" extended="<%= true %>">
<liferay-ui:panel defaultState="closed" title="Attività e Commenti">
<%
List<Integer> logTypes = new ArrayList<Integer>();
logTypes.add(WorkflowLog.TASK_ASSIGN);
logTypes.add(WorkflowLog.TASK_COMPLETION);
logTypes.add(WorkflowLog.TASK_UPDATE);
logTypes.add(WorkflowLog.TRANSITION);
List<WorkflowLog> workflowLogs = WorkflowLogManagerUtil.getWorkflowLogsByWorkflowInstance(company.getCompanyId(), workflowTask.getWorkflowInstanceId(), logTypes, QueryUtil.ALL_POS, QueryUtil.ALL_POS, WorkflowComparatorFactoryUtil.getLogCreateDateComparator(true));
%>
<%@ include file="/html/portlet/workflow_instances/workflow_logs.jspf" %>
</liferay-ui:panel>
</liferay-ui:panel-container>
</div>
</div>
<div class="container_gestione_attivita_body-right">
<div class="lfr-asset-summary">
<h2 class="title-action">Azioni</h2>
<div class="separator"></div>
</div>
<%
request.removeAttribute(WebKeys.SEARCH_CONTAINER_RESULT_ROW);
%>
<liferay-util:include page="/html/portlet/workflow_tasks/workflow_task_action.jsp">
<liferay-portlet:param name="viewFullContentURLString" value="<%= viewFullContentURLString %>"/>
<!-- ADT BUG BO ID= 27 -->
<liferay-portlet:param name="classPkForCarichiLavoro" value="<%= String.valueOf(classPK) %>"/>
</liferay-util:include>
</div>
</div>
<style>
html {
padding: 0!important;
}
.container_gestione_attivita_header {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
border-bottom: 1px solid #ddd;
padding-left: 15px;
padding-right: 15px;
background-color: #812121;
}
.container_gestione_attivita_header-title {
color: #fff!important;
}
.attivita_header-item .control-label {
padding-left: 18px;
}
.attivita_header-item {
padding-right: 40px;
}
.container_gestione_attivita_body {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
}
.container_gestione_attivita_body-left {
-webkit-box-flex: 1;
-ms-flex: 1;
flex: 1;
}
.container_gestione_attivita_body-right {
width: 200px;
}
.container_gestione_attivita_body-left, .container_gestione_attivita_body-right {
padding: 15px;
}
.button_custom {
border-radius: 4px;
width: 80%;
}
.button_custom a, .button_custom a i, .button_custom a span, .button_custom a span:hover, .button_custom a i:hover, .button_custom a:hover {
color: #333!important;
}
.task-panel-header {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}
.task-panel-header .task-content-title {
color: rgb(85, 85, 85);
}
.title-action {
margin: 0;
}
.container_gestione_attivita_body-right {
border-left: 1px solid #ddd;
}
.container_gestione_attivita_body-right .lfr-menu-list {
margin-left: 0;
}
.opens-new-window-accessible {
display: none!important;
}
.task-activity {
padding-bottom: 15px;
}
.task-activity:first-child {
padding-top: 15px;
}
.task-activity-date {
font-weight: 600;
font-size: 16px;
}
.container_gestione_attivita_body-left-dati {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
border-bottom: 1px solid #ddd;
}
.accordion .accordion-heading {
background-color: #812121!important;
}
.accordion .accordion-heading .title-text {
color: #fff;
}
.accordion .accordion-heading .accordion-toggle::before {
color: #fff!important;
opacity: 1!important;
}
#updateComments .columns-max .control-group.field-wrapper > .control-group select,
#updateComments .control-group.field-wrapper textarea,
#updateComments .control-group.field-wrapper label,
#updateComments .columns-max .control-group.field-wrapper > .control-group label,
#updateComments .control-group.field-wrapper span.control-label,
#updateComments .control-group.input-text-wrapper textarea.field,
.aui label.control-label{
color: black
}
</style>
<aui:script use="liferay-workflow-tasks">
var onTaskClickFn = A.rbind('onTaskClick', Liferay.WorkflowTasks, '');
Liferay.delegateClick('<portlet:namespace /><%= randomId %>taskAssignToMeLink', onTaskClickFn);
Liferay.delegateClick('<portlet:namespace /><%= randomId %>taskAssignLink', onTaskClickFn);
<%-- Liferay.delegateClick('<portlet:namespace /><%= randomId %>taskDueDateLink', onTaskClickFn); --%>
</aui:script>
<%
PortalUtil.addPortletBreadcrumbEntry(request, headerTitle, currentURL);
<%--
/**
* Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
--%>
<%@page import="com.liferay.portal.kernel.util.ParamUtil"%>
<%@ include file="/html/portlet/workflow_tasks/init.jsp" %>
<%
String randomId = StringUtil.randomId();
String redirect = ParamUtil.getString(request, "redirect");
WorkflowTask workflowTask = (WorkflowTask)request.getAttribute(WebKeys.WORKFLOW_TASK);
WorkflowInstance workflowInstance = WorkflowInstanceManagerUtil.getWorkflowInstance(company.getCompanyId(), workflowTask.getWorkflowInstanceId());
Map<String, Serializable> workflowContext = workflowInstance.getWorkflowContext();
long companyId = GetterUtil.getLong((String)workflowContext.get(WorkflowConstants.CONTEXT_COMPANY_ID));
long groupId = GetterUtil.getLong((String)workflowContext.get(WorkflowConstants.CONTEXT_GROUP_ID));
String className = (String)workflowContext.get(WorkflowConstants.CONTEXT_ENTRY_CLASS_NAME);
long classPK = GetterUtil.getLong((String)workflowContext.get(WorkflowConstants.CONTEXT_ENTRY_CLASS_PK));
WorkflowHandler workflowHandler = WorkflowHandlerRegistryUtil.getWorkflowHandler(className);
AssetRenderer assetRenderer = workflowHandler.getAssetRenderer(classPK);
AssetRendererFactory assetRendererFactory = workflowHandler.getAssetRendererFactory();
AssetEntry assetEntry = null;
if (assetRenderer != null) {
assetEntry = assetRendererFactory.getAssetEntry(assetRendererFactory.getClassName(), assetRenderer.getClassPK());
}
String headerTitle = LanguageUtil.get(pageContext, workflowTask.getName());
headerTitle = headerTitle.concat(StringPool.COLON + StringPool.SPACE + workflowHandler.getTitle(classPK, locale));
boolean showEditURL = false;
if ((workflowTask.getAssigneeUserId() == user.getUserId()) && !workflowTask.isCompleted()) {
showEditURL = true;
}
PortletURL editPortletURL = workflowHandler.getURLEdit(classPK, liferayPortletRequest, liferayPortletResponse);
String viewFullContentURLString = null;
if (assetRenderer.isPreviewInContext()) {
viewFullContentURLString = assetRenderer.getURLViewInContext((LiferayPortletRequest)renderRequest, (LiferayPortletResponse)renderResponse, null);
}
else {
PortletURL viewFullContentURL = renderResponse.createRenderURL();
viewFullContentURL.setParameter("struts_action", "/workflow_tasks/view_content");
viewFullContentURL.setParameter("redirect", currentURL);
if (assetEntry != null) {
viewFullContentURL.setParameter("assetEntryId", String.valueOf(assetEntry.getEntryId()));
viewFullContentURL.setParameter("assetEntryVersionId", String.valueOf(classPK));
}
if (assetRendererFactory != null) {
viewFullContentURL.setParameter("type", assetRendererFactory.getType());
}
viewFullContentURL.setParameter("showEditURL", String.valueOf(showEditURL));
viewFullContentURL.setParameter("workflowAssetPreview", Boolean.TRUE.toString());
viewFullContentURLString = viewFullContentURL.toString();
}
request.setAttribute(WebKeys.WORKFLOW_ASSET_PREVIEW, Boolean.TRUE);
%>
<%-- <portlet:renderURL var="backURL">
<portlet:param name="struts_action" value="/workflow_tasks/view" />
</portlet:renderURL>
<liferay-ui:header
backURL="<%= backURL.toString() %>"
localizeTitle="<%= false %>"
title="<%= headerTitle %>"
/>--%>
<div class="container_gestione_attivita">
<div class="container_gestione_attivita_header">
<h2 class="container_gestione_attivita_header-title">Gestione Attività</h2>
</div>
<div class="container_gestione_attivita_body">
<div class="container_gestione_attivita_body-left">
<div class="container_gestione_attivita_body-left-dati">
<liferay-ui:error exception="<%= WorkflowTaskDueDateException.class %>" message="please-enter-a-valid-due-date" />
<div class="lfr-asset-assigned attivita_header-item">
<aui:field-wrapper label="assigned-to">
<i class="icon-user"></i>
<c:choose>
<c:when test="<%= workflowTask.isAssignedToSingleUser() %>">
<liferay-ui:input-resource url="<%= PortalUtil.getUserName(workflowTask.getAssigneeUserId(), StringPool.BLANK) %>" />
</c:when>
<c:otherwise>
<liferay-ui:input-resource url='<%= LanguageUtil.get(pageContext, "nobody") %>' />
</c:otherwise>
</c:choose>
</aui:field-wrapper>
</div>
<div class="lfr-asset-status attivita_header-item">
<aui:field-wrapper label="state">
<i class="icon-th-list"></i>
<liferay-ui:input-resource url="<%= LanguageUtil.get(pageContext, WorkflowInstanceLinkLocalServiceUtil.getState(companyId, groupId, className, classPK)) %>" />
</aui:field-wrapper>
</div>
<div class="lfr-asset-date attivita_header-item">
<aui:field-wrapper label="create-date">
<i class="icon-calendar"></i>
<liferay-ui:input-resource url="<%= dateFormatDateTime.format(workflowTask.getCreateDate()) %>" />
</aui:field-wrapper>
</div>
</div>
<c:if test="<%= Validator.isNotNull(workflowTask.getDescription()) %>">
<div class="lfr-asset-field">
<aui:field-wrapper label="description">
<%= workflowTask.getDescription() %>
</aui:field-wrapper>
</div>
</c:if>
<c:if test="<%= assetRenderer != null %>">
<%
String path = workflowHandler.render(classPK, renderRequest, renderResponse, AssetRenderer.TEMPLATE_ABSTRACT);
request.setAttribute(WebKeys.ASSET_RENDERER, assetRenderer);
request.setAttribute(WebKeys.ASSET_PUBLISHER_ABSTRACT_LENGTH, 200);
%>
<c:choose>
<c:when test="<%= path == null %>">
<%= workflowHandler.getSummary(classPK, locale) %>
</c:when>
<c:otherwise>
<liferay-util:include page="<%= path %>" portletId="<%= assetRendererFactory.getPortletId() %>" />
</c:otherwise>
</c:choose>
</c:if>
<liferay-ui:panel-container cssClass="task-panel-container" extended="<%= true %>">
<liferay-ui:panel defaultState="closed" title="Attivit<EFBFBD> e Commenti">
<%
List<Integer> logTypes = new ArrayList<Integer>();
logTypes.add(WorkflowLog.TASK_ASSIGN);
logTypes.add(WorkflowLog.TASK_COMPLETION);
logTypes.add(WorkflowLog.TASK_UPDATE);
logTypes.add(WorkflowLog.TRANSITION);
List<WorkflowLog> workflowLogs = WorkflowLogManagerUtil.getWorkflowLogsByWorkflowInstance(company.getCompanyId(), workflowTask.getWorkflowInstanceId(), logTypes, QueryUtil.ALL_POS, QueryUtil.ALL_POS, WorkflowComparatorFactoryUtil.getLogCreateDateComparator(true));
%>
<%@ include file="/html/portlet/workflow_instances/workflow_logs.jspf" %>
</liferay-ui:panel>
</liferay-ui:panel-container>
</div>
</div>
<div class="container_gestione_attivita_body-right">
<div class="lfr-asset-summary">
<h2 class="title-action">Azioni</h2>
<div class="separator"></div>
</div>
<%
request.removeAttribute(WebKeys.SEARCH_CONTAINER_RESULT_ROW);
%>
<liferay-util:include page="/html/portlet/workflow_tasks/workflow_task_action.jsp">
<liferay-portlet:param name="viewFullContentURLString" value="<%= viewFullContentURLString %>"/>
<!-- ADT BUG BO ID= 27 -->
<liferay-portlet:param name="classPkForCarichiLavoro" value="<%= String.valueOf(classPK) %>"/>
</liferay-util:include>
</div>
</div>
<style>
html {
padding: 0!important;
}
.container_gestione_attivita_header {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
border-bottom: 1px solid #ddd;
padding-left: 15px;
padding-right: 15px;
background-color: #812121;
}
.container_gestione_attivita_header-title {
color: #fff!important;
}
.attivita_header-item .control-label {
padding-left: 18px;
}
.attivita_header-item {
padding-right: 40px;
}
.container_gestione_attivita_body {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
}
.container_gestione_attivita_body-left {
-webkit-box-flex: 1;
-ms-flex: 1;
flex: 1;
}
.container_gestione_attivita_body-right {
width: 200px;
}
.container_gestione_attivita_body-left, .container_gestione_attivita_body-right {
padding: 15px;
}
.button_custom {
border-radius: 4px;
width: 80%;
}
.button_custom a, .button_custom a i, .button_custom a span, .button_custom a span:hover, .button_custom a i:hover, .button_custom a:hover {
color: #333!important;
}
.task-panel-header {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}
.task-panel-header .task-content-title {
color: rgb(85, 85, 85);
}
.title-action {
margin: 0;
}
.container_gestione_attivita_body-right {
border-left: 1px solid #ddd;
}
.container_gestione_attivita_body-right .lfr-menu-list {
margin-left: 0;
}
.opens-new-window-accessible {
display: none!important;
}
.task-activity {
padding-bottom: 15px;
}
.task-activity:first-child {
padding-top: 15px;
}
.task-activity-date {
font-weight: 600;
font-size: 16px;
}
.container_gestione_attivita_body-left-dati {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
border-bottom: 1px solid #ddd;
}
.accordion .accordion-heading {
background-color: #812121!important;
}
.accordion .accordion-heading .title-text {
color: #fff;
}
.accordion .accordion-heading .accordion-toggle::before {
color: #fff!important;
opacity: 1!important;
}
#updateComments .columns-max .control-group.field-wrapper > .control-group select,
#updateComments .control-group.field-wrapper textarea,
#updateComments .control-group.field-wrapper label,
#updateComments .columns-max .control-group.field-wrapper > .control-group label,
#updateComments .control-group.field-wrapper span.control-label,
#updateComments .control-group.input-text-wrapper textarea.field,
.aui label.control-label{
color: black
}
</style>
<aui:script use="liferay-workflow-tasks">
var onTaskClickFn = A.rbind('onTaskClick', Liferay.WorkflowTasks, '');
Liferay.delegateClick('<portlet:namespace /><%= randomId %>taskAssignToMeLink', onTaskClickFn);
Liferay.delegateClick('<portlet:namespace /><%= randomId %>taskAssignLink', onTaskClickFn);
<%-- Liferay.delegateClick('<portlet:namespace /><%= randomId %>taskDueDateLink', onTaskClickFn); --%>
</aui:script>
<%
PortalUtil.addPortletBreadcrumbEntry(request, headerTitle, currentURL);
%>

681
liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_tasks/render_form_task.jsp

@ -1,342 +1,341 @@
<%@page import="com.liferay.portal.kernel.util.MapUtil"%>
<%@page import="java.io.UnsupportedEncodingException"%>
<%@page import="org.apache.commons.codec.binary.Hex"%>
<%@page import="com.liferay.portal.kernel.util.UnicodeFormatter"%>
<%@page import="com.liferay.portlet.dynamicdatamapping.service.DDMStructureLocalServiceUtil"%>
<%@page import="com.liferay.portal.kernel.util.StringUtil"%>
<%@page import="org.htmlparser.Node"%>
<%@page import="org.htmlparser.tags.OptionTag"%>
<%@page import="org.htmlparser.tags.TextareaTag"%>
<%@page import="org.htmlparser.tags.InputTag"%>
<%@page import="org.htmlparser.tags.SelectTag"%>
<%@page import="org.htmlparser.tags.Div" %>
<%@page import="org.htmlparser.tags.LabelTag" %>
<%@page import="org.htmlparser.nodes.TagNode"%>
<%@page import="org.htmlparser.nodes.TextNode"%>
<%@page import="org.htmlparser.util.NodeList"%>
<%@page import="org.htmlparser.Parser"%>
<%@page import="org.htmlparser.util.ParserException"%>
<%@page import="javax.portlet.RenderResponse"%>
<%@page import="java.util.Iterator"%>
<%@page import="java.util.Map.Entry"%>
<%@page import="com.liferay.portal.kernel.util.LocaleUtil"%>
<%@page import="com.liferay.portal.kernel.util.Validator"%>
<%@page import="com.liferay.portal.kernel.util.ParamUtil"%>
<%@page import="java.util.Set"%>
<%@page import="java.util.Locale"%>
<%@page import="com.liferay.portlet.dynamicdatamapping.storage.StorageEngineUtil"%>
<%@page import="com.liferay.portlet.dynamicdatamapping.storage.Fields"%>
<%@page import="com.liferay.portlet.dynamicdatalists.model.DDLRecordSet"%>
<%@page import="com.liferay.portlet.dynamicdatalists.service.DDLRecordSetServiceUtil"%>
<%@page import="com.liferay.portlet.dynamicdatalists.model.DDLRecordVersion"%>
<%@page import="com.liferay.portal.kernel.bean.BeanParamUtil"%>
<%@page import="com.liferay.portlet.dynamicdatalists.model.DDLRecord"%>
<%@page import="com.liferay.portal.kernel.util.StringPool"%>
<%@page import="com.liferay.portlet.dynamicdatamapping.model.DDMStructure"%>
<%@page import="com.liferay.portlet.dynamicdatamapping.model.DDMTemplate"%>
<%@ include file="/html/portlet/workflow_tasks/init.jsp" %>
<!-- ADT BUG BO ID=27 -->
<%
String classPkForCarichiLavoro = (String) renderRequest.getAttribute("classPkForCarichiLavoro");
%>
<c:if test="<%= Validator.isNotNull(classPkForCarichiLavoro) %>">
<div class="container_header_text_attivita">
<liferay-portlet:renderURL portletName='9_WAR_portosboportlet' windowState="<%=LiferayWindowState.POP_UP.toString() %>" var="carichiDiLavoro">
<liferay-portlet:param name="controlloPraticaId" value='<%= (String)renderRequest.getAttribute("classPkForCarichiLavoro") %>'/>
</liferay-portlet:renderURL>
<liferay-ui:icon url="<%=carichiDiLavoro %>" useDialog="true" message="visualizza-carichi-di-lavoro" linkCssClass="btn btn-rounded" iconCssClass="icon-bar-chart"/>
<span>Visualizza Carichi di Lavoro Istruttori</span>
</div>
</c:if>
<!-- ************ -->
<%
long ddmTemplateId = (Long) renderRequest.getAttribute("ddmTemplateId");
long ddmStructureId = (Long) renderRequest.getAttribute("ddmStructureId");
Map<String, Serializable> parameters = (Map<String, Serializable>) renderRequest.getAttribute("parameters");
String prefix = (String) renderRequest.getAttribute("prefix");
String suffix = (String) renderRequest.getAttribute("suffix");
Map<String, List<Map<String, Serializable>>> fieldNameOptions
= (Map<String, List<Map<String, Serializable>>>) renderRequest.getAttribute("fieldNameOptions");
String redirect = StringPool.BLANK;
DDLRecord record = null;
long recordId = BeanParamUtil.getLong(record, request, "recordId");
DDLRecordVersion recordVersion = null;
if (record != null) {
recordVersion = record.getLatestRecordVersion();
}
DDMStructure ddmStructure = DDMStructureLocalServiceUtil.getDDMStructure(ddmStructureId);
Fields fields = null;
if (recordVersion != null) {
fields = StorageEngineUtil.getFields(recordVersion.getDDMStorageId());
}
Locale[] availableLocales = new Locale[0];
if (fields != null) {
Set<Locale> availableLocalesSet = fields.getAvailableLocales();
availableLocales = availableLocalesSet.toArray(new Locale[availableLocalesSet.size()]);
}
String defaultLanguageId = StringPool.BLANK;
if (Validator.isNull(defaultLanguageId)) {
defaultLanguageId = themeDisplay.getLanguageId();
if (fields != null) {
defaultLanguageId = LocaleUtil.toLanguageId(fields.getDefaultLocale());
}
}
String languageId = defaultLanguageId;
boolean translating = false;
if (!defaultLanguageId.equals(languageId)) {
translating = true;
}
if (translating) {
redirect = currentURL;
}
long classNameId = PortalUtil.getClassNameId(DDMStructure.class);
long classPK = ddmStructure.getStructureId();
if (ddmTemplateId > 0) {
classNameId = PortalUtil.getClassNameId(DDMTemplate.class);
classPK = ddmTemplateId;
}
%>
<liferay-util:buffer var="html">
<liferay-ddm:html
classNameId="<%= classNameId %>"
classPK="<%= classPK %>"
fields="<%= fields %>"
repeatable="<%= translating ? false : true %>"
requestedLocale="<%= LocaleUtil.fromLanguageId(languageId) %>"
/>
</liferay-util:buffer>
<%= normalize(html, parameters, fieldNameOptions, renderResponse, prefix, suffix) %>
<%!
private String normalize(String html, Map<String, Serializable> parameters,
Map<String, List<Map<String, Serializable>>> fieldNameOptions,
RenderResponse renderResponse, String prefix, String suffix) {
if (Validator.isNull(html)) {
return StringPool.BLANK;
}
// replace portlet namespace + random namespace
html = html.replaceAll("name=\"" + renderResponse.getNamespace(), "name=\"");
try {
Parser parser = Parser.createParser(html, StringPool.UTF8);
NodeList nodeList = (NodeList) parser.parse(null);
for (int i = 0; i < nodeList.size(); i++) {
filter(nodeList.elementAt(i), parameters, fieldNameOptions, prefix, suffix);
}
html = nodeList.toHtml();
} catch (ParserException e) {
}
// add prefix + suffix
html = html.replaceAll("name=\"(.*?)\"", "name=\"" + prefix + "$1" + suffix + "\"");
// ignore ddm fields display
html = html.replaceAll("name=\"" + prefix + "_fieldsDisplay" + suffix, "name=\"_fieldsDisplay\"");
return html;
}
private void filter(Node node, Map<String, Serializable> parameters,
Map<String, List<Map<String, Serializable>>> fieldNameOptions,
String prefix, String suffix) {
if (node != null) {
if (node instanceof SelectTag || node instanceof InputTag || node instanceof TextareaTag) {
TagNode tag = (TagNode) node;
String name = tag.getAttribute("name");
String namespace = getNamespace(node);
if (Validator.isNotNull(namespace)) {
name = name.replaceAll(namespace, StringPool.BLANK);
tag.setAttribute("name", name);
}
String value = null;
if (parameters.containsKey(name)) {
value = parameters.get(name).toString();
if (node instanceof TextareaTag) {
if (node.getChildren() != null && node.getChildren().size() > 0) {
TextNode text = (TextNode) node.getChildren().elementAt(0);
text.setText(value);
} else {
NodeList nodeList = new NodeList();
nodeList.add(new TextNode(value));
node.setChildren(nodeList);
}
} else if (tag instanceof SelectTag) {
if (node.getChildren() != null && node.getChildren().size() > 0) {
for (int i = 0; i < node.getChildren().size(); i++) {
if (node.getChildren().elementAt(i) instanceof OptionTag) {
TagNode optionTag = (TagNode) node.getChildren().elementAt(i);
String optionValue = optionTag.getAttribute("value");
optionValue = replaceHex(optionValue);
String[] values = StringUtil.split(value, StringPool.COMMA);
for (String v : values) {
if (StringUtil.trim(v).equals(optionValue)) {
optionTag.setAttribute("selected", "selected");
}
}
}
}
}
} else {
String type = tag.getAttribute("type");
if (type.equals("checkbox")) {
value = parameters.get(
StringUtil.replace(name, "Checkbox", StringPool.BLANK)).toString();
if (value.equalsIgnoreCase("true")) {
tag.setAttribute("checked", "checked");
}
} else if (type.equals("radio")) {
String valueInput = tag.getAttribute("value");
valueInput = replaceHex(valueInput);
if (value.equals(valueInput)) {
tag.setAttribute("checked", "checked");
}
} else {
tag.setAttribute("value", value, '"');
}
}
}
// select singolo o multiplo senza opzioni fisse
if (tag instanceof SelectTag) {
List<Map<String, Serializable>> options = fieldNameOptions.get(name);
if (options != null && !options.isEmpty()) {
NodeList optionsTag = new NodeList();
for (Map<String, Serializable> option : options) {
String label = MapUtil.getString(option, "label");
String valueOption = MapUtil.getString(option, "value");
boolean defaultValue = MapUtil.getBoolean(option, "default");
// new option
OptionTag optionTag = new OptionTag();
optionTag.setAttribute("value", valueOption, '"');
if (defaultValue && !parameters.containsKey(name)) {
optionTag.setAttribute("selected", "selected");
} else if (Validator.isNotNull(value) && value.equals(valueOption)) {
optionTag.setAttribute("selected", "selected");
}
TextNode textNode = new TextNode(label);
NodeList nodeList = new NodeList();
nodeList.add(textNode);
optionTag.setChildren(nodeList);
optionsTag.add(optionTag);
}
tag.setChildren(optionsTag);
}
} else if ("radio".equals(tag.getAttribute("type"))) {
List<Map<String, Serializable>> options = fieldNameOptions.get(name);
if(options!=null){
for (Map<String, Serializable> option : options) {
String label = MapUtil.getString(option, "label");
String valueOption = MapUtil.getString(option, "value");
boolean defaultValue = MapUtil.getBoolean(option, "default");
if(tag.getAttribute("value").equals(valueOption)){
tag.getNextSibling().setText(label);
}
}
}
}
}
if (node.getChildren() != null) {
for (int i = 0; i < node.getChildren().size(); i++) {
filter(node.getChildren().elementAt(i), parameters, fieldNameOptions, prefix, suffix);
}
}
}
}
private String getNamespace(Node node) {
String namespace = null;
boolean trovato = false;
Node parent = node.getParent();
while (!trovato && parent != null) {
if (parent instanceof TagNode) {
TagNode tag = (TagNode) parent;
String dataFieldNamespace = tag.getAttribute("data-fieldnamespace");
if (Validator.isNotNull(dataFieldNamespace)) {
trovato = true;
namespace = dataFieldNamespace;
}
}
if (!trovato) {
parent = parent.getParent();
}
}
return namespace;
}
private String replaceHex(String s) {
final String prefix = "&#x";
final String suffix = ";";
int index = 0;
while (true) {
int i = s.indexOf(prefix, index);
if (i < 0) {
break;
} else {
int j = s.indexOf(suffix, i);
if (j < 0) {
break;
} else {
String hexCode = s.substring(i, (j + 1));
String hex = hexCode.substring(prefix.length(), hexCode.length() - 1);
try {
s = StringUtil.replace(s, hexCode,
new String(Hex.decodeHex(hex.toCharArray()), StringPool.UTF8));
} catch (Exception e) {}
index = i;
}
}
}
return s;
}
<%@page import="com.liferay.portal.kernel.util.MapUtil"%>
<%@page import="java.io.UnsupportedEncodingException"%>
<%@page import="org.apache.commons.codec.binary.Hex"%>
<%@page import="com.liferay.portal.kernel.util.UnicodeFormatter"%>
<%@page import="com.liferay.portlet.dynamicdatamapping.service.DDMStructureLocalServiceUtil"%>
<%@page import="com.liferay.portal.kernel.util.StringUtil"%>
<%@page import="org.htmlparser.Node"%>
<%@page import="org.htmlparser.tags.OptionTag"%>
<%@page import="org.htmlparser.tags.TextareaTag"%>
<%@page import="org.htmlparser.tags.InputTag"%>
<%@page import="org.htmlparser.tags.SelectTag"%>
<%@page import="org.htmlparser.tags.Div" %>
<%@page import="org.htmlparser.tags.LabelTag" %>
<%@page import="org.htmlparser.nodes.TagNode"%>
<%@page import="org.htmlparser.nodes.TextNode"%>
<%@page import="org.htmlparser.util.NodeList"%>
<%@page import="org.htmlparser.Parser"%>
<%@page import="org.htmlparser.util.ParserException"%>
<%@page import="javax.portlet.RenderResponse"%>
<%@page import="java.util.Iterator"%>
<%@page import="java.util.Map.Entry"%>
<%@page import="com.liferay.portal.kernel.util.LocaleUtil"%>
<%@page import="com.liferay.portal.kernel.util.Validator"%>
<%@page import="com.liferay.portal.kernel.util.ParamUtil"%>
<%@page import="java.util.Set"%>
<%@page import="java.util.Locale"%>
<%@page import="com.liferay.portlet.dynamicdatamapping.storage.StorageEngineUtil"%>
<%@page import="com.liferay.portlet.dynamicdatamapping.storage.Fields"%>
<%@page import="com.liferay.portlet.dynamicdatalists.model.DDLRecordSet"%>
<%@page import="com.liferay.portlet.dynamicdatalists.service.DDLRecordSetServiceUtil"%>
<%@page import="com.liferay.portlet.dynamicdatalists.model.DDLRecordVersion"%>
<%@page import="com.liferay.portal.kernel.bean.BeanParamUtil"%>
<%@page import="com.liferay.portlet.dynamicdatalists.model.DDLRecord"%>
<%@page import="com.liferay.portal.kernel.util.StringPool"%>
<%@page import="com.liferay.portlet.dynamicdatamapping.model.DDMStructure"%>
<%@page import="com.liferay.portlet.dynamicdatamapping.model.DDMTemplate"%>
<%@ include file="/html/portlet/workflow_tasks/init.jsp" %>
<!-- ADT BUG BO ID=27 -->
<%
String classPkForCarichiLavoro = (String) renderRequest.getAttribute("classPkForCarichiLavoro");
%>
<c:if test="<%= Validator.isNotNull(classPkForCarichiLavoro) %>">
<div class="container_header_text_attivita">
<liferay-portlet:renderURL portletName='9_WAR_portosboportlet' windowState="<%=LiferayWindowState.POP_UP.toString() %>" var="carichiDiLavoro">
<liferay-portlet:param name="controlloPraticaId" value='<%= (String)renderRequest.getAttribute("classPkForCarichiLavoro") %>'/>
</liferay-portlet:renderURL>
<liferay-ui:icon url="<%=carichiDiLavoro %>" useDialog="true" message="visualizza-carichi-di-lavoro" linkCssClass="btn btn-rounded" iconCssClass="icon-bar-chart"/>
<span>Visualizza Carichi di Lavoro Istruttori</span>
</div>
</c:if>
<!-- ************ -->
<%
long ddmTemplateId = (Long) renderRequest.getAttribute("ddmTemplateId");
long ddmStructureId = (Long) renderRequest.getAttribute("ddmStructureId");
Map<String, Serializable> parameters = (Map<String, Serializable>) renderRequest.getAttribute("parameters");
String prefix = (String) renderRequest.getAttribute("prefix");
String suffix = (String) renderRequest.getAttribute("suffix");
Map<String, List<Map<String, Serializable>>> fieldNameOptions
= (Map<String, List<Map<String, Serializable>>>) renderRequest.getAttribute("fieldNameOptions");
String redirect = StringPool.BLANK;
DDLRecord record = null;
long recordId = BeanParamUtil.getLong(record, request, "recordId");
DDLRecordVersion recordVersion = null;
if (record != null) {
recordVersion = record.getLatestRecordVersion();
}
DDMStructure ddmStructure = DDMStructureLocalServiceUtil.getDDMStructure(ddmStructureId);
Fields fields = null;
if (recordVersion != null) {
fields = StorageEngineUtil.getFields(recordVersion.getDDMStorageId());
}
Locale[] availableLocales = new Locale[0];
if (fields != null) {
Set<Locale> availableLocalesSet = fields.getAvailableLocales();
availableLocales = availableLocalesSet.toArray(new Locale[availableLocalesSet.size()]);
}
String defaultLanguageId = StringPool.BLANK;
if (Validator.isNull(defaultLanguageId)) {
defaultLanguageId = themeDisplay.getLanguageId();
if (fields != null) {
defaultLanguageId = LocaleUtil.toLanguageId(fields.getDefaultLocale());
}
}
String languageId = defaultLanguageId;
boolean translating = false;
if (!defaultLanguageId.equals(languageId)) {
translating = true;
}
if (translating) {
redirect = currentURL;
}
long classNameId = PortalUtil.getClassNameId(DDMStructure.class);
long classPK = ddmStructure.getStructureId();
if (ddmTemplateId > 0) {
classNameId = PortalUtil.getClassNameId(DDMTemplate.class);
classPK = ddmTemplateId;
}
%>
<liferay-util:buffer var="html">
<liferay-ddm:html
classNameId="<%= classNameId %>"
classPK="<%= classPK %>"
fields="<%= fields %>"
repeatable="<%= translating ? false : true %>"
requestedLocale="<%= LocaleUtil.fromLanguageId(languageId) %>"
/>
</liferay-util:buffer>
<%= normalize(html, parameters, fieldNameOptions, renderResponse, prefix, suffix) %>
<%!
private String normalize(String html, Map<String, Serializable> parameters,
Map<String, List<Map<String, Serializable>>> fieldNameOptions,
RenderResponse renderResponse, String prefix, String suffix) {
if (Validator.isNull(html)) {
return StringPool.BLANK;
}
// replace portlet namespace + random namespace
html = html.replaceAll("name=\"" + renderResponse.getNamespace(), "name=\"");
try {
Parser parser = Parser.createParser(html, StringPool.UTF8);
NodeList nodeList = (NodeList) parser.parse(null);
for (int i = 0; i < nodeList.size(); i++) {
filter(nodeList.elementAt(i), parameters, fieldNameOptions, prefix, suffix);
}
html = nodeList.toHtml();
} catch (ParserException e) {
}
// add prefix + suffix
html = html.replaceAll("name=\"(.*?)\"", "name=\"" + prefix + "$1" + suffix + "\"");
// ignore ddm fields display
html = html.replaceAll("name=\"" + prefix + "_fieldsDisplay" + suffix, "name=\"_fieldsDisplay\"");
return html;
}
private void filter(Node node, Map<String, Serializable> parameters,
Map<String, List<Map<String, Serializable>>> fieldNameOptions,
String prefix, String suffix) {
if (node != null) {
if (node instanceof SelectTag || node instanceof InputTag || node instanceof TextareaTag) {
TagNode tag = (TagNode) node;
String name = tag.getAttribute("name");
String namespace = getNamespace(node);
if (Validator.isNotNull(namespace)) {
name = name.replaceAll(namespace, StringPool.BLANK);
tag.setAttribute("name", name);
}
String value = null;
if (parameters.containsKey(name)) {
value = parameters.get(name).toString();
if (node instanceof TextareaTag) {
if (node.getChildren() != null && node.getChildren().size() > 0) {
TextNode text = (TextNode) node.getChildren().elementAt(0);
text.setText(value);
} else {
NodeList nodeList = new NodeList();
nodeList.add(new TextNode(value));
node.setChildren(nodeList);
}
} else if (tag instanceof SelectTag) {
if (node.getChildren() != null && node.getChildren().size() > 0) {
for (int i = 0; i < node.getChildren().size(); i++) {
if (node.getChildren().elementAt(i) instanceof OptionTag) {
TagNode optionTag = (TagNode) node.getChildren().elementAt(i);
String optionValue = optionTag.getAttribute("value");
optionValue = replaceHex(optionValue);
String[] values = StringUtil.split(value, StringPool.COMMA);
for (String v : values) {
if (StringUtil.trim(v).equals(optionValue)) {
optionTag.setAttribute("selected", "selected");
}
}
}
}
}
} else {
String type = tag.getAttribute("type");
if (type.equals("checkbox")) {
value = parameters.get(
StringUtil.replace(name, "Checkbox", StringPool.BLANK)).toString();
if (value.equalsIgnoreCase("true")) {
tag.setAttribute("checked", "checked");
}
} else if (type.equals("radio")) {
String valueInput = tag.getAttribute("value");
valueInput = replaceHex(valueInput);
if (value.equals(valueInput)) {
tag.setAttribute("checked", "checked");
}
} else {
tag.setAttribute("value", value, '"');
}
}
}
// select singolo o multiplo senza opzioni fisse
if (tag instanceof SelectTag) {
List<Map<String, Serializable>> options = fieldNameOptions.get(name);
if (options != null && !options.isEmpty()) {
NodeList optionsTag = new NodeList();
for (Map<String, Serializable> option : options) {
String label = MapUtil.getString(option, "label");
String valueOption = MapUtil.getString(option, "value");
boolean defaultValue = MapUtil.getBoolean(option, "default");
// new option
OptionTag optionTag = new OptionTag();
optionTag.setAttribute("value", valueOption, '"');
if (defaultValue && !parameters.containsKey(name)) {
optionTag.setAttribute("selected", "selected");
} else if (Validator.isNotNull(value) && value.equals(valueOption)) {
optionTag.setAttribute("selected", "selected");
}
TextNode textNode = new TextNode(label);
NodeList nodeList = new NodeList();
nodeList.add(textNode);
optionTag.setChildren(nodeList);
optionsTag.add(optionTag);
}
tag.setChildren(optionsTag);
}
} else if ("radio".equals(tag.getAttribute("type"))) {
List<Map<String, Serializable>> options = fieldNameOptions.get(name);
if(options!=null){
for (Map<String, Serializable> option : options) {
String label = MapUtil.getString(option, "label");
String valueOption = MapUtil.getString(option, "value");
boolean defaultValue = MapUtil.getBoolean(option, "default");
if(tag.getAttribute("value").equals(valueOption)){
tag.getNextSibling().setText(label);
}
}
}
}
}
if (node.getChildren() != null) {
for (int i = 0; i < node.getChildren().size(); i++) {
filter(node.getChildren().elementAt(i), parameters, fieldNameOptions, prefix, suffix);
}
}
}
}
private String getNamespace(Node node) {
String namespace = null;
boolean trovato = false;
Node parent = node.getParent();
while (!trovato && parent != null) {
if (parent instanceof TagNode) {
TagNode tag = (TagNode) parent;
String dataFieldNamespace = tag.getAttribute("data-fieldnamespace");
if (Validator.isNotNull(dataFieldNamespace)) {
trovato = true;
namespace = dataFieldNamespace;
}
}
if (!trovato) {
parent = parent.getParent();
}
}
return namespace;
}
private String replaceHex(String s) {
final String prefix = "&#x";
final String suffix = ";";
int index = 0;
while (true) {
int i = s.indexOf(prefix, index);
if (i < 0) {
break;
} else {
int j = s.indexOf(suffix, i);
if (j < 0) {
break;
} else {
String hexCode = s.substring(i, (j + 1));
String hex = hexCode.substring(prefix.length(), hexCode.length() - 1);
try {
s = StringUtil.replace(s, hexCode,
new String(Hex.decodeHex(hex.toCharArray()), StringPool.UTF8));
} catch (Exception e) {}
index = i;
}
}
}
return s;
}
%>

590
liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_tasks/workflow_task_action.jsp

@ -1,296 +1,296 @@
<%--
/**
* Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; eitheistrr version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
--%>
<%@page import="com.liferay.portal.kernel.util.ParamUtil"%>
<%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%>
<%@ include file="/html/portlet/workflow_tasks/init.jsp" %>
<%
String randomId = StringPool.BLANK;
String closeRedirect = ParamUtil.getString(request, "closeRedirect");
//boolean canPortosAssegnatore = ParamUtil.getBoolean(request, "canPortosAssegnatore", false);
//boolean canPortosApprovatore = ParamUtil.getBoolean(request, "canPortosApprovatore", false);
//boolean canPortosIstruttore = ParamUtil.getBoolean(request, "canPortosIstruttore", false);
boolean canPortosAssegnatore = (Boolean)request.getAttribute("canPortosAssegnatore");
boolean canPortosApprovatore = (Boolean)request.getAttribute("canPortosApprovatore");
boolean canPortosIstruttore = (Boolean)request.getAttribute("canPortosIstruttore");
ResultRow row = (ResultRow)request.getAttribute(WebKeys.SEARCH_CONTAINER_RESULT_ROW);
String viewFullContentURLString = ParamUtil.getString(request, "viewFullContentURLString");
// ADT BUG BO ID= 27
String classPkForCarichiLavoro=ParamUtil.getString(request, "classPkForCarichiLavoro");
WorkflowTask workflowTask = null;
if (row != null) {
randomId = StringUtil.randomId();
workflowTask = (WorkflowTask)row.getParameter("workflowTask");
}
else {
workflowTask = (WorkflowTask)request.getAttribute(WebKeys.WORKFLOW_TASK);
}
long[] pooledActorsIds = WorkflowTaskManagerUtil.getPooledActorsIds(company.getCompanyId(), workflowTask.getWorkflowTaskId());
%>
<liferay-ui:icon-menu showExpanded="<%= (row == null) %>" showWhenSingleIcon="<%= (row == null) %>" cssClass="wrap-action">
<div class="task-content-actions">
<liferay-ui:icon-list>
<liferay-ui:icon iconCssClass="icon-eye-open" cssClass="btn btn-large button_custom" message="Visualizza" method="get" target="_blank" url="<%= viewFullContentURLString %>" />
</liferay-ui:icon-list>
</div>
<c:if test="<%= !workflowTask.isCompleted() && _isAssignedToUser(workflowTask, user) %>">
<%
List<String> transitionNames = WorkflowTaskManagerUtil.getNextTransitionNames(company.getCompanyId(), user.getUserId(), workflowTask.getWorkflowTaskId());
for (String transitionName : transitionNames) {
String message = "proceed";
if (Validator.isNotNull(transitionName)) {
message = transitionName;
}
%>
<%
//Non fa nulla ma forse tornera comodo
boolean canCose = true;
if(transitionName.equals("registra-esito") && !canPortosIstruttore){
canCose = false;
} else if(transitionName.equals("approva") && !canPortosApprovatore){
canCose = false;
}
%>
<portlet:actionURL var="editURL">
<portlet:param name="struts_action" value="/workflow_tasks/edit_workflow_task" />
<portlet:param name="<%= Constants.CMD %>" value="<%= Constants.SAVE %>" />
<portlet:param name="redirect" value="<%= currentURL %>" />
<portlet:param name="closeRedirect" value="<%= closeRedirect %>" />
<portlet:param name="workflowTaskId" value="<%= StringUtil.valueOf(workflowTask.getWorkflowTaskId()) %>" />
<portlet:param name="assigneeUserId" value="<%= StringUtil.valueOf(workflowTask.getAssigneeUserId()) %>" />
<c:if test="<%= transitionName != null %>">
<portlet:param name="transitionName" value="<%= transitionName %>" />
</c:if>
</portlet:actionURL>
<portlet:renderURL var="renderFormURL" windowState="<%= LiferayWindowState.POP_UP.toString() %>">
<portlet:param name="struts_action" value="/workflow_tasks/render_form_task" />
<portlet:param name="formName" value='<%= "fm_"+ randomId %>' />
<portlet:param name="workflowTaskId" value="<%= StringUtil.valueOf(workflowTask.getWorkflowTaskId()) %>" />
<portlet:param name="assigneeUserId" value="<%= StringUtil.valueOf(workflowTask.getAssigneeUserId()) %>" />
<c:if test="<%= transitionName != null %>">
<portlet:param name="transitionName" value="<%= transitionName %>" />
</c:if>
</portlet:renderURL>
<portlet:resourceURL var="validationURL">
<portlet:param name="struts_action" value="/workflow_tasks/render_form_task" />
<portlet:param name="workflowTaskId" value="<%= StringUtil.valueOf(workflowTask.getWorkflowTaskId()) %>" />
<portlet:param name="assigneeUserId" value="<%= StringUtil.valueOf(workflowTask.getAssigneeUserId()) %>" />
<c:if test="<%= transitionName != null %>">
<portlet:param name="transitionName" value="<%= transitionName %>" />
</c:if>
</portlet:resourceURL>
<%
Map<String, Object> data = new HashMap<String, Object>();
data.put("href-validation", validationURL);
data.put("href-render-form", renderFormURL);
%>
<liferay-ui:icon
iconCssClass="icon-random"
linkCssClass='<%= "workflow-task-" + randomId + " task-change-status-link btn btn-large button_custom" %>'
id='<%= randomId + transitionName + "taskChangeStatusLink" %>'
message="<%= message %>"
method="get"
url="<%= editURL %>"
data="<%= data %>"
/>
<%
}
%>
</c:if>
<c:if test='<%= !workflowTask.isCompleted() && !_isAssignedToUser(workflowTask, user) && !workflowTask.getName().equalsIgnoreCase("esito") && canPortosAssegnatore%>'>
<portlet:actionURL var="assignToMeURL">
<portlet:param name="struts_action" value="/workflow_tasks/edit_workflow_task" />
<portlet:param name="<%= Constants.CMD %>" value="<%= Constants.ASSIGN %>" />
<portlet:param name="redirect" value="<%= currentURL %>" />
<portlet:param name="closeRedirect" value="<%= closeRedirect %>" />
<portlet:param name="workflowTaskId" value="<%= String.valueOf(workflowTask.getWorkflowTaskId()) %>" />
<portlet:param name="assigneeUserId" value="<%= String.valueOf(user.getUserId()) %>" />
</portlet:actionURL>
<liferay-ui:icon
iconCssClass="icon-reply"
linkCssClass='<%= "workflow-task-" + randomId + " task-assign-to-me-link btn btn-large button_custom btn-action" %>'
id='<%= randomId + "taskAssignToMeLink" %>'
message="assign-to-me"
method="get"
url="<%= assignToMeURL %>"
/>
</c:if>
<c:if test="<%= _hasOtherAssignees(pooledActorsIds, workflowTask, user) %>">
<portlet:actionURL var="assignURL">
<portlet:param name="struts_action" value="/workflow_tasks/edit_workflow_task" />
<portlet:param name="<%= Constants.CMD %>" value="<%= Constants.ASSIGN %>" />
<portlet:param name="redirect" value="<%= currentURL %>" />
<portlet:param name="closeRedirect" value="<%= closeRedirect %>" />
<portlet:param name="workflowTaskId" value="<%= String.valueOf(workflowTask.getWorkflowTaskId()) %>" />
<!-- ADT BUG BO id = 27 -->
<portlet:param name="classPkForCarichiLavoro" value="<%= classPkForCarichiLavoro %>" />
</portlet:actionURL>
<liferay-ui:icon
iconCssClass="icon-share-alt"
linkCssClass='<%= "workflow-task-" + randomId + " task-assign-link btn btn-large button_custom" %>'
id='<%= randomId + "taskAssignLink" %>'
message="assign-to-..."
method="get"
url="<%= assignURL %>"
/>
</c:if>
<%-- <c:if test="<%= !workflowTask.isCompleted() %>">
<portlet:actionURL var="updateDueDateURL">
<portlet:param name="struts_action" value="/workflow_tasks/edit_workflow_task" />
<portlet:param name="<%= Constants.CMD %>" value="<%= Constants.UPDATE %>" />
<portlet:param name="redirect" value="<%= currentURL %>" />
<portlet:param name="workflowTaskId" value="<%= StringUtil.valueOf(workflowTask.getWorkflowTaskId()) %>" />
</portlet:actionURL>
<liferay-ui:icon
cssClass='<%= "workflow-task-" + randomId + " task-due-date-link" %>'
id='<%= randomId + "taskDueDateLink" %>'
image="time"
message="update-due-date"
method="get"
url="<%= updateDueDateURL %>"
/>
</c:if> --%>
</liferay-ui:icon-menu>
<%-- <div class="hide" id="<%= randomId %>updateAsignee">
<c:if test="<%= _hasOtherAssignees(pooledActorsIds, workflowTask, user) %>">
<aui:select label="assign-to" name="assigneeUserId">
<%
for (long pooledActorId : pooledActorsIds) {
if (pooledActorId == user.getUserId()) {
continue;
}
%>
<aui:option label="<%= HtmlUtil.escape(PortalUtil.getUserName(pooledActorId, StringPool.BLANK)) %>" selected="<%= workflowTask.getAssigneeUserId() == pooledActorId %>" value="<%= String.valueOf(pooledActorId) %>" />
<%
}
%>
</aui:select>
</c:if>
</div> --%>
<div class="hide" id="<%= randomId %>updateAsigneeToMe">
<aui:input name="asigneeUserId" type="hidden" value="<%= user.getUserId() %>" />
</div>
<div class="hide" id="<%= randomId %>updateDueDate">
<aui:input bean="<%= workflowTask %>" model="<%= WorkflowTask.class %>" name="dueDate" />
</div>
<div class="hide" id="<%= randomId %>updateComments">
<%-- hook tref-ekaleo --%>
<div id="<%= randomId %>formError"></div>
<div id="<%= randomId %>form"></div>
<aui:input cols="105" name="comment" rows="10" type="textarea" required="true" />
</div>
<%-- hook tref-ekaleo --%>
<aui:script use="liferay-workflow-tasks,aui-io-plugin-deprecated">
var onTaskClickFn = A.rbind('onTaskClick', Liferay.WorkflowTasks, '<%= randomId %>');
<c:if test="<%= !workflowTask.isCompleted() && _isAssignedToUser(workflowTask, user) %>">
var renderFormFn = A.rbind('renderForm', Liferay.WorkflowTasks, '<%= randomId %>');
<%
List<String> transitionNames = WorkflowTaskManagerUtil.getNextTransitionNames(company.getCompanyId(), user.getUserId(), workflowTask.getWorkflowTaskId());
for (String transitionName : transitionNames) {
String message = "proceed";
if (Validator.isNotNull(transitionName)) {
message = transitionName;
}
%>
Liferay.delegateClick('<portlet:namespace /><%= randomId + transitionName %>taskChangeStatusLink', renderFormFn);
<%
}
%>
</c:if>
Liferay.delegateClick('<portlet:namespace /><%= randomId %>taskAssignToMeLink', onTaskClickFn);
Liferay.delegateClick('<portlet:namespace /><%= randomId %>taskAssignLink', onTaskClickFn);
Liferay.delegateClick('<portlet:namespace /><%= randomId %>taskDueDateLink', onTaskClickFn);
</aui:script>
<style>
.wrap-action {
list-style: none;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
}
.wrap-action .btn {
margin: 2px;
}
.button_custom {
min-width: 140px!important;
}
<%--
/**
* Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; eitheistrr version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
--%>
<%@page import="com.liferay.portal.kernel.util.ParamUtil"%>
<%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%>
<%@ include file="/html/portlet/workflow_tasks/init.jsp" %>
<%
String randomId = StringPool.BLANK;
String closeRedirect = ParamUtil.getString(request, "closeRedirect");
//boolean canPortosAssegnatore = ParamUtil.getBoolean(request, "canPortosAssegnatore", false);
//boolean canPortosApprovatore = ParamUtil.getBoolean(request, "canPortosApprovatore", false);
//boolean canPortosIstruttore = ParamUtil.getBoolean(request, "canPortosIstruttore", false);
boolean canPortosAssegnatore = (Boolean)request.getAttribute("canPortosAssegnatore");
boolean canPortosApprovatore = (Boolean)request.getAttribute("canPortosApprovatore");
boolean canPortosIstruttore = (Boolean)request.getAttribute("canPortosIstruttore");
ResultRow row = (ResultRow)request.getAttribute(WebKeys.SEARCH_CONTAINER_RESULT_ROW);
String viewFullContentURLString = ParamUtil.getString(request, "viewFullContentURLString");
// ADT BUG BO ID= 27
String classPkForCarichiLavoro=ParamUtil.getString(request, "classPkForCarichiLavoro");
WorkflowTask workflowTask = null;
if (row != null) {
randomId = StringUtil.randomId();
workflowTask = (WorkflowTask)row.getParameter("workflowTask");
}
else {
workflowTask = (WorkflowTask)request.getAttribute(WebKeys.WORKFLOW_TASK);
}
long[] pooledActorsIds = WorkflowTaskManagerUtil.getPooledActorsIds(company.getCompanyId(), workflowTask.getWorkflowTaskId());
%>
<liferay-ui:icon-menu showExpanded="<%= (row == null) %>" showWhenSingleIcon="<%= (row == null) %>" cssClass="wrap-action">
<div class="task-content-actions">
<liferay-ui:icon-list>
<liferay-ui:icon iconCssClass="icon-eye-open" cssClass="btn btn-large button_custom" message="Visualizza" method="get" target="_blank" url="<%= viewFullContentURLString %>" />
</liferay-ui:icon-list>
</div>
<c:if test="<%= !workflowTask.isCompleted() && _isAssignedToUser(workflowTask, user) %>">
<%
List<String> transitionNames = WorkflowTaskManagerUtil.getNextTransitionNames(company.getCompanyId(), user.getUserId(), workflowTask.getWorkflowTaskId());
for (String transitionName : transitionNames) {
String message = "proceed";
if (Validator.isNotNull(transitionName)) {
message = transitionName;
}
%>
<%
//Non fa nulla ma forse tornera comodo
boolean canCose = true;
if(transitionName.equals("registra-esito") && !canPortosIstruttore){
canCose = false;
} else if(transitionName.equals("approva") && !canPortosApprovatore){
canCose = false;
}
%>
<portlet:actionURL var="editURL">
<portlet:param name="struts_action" value="/workflow_tasks/edit_workflow_task" />
<portlet:param name="<%= Constants.CMD %>" value="<%= Constants.SAVE %>" />
<portlet:param name="redirect" value="<%= currentURL %>" />
<portlet:param name="closeRedirect" value="<%= closeRedirect %>" />
<portlet:param name="workflowTaskId" value="<%= StringUtil.valueOf(workflowTask.getWorkflowTaskId()) %>" />
<portlet:param name="assigneeUserId" value="<%= StringUtil.valueOf(workflowTask.getAssigneeUserId()) %>" />
<c:if test="<%= transitionName != null %>">
<portlet:param name="transitionName" value="<%= transitionName %>" />
</c:if>
</portlet:actionURL>
<portlet:renderURL var="renderFormURL" windowState="<%= LiferayWindowState.POP_UP.toString() %>">
<portlet:param name="struts_action" value="/workflow_tasks/render_form_task" />
<portlet:param name="formName" value='<%= "fm_"+ randomId %>' />
<portlet:param name="workflowTaskId" value="<%= StringUtil.valueOf(workflowTask.getWorkflowTaskId()) %>" />
<portlet:param name="assigneeUserId" value="<%= StringUtil.valueOf(workflowTask.getAssigneeUserId()) %>" />
<c:if test="<%= transitionName != null %>">
<portlet:param name="transitionName" value="<%= transitionName %>" />
</c:if>
</portlet:renderURL>
<portlet:resourceURL var="validationURL">
<portlet:param name="struts_action" value="/workflow_tasks/render_form_task" />
<portlet:param name="workflowTaskId" value="<%= StringUtil.valueOf(workflowTask.getWorkflowTaskId()) %>" />
<portlet:param name="assigneeUserId" value="<%= StringUtil.valueOf(workflowTask.getAssigneeUserId()) %>" />
<c:if test="<%= transitionName != null %>">
<portlet:param name="transitionName" value="<%= transitionName %>" />
</c:if>
</portlet:resourceURL>
<%
Map<String, Object> data = new HashMap<String, Object>();
data.put("href-validation", validationURL);
data.put("href-render-form", renderFormURL);
%>
<liferay-ui:icon
iconCssClass="icon-random"
linkCssClass='<%= "workflow-task-" + randomId + " task-change-status-link btn btn-large button_custom" %>'
id='<%= randomId + transitionName + "taskChangeStatusLink" %>'
message="<%= message %>"
method="get"
url="<%= editURL %>"
data="<%= data %>"
/>
<%
}
%>
</c:if>
<c:if test='<%= !workflowTask.isCompleted() && !_isAssignedToUser(workflowTask, user) && !workflowTask.getName().equalsIgnoreCase("esito") && canPortosAssegnatore%>'>
<portlet:actionURL var="assignToMeURL">
<portlet:param name="struts_action" value="/workflow_tasks/edit_workflow_task" />
<portlet:param name="<%= Constants.CMD %>" value="<%= Constants.ASSIGN %>" />
<portlet:param name="redirect" value="<%= currentURL %>" />
<portlet:param name="closeRedirect" value="<%= closeRedirect %>" />
<portlet:param name="workflowTaskId" value="<%= String.valueOf(workflowTask.getWorkflowTaskId()) %>" />
<portlet:param name="assigneeUserId" value="<%= String.valueOf(user.getUserId()) %>" />
</portlet:actionURL>
<liferay-ui:icon
iconCssClass="icon-reply"
linkCssClass='<%= "workflow-task-" + randomId + " task-assign-to-me-link btn btn-large button_custom btn-action" %>'
id='<%= randomId + "taskAssignToMeLink" %>'
message="assign-to-me"
method="get"
url="<%= assignToMeURL %>"
/>
</c:if>
<c:if test="<%= _hasOtherAssignees(pooledActorsIds, workflowTask, user) %>">
<portlet:actionURL var="assignURL">
<portlet:param name="struts_action" value="/workflow_tasks/edit_workflow_task" />
<portlet:param name="<%= Constants.CMD %>" value="<%= Constants.ASSIGN %>" />
<portlet:param name="redirect" value="<%= currentURL %>" />
<portlet:param name="closeRedirect" value="<%= closeRedirect %>" />
<portlet:param name="workflowTaskId" value="<%= String.valueOf(workflowTask.getWorkflowTaskId()) %>" />
<!-- ADT BUG BO id = 27 -->
<portlet:param name="classPkForCarichiLavoro" value="<%= classPkForCarichiLavoro %>" />
</portlet:actionURL>
<liferay-ui:icon
iconCssClass="icon-share-alt"
linkCssClass='<%= "workflow-task-" + randomId + " task-assign-link btn btn-large button_custom" %>'
id='<%= randomId + "taskAssignLink" %>'
message="assign-to-..."
method="get"
url="<%= assignURL %>"
/>
</c:if>
<%-- <c:if test="<%= !workflowTask.isCompleted() %>">
<portlet:actionURL var="updateDueDateURL">
<portlet:param name="struts_action" value="/workflow_tasks/edit_workflow_task" />
<portlet:param name="<%= Constants.CMD %>" value="<%= Constants.UPDATE %>" />
<portlet:param name="redirect" value="<%= currentURL %>" />
<portlet:param name="workflowTaskId" value="<%= StringUtil.valueOf(workflowTask.getWorkflowTaskId()) %>" />
</portlet:actionURL>
<liferay-ui:icon
cssClass='<%= "workflow-task-" + randomId + " task-due-date-link" %>'
id='<%= randomId + "taskDueDateLink" %>'
image="time"
message="update-due-date"
method="get"
url="<%= updateDueDateURL %>"
/>
</c:if> --%>
</liferay-ui:icon-menu>
<%-- <div class="hide" id="<%= randomId %>updateAsignee">
<c:if test="<%= _hasOtherAssignees(pooledActorsIds, workflowTask, user) %>">
<aui:select label="assign-to" name="assigneeUserId">
<%
for (long pooledActorId : pooledActorsIds) {
if (pooledActorId == user.getUserId()) {
continue;
}
%>
<aui:option label="<%= HtmlUtil.escape(PortalUtil.getUserName(pooledActorId, StringPool.BLANK)) %>" selected="<%= workflowTask.getAssigneeUserId() == pooledActorId %>" value="<%= String.valueOf(pooledActorId) %>" />
<%
}
%>
</aui:select>
</c:if>
</div> --%>
<div class="hide" id="<%= randomId %>updateAsigneeToMe">
<aui:input name="asigneeUserId" type="hidden" value="<%= user.getUserId() %>" />
</div>
<div class="hide" id="<%= randomId %>updateDueDate">
<aui:input bean="<%= workflowTask %>" model="<%= WorkflowTask.class %>" name="dueDate" />
</div>
<div class="hide" id="<%= randomId %>updateComments">
<%-- hook tref-ekaleo --%>
<div id="<%= randomId %>formError"></div>
<div id="<%= randomId %>form"></div>
<aui:input cols="105" name="comment" rows="10" type="textarea" required="true" />
</div>
<%-- hook tref-ekaleo --%>
<aui:script use="liferay-workflow-tasks,aui-io-plugin-deprecated">
var onTaskClickFn = A.rbind('onTaskClick', Liferay.WorkflowTasks, '<%= randomId %>');
<c:if test="<%= !workflowTask.isCompleted() && _isAssignedToUser(workflowTask, user) %>">
var renderFormFn = A.rbind('renderForm', Liferay.WorkflowTasks, '<%= randomId %>');
<%
List<String> transitionNames = WorkflowTaskManagerUtil.getNextTransitionNames(company.getCompanyId(), user.getUserId(), workflowTask.getWorkflowTaskId());
for (String transitionName : transitionNames) {
String message = "proceed";
if (Validator.isNotNull(transitionName)) {
message = transitionName;
}
%>
Liferay.delegateClick('<portlet:namespace /><%= randomId + transitionName %>taskChangeStatusLink', renderFormFn);
<%
}
%>
</c:if>
Liferay.delegateClick('<portlet:namespace /><%= randomId %>taskAssignToMeLink', onTaskClickFn);
Liferay.delegateClick('<portlet:namespace /><%= randomId %>taskAssignLink', onTaskClickFn);
Liferay.delegateClick('<portlet:namespace /><%= randomId %>taskDueDateLink', onTaskClickFn);
</aui:script>
<style>
.wrap-action {
list-style: none;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
}
.wrap-action .btn {
margin: 2px;
}
.button_custom {
min-width: 140px!important;
}
</style>
Caricamento…
Annulla
Salva