Rev 1310 | Rev 1463 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
<%@ page import="pt.estgp.estgweb.services.common.IToDoCat" %>
<%@ page import="java.util.List" %>
<%@ page import="pt.utl.ist.berserk.logic.serviceManager.IServiceManager" %>
<%@ page import="pt.utl.ist.berserk.logic.serviceManager.ServiceManager" %>
<%@ page import="pt.estgp.estgweb.web.utils.RequestUtils" %>
<%@ page import="jomm.utils.MessageResources" %>
<%@ page import="pt.estgp.estgweb.services.common.IToDo" %>
<%@ page import="pt.estgp.estgweb.services.common.ModuleEnum" %>
<%@ page import="pt.estgp.estgweb.web.Globals" %>
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %>
<%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %>
<%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %>
<%--
Created by IntelliJ IDEA.
User: Jorge
Date: 2/Jun/2008
Time: 16:01:47
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
IServiceManager sm = ServiceManager.getInstance();
String[] names = new String[]{};
Object[] args = new Object[]{};
List<IToDoCat> todos = (List<IToDoCat>) sm.execute(RequestUtils.getRequester(request, response), "CommonServicesGetAllTodosCat", args, names);
%>
<div class="panel panel-primary">
<div class="panel-heading"><bean:message key="intranet.todo"/></div>
<div class="panel-body">
<%
if (todos == null || todos.size() == 0)
{
%>
<div class="zerofound">
<bean:message key="todo.zero.todos"/>
</div>
<%
}
else
{
%>
<%
for (IToDoCat toDoCat : todos)
{
String imgClose;
String imgOpen;
String style;
String img;
String styleClass;
// Duarte Santos
if (toDoCat.getDescription().equals(ModuleEnum.TodoAnnouncements.getMessageKey()) || toDoCat.getDescription().equals(ModuleEnum.Surveys.getMessageKey()))
{
styleClass = "WARNING";
img = "/imgs/openedboxNeg.gif";
style = "";
imgClose = "/imgs/closedboxNeg.gif";
imgOpen = "/imgs/openedboxNeg.gif";
}
//Filipe Matos
else
if(toDoCat.getDescription().equals(ModuleEnum.TodoAnnouncements.getMessageKey()) || toDoCat.getDescription().equals(ModuleEnum.Assessments.getMessageKey())){
styleClass = "WARNING";
img = "/imgs/openedboxNeg.gif";
style = "";
imgClose = "/imgs/closedboxNeg.gif";
imgOpen = "/imgs/openedboxNeg.gif";
}
else
if (toDoCat.getDescription().equals(ModuleEnum.Reminders.getMessageKey()) || toDoCat.getDescription().equals(ModuleEnum.CourseUnits.getMessageKey()))
{
styleClass = "";
img = "/imgs/openedbox.gif";
style = "";
imgClose = "/imgs/closedbox.gif";
imgOpen = "/imgs/openedbox.gif";
}
else
{
styleClass = "";
img = "/imgs/closedbox.gif";
style = Globals.HIDDEN;
imgClose = "/imgs/closedbox.gif";
imgOpen = "/imgs/openedbox.gif";
}
%>
<div class="panel-body-h1 <%=styleClass%>">
<%=MessageResources.getMessage(request, toDoCat.getDescription())%> (<%=toDoCat.getTotalToDo()%>) <img alt="abrir" src="<%=request.getContextPath() + img%>" onclick="this.src=showOrHide('<%=toDoCat.getDescription()%>','<%=request.getContextPath() + imgClose%>','<%=request.getContextPath() + imgOpen%>')" >
</div>
<ul id="<%=toDoCat.getDescription()%>" style="<%=style%>">
<%
for (IToDo todo : toDoCat.getAllToDos())
{
if (todo.getUrl() != null)
{
%>
<li>
<a href="<%=request.getContextPath() + todo.getUrl()%>">
<font class="<%=styleClass%>">
<%
if(todo.getCatArg0() == null && todo.getCatKey() != null)
{
out.print(MessageResources.getMessage(request,todo.getCatKey()) + ":");
}
else if(todo.getCatArg0() != null && todo.getCatKey() != null)
{
out.print(MessageResources.getMessage(request,todo.getCatKey(),todo.getCatArg0()) + ":");
}
%>
<%=todo.getLabelInsideCat(request)%>
</font>
</a>
</li>
<%
}
else
{
%>
<li>
<%=todo.getLabelInsideCat(request)%>
</li>
<%
}
}
%>
</ul>
<%
}
%>
<%
}
%>
</div>
</div>