Rev 1310 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1049 | jmachado | 1 | <%@ page import="jomm.dao.impl.AbstractDao" %> |
2 | <%@ page import="pt.estgp.estgweb.domain.ConfigurationGrades" %> |
||
3 | <%@ page import="pt.estgp.estgweb.domain.dao.DaoFactory" %> |
||
4 | <%@ page import="pt.estgp.estgweb.domain.views.ConfigurationGradesView" %> |
||
5 | <%@ page import="pt.estgp.estgweb.web.form.configuration.ConfigurationGradesForm" %> |
||
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-logic.tld" prefix="logic" %> |
||
9 | <%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %> |
||
10 | <%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %> |
||
11 | <%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %> |
||
12 | <%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %> |
||
1350 | jmachado | 13 | |
1049 | jmachado | 14 | <jsp:useBean id="UserSession" type="pt.estgp.estgweb.domain.UserSession" scope="request"/> |
15 | <jomm:messages/> |
||
16 | <html:errors/> |
||
17 | |||
18 | |||
19 | <script type="text/javascript" language="JavaScript"> |
||
20 | //TABLE SORTER |
||
21 | |||
22 | |||
23 | |||
24 | $(document).ready(function() |
||
25 | { |
||
26 | |||
27 | // $('#myTable').tablesorter(); |
||
28 | // $('#myTable2').tablesorter(); |
||
1077 | jmachado | 29 | $("#myCollapse1").hide(); |
30 | $("#myCollapse2").hide(); |
||
1049 | jmachado | 31 | |
32 | <% |
||
33 | if(request.getAttribute("ConfigurationGradesForm")!=null) |
||
34 | { |
||
35 | ConfigurationGradesForm confForm = (ConfigurationGradesForm) request.getAttribute("ConfigurationGradesForm"); |
||
36 | if(confForm.getOp() != null && ( |
||
37 | confForm.getOp().equals("addSatusEpoca") || |
||
38 | confForm.getOp().equals("deleteStatusEpoca"))) |
||
39 | { |
||
40 | |||
41 | %> |
||
1077 | jmachado | 42 | $("#myCollapse1").show(); |
1049 | jmachado | 43 | |
44 | <% |
||
45 | } |
||
46 | else if(confForm.getOp() != null && ( |
||
47 | confForm.getOp().equals("addEpocaAvaliacao") || |
||
48 | confForm.getOp().equals("deleteEpocaAvaliacao"))) |
||
49 | { |
||
50 | %> |
||
1077 | jmachado | 51 | $("#myCollapse2").show(); |
1049 | jmachado | 52 | <% |
53 | } |
||
54 | } |
||
55 | %> |
||
56 | } |
||
57 | ); |
||
58 | </script> |
||
59 | <% |
||
60 | |||
61 | AbstractDao.getCurrentSession().beginTransaction(); |
||
62 | |||
63 | ConfigurationGrades grades = DaoFactory.getConfigurationDaoImpl().load().getConfigurationGrades(); |
||
64 | ConfigurationGradesView view = new ConfigurationGradesView(); |
||
65 | view.init(grades); |
||
66 | |||
67 | %> |
||
68 | |||
69 | <div class="container"> |
||
70 | |||
71 | <nested:form action="/user/grades" enctype="multipart/form-data"> |
||
72 | <jsp:useBean id="ConfigurationGradesForm" scope="request" type="pt.estgp.estgweb.web.form.configuration.ConfigurationGradesForm"/> |
||
73 | <% |
||
74 | ConfigurationGradesForm.setConfigurationGrades(view); |
||
75 | %> |
||
76 | <input type="hidden" name="dispatch" value="saveGrades"> |
||
77 | <input type="hidden" name="op"> |
||
78 | |||
79 | |||
80 | <div class="panel panel-default"> |
||
81 | <div class="panel-heading"> |
||
82 | |||
83 | <button style="float: right" class="btn btn-success" onclick="this.form.op.value='addSatusEpoca';set(this.form,'addSatusEpoca');this.form.submit()">Adicionar Novo</button> |
||
84 | |||
1077 | jmachado | 85 | <button type="button" class="btn btn-info" onclick="$('#myCollapse1').toggle();">Status de Época</button> |
1049 | jmachado | 86 | |
87 | |||
88 | </div> |
||
1077 | jmachado | 89 | <div id="myCollapse1"> |
1049 | jmachado | 90 | <div class="panel-body"> |
91 | <table id="myTable" class="dataTable tablesorter"> |
||
92 | <thead> |
||
93 | <tr> |
||
94 | <th>Status Época</th> |
||
95 | <th>Descrição</th> |
||
96 | <th>Observações</th> |
||
97 | <td></td> |
||
98 | </tr> |
||
99 | </thead> |
||
100 | <tbody> |
||
101 | <nested:iterate id="status" property="configurationGrades.statusEpocas" type="pt.estgp.estgweb.domain.ConfigurationGradesStatusEpocaImpl"> |
||
102 | |||
103 | <tr> |
||
104 | <td style="width: 100px"> |
||
1066 | jmachado | 105 | <nested:hidden property="id"/> |
1049 | jmachado | 106 | <nested:text property="status"></nested:text> |
107 | </td> |
||
108 | <td> |
||
109 | <nested:text property="descricao" style="width:100%"></nested:text> |
||
110 | </td> |
||
111 | <td> |
||
112 | <nested:text property="obs" style="width:100%"></nested:text> |
||
113 | </td> |
||
114 | <td> |
||
1077 | jmachado | 115 | <a class="btn btn-danger btn-sm" href="<%=request.getContextPath()%>/user/grades.do?op=deleteStatusEpoca&dispatch=deleteStatusEpoca&id=${status.id}"><span class="glyphicon glyphicon-remove"></span></a> |
1049 | jmachado | 116 | </td> |
117 | </tr> |
||
118 | </nested:iterate> |
||
119 | </tbody> |
||
120 | </table> |
||
121 | </div> |
||
122 | <div class="panel-footer"> |
||
123 | <html:submit styleClass="btn btn-warning" value="Salvar"/> |
||
124 | </div> |
||
125 | </div> |
||
126 | </div> |
||
127 | </nested:form> |
||
128 | <a name="epocas"/> |
||
129 | <nested:form action="/user/grades" enctype="multipart/form-data"> |
||
130 | <input type="hidden" name="dispatch" value="saveGrades"> |
||
131 | <input type="hidden" name="op"> |
||
132 | <div class="panel panel-default"> |
||
133 | <div class="panel-heading"> |
||
134 | <button style="float:right" class="btn btn-success" onclick="this.form.op.value='addEpocaAvaliacao';set(this.form,'addEpocaAvaliacao');this.form.action+'#epocas';set(this.form,'addEpocaAvaliacao');this.form.submit()">Adicionar Novo</button> |
||
1077 | jmachado | 135 | <button type="button" class="btn btn-info" onclick="$('#myCollapse2').toggle();">Épocas de Avaliação</button> |
1049 | jmachado | 136 | </div> |
1077 | jmachado | 137 | <div id="myCollapse2" > |
1049 | jmachado | 138 | <div class="panel-body"> |
139 | <table id="myTable2" class="dataTable tablesorter"> |
||
140 | <thead> |
||
141 | <tr> |
||
142 | <th>Código de Época</th> |
||
143 | <th>Código de Momento</th> |
||
144 | <th>Descrição</th> |
||
145 | <th>Observações</th> |
||
146 | <td></td> |
||
147 | </tr> |
||
148 | </thead> |
||
149 | <tbody> |
||
150 | <nested:iterate id="status" property="configurationGrades.epocasAvaliacao" type="pt.estgp.estgweb.domain.ConfigurationGradesEpocaAvaliacaoImpl"> |
||
151 | |||
152 | <tr> |
||
153 | <td style="width: 100px"> |
||
1066 | jmachado | 154 | <nested:hidden property="id"/> |
1049 | jmachado | 155 | <nested:text property="codigoEpoca"></nested:text> |
156 | </td> |
||
157 | <td style="width: 100px"> |
||
158 | <nested:text property="codigoMomento"></nested:text> |
||
159 | </td> |
||
160 | <td> |
||
161 | <nested:text property="descricao" style="width:100%"></nested:text> |
||
162 | </td> |
||
163 | <td> |
||
164 | <nested:text property="obs" style="width:100%"></nested:text> |
||
165 | </td> |
||
166 | <td> |
||
1077 | jmachado | 167 | <a class="btn btn-danger btn-sm" href="<%=request.getContextPath()%>/user/grades.do?op=deleteEpocaAvaliacao&dispatch=deleteEpocaAvaliacao&id=${status.id}#epocas"><span class="glyphicon glyphicon-remove"></span></a> |
1049 | jmachado | 168 | </td> |
169 | </tr> |
||
170 | </nested:iterate> |
||
171 | </tbody> |
||
172 | </table> |
||
173 | </div> |
||
174 | <div class="panel-footer"> |
||
175 | <html:submit styleClass="btn btn-warning" value="Salvar"/> |
||
176 | </div> |
||
177 | </div> |
||
178 | </div> |
||
179 | </nested:form> |
||
180 | |||
181 | <% |
||
182 | AbstractDao.getCurrentSession().beginTransaction().commit(); |
||
183 | %> |
||
184 | </div> |