Rev 1029 | Rev 1039 | 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(); |
1029 | jmachado | 220 | String activeYear = DaoFactory.getConfigurationDaoImpl().getCourseUnitEvaluationActiveYear(); |
221 | if(activeYear != null) |
||
1024 | jmachado | 222 | { |
1029 | jmachado | 223 | List<CourseUnit> result = DaoFactory.getCourseUnitDaoImpl().loadTeacherUnitsMissingEvaluation(UserSession); |
224 | if(result.size() > 0 ) |
||
225 | { |
||
226 | %> |
||
227 | <div class="block"> |
||
228 | <p class="WARNING"><label class="WARNING"> Tarefas Docente Relativas a Unidades (<%=activeYear%>)</label></p> |
||
229 | <h1>Relatórios de avaliação por preencher/entregar</h1> |
||
230 | <ul> |
||
231 | <% |
||
232 | for(CourseUnit cu: result) |
||
233 | { |
||
234 | %> |
||
235 | <li><a href="<%=request.getContextPath()%>/user/startLoadCourseUnitEvaluation.do?courseUnitId=<%=cu.getId()%>"><%=cu.getName()%>/<%=cu.getCode()%> (<%=cu.getCourseName() + "/" +cu.getCourseCode()%>)</a></li> |
||
236 | <% |
||
237 | } |
||
238 | %> |
||
239 | </ul> |
||
240 | </div> |
||
241 | <% |
||
242 | } |
||
1024 | jmachado | 243 | } |
244 | HibernateUtils.getCurrentSession().getTransaction().commit(); |
||
245 | }catch(Throwable e) |
||
246 | { |
||
247 | System.out.println(e); |
||
248 | e.printStackTrace(); |
||
249 | } |
||
250 | %> |
||
251 | |||
252 | |||
253 | <% |
||
1034 | jmachado | 254 | |
1024 | jmachado | 255 | try{ |
1034 | jmachado | 256 | HibernateUtils.getCurrentSession().beginTransaction(); |
257 | String activeYear = DaoFactory.getConfigurationDaoImpl().getCourseUnitEvaluationActiveYear(); |
||
258 | if(activeYear != null) |
||
259 | { |
||
260 | List<CourseUnitDaoImpl.CourseMissingValidationProgram> result = DaoFactory.getCourseUnitDaoImpl().loadMissingProgramValidate(UserSession); |
||
261 | List<CourseUnitDaoImpl.CourseMissingValidationEvaluation> result2 = DaoFactory.getCourseUnitDaoImpl().loadMissingEvaluationValidate(UserSession); |
||
262 | List<CourseUnitDaoImpl.CourseMissingValidationEvaluation> result3 = DaoFactory.getCourseUnitDaoImpl().loadMissingEvaluation(UserSession); |
||
263 | if(result.size() > 0 || result2.size() > 0 || result3.size()>0) |
||
264 | { |
||
265 | %> |
||
266 | <div class="block"> |
||
267 | <p class="WARNING"><label class="WARNING"> Tarefas das Comissões de Curso (<%=activeYear%>)</label></p> |
||
981 | jmachado | 268 | |
1034 | jmachado | 269 | <ul> |
960 | jmachado | 270 | |
271 | |||
961 | jmachado | 272 | <% |
1034 | jmachado | 273 | if(result.size()>0) |
274 | { |
||
275 | %> |
||
276 | <li> |
||
277 | <h1>Fichas curriculares por validar</h1> |
||
278 | <ul> |
||
279 | <% |
||
280 | for(CourseUnitDaoImpl.CourseMissingValidationProgram mis:result) |
||
281 | { |
||
282 | %> |
||
283 | <li><a href="<%=request.getContextPath()%>/user/startLoadCoursesProgramsFromHome.do#<%=mis.course.getId()%>"><%=mis.course.getName()%> (<%=mis.courseUnits.size()%>)</a></li> |
||
284 | <% |
||
285 | } |
||
286 | %> |
||
287 | </ul> |
||
288 | </li> |
||
289 | <% |
||
290 | } |
||
291 | %> |
||
292 | <% |
||
293 | if(result2.size()>0) |
||
961 | jmachado | 294 | { |
1034 | jmachado | 295 | |
961 | jmachado | 296 | %> |
1034 | jmachado | 297 | <li> |
298 | <h1>Relatórios de avaliação por validar</h1> |
||
299 | <p>Expanda os cursos e clique nas unidades para validar os relatórios de avaliação.</p> |
||
300 | <p>No final de cada relatório existe um botão de validação para os membros das comissões dos cursos respectivos.</p> |
||
301 | <ul> |
||
302 | <% |
||
303 | for(CourseUnitDaoImpl.CourseMissingValidationEvaluation mis:result2) |
||
304 | { |
||
305 | %> |
||
306 | <li> |
||
307 | <h2><a href="javascript:showOrHide('evaluationValidate<%=mis.course.getId()%>')"><%=mis.course.getName()%> / <%=mis.course.getCode()%></a> (<%=mis.courseUnits.size()%>)</h2> |
||
308 | <ul id="evaluationValidate<%=mis.course.getId()%>" style="display: none"> |
||
309 | <% |
||
310 | for(CourseUnit cu: mis.courseUnits) |
||
311 | { |
||
312 | %> |
||
313 | <li><a href="<%=request.getContextPath()%>/user/startLoadCourseUnitEvaluation.do?courseUnitId=<%=cu.getId()%>"><%=cu.getImportYear()%> / <%=cu.getName()%> / <%=cu.getCode()%></a></li> |
||
314 | <% |
||
315 | } |
||
316 | %> |
||
317 | </ul> |
||
318 | |||
319 | </li> |
||
320 | <% |
||
321 | } |
||
322 | %> |
||
323 | </ul> |
||
324 | </li> |
||
961 | jmachado | 325 | <% |
1034 | jmachado | 326 | |
961 | jmachado | 327 | } |
328 | %> |
||
960 | jmachado | 329 | <% |
1034 | jmachado | 330 | if(result3.size()>0) |
960 | jmachado | 331 | { |
1034 | jmachado | 332 | |
333 | %> |
||
334 | <li> |
||
335 | <h1>Relatórios de avaliação ainda não preenchidos</h1> |
||
336 | <ul> |
||
337 | <% |
||
338 | for(CourseUnitDaoImpl.CourseMissingValidationEvaluation mis:result3) |
||
339 | { |
||
960 | jmachado | 340 | %> |
980 | jmachado | 341 | <li> |
1034 | jmachado | 342 | <h2><a href="javascript:showOrHide('evaluationFill<%=mis.course.getId()%>')"><%=mis.course.getName()%> / <%=mis.course.getCode()%></a> (<%=mis.courseUnits.size()%>)</h2> |
343 | <ul id="evaluationFill<%=mis.course.getId()%>" style="display: none"> |
||
960 | jmachado | 344 | <% |
345 | for(CourseUnit cu: mis.courseUnits) |
||
346 | { |
||
347 | %> |
||
1034 | jmachado | 348 | <li><a href="<%=request.getContextPath()%>/user/startLoadCourseUnitEvaluation.do?courseUnitId=<%=cu.getId()%>"><%=cu.getImportYear()%> / <%=cu.getName()%> / <%=cu.getCode()%></a></li> |
960 | jmachado | 349 | <% |
350 | } |
||
351 | %> |
||
352 | </ul> |
||
353 | |||
354 | </li> |
||
355 | <% |
||
967 | jmachado | 356 | } |
357 | %> |
||
358 | </ul> |
||
359 | </li> |
||
360 | <% |
||
1034 | jmachado | 361 | |
967 | jmachado | 362 | } |
363 | %> |
||
364 | </ul> |
||
1034 | jmachado | 365 | </div> |
366 | <% |
||
367 | } |
||
368 | } |
||
369 | HibernateUtils.getCurrentSession().getTransaction().commit(); |
||
961 | jmachado | 370 | }catch(Throwable e) |
371 | { |
||
372 | System.out.println(e); |
||
373 | e.printStackTrace(); |
||
374 | } |
||
960 | jmachado | 375 | %> |
376 | |||
377 | |||
378 | |||
204 | jmachado | 379 | </td> |
380 | </tr> |
||
381 | </tbody> |
||
382 | </table> |
||
383 | </div> |