Rev 1409 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1315 | jmachado | 1 | <%@ page import="jomm.dao.impl.AbstractDao" %> |
1325 | jmachado | 2 | <%@ page import="pt.estgp.estgweb.domain.Questionario" %> |
1315 | jmachado | 3 | <%@ page import="pt.estgp.estgweb.domain.QuestionarioImpl" %> |
1325 | jmachado | 4 | <%@ page import="pt.estgp.estgweb.domain.dao.DaoFactory" %> |
5 | <%@ page import="java.util.List" %> |
||
1314 | jmachado | 6 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> |
7 | <%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %> |
||
8 | <%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %> |
||
9 | <%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %> |
||
10 | <%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %> |
||
11 | <%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %> |
||
12 | <%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %> |
||
13 | <%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %> |
||
14 | |||
1315 | jmachado | 15 | |
1387 | jmachado | 16 | <jsp:include page="headerQuestionarios.jsp"/> |
1314 | jmachado | 17 | |
1315 | jmachado | 18 | |
1314 | jmachado | 19 | <div class="container-fluid" style="margin-top: 10px"> |
20 | |||
1315 | jmachado | 21 | |
1314 | jmachado | 22 | <div class="panel panel-primary"> |
23 | <div class="panel-heading clearfix"> |
||
1346 | jmachado | 24 | Questionários |
25 | <baco:hasRole role="questionarios.admin,all,admin"> |
||
26 | <html:link styleClass="btn btn-default btn-sm pull-right" action="/user/startNewQuestionario">Criar Novo <span class="glyphicon glyphicon-plus"> </span></html:link> |
||
27 | </baco:hasRole> |
||
1387 | jmachado | 28 | <a class="btn btn-default" href="#" data-toggle="modal" data-target="#modalHelpQuestionario"> |
29 | <span class="glyphicon glyphicon-question-sign"></span> Ajuda sobre Processo dos Questionários |
||
30 | </a> |
||
1314 | jmachado | 31 | </div> |
32 | <div class="panel-body"> |
||
1326 | jmachado | 33 | <html:errors/> |
34 | <jomm:messages/> |
||
1314 | jmachado | 35 | <table class="tablesortersimple"> |
36 | <thead> |
||
37 | <tr> |
||
1315 | jmachado | 38 | <th>Num. Control</th> |
1401 | jmachado | 39 | <th>Descrição</th> |
1314 | jmachado | 40 | <th>Ano</th> |
41 | <th>Semestre</th> |
||
42 | <th>Administrar</th> |
||
1315 | jmachado | 43 | <th>Formulário</th> |
44 | <th>Estado</th> |
||
45 | <th>Alterado a</th> |
||
1326 | jmachado | 46 | <th>Apagar</th> |
1314 | jmachado | 47 | </tr> |
48 | </thead> |
||
49 | <tbody> |
||
1315 | jmachado | 50 | <% |
51 | AbstractDao.getCurrentSession().beginTransaction(); |
||
1409 | jmachado | 52 | List<QuestionarioImpl> questionarios = DaoFactory.getQuestionarioDaoImpl().findSortedBy(0, 30, "id"); |
1326 | jmachado | 53 | |
54 | //As transacoes tem de estar fechadas para se chamar a tag initClearances |
||
55 | for(QuestionarioImpl q: questionarios) |
||
1315 | jmachado | 56 | { |
57 | request.setAttribute("q",q); |
||
58 | %> |
||
1326 | jmachado | 59 | <baco:initClearances name="q"/> |
1315 | jmachado | 60 | <tr> |
61 | <td>${q.id}</td> |
||
1401 | jmachado | 62 | <td>${q.description}</td> |
1315 | jmachado | 63 | <td>${q.year}</td> |
64 | <td>${q.semestre}</td> |
||
65 | <td> |
||
1327 | jmachado | 66 | <baco:clearOperation name="q" op="QUESTIONARIO_SEE_ADMIN"> |
1346 | jmachado | 67 | <html:link styleClass="btn btn-default" action="/user/adminQuestionario?questionario.id=${q.id}">Admin</html:link></td> |
1327 | jmachado | 68 | </baco:clearOperation> |
1326 | jmachado | 69 | <td> |
1327 | jmachado | 70 | <baco:clearOperation name="q" op="QUESTIONARIO_SEE_FORM"> |
71 | <% |
||
72 | if(q.getStateEnum().getPosition() < QuestionarioImpl.State.PROCESSING.getPosition()) |
||
73 | { |
||
74 | %> |
||
1346 | jmachado | 75 | <html:link action="/user/formQuestionariosPae?questionario.id=${q.id}" styleClass="btn btn-default">Editar</html:link> |
1327 | jmachado | 76 | <% |
77 | } |
||
78 | else if (q.getStateEnum().getPosition() < QuestionarioImpl.State.OLAP.getPosition()) |
||
79 | { |
||
80 | %> |
||
1346 | jmachado | 81 | <html:link action="/user/formQuestionariosPae?questionario.id=${q.id}" styleClass="btn btn-warning">Trancado</html:link> |
1327 | jmachado | 82 | <% |
83 | } |
||
84 | else |
||
85 | { |
||
86 | %> |
||
1346 | jmachado | 87 | <html:link action="/user/formQuestionariosPae?questionario.id=${q.id}" styleClass="btn btn-success">Terminado</html:link> |
1327 | jmachado | 88 | <% |
89 | } |
||
90 | %> |
||
91 | </baco:clearOperation> |
||
1315 | jmachado | 92 | </td> |
1326 | jmachado | 93 | <td> |
94 | <logic:equal name="q" property="state" value="OLAP"> |
||
95 | <div class="alert alert-success alert-small" > |
||
96 | <bean:message key="questionario.state.${q.state}"/> |
||
97 | </div> |
||
98 | </logic:equal> |
||
99 | <logic:notEqual name="q" property="state" value="OLAP"> |
||
1424 | jmachado | 100 | <% |
101 | String alert = "warning"; |
||
102 | if(q.getStateEnum() == QuestionarioImpl.State.PROCESSING || q.getStateEnum() == QuestionarioImpl.State.PROCESSING_WITH_ANSWERS) |
||
103 | alert = "success"; |
||
104 | else if(q.getStateEnum() == QuestionarioImpl.State.STOPED_WITH_ANSWERS) |
||
105 | alert = "danger"; |
||
106 | %> |
||
107 | <div class="alert alert-<%=alert%> alert-small"> |
||
1326 | jmachado | 108 | <bean:message key="questionario.state.${q.state}"/> |
109 | </div> |
||
110 | </logic:notEqual> |
||
111 | |||
112 | </td> |
||
1315 | jmachado | 113 | <td><%=pt.estgp.estgweb.web.utils.DatesUtils.getStringFromDate(q.getUpdateDate())%></td> |
1326 | jmachado | 114 | <td> |
115 | <baco:clearOperation name="q" op="QUESTIONARIO_DELETE"> |
||
1346 | jmachado | 116 | <button class="btn btn-danger" data-href="<%=request.getContextPath()%>/user/deleteQuestionario.do?questionario.id=${q.id}" data-message="Tem a certeza que deseja eliminar o questionário ${q.id}?" data-toggle="modal" data-target="#confirm-ModalGeneric"> |
1326 | jmachado | 117 | <span class="glyphicon glyphicon-remove small"> </span> |
118 | </button> |
||
119 | </baco:clearOperation> |
||
120 | |||
121 | </td> |
||
1315 | jmachado | 122 | </tr> |
123 | <% |
||
124 | } |
||
125 | AbstractDao.getCurrentSession().getTransaction().commit(); |
||
126 | %> |
||
1314 | jmachado | 127 | </tbody> |
128 | </table> |
||
129 | </div> |
||
130 | |||
131 | </div> |
||
132 | |||
133 | </div> |