Rev 1416 | Rev 1424 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1409 | jmachado | 1 | <%@ page import="jomm.dao.impl.AbstractDao" %> |
2 | <%@ page import="pt.estgp.estgweb.domain.Questionario" %> |
||
3 | <%@ page import="pt.estgp.estgweb.domain.QuestionarioImpl" %> |
||
4 | <%@ page import="pt.estgp.estgweb.domain.dao.DaoFactory" %> |
||
5 | <%@ page import="java.util.List" %> |
||
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 | |||
15 | |||
16 | <jsp:include page="headerQuestionarios.jsp"/> |
||
17 | |||
18 | |||
19 | <div class="container-fluid" style="margin-top: 10px"> |
||
20 | |||
21 | |||
22 | <div class="panel panel-primary"> |
||
23 | <div class="panel-heading clearfix"> |
||
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> |
||
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> |
||
31 | </div> |
||
32 | <div class="panel-body"> |
||
33 | <html:errors/> |
||
34 | <jomm:messages/> |
||
1417 | jmachado | 35 | <table class="tablesorterfiltered"> |
1409 | jmachado | 36 | <thead> |
37 | <tr> |
||
38 | <th>Num. Control</th> |
||
39 | <th>Descrição</th> |
||
40 | <th>Ano</th> |
||
41 | <th>Semestre</th> |
||
42 | <th>Acompanhar</th> |
||
43 | <th>Formulário</th> |
||
44 | <th>Estado</th> |
||
45 | <th>Alterado a</th> |
||
46 | </tr> |
||
47 | </thead> |
||
48 | <tbody> |
||
49 | <% |
||
50 | AbstractDao.getCurrentSession().beginTransaction(); |
||
51 | List<QuestionarioImpl> questionarios = DaoFactory.getQuestionarioDaoImpl().findNotClosed(); |
||
52 | |||
53 | //As transacoes tem de estar fechadas para se chamar a tag initClearances |
||
54 | for(QuestionarioImpl q: questionarios) |
||
55 | { |
||
56 | request.setAttribute("q",q); |
||
57 | %> |
||
58 | <baco:initClearances name="q"/> |
||
1416 | jmachado | 59 | <% |
60 | if(q.getStateEnum().getPosition() >= QuestionarioImpl.State.PROCESSING.getPosition()) |
||
61 | { |
||
62 | %> |
||
1409 | jmachado | 63 | <tr> |
64 | <td>${q.id}</td> |
||
65 | <td>${q.description}</td> |
||
66 | <td>${q.year}</td> |
||
67 | <td>${q.semestre}</td> |
||
68 | <td> |
||
69 | <baco:clearOperation name="q" op="QUESTIONARIO_SEE_DASHBOARD"> |
||
70 | <html:link styleClass="btn btn-default" action="/user/seeQuestionario?questionarioId=${q.id}">Acompanhar</html:link></td> |
||
71 | </baco:clearOperation> |
||
72 | <td> |
||
73 | <baco:clearOperation name="q" op="QUESTIONARIO_SEE_FORM"> |
||
74 | <% |
||
75 | if(q.getStateEnum().getPosition() < QuestionarioImpl.State.PROCESSING.getPosition()) |
||
76 | { |
||
77 | %> |
||
78 | <html:link action="/user/formQuestionariosPae?questionario.id=${q.id}" styleClass="btn btn-default">Folumário</html:link> |
||
79 | <% |
||
80 | } |
||
81 | else if (q.getStateEnum().getPosition() < QuestionarioImpl.State.OLAP.getPosition()) |
||
82 | { |
||
83 | %> |
||
84 | <html:link action="/user/formQuestionariosPae?questionario.id=${q.id}" styleClass="btn btn-warning">Trancado</html:link> |
||
85 | <% |
||
86 | } |
||
87 | else |
||
88 | { |
||
89 | %> |
||
90 | <html:link action="/user/formQuestionariosPae?questionario.id=${q.id}" styleClass="btn btn-success">Terminado</html:link> |
||
91 | <% |
||
92 | } |
||
93 | %> |
||
94 | </baco:clearOperation> |
||
95 | </td> |
||
96 | <td> |
||
97 | <logic:equal name="q" property="state" value="OLAP"> |
||
98 | <div class="alert alert-success alert-small" > |
||
99 | <bean:message key="questionario.state.${q.state}"/> |
||
100 | </div> |
||
101 | </logic:equal> |
||
102 | <logic:notEqual name="q" property="state" value="OLAP"> |
||
103 | <div class="alert alert-warning alert-small"> |
||
104 | <bean:message key="questionario.state.${q.state}"/> |
||
105 | </div> |
||
106 | </logic:notEqual> |
||
107 | |||
108 | </td> |
||
109 | <td><%=pt.estgp.estgweb.web.utils.DatesUtils.getStringFromDate(q.getUpdateDate())%></td> |
||
110 | </tr> |
||
111 | <% |
||
1416 | jmachado | 112 | } |
1409 | jmachado | 113 | } |
114 | AbstractDao.getCurrentSession().getTransaction().commit(); |
||
115 | %> |
||
116 | </tbody> |
||
117 | </table> |
||
118 | </div> |
||
119 | |||
120 | </div> |
||
121 | |||
122 | </div> |