Rev 1817 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1817 | Rev 1821 | ||
---|---|---|---|
Line 21... | Line 21... | ||
21 | <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> |
21 | <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> |
22 | <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %> |
22 | <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %> |
23 | <jsp:useBean id="UserSession" type="pt.estgp.estgweb.domain.UserSessionImpl" scope="request"/> |
23 | <jsp:useBean id="UserSession" type="pt.estgp.estgweb.domain.UserSessionImpl" scope="request"/> |
24 | 24 | ||
25 | <% |
25 | <% |
- | 26 | AbstractDao.getCurrentSession().beginTransaction(); |
|
26 | String all = request.getParameter("all"); |
27 | String all = request.getParameter("all"); |
27 | String importYear = request.getParameter("importYear"); |
28 | String importYear = request.getParameter("importYear"); |
28 | AbstractDao.getCurrentSession().beginTransaction(); |
29 | //AbstractDao.getCurrentSession().beginTransaction(); |
29 | if(importYear == null) |
30 | if(importYear == null) |
30 | importYear = UserSession.getNowConfiguration().getInterfaceImportYear(); |
31 | importYear = UserSession.getNowConfiguration().getInterfaceImportYear(); |
31 | 32 | ||
32 | %> |
33 | %> |
33 | <div class="panel panel-default"> |
34 | <div class="panel panel-default"> |
Line 40... | Line 41... | ||
40 | boolean allCourses = false; |
41 | boolean allCourses = false; |
41 | List<String> comissionsRoles = null; |
42 | List<String> comissionsRoles = null; |
42 | if(UserSession.getUser().isSuperuserOrAdmin() || UserSession.getUser().hasRole(Globals.SERVICES_PROGRAMS_ROLE) || UserSession.getUser().hasRole("services")) |
43 | if(UserSession.getUser().isSuperuserOrAdmin() || UserSession.getUser().hasRole(Globals.SERVICES_PROGRAMS_ROLE) || UserSession.getUser().hasRole("services")) |
43 | { |
44 | { |
44 | allCourses = true; |
45 | allCourses = true; |
45 | AbstractDao.getCurrentSession().beginTransaction(); |
- | |
- | 46 | ||
46 | 47 | ||
47 | 48 | ||
48 | Criteria c = AbstractDao.getCurrentSession().createCriteria(CourseUnit.class) |
49 | Criteria c = AbstractDao.getCurrentSession().createCriteria(CourseUnit.class) |
49 | .setProjection(Projections.projectionList().add(Projections.groupProperty("c.validationRole")) |
50 | .setProjection(Projections.projectionList().add(Projections.groupProperty("c.validationRole")) |
50 | .add(Projections.property("c.id")).add(Projections.property("c.name")).add(Projections.property("c.code"))) |
51 | .add(Projections.property("c.id")).add(Projections.property("c.name")).add(Projections.property("c.code"))) |
51 | .createAlias("course", "c") |
52 | .createAlias("course", "c") |
52 | //.add(eq("importYear", importYear)) |
53 | //.add(eq("importYear", importYear)) |
53 | ; |
54 | ; |
54 | List<Object[]> validationRoles = c.list(); |
55 | List<Object[]> validationRoles = c.list(); |
55 | AbstractDao.getCurrentSession().getTransaction().commit(); |
- | |
- | 56 | ||
56 | comissionsRoles = new ArrayList<String>(); |
57 | comissionsRoles = new ArrayList<String>(); |
57 | 58 | ||
58 | %> |
59 | %> |
59 | <div class="avisosWarning" style="display: none"> |
60 | <div class="avisosWarning" style="display: none"> |
60 | <div class="alert alert-warning">Existem cursos sem papel de comissão atribuido |
61 | <div class="alert alert-warning">Existem cursos sem papel de comissão atribuido |
Line 90... | Line 91... | ||
90 | <% |
91 | <% |
91 | } |
92 | } |
92 | %> |
93 | %> |
93 | </div> |
94 | </div> |
94 | <% |
95 | <% |
95 | } |
96 | } |
96 | else |
97 | else |
97 | { |
98 | { |
98 | 99 | ||
99 | User persistentUser = DaoFactory.getUserDaoImpl().narrow(DaoFactory.getUserDaoImpl().get(UserSession.getUser().getId())); |
100 | User persistentUser = DaoFactory.getUserDaoImpl().narrow(DaoFactory.getUserDaoImpl().get(UserSession.getUser().getId())); |
100 | comissionsRoles = new ArrayList<String>(); |
101 | comissionsRoles = new ArrayList<String>(); |
101 | if(persistentUser instanceof TeacherImpl) |
102 | if(persistentUser instanceof TeacherImpl) |
102 | { |
103 | { |
Line 145... | Line 146... | ||
145 | } |
146 | } |
146 | </script> |
147 | </script> |
147 | <% |
148 | <% |
148 | try |
149 | try |
149 | { |
150 | { |
150 | AbstractDao.getCurrentSession().beginTransaction(); |
- | |
- | 151 | ||
151 | 152 | ||
152 | if(all == null) |
153 | if(all == null) |
153 | { |
154 | { |
154 | %> |
155 | %> |
155 | <div class="row"> |
156 | <div class="row"> |
Line 223... | Line 224... | ||
223 | .setProjection(Projections.projectionList() |
224 | .setProjection(Projections.projectionList() |
224 | .add(Projections.groupProperty("c.id")) |
225 | .add(Projections.groupProperty("c.id")) |
225 | .add(Projections.property("c.name")) |
226 | .add(Projections.property("c.name")) |
226 | .add(Projections.property("c.code"))) |
227 | .add(Projections.property("c.code"))) |
227 | .createAlias("course", "c") |
228 | .createAlias("course", "c") |
- | 229 | .add(eq("c.status", true)) |
|
228 | .add(eq("importYear", importYear)) |
230 | .add(eq("importYear", importYear)) |
229 | .add(eq("c.validationRole", roleCourse)); |
231 | .add(eq("c.validationRole", roleCourse)); |
230 | List<Object[]> coursesForRole = c.list(); |
232 | List<Object[]> coursesForRole = c.list(); |
231 | 233 | ||
232 | if(all==null && coursesForRole.size() > 1) |
234 | if(all==null && coursesForRole.size() > 1) |
Line 337... | Line 339... | ||
337 | <td>${cu.statdtpInqueritoPedagogicoFiles}</td> |
339 | <td>${cu.statdtpInqueritoPedagogicoFiles}</td> |
338 | <td>${cu.statcontentsFiles}</td> |
340 | <td>${cu.statcontentsFiles}</td> |
339 | <td><button class="btn btn-default" data-href="<%=request.getContextPath()%>/user/courseunits/statsAjax.jsp?courseUnitId=${cu.id}" data-title="Estatisticas da Unidade ${cu.name} (${cu.code})" data-toggle="modal" data-target="#modalAjaxRequest"><span class="glyphicon glyphicon-zoom-in"/></button> </td> |
341 | <td><button class="btn btn-default" data-href="<%=request.getContextPath()%>/user/courseunits/statsAjax.jsp?courseUnitId=${cu.id}" data-title="Estatisticas da Unidade ${cu.name} (${cu.code})" data-toggle="modal" data-target="#modalAjaxRequest"><span class="glyphicon glyphicon-zoom-in"/></button> </td> |
340 | </tr> |
342 | </tr> |
341 | <% |
343 | <% |
- | 344 | AbstractDao.getCurrentSession().evict(cu); |
|
342 | } |
345 | } |
343 | 346 | ||
344 | if(all == null) |
347 | if(all == null) |
345 | { |
348 | { |
346 | %> |
349 | %> |
Line 367... | Line 370... | ||
367 | %> |
370 | %> |
368 | </tbody> |
371 | </tbody> |
369 | </table> |
372 | </table> |
370 | <% |
373 | <% |
371 | } |
374 | } |
372 | AbstractDao.getCurrentSession().getTransaction().commit(); |
- | |
- | 375 | ||
373 | } |
376 | } |
374 | catch(Exception e) |
377 | catch(Exception e) |
375 | { |
378 | { |
376 | System.out.println(e.toString()); |
379 | System.out.println(e.toString()); |
377 | e.printStackTrace(); |
380 | e.printStackTrace(); |