<%@ include file="/project/include.jsp" %>

<%@ page import = "java.util.Calendar" %>
<%@ page import = "java.util.Date" %>
<%@ page import = "java.util.List" %>
<%@ page import = "it.cedaf.commons.DateLib" %>
<%@ page import = "it.cedaf.commons.StringLib" %>
<%@ page import = "it.cedaf.juice.mvc.view.customtags.misc.UrlFunctions" %>
<%@ page import = "it.cedaf.icare.quadririassuntivi.view.dto.QuadroRiassuntivoJspSupport" %>
<%@ page import = "it.cedaf.icare.business.managers.quadririassuntivi.Info" %>
<%@ page import = "it.cedaf.icare.quadririassuntivi.view.dto.PresaInCaricoItem" %>
<%@ page import = "it.cedaf.icare.business.managers.quadririassuntivi.PresaInCaricoInfo" %>


<% 
PresaInCaricoItem item = (PresaInCaricoItem) request.getAttribute("currentItem");	
PresaInCaricoInfo picInfo = item.getPresaInCaricoInfo(); 

Info info = QuadroRiassuntivoJspSupport.getInfo(item);
String responsabile = getStringValue(info.getOperatoreResponsabile());
String emailAddress = info.getMailOperatoreResponsabile();
if (!StringLib.isNullOrEmptyString(emailAddress)) {
	responsabile = "<a href='mailto:" + emailAddress + "'>" + responsabile + "</a>";
}

Date itemFrom = item.getFrom();
Date itemTo = item.getTo();
String itemFrom_str = DateLib.format(itemFrom);
String itemTo_str = "&nbsp;";
if (itemTo != null && item.getRange() && item.getCompleted()) {
	itemTo_str = DateLib.format(itemTo);
}
%>


<td width="50%">
	<table>
		<tr>
			<td class="gantt-detail-label"><shell:label prop="dataInizio" /></td>
			<td class="gantt-detail-value"><%=itemFrom_str%></td>	
		</tr>
		<tr>
			<td class="gantt-detail-label"><shell:label prop="operatoreResponsabile" /></td>
			<td class="gantt-detail-value"><%=responsabile%></td>	
		</tr>
	</table>
</td>
<td width="50%">
	<table>
		<tr>
			<td class="gantt-detail-label"><shell:label prop="dataFine" /></td>
			<td class="gantt-detail-value"><%=itemTo_str%></td>	
		</tr>
		<tr>
			<td class="gantt-detail-label"><shell:label prop="operatoreAbilitato" /></td>
			<td class="gantt-detail-value"><%=getStringValue(picInfo.getOperatoreAbilitato())%></td>	
		</tr>
	</table>
</td>



<%! 

	// 
	public String getStringValue(String value) {
		return value != null ? value : StringLib.EMPTY_STRING;
	}
	
	// 
	public String getStringValue(Boolean value) {
		if (Boolean.TRUE.equals(value)) {
			return "S�";
		} else {
			return "No";
		}
	}
%>