Rev 1306 | Blame | Compare with Previous | Last modification | View Log | RSS feed
<%@ page import="pt.utl.ist.berserk.logic.serviceManager.IServiceManager" %>
<%@ page import="pt.utl.ist.berserk.logic.serviceManager.ServiceManager" %>
<%@ page import="java.util.List" %>
<%@ page import="pt.estgp.estgweb.web.utils.RequestUtils" %>
<%@ page import="pt.estgp.estgweb.domain.views.SurveyView" %>
<%@ page import="pt.estgp.estgweb.domain.UserSession" %>
<%@ page import="pt.estgp.estgweb.web.UserSessionProxy" %>
<%@ page import="pt.estgp.estgweb.services.surveys.SurveyStatusEnum" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
<%@ 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-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %>
<%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %>
<%
IServiceManager sm = ServiceManager.getInstance();
String[] names = new String[]{};
Object[] args = new String[]{};
List<SurveyView> surveyViews;
UserSession userSession = UserSessionProxy.loadUserSession(request, response);
if(userSession.getUser().isAdmin())
{
surveyViews = (List<SurveyView>) sm.execute(RequestUtils.getRequester(request,response),"LoadSurveys", args, names);
}
else
{
surveyViews = (List<SurveyView>) sm.execute(RequestUtils.getRequester(request,response),"LoadOwnedSurveys", args, names);
}
request.setAttribute("SurveyViews", surveyViews);
%>
<jomm:messages/>
<html:errors/>
<%
if(surveyViews.size() > 0)
{
%>
<table class="dataTable">
<tr>
<th><bean:message key="survey.list.form.title"/></th>
<th><bean:message key="survey.list.form.type"/></th>
<th><bean:message key="survey.list.form.target"/></th>
<th><bean:message key="survey.list.form.year"/></th>
<th><bean:message key="survey.list.form.semester"/></th>
<th><bean:message key="survey.list.form.start.date"/></th>
<th><bean:message key="survey.list.form.end.date"/></th>
<th><bean:message key="survey.list.form.created.by"/></th>
<th><bean:message key="survey.list.form.number.responses"/></th>
<th><bean:message key="survey.list.form.status"/></th>
</tr>
<logic:iterate id="surveyView" name="SurveyViews" type="pt.estgp.estgweb.domain.views.SurveyView">
<bean:define id="sv" name="surveyView" type="pt.estgp.estgweb.domain.views.SurveyView"/>
<tr>
<td><bean:write name="surveyView" property="title"/></td>
<td><bean:message key="surveys.type.${surveyView.type}"/></td>
<%
if(sv.isPedagogic())
{
%>
<td><bean:message key="surveys.target.pair.${surveyView.targetRoles}"/></td>
<%
} else {
%>
<td><bean:message key="user.role.${surveyView.targetRoles}"/></td>
<%
}
%>
<td><bean:write name="surveyView" property="year"/></td>
<td><bean:message key="courseunit.${surveyView.semester}"/></td>
<td><bean:write name="surveyView" property="formatedStartDate"/></td>
<td><bean:write name="surveyView" property="formatedEndDate"/></td>
<td><bean:write name="surveyView" property="owner.username"/></td>
<td><bean:write name="surveyView" property="numberOfResponses"/>/<bean:write name="surveyView" property="numberTotalOfResponses"/></td>
<td><bean:write name="surveyView" property="statusPercentage"/><bean:message key="survey.list.form.percentage.symbol"/></td>
<%
if(sv.getStatus() != null && (sv.getStatus() == SurveyStatusEnum.STATUS_STOPPED || sv.isExpired()))
{
%>
<logic:equal name="surveyView" property="numberOfResponses" value="0">
<td><html:link action="/user/startEditSurveyFromServiceZone.do?id=${surveyView.id}"><bean:message key="survey.list.form.option.edit"/></html:link></td>
</logic:equal>
<td><html:link action="/user/startCloneSurveyFromServiceZone.do?id=${surveyView.id}"><bean:message key="survey.list.form.option.clone"/></html:link></td>
<td><html:link action="/user/startConsistSurveyFromServiceZone.do?id=${surveyView.id}"><bean:message key="survey.list.form.option.consist"/></html:link></td>
<td><html:link action="/user/startGenerateSurveyStatsFromServiceZone.do?id=${surveyView.id}"><bean:message key="survey.list.form.option.gen.stats"/></html:link></td>
<logic:present name="surveyView" property="identifier">
<td><html:link action="/user/startListSurveyStats.do?id=${surveyView.id}"><bean:message key="survey.list.form.option.view.stats"/></html:link></td>
<td><a href="<%=request.getContextPath()%>/repositoryStream/${surveyView.identifier}"><bean:message key="survey.list.form.option.download.csv"/></a></td>
</logic:present>
<%
}
else if(sv.getStatus() != null)
{
%>
<td colspan="200"><bean:message key="<%=sv.getStatus().getMessageKey()%>"/></td>
<%
}
%>
</tr>
</logic:iterate>
</table>
<%
}
else
{
%>
<bean:message key="survey.list.form.empty"/>
<%
}
%>
Generated by GNU Enscript 1.6.5.2.