Rev 995 | Rev 1027 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
204 | jmachado | 1 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> |
2 | <%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %> |
||
3 | <%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %> |
||
4 | <%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %> |
||
5 | <%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %> |
||
6 | <%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %> |
||
7 | <%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %> |
||
8 | <%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %> |
||
960 | jmachado | 9 | <%@ page import="jomm.dao.utils.HibernateUtils" %> |
10 | <%@ page import="pt.estgp.estgweb.domain.dao.DaoFactory" %> |
||
11 | <%@ page import="pt.estgp.estgweb.domain.dao.impl.CourseUnitDaoImpl" %> |
||
787 | jmachado | 12 | <%@ page import="java.util.List" %> |
960 | jmachado | 13 | <%@ page import="pt.estgp.estgweb.domain.CourseUnit" %> |
995 | jmachado | 14 | <%@ page import="pt.estgp.estgweb.domain.Configuration" %> |
15 | <%@ page import="pt.estgp.estgweb.domain.ConfigurationImpl" %> |
||
16 | <%@ page import="pt.estgp.estgweb.utils.DatesUtils" %> |
||
204 | jmachado | 17 | <jsp:useBean id="UserSession" type="pt.estgp.estgweb.domain.UserSession" scope="request"/> |
18 | <div class="portal"> |
||
432 | jmachado | 19 | <logic:notMatch value="TeacherImpl" name="UserSession" property="user.class.name"> |
301 | jmachado | 20 | <ul> |
21 | <li class="WARNING"> |
||
432 | jmachado | 22 | <bean:message key="profile.bad.profile.teacher.iregular.user.class"/> |
301 | jmachado | 23 | </li> |
24 | </ul> |
||
432 | jmachado | 25 | </logic:notMatch> |
204 | jmachado | 26 | <table class="columnTable" width="100%"> |
27 | <tbody> |
||
28 | <tr> |
||
215 | jmachado | 29 | <baco:isModuleOn module="courseunits"> |
30 | <td class="column"> |
||
31 | <div class="block"> |
||
787 | jmachado | 32 | <% |
33 | java.util.List<String> years = new java.util.ArrayList<String>(); |
||
995 | jmachado | 34 | String nowImportYear = DaoFactory.getConfigurationDaoImpl().getInterfaceImportYearCreateTransaction(); |
35 | years.add(DaoFactory.getConfigurationDaoImpl().getInterfaceImportYearCreateTransaction()); |
||
36 | years.add(DatesUtils.getPreviousImportYear(nowImportYear)); |
||
787 | jmachado | 37 | |
38 | java.util.Collections.sort(years, new java.util.Comparator<String>() |
||
39 | { |
||
40 | public int compare(String o1, String o2) { |
||
41 | return o2.compareTo(o1); |
||
42 | } |
||
43 | }); |
||
44 | |||
45 | for(String year: years) |
||
46 | { |
||
47 | |||
48 | String yearFormatted = pt.estgp.estgweb.utils.DatesUtils.getImportYearFormatted(year); |
||
49 | |||
50 | %> |
||
51 | |||
789 | jmachado | 52 | <h2><bean:message key="intranet.course.units"/> - <%=yearFormatted%></h2> |
787 | jmachado | 53 | <ul> |
54 | <li> |
||
55 | <p><bean:message key="courseunit.semestre"/> 1</p> |
||
56 | <% |
||
57 | List<pt.estgp.estgweb.domain.CourseUnit> cus = ((pt.estgp.estgweb.domain.TeacherImpl)UserSession.getUser()).getTeachedUnitsViewS1(year); |
||
58 | if(cus == null || cus.size() == 0) |
||
59 | { |
||
60 | %><bean:message key="courseunit.zero.units"/><% |
||
61 | } |
||
789 | jmachado | 62 | else if(cus.size() > 0) |
787 | jmachado | 63 | { |
64 | %> |
||
65 | <ul> |
||
550 | jmachado | 66 | <% |
787 | jmachado | 67 | for(pt.estgp.estgweb.domain.CourseUnit unit:cus) |
550 | jmachado | 68 | { |
787 | jmachado | 69 | request.setAttribute("unit",unit); |
70 | %> |
||
71 | <li> |
||
72 | <% |
||
73 | String courseCode = ""; |
||
74 | if(unit.getCourse() != null) |
||
75 | { |
||
76 | String courseName = unit.getCourse().getName(); |
||
77 | String[] words = courseName.split(" "); |
||
78 | for(String word: words) |
||
79 | { |
||
80 | if(word != null && word.length() > 3 && word.charAt(0) >= 'A' && word.charAt(0) <= 'Z' ) |
||
81 | { |
||
82 | courseCode += word.charAt(0); |
||
83 | } |
||
84 | } |
||
85 | } |
||
86 | |||
87 | %> |
||
88 | <html:link action="/user/startLoadCourseUnitFromHome?id=${unit.id}">${unit.name} (${unit.courseName} (${unit.courseCode}))</html:link> |
||
89 | <html:link action="/user/startLoadCourseUnitRootFromHome?courseUnitView.id=${unit.id}"><img border="0" alt="Pastas" src="<%=request.getContextPath()%>/imgs/folder.gif"></html:link> |
||
90 | </li> |
||
91 | <% |
||
550 | jmachado | 92 | } |
787 | jmachado | 93 | %> |
94 | </ul> |
||
95 | <% |
||
96 | } |
||
97 | %> |
||
550 | jmachado | 98 | |
787 | jmachado | 99 | |
100 | </li> |
||
101 | <li> |
||
102 | <p><bean:message key="courseunit.semestre"/> 2</p> |
||
103 | <% |
||
104 | cus = ((pt.estgp.estgweb.domain.TeacherImpl)UserSession.getUser()).getTeachedUnitsViewS2(year); |
||
105 | if(cus == null || cus.size() == 0) |
||
106 | { |
||
107 | %><bean:message key="courseunit.zero.units"/><% |
||
108 | } |
||
789 | jmachado | 109 | else if(cus.size() > 0) |
787 | jmachado | 110 | { |
111 | %> |
||
112 | <ul> |
||
113 | <% |
||
114 | for(pt.estgp.estgweb.domain.CourseUnit unit:cus) |
||
550 | jmachado | 115 | { |
787 | jmachado | 116 | request.setAttribute("unit",unit); |
117 | %> |
||
118 | <li> |
||
119 | <% |
||
120 | String courseCode = ""; |
||
121 | if(unit.getCourse() != null) |
||
122 | { |
||
123 | String courseName = unit.getCourse().getName(); |
||
124 | String[] words = courseName.split(" "); |
||
125 | for(String word: words) |
||
126 | { |
||
127 | if(word != null && word.length() > 3 && word.charAt(0) >= 'A' && word.charAt(0) <= 'Z' ) |
||
128 | { |
||
129 | courseCode += word.charAt(0); |
||
130 | } |
||
131 | } |
||
132 | } |
||
133 | |||
134 | %> |
||
135 | <html:link action="/user/startLoadCourseUnitFromHome?id=${unit.id}">${unit.name} (${unit.courseName} (${unit.courseCode}))</html:link> |
||
136 | <html:link action="/user/startLoadCourseUnitRootFromHome?courseUnitView.id=${unit.id}"><img border="0" alt="Pastas" src="<%=request.getContextPath()%>/imgs/folder.gif"></html:link> |
||
137 | </li> |
||
138 | <% |
||
550 | jmachado | 139 | } |
787 | jmachado | 140 | %> |
141 | </ul> |
||
142 | <% |
||
143 | } |
||
144 | %> |
||
550 | jmachado | 145 | |
787 | jmachado | 146 | |
147 | </li> |
||
148 | <li> |
||
149 | <p><bean:message key="courseunit.semestre"/> (Anuais)</p> |
||
150 | <% |
||
151 | cus = ((pt.estgp.estgweb.domain.TeacherImpl)UserSession.getUser()).getTeachedUnitsViewA(year); |
||
152 | if(cus == null || cus.size() == 0) |
||
153 | { |
||
154 | %><bean:message key="courseunit.zero.units"/><% |
||
155 | } |
||
789 | jmachado | 156 | else if(cus.size() > 0) |
787 | jmachado | 157 | { |
158 | %> |
||
159 | <ul> |
||
728 | jmachado | 160 | <% |
787 | jmachado | 161 | for(pt.estgp.estgweb.domain.CourseUnit unit:cus) |
728 | jmachado | 162 | { |
787 | jmachado | 163 | request.setAttribute("unit",unit); |
164 | %> |
||
165 | <li> |
||
166 | <% |
||
167 | String courseCode = ""; |
||
168 | if(unit.getCourse() != null) |
||
169 | { |
||
170 | String courseName = unit.getCourse().getName(); |
||
171 | String[] words = courseName.split(" "); |
||
172 | for(String word: words) |
||
173 | { |
||
174 | if(word != null && word.length() > 3 && word.charAt(0) >= 'A' && word.charAt(0) <= 'Z' ) |
||
175 | { |
||
176 | courseCode += word.charAt(0); |
||
177 | } |
||
178 | } |
||
179 | } |
||
180 | |||
181 | %> |
||
182 | <html:link action="/user/startLoadCourseUnitFromHome?id=${unit.id}">${unit.name} (${unit.courseName} (${unit.courseCode}))</html:link> |
||
183 | <html:link action="/user/startLoadCourseUnitRootFromHome?courseUnitView.id=${unit.id}"><img border="0" alt="Pastas" src="<%=request.getContextPath()%>/imgs/folder.gif"></html:link> |
||
184 | </li> |
||
185 | <% |
||
728 | jmachado | 186 | } |
787 | jmachado | 187 | %> |
188 | </ul> |
||
189 | <% |
||
190 | } |
||
191 | %> |
||
192 | </li> |
||
193 | </ul> |
||
194 | <% |
||
195 | } |
||
196 | %> |
||
728 | jmachado | 197 | |
215 | jmachado | 198 | </div> |
376 | jmachado | 199 | <div class="block"> |
200 | <p><bean:message key="intranet.home.curricular"/></p> |
||
201 | <ul> |
||
202 | <li> |
||
203 | <html:link action="/user/startLoadCoursesProgramsFromHome"><bean:message key="courseunit.programs"/></html:link> |
||
204 | </li> |
||
205 | </ul> |
||
206 | </div> |
||
215 | jmachado | 207 | </td> |
208 | </baco:isModuleOn> |
||
204 | jmachado | 209 | <td class="column"> |
215 | jmachado | 210 | <baco:isModuleOn module="courseunits"> |
211 | <jsp:include page="/user/home/courseUnitsAnnouncements.jsp"/> |
||
212 | </baco:isModuleOn> |
||
213 | <baco:isModuleOn module="todos"> |
||
214 | <jsp:include page="/user/home/todos.jsp"/> |
||
215 | </baco:isModuleOn> |
||
1024 | jmachado | 216 | |
960 | jmachado | 217 | <% |
961 | jmachado | 218 | try{ |
1024 | jmachado | 219 | HibernateUtils.getCurrentSession().beginTransaction(); |
220 | List<CourseUnit> result = DaoFactory.getCourseUnitDaoImpl().loadTeacherUnitsMissingEvaluation(UserSession); |
||
221 | if(result.size() > 0 ) |
||
222 | { |
||
223 | %> |
||
224 | <div class="block"> |
||
225 | <p class="WARNING"><label class="WARNING"> Tarefas Docente Relativas a Unidades</label></p> |
||
226 | <h1>Relatórios de avaliação por preencher/entregar</h1> |
||
227 | <ul> |
||
228 | <% |
||
229 | for(CourseUnit cu: result) |
||
230 | { |
||
231 | %> |
||
232 | <li><a href="<%=request.getContextPath()%>/user/startLoadCourseUnitEvaluation.do?courseUnitId=<%=cu.getId()%>"><%=cu.getImportYear()%> / <%=cu.getName()%> / <%=cu.getCode()%></a></li> |
||
233 | <% |
||
234 | } |
||
235 | %> |
||
236 | </ul> |
||
237 | </div> |
||
238 | <% |
||
239 | } |
||
240 | HibernateUtils.getCurrentSession().getTransaction().commit(); |
||
241 | }catch(Throwable e) |
||
242 | { |
||
243 | System.out.println(e); |
||
244 | e.printStackTrace(); |
||
245 | } |
||
246 | %> |
||
247 | |||
248 | |||
249 | <% |
||
250 | try{ |
||
960 | jmachado | 251 | HibernateUtils.getCurrentSession().beginTransaction(); |
252 | List<CourseUnitDaoImpl.CourseMissingValidationProgram> result = DaoFactory.getCourseUnitDaoImpl().loadMissingProgramValidate(UserSession); |
||
253 | List<CourseUnitDaoImpl.CourseMissingValidationEvaluation> result2 = DaoFactory.getCourseUnitDaoImpl().loadMissingEvaluationValidate(UserSession); |
||
967 | jmachado | 254 | List<CourseUnitDaoImpl.CourseMissingValidationEvaluation> result3 = DaoFactory.getCourseUnitDaoImpl().loadMissingEvaluation(UserSession); |
255 | if(result.size() > 0 || result2.size() > 0 || result3.size()>0) |
||
960 | jmachado | 256 | { |
257 | %> |
||
258 | <div class="block"> |
||
965 | jmachado | 259 | <p class="WARNING"><label class="WARNING"> Tarefas das Comissões de Curso</label></p> |
981 | jmachado | 260 | |
961 | jmachado | 261 | <ul> |
960 | jmachado | 262 | |
263 | |||
264 | <% |
||
265 | if(result.size()>0) |
||
266 | { |
||
267 | %> |
||
961 | jmachado | 268 | <li> |
980 | jmachado | 269 | <h1>Fichas curriculares por validar</h1> |
961 | jmachado | 270 | <ul> |
271 | <% |
||
272 | for(CourseUnitDaoImpl.CourseMissingValidationProgram mis:result) |
||
273 | { |
||
274 | %> |
||
275 | <li><a href="<%=request.getContextPath()%>/user/startLoadCoursesProgramsFromHome.do#<%=mis.course.getId()%>"><%=mis.course.getName()%> (<%=mis.courseUnits.size()%>)</a></li> |
||
276 | <% |
||
277 | } |
||
278 | %> |
||
279 | </ul> |
||
280 | </li> |
||
960 | jmachado | 281 | <% |
282 | } |
||
283 | %> |
||
284 | <% |
||
285 | if(result2.size()>0) |
||
286 | { |
||
961 | jmachado | 287 | |
960 | jmachado | 288 | %> |
961 | jmachado | 289 | <li> |
980 | jmachado | 290 | <h1>Relatórios de avaliação por validar</h1> |
981 | jmachado | 291 | <p>Expanda os cursos e clique nas unidades para validar os relatórios de avaliação.</p> |
292 | <p>No final de cada relatório existe um botão de validação para os membros das comissões dos cursos respectivos.</p> |
||
960 | jmachado | 293 | <ul> |
294 | <% |
||
295 | for(CourseUnitDaoImpl.CourseMissingValidationEvaluation mis:result2) |
||
296 | { |
||
297 | %> |
||
980 | jmachado | 298 | <li> |
299 | <h2><a href="javascript:showOrHide('evaluationValidate<%=mis.course.getId()%>')"><%=mis.course.getName()%> / <%=mis.course.getCode()%></a> (<%=mis.courseUnits.size()%>)</h2> |
||
300 | <ul id="evaluationValidate<%=mis.course.getId()%>" style="display: none"> |
||
960 | jmachado | 301 | <% |
302 | for(CourseUnit cu: mis.courseUnits) |
||
303 | { |
||
304 | %> |
||
963 | jmachado | 305 | <li><a href="<%=request.getContextPath()%>/user/startLoadCourseUnitEvaluation.do?courseUnitId=<%=cu.getId()%>"><%=cu.getImportYear()%> / <%=cu.getName()%> / <%=cu.getCode()%></a></li> |
960 | jmachado | 306 | <% |
307 | } |
||
308 | %> |
||
309 | </ul> |
||
310 | |||
311 | </li> |
||
312 | <% |
||
313 | } |
||
314 | %> |
||
315 | </ul> |
||
961 | jmachado | 316 | </li> |
960 | jmachado | 317 | <% |
961 | jmachado | 318 | |
960 | jmachado | 319 | } |
320 | %> |
||
967 | jmachado | 321 | <% |
322 | if(result3.size()>0) |
||
323 | { |
||
324 | |||
325 | %> |
||
326 | <li> |
||
980 | jmachado | 327 | <h1>Relatórios de avaliação ainda não preenchidos</h1> |
967 | jmachado | 328 | <ul> |
329 | <% |
||
330 | for(CourseUnitDaoImpl.CourseMissingValidationEvaluation mis:result3) |
||
331 | { |
||
332 | %> |
||
980 | jmachado | 333 | <li> |
334 | <h2><a href="javascript:showOrHide('evaluationFill<%=mis.course.getId()%>')"><%=mis.course.getName()%> / <%=mis.course.getCode()%></a> (<%=mis.courseUnits.size()%>)</h2> |
||
335 | <ul id="evaluationFill<%=mis.course.getId()%>" style="display: none"> |
||
967 | jmachado | 336 | <% |
337 | for(CourseUnit cu: mis.courseUnits) |
||
338 | { |
||
339 | %> |
||
340 | <li><a href="<%=request.getContextPath()%>/user/startLoadCourseUnitEvaluation.do?courseUnitId=<%=cu.getId()%>"><%=cu.getImportYear()%> / <%=cu.getName()%> / <%=cu.getCode()%></a></li> |
||
341 | <% |
||
342 | } |
||
343 | %> |
||
344 | </ul> |
||
345 | |||
346 | </li> |
||
347 | <% |
||
348 | } |
||
349 | %> |
||
350 | </ul> |
||
351 | </li> |
||
352 | <% |
||
353 | |||
354 | } |
||
355 | %> |
||
961 | jmachado | 356 | </ul> |
960 | jmachado | 357 | </div> |
358 | <% |
||
359 | } |
||
360 | HibernateUtils.getCurrentSession().getTransaction().commit(); |
||
961 | jmachado | 361 | }catch(Throwable e) |
362 | { |
||
363 | System.out.println(e); |
||
364 | e.printStackTrace(); |
||
365 | } |
||
960 | jmachado | 366 | %> |
367 | |||
368 | |||
369 | |||
204 | jmachado | 370 | </td> |
371 | </tr> |
||
372 | </tbody> |
||
373 | </table> |
||
374 | </div> |