Salvatore La Manna 4 anni fa
parent
commit
2149968ba4
  1. 630
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_instances/workflow_logs.jspf

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

@ -1,316 +1,316 @@
<%-- <%--
/** /**
* Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
* *
* This library is free software; you can redistribute it and/or modify it under * 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 * 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) * Software Foundation; either version 2.1 of the License, or (at your option)
* any later version. * any later version.
* *
* This library is distributed in the hope that it will be useful, but WITHOUT * 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 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details. * details.
*/ */
--%> --%>
<%@page import="com.liferay.portal.kernel.json.JSONException"%> <%@page import="com.liferay.portal.kernel.json.JSONException"%>
<%@page import="com.liferay.portal.kernel.util.Validator"%> <%@page import="com.liferay.portal.kernel.util.Validator"%>
<%@page import="com.liferay.portal.kernel.json.JSONFactoryUtil"%> <%@page import="com.liferay.portal.kernel.json.JSONFactoryUtil"%>
<%@page import="com.liferay.portal.kernel.json.JSONObject"%> <%@page import="com.liferay.portal.kernel.json.JSONObject"%>
<%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%> <%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%>
<table class="table table-striped attivita-table" <%-- id="<portlet:namespace/>_<%= workflowLog.getType() %>" --%>> <table class="table table-striped attivita-table" <%-- id="<portlet:namespace/>_<%= workflowLog.getType() %>" --%>>
<thead class="table-columns attivita-group__head"> <thead class="table-columns attivita-group__head">
<tr> <tr>
<th class="head-date text-center">Data</th> <th class="head-date text-center">Data</th>
<th class="head-description">Descrizione</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> <th class="head-comment text-center">Commento</th>
</tr> </tr>
</thead> </thead>
<tbody class="attivita-group__body"> <tbody class="attivita-group__body">
<% <%
//ADT: bug bo id=33 //ADT: bug bo id=33
Map<Long,String> historyWorkflowEsitiLogs = (Map<Long,String>)request.getAttribute("historyWorkflowEsitiLogs"); Map<Long,String> historyWorkflowEsitiLogs = (Map<Long,String>)request.getAttribute("historyWorkflowEsitiLogs");
for (WorkflowLog workflowLog : workflowLogs) { for (WorkflowLog workflowLog : workflowLogs) {
Role curRole = null; Role curRole = null;
User curUser = null; User curUser = null;
String actorName = null; String actorName = null;
if (workflowLog.getRoleId() != 0) { if (workflowLog.getRoleId() != 0) {
curRole = RoleLocalServiceUtil.getRole(workflowLog.getRoleId()); curRole = RoleLocalServiceUtil.getRole(workflowLog.getRoleId());
actorName = curRole.getDescriptiveName(); actorName = curRole.getDescriptiveName();
} }
else if (workflowLog.getUserId() != 0) { else if (workflowLog.getUserId() != 0) {
curUser = UserLocalServiceUtil.getUser(workflowLog.getUserId()); curUser = UserLocalServiceUtil.getUser(workflowLog.getUserId());
actorName = curUser.getFullName(); actorName = curUser.getFullName();
} }
String kaleoNodeName = null; String kaleoNodeName = null;
String transitionName = null; String transitionName = null;
try { try {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject(workflowLog.getState()); JSONObject jsonObject = JSONFactoryUtil.createJSONObject(workflowLog.getState());
kaleoNodeName = jsonObject.getString("kaleoNodeName"); kaleoNodeName = jsonObject.getString("kaleoNodeName");
transitionName = jsonObject.getString("transitionName"); transitionName = jsonObject.getString("transitionName");
} catch (JSONException e) { } catch (JSONException e) {
kaleoNodeName = workflowLog.getState(); kaleoNodeName = workflowLog.getState();
} }
%> %>
<tr> <tr>
<td class="text-center date-col"> <td class="text-center date-col">
<%= dateFormatDateTime.format(workflowLog.getCreateDate()) %> <%= dateFormatDateTime.format(workflowLog.getCreateDate()) %>
</td> </td>
<td class="description-col"> <td class="description-col">
<c:choose> <c:choose>
<c:when test="<%= workflowLog.getType() == WorkflowLog.TASK_COMPLETION %>"> <c:when test="<%= workflowLog.getType() == WorkflowLog.TASK_COMPLETION %>">
<div> <div>
<c:choose> <c:choose>
<c:when test="<%= Validator.isNull(transitionName) %>"> <c:when test="<%= Validator.isNull(transitionName) %>">
<liferay-ui:message arguments="<%= new Object[] {HtmlUtil.escape(actorName), kaleoNodeName} %>" key="x-completed-the-task-x" /> <liferay-ui:message arguments="<%= new Object[] {HtmlUtil.escape(actorName), kaleoNodeName} %>" key="x-completed-the-task-x" />
</c:when> </c:when>
<c:otherwise> <c:otherwise>
<c:if test='<%= "registra-esito".equalsIgnoreCase(transitionName) %>'> <c:if test='<%= "registra-esito".equalsIgnoreCase(transitionName) %>'>
<% <%
//ADT: bug bo id=33 //ADT: bug bo id=33
String esito = (String)request.getAttribute("registra-esito-value"); String esito = (String)request.getAttribute("registra-esito-value");
if (historyWorkflowEsitiLogs!=null&& historyWorkflowEsitiLogs.containsKey(workflowLog.getWorkflowLogId()) ){ if (historyWorkflowEsitiLogs!=null&& historyWorkflowEsitiLogs.containsKey(workflowLog.getWorkflowLogId()) ){
esito=historyWorkflowEsitiLogs.get(workflowLog.getWorkflowLogId()); esito=historyWorkflowEsitiLogs.get(workflowLog.getWorkflowLogId());
} }
%> %>
<liferay-ui:message arguments="<%= new Object[] {HtmlUtil.escape(actorName), kaleoNodeName, esito} %>" key="x-completed-the-task-y-z" /> <liferay-ui:message arguments="<%= new Object[] {HtmlUtil.escape(actorName), kaleoNodeName, esito} %>" key="x-completed-the-task-y-z" />
</c:if> </c:if>
<c:if test='<%= "assegna".equalsIgnoreCase(transitionName) %>'> <c:if test='<%= "assegna".equalsIgnoreCase(transitionName) %>'>
<% <%
String assegna = (String)request.getAttribute("assegna-value"); String assegna = (String)request.getAttribute("assegna-value");
%> %>
<liferay-ui:message arguments="<%= new Object[] {HtmlUtil.escape(actorName), kaleoNodeName, assegna} %>" key="x-completed-the-task-y-z" /> <liferay-ui:message arguments="<%= new Object[] {HtmlUtil.escape(actorName), kaleoNodeName, assegna} %>" key="x-completed-the-task-y-z" />
</c:if> </c:if>
<c:if test='<%= !"assegna".equalsIgnoreCase(transitionName) && !"registra-esito".equalsIgnoreCase(transitionName) %>'> <c:if test='<%= !"assegna".equalsIgnoreCase(transitionName) && !"registra-esito".equalsIgnoreCase(transitionName) %>'>
<liferay-ui:message arguments="<%= new Object[] {HtmlUtil.escape(actorName), kaleoNodeName} %>" key="x-completed-the-task-x" /> <liferay-ui:message arguments="<%= new Object[] {HtmlUtil.escape(actorName), kaleoNodeName} %>" key="x-completed-the-task-x" />
</c:if> </c:if>
</c:otherwise> </c:otherwise>
</c:choose> </c:choose>
<portlet:renderURL var="historyFormTaskURL" windowState="<%= LiferayWindowState.POP_UP.toString() %>"> <portlet:renderURL var="historyFormTaskURL" windowState="<%= LiferayWindowState.POP_UP.toString() %>">
<portlet:param name="struts_action" value="/workflow_tasks/render_history_form_task" /> <portlet:param name="struts_action" value="/workflow_tasks/render_history_form_task" />
<portlet:param name="workflowTaskId" value="<%= StringUtil.valueOf(workflowLog.getWorkflowTaskId()) %>" /> <portlet:param name="workflowTaskId" value="<%= StringUtil.valueOf(workflowLog.getWorkflowTaskId()) %>" />
</portlet:renderURL> </portlet:renderURL>
<span>&nbsp;</span> <span>&nbsp;</span>
<liferay-ui:icon <liferay-ui:icon
image="history" image="history"
url='<%=historyFormTaskURL %>' url='<%=historyFormTaskURL %>'
useDialog='<%=true %>' useDialog='<%=true %>'
/> />
</div> </div>
</c:when> </c:when>
<c:when test="<%= workflowLog.getType() == WorkflowLog.TASK_UPDATE %>"> <c:when test="<%= workflowLog.getType() == WorkflowLog.TASK_UPDATE %>">
<div> <div>
<liferay-ui:message arguments="<%= HtmlUtil.escape(actorName) %>" key="x-updated-the-due-date" /> <liferay-ui:message arguments="<%= HtmlUtil.escape(actorName) %>" key="x-updated-the-due-date" />
</div> </div>
</c:when> </c:when>
<c:when test="<%= workflowLog.getType() == WorkflowLog.TRANSITION %>"> <c:when test="<%= workflowLog.getType() == WorkflowLog.TRANSITION %>">
<div> <div>
<liferay-ui:message arguments="<%= new Object[] {HtmlUtil.escape(actorName), workflowLog.getState()} %>" key="x-sent-signal-x" /> <liferay-ui:message arguments="<%= new Object[] {HtmlUtil.escape(actorName), workflowLog.getState()} %>" key="x-sent-signal-x" />
</div> </div>
</c:when> </c:when>
<c:otherwise> <c:otherwise>
<c:choose> <c:choose>
<c:when test="<%= (curUser != null) && (workflowLog.getAuditUserId() == curUser.getUserId()) %>"> <c:when test="<%= (curUser != null) && (workflowLog.getAuditUserId() == curUser.getUserId()) %>">
<div> <div>
<liferay-ui:message arguments="<%= HtmlUtil.escape(curUser.getFullName()) %>" key='<%= curUser.isMale() ? "x-assigned-the-task-to-himself" : "x-assigned-the-task-to-herself" %>' /> <liferay-ui:message arguments="<%= HtmlUtil.escape(curUser.getFullName()) %>" key='<%= curUser.isMale() ? "x-assigned-the-task-to-himself" : "x-assigned-the-task-to-herself" %>' />
</div> </div>
</c:when> </c:when>
<c:otherwise> <c:otherwise>
<% <%
if (curRole == null) { if (curRole == null) {
String assignerName = PortalUtil.getUserName(workflowLog.getAuditUserId(), StringPool.BLANK); String assignerName = PortalUtil.getUserName(workflowLog.getAuditUserId(), StringPool.BLANK);
%> %>
<div> <div>
<liferay-ui:message arguments="<%= new Object[] {HtmlUtil.escape(assignerName), HtmlUtil.escape(actorName)} %>" key="x-assigned-the-task-to-x" /> <liferay-ui:message arguments="<%= new Object[] {HtmlUtil.escape(assignerName), HtmlUtil.escape(actorName)} %>" key="x-assigned-the-task-to-x" />
<c:if test="<%= workflowLog.getPreviousUserId() != 0 %>"> <c:if test="<%= workflowLog.getPreviousUserId() != 0 %>">
<liferay-ui:message arguments="<%= PortalUtil.getUserName(workflowLog.getPreviousUserId(), StringPool.BLANK) %>" key="previous-assignee-was-x" /> <liferay-ui:message arguments="<%= PortalUtil.getUserName(workflowLog.getPreviousUserId(), StringPool.BLANK) %>" key="previous-assignee-was-x" />
</c:if> </c:if>
</div> </div>
<% <%
} }
else { else {
%> %>
<div> <div>
<liferay-ui:message arguments="<%= HtmlUtil.escape(actorName) %>" key="task-initially-assigned-to-the-x-role" /> <liferay-ui:message arguments="<%= HtmlUtil.escape(actorName) %>" key="task-initially-assigned-to-the-x-role" />
</div> </div>
<% <%
} }
%> %>
</c:otherwise> </c:otherwise>
</c:choose> </c:choose>
</c:otherwise> </c:otherwise>
</c:choose> </c:choose>
</td> </td>
<td class="text-center activity-col"> <td class="text-center activity-col">
<% <%
if(Validator.isNotNull(kaleoNodeName)){ if(Validator.isNotNull(kaleoNodeName)){
out.print(kaleoNodeName); out.print(kaleoNodeName);
if(Validator.isNotNull(transitionName)){ if(Validator.isNotNull(transitionName)){
if("registra-esito".equalsIgnoreCase(transitionName)){ if("registra-esito".equalsIgnoreCase(transitionName)){
//out.print(" ( " + (String)request.getAttribute("registra-esito-value") + " ) "); //out.print(" ( " + (String)request.getAttribute("registra-esito-value") + " ) ");
//ADT BUG BO ID=33 //ADT BUG BO ID=33
String esito = (String)request.getAttribute("registra-esito-value"); String esito = (String)request.getAttribute("registra-esito-value");
if (historyWorkflowEsitiLogs!=null&& historyWorkflowEsitiLogs.containsKey(workflowLog.getWorkflowLogId()) ){ if (historyWorkflowEsitiLogs!=null&& historyWorkflowEsitiLogs.containsKey(workflowLog.getWorkflowLogId()) ){
esito=historyWorkflowEsitiLogs.get(workflowLog.getWorkflowLogId()); esito=historyWorkflowEsitiLogs.get(workflowLog.getWorkflowLogId());
} }
out.print(" ( " + esito + " ) "); out.print(" ( " + esito + " ) ");
} else if("assegna".equalsIgnoreCase(transitionName)){ } else if("assegna".equalsIgnoreCase(transitionName)){
out.print(" ( " + (String)request.getAttribute("assegna-value") + " ) "); out.print(" ( " + (String)request.getAttribute("assegna-value") + " ) ");
} }
} }
} }
%> %>
</td> </td>
<td class="activity-note"> <td class="activity-note">
<c:if test='<%=Validator.isNotNull(workflowLog.getComment()) && !"Assigned initial task.".equals(workflowLog.getComment()) %>'> <c:if test='<%=Validator.isNotNull(workflowLog.getComment()) && !"Assigned initial task.".equals(workflowLog.getComment()) %>'>
<div class="post-it-note"> <div class="post-it-note">
<div class="header-post-it"> <div class="header-post-it">
<p class="header-post-it_date"><%= dateFormatDateTime.format(workflowLog.getCreateDate()) %></p> <p class="header-post-it_date"><%= dateFormatDateTime.format(workflowLog.getCreateDate()) %></p>
<p class="header-post-it_name"> <p class="header-post-it_name">
<c:if test="<%=Validator.isNotNull(curUser) %>"> <c:if test="<%=Validator.isNotNull(curUser) %>">
<%= curUser.getFullName() %> <%= curUser.getFullName() %>
</c:if> </c:if>
</p> </p>
</div> </div>
<div class="body-post-it"> <div class="body-post-it">
<%= HtmlUtil.escape(workflowLog.getComment()) %> <%= HtmlUtil.escape(workflowLog.getComment()) %>
</div> </div>
</div> </div>
</c:if> </c:if>
</td> </td>
</tr> </tr>
<%-- <div class="task-activity task-type-<%= workflowLog.getType() %>"> <%-- <div class="task-activity task-type-<%= workflowLog.getType() %>">
<div> <div>
</div> </div>
</div> --%> </div> --%>
<% <%
} }
%> %>
</tbody> </tbody>
</table> </table>
<style> <style>
.head-date { .head-date {
width: 120px; width: 120px;
} }
.head-description { .head-description {
width: 60%; width: 60%;
} }
.head-activity { .head-activity {
width: 150px; width: 150px;
} }
.head-comment { .head-comment {
width: 40%; width: 40%;
} }
.attivita-table { .attivita-table {
overflow: auto!important; overflow: auto!important;
table-layout: fixed; table-layout: fixed;
} }
.attivita-table thead th { .attivita-table thead th {
background-color: #812121!important; background-color: #812121!important;
color: white; color: white;
} }
.attivita-table td { .attivita-table td {
border: 1px solid #dddddd; border: 1px solid #dddddd;
} }
.activity-note { .activity-note {
padding-bottom: 40px!important; padding-bottom: 40px!important;
} }
.post-it-note { .post-it-note {
min-width: 13em; min-width: 13em;
background: rgb(255,215,7); background: rgb(255,215,7);
position: relative; position: relative;
/* box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); */ /* box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); */
} }
.post-it-note:after { .post-it-note:after {
content: ""; content: "";
position: absolute; position: absolute;
bottom: -2em; bottom: -2em;
left: 0; left: 0;
right: 2em; right: 2em;
border-width: 1em; border-width: 1em;
border-style: solid; border-style: solid;
border-color: rgb(255,215,7); border-color: rgb(255,215,7);
} }
.post-it-note:before { .post-it-note:before {
content: ""; content: "";
position: absolute; position: absolute;
bottom: -2em; bottom: -2em;
right: 0; right: 0;
border-width: 2em 2em 0 0; border-width: 2em 2em 0 0;
border-style: solid; border-style: solid;
border-color: #d3b100 transparent; border-color: #d3b100 transparent;
} }
.header-post-it { .header-post-it {
background-color: rgba(211, 177, 0, 0.30); background-color: rgba(211, 177, 0, 0.30);
display: -webkit-box; display: -webkit-box;
display: -ms-flexbox; display: -ms-flexbox;
display: flex; display: flex;
-webkit-box-align: center; -webkit-box-align: center;
-ms-flex-align: center; -ms-flex-align: center;
align-items: center; align-items: center;
-webkit-box-pack: justify; -webkit-box-pack: justify;
-ms-flex-pack: justify; -ms-flex-pack: justify;
justify-content: space-between; justify-content: space-between;
padding: 5px; padding: 5px;
} }
.header-post-it p { .header-post-it p {
margin: 0; margin: 0;
padding: 0; padding: 0;
font-weight: bold; font-weight: bold;
font-size: 12px; font-size: 12px;
} }
.body-post-it { .body-post-it {
padding: 5px 10px 0px 10px; padding: 5px 10px 0px 10px;
} }
</style> </style>
Caricamento…
Annulla
Salva