Rev 1476 | 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" %> |
||
1457 | jmachado | 6 | <%@ page import="java.net.URLEncoder" %> |
1814 | jmachado | 7 | <%@ page import="pt.estgp.estgweb.utils.DatesWebUtils" %> |
1409 | jmachado | 8 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> |
9 | <%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %> |
||
10 | <%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %> |
||
11 | <%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %> |
||
12 | <%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %> |
||
13 | <%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %> |
||
14 | <%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %> |
||
15 | <%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %> |
||
16 | |||
17 | |||
18 | <jsp:include page="headerQuestionarios.jsp"/> |
||
19 | |||
20 | |||
21 | <div class="container-fluid" style="margin-top: 10px"> |
||
22 | |||
23 | |||
24 | <div class="panel panel-primary"> |
||
25 | <div class="panel-heading clearfix"> |
||
26 | Questionários |
||
1457 | jmachado | 27 | <% |
28 | String desc = URLEncoder.encode("Mensagem para os alunos de todos os Questionários em Processamento","ISO-8859-1"); |
||
29 | request.setAttribute("desc",desc); |
||
30 | |||
31 | %> |
||
32 | |||
1476 | jmachado | 33 | <baco:hasRole role="admin,all,questionarios.gerais,questionarios.admin,pedagogicCouncil.president,administrativeCouncil.director"> |
1457 | jmachado | 34 | <html:link styleClass="btn btn-default pull-right" action="/user/startQuestionariosPaeMessagePedagogico.do?&formDescription=${desc}&targetDispatch=sendEmailQuestionariosProcessing"> |
35 | <span class="glyphicon glyphicon-envelope"> </span> Enviar Mensagem A Todos Os Inquiridos |
||
36 | </html:link> |
||
1476 | jmachado | 37 | </baco:hasRole> |
1409 | jmachado | 38 | <a class="btn btn-default" href="#" data-toggle="modal" data-target="#modalHelpQuestionario"> |
39 | <span class="glyphicon glyphicon-question-sign"></span> Ajuda sobre Processo dos Questionários |
||
40 | </a> |
||
41 | </div> |
||
42 | <div class="panel-body"> |
||
43 | <html:errors/> |
||
44 | <jomm:messages/> |
||
1417 | jmachado | 45 | <table class="tablesorterfiltered"> |
1409 | jmachado | 46 | <thead> |
47 | <tr> |
||
48 | <th>Num. Control</th> |
||
49 | <th>Descrição</th> |
||
50 | <th>Ano</th> |
||
51 | <th>Semestre</th> |
||
52 | <th>Acompanhar</th> |
||
53 | <th>Formulário</th> |
||
54 | <th>Estado</th> |
||
55 | <th>Alterado a</th> |
||
56 | </tr> |
||
57 | </thead> |
||
58 | <tbody> |
||
59 | <% |
||
60 | AbstractDao.getCurrentSession().beginTransaction(); |
||
61 | List<QuestionarioImpl> questionarios = DaoFactory.getQuestionarioDaoImpl().findNotClosed(); |
||
62 | |||
63 | //As transacoes tem de estar fechadas para se chamar a tag initClearances |
||
64 | for(QuestionarioImpl q: questionarios) |
||
65 | { |
||
66 | request.setAttribute("q",q); |
||
67 | %> |
||
68 | <baco:initClearances name="q"/> |
||
1416 | jmachado | 69 | <% |
70 | if(q.getStateEnum().getPosition() >= QuestionarioImpl.State.PROCESSING.getPosition()) |
||
71 | { |
||
72 | %> |
||
1409 | jmachado | 73 | <tr> |
74 | <td>${q.id}</td> |
||
75 | <td>${q.description}</td> |
||
76 | <td>${q.year}</td> |
||
77 | <td>${q.semestre}</td> |
||
78 | <td> |
||
79 | <baco:clearOperation name="q" op="QUESTIONARIO_SEE_DASHBOARD"> |
||
80 | <html:link styleClass="btn btn-default" action="/user/seeQuestionario?questionarioId=${q.id}">Acompanhar</html:link></td> |
||
81 | </baco:clearOperation> |
||
82 | <td> |
||
83 | <baco:clearOperation name="q" op="QUESTIONARIO_SEE_FORM"> |
||
84 | <% |
||
85 | if(q.getStateEnum().getPosition() < QuestionarioImpl.State.PROCESSING.getPosition()) |
||
86 | { |
||
87 | %> |
||
88 | <html:link action="/user/formQuestionariosPae?questionario.id=${q.id}" styleClass="btn btn-default">Folumário</html:link> |
||
89 | <% |
||
90 | } |
||
91 | else if (q.getStateEnum().getPosition() < QuestionarioImpl.State.OLAP.getPosition()) |
||
92 | { |
||
93 | %> |
||
94 | <html:link action="/user/formQuestionariosPae?questionario.id=${q.id}" styleClass="btn btn-warning">Trancado</html:link> |
||
95 | <% |
||
96 | } |
||
97 | else |
||
98 | { |
||
99 | %> |
||
100 | <html:link action="/user/formQuestionariosPae?questionario.id=${q.id}" styleClass="btn btn-success">Terminado</html:link> |
||
101 | <% |
||
102 | } |
||
103 | %> |
||
104 | </baco:clearOperation> |
||
105 | </td> |
||
106 | <td> |
||
107 | <logic:equal name="q" property="state" value="OLAP"> |
||
108 | <div class="alert alert-success alert-small" > |
||
109 | <bean:message key="questionario.state.${q.state}"/> |
||
110 | </div> |
||
111 | </logic:equal> |
||
112 | <logic:notEqual name="q" property="state" value="OLAP"> |
||
1424 | jmachado | 113 | <% |
114 | String alert = "warning"; |
||
115 | if(q.getStateEnum() == QuestionarioImpl.State.PROCESSING || q.getStateEnum() == QuestionarioImpl.State.PROCESSING_WITH_ANSWERS) |
||
116 | alert = "success"; |
||
117 | else if(q.getStateEnum() == QuestionarioImpl.State.STOPED_WITH_ANSWERS) |
||
118 | alert = "danger"; |
||
119 | %> |
||
120 | <div class="alert alert-<%=alert%> alert-small"> |
||
1409 | jmachado | 121 | <bean:message key="questionario.state.${q.state}"/> |
122 | </div> |
||
123 | </logic:notEqual> |
||
124 | |||
125 | </td> |
||
1814 | jmachado | 126 | <td><%=DatesWebUtils.getStringFromDate(q.getUpdateDate())%></td> |
1409 | jmachado | 127 | </tr> |
128 | <% |
||
1416 | jmachado | 129 | } |
1409 | jmachado | 130 | } |
131 | AbstractDao.getCurrentSession().getTransaction().commit(); |
||
132 | %> |
||
133 | </tbody> |
||
134 | </table> |
||
135 | </div> |
||
136 | |||
137 | </div> |
||
138 | |||
139 | </div> |