Rev 1353 | Rev 1699 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1353 | jmachado | 1 | <%@ page import="jomm.dao.impl.AbstractDao" %> |
2 | <%@ page import="pt.estgp.estgweb.Globals" %> |
||
3 | <%@ page import="pt.estgp.estgweb.domain.Student" %> |
||
4 | <%@ page import="pt.estgp.estgweb.domain.dao.DaoFactory" %> |
||
5 | <%@ page import="java.util.ArrayList" %> |
||
6 | <%@ page import="java.util.List" %> |
||
7 | <%@ page import="org.hibernate.Criteria" %> |
||
8 | <%@ page import="static org.hibernate.criterion.Restrictions.eq" %> |
||
9 | <%@ page import="org.hibernate.criterion.Criterion" %> |
||
10 | <%@ page import="static org.hibernate.criterion.Restrictions.eq" %> |
||
11 | <%@ page import="static org.hibernate.criterion.Restrictions.or" %> |
||
12 | <%@ page import="static org.hibernate.criterion.Restrictions.*" %> |
||
13 | <%@ page import="org.hibernate.criterion.Order" %> |
||
14 | <%@ page import="org.hibernate.criterion.Projections" %> |
||
15 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> |
||
16 | <%@ taglib uri="/WEB-INF/baco.tld" prefix="baco" %> |
||
17 | <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> |
||
18 | <%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %> |
||
19 | <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> |
||
20 | <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> |
||
21 | <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %> |
||
22 | <jsp:useBean id="UserSession" type="pt.estgp.estgweb.domain.UserSessionImpl" scope="request"/> |
||
23 | |||
24 | <div class="panel panel-default"> |
||
25 | <div class="panel-heading"> |
||
26 | Listagem de alunos das comissões de curso |
||
27 | </div> |
||
28 | <div class="panel-body"> |
||
29 | |||
30 | <% |
||
31 | UserSession.getUser().getRolesList(); |
||
32 | List<String> comissionsRoles = new ArrayList<String>(); |
||
33 | for(String role: UserSession.getUser().getRolesList()) |
||
34 | { |
||
1354 | jmachado | 35 | if(role.startsWith(Globals.COURSE_COMMISSION_PROGRAMS_ROLES_PREFIX)) |
1353 | jmachado | 36 | comissionsRoles.add(role); |
37 | } |
||
38 | if(comissionsRoles.size() == 0) |
||
39 | { |
||
40 | %> |
||
41 | <div class="alert alert-warning"> |
||
42 | Lamentamos mas não têm qualquer comissão de curso associada |
||
43 | </div> |
||
44 | <% |
||
45 | } |
||
46 | else |
||
47 | { |
||
48 | AbstractDao.getCurrentSession().beginTransaction(); |
||
49 | |||
50 | for(String roleCourse: comissionsRoles) |
||
51 | { |
||
52 | |||
53 | request.setAttribute("roleCourse",roleCourse); |
||
54 | |||
55 | Criteria c = AbstractDao.getCurrentSession().createCriteria(Student.class) |
||
56 | .setProjection(Projections.projectionList() |
||
57 | .add(Projections.groupProperty("id")) |
||
58 | .add(Projections.countDistinct("su.id")) |
||
59 | .add(Projections.property("course.name")) |
||
60 | .add(Projections.property("course.id")) |
||
61 | .add(Projections.property("course.code"))) |
||
62 | .createAlias("subscribedUnits", "su") |
||
63 | .createAlias("su.course", "course") |
||
64 | .add(eq("su.importYear", "201516")) |
||
65 | .add(eq("course.validationRole", roleCourse)) |
||
66 | ; |
||
67 | c.addOrder(Order.asc("name")); |
||
68 | List<Object[]> students = c.list(); |
||
69 | if(students.size() == 0) |
||
70 | { |
||
71 | %> |
||
72 | <h2><bean:message key="user.role.${roleCourse}"/> </h2> |
||
73 | <div class="alert alert-info alert-small"> |
||
74 | Não foram encontrados <%=students.size()%> alunos, inscritos no ano ${UserSession.nowConfiguration.interfaceImportYear} |
||
75 | </div> |
||
76 | <% |
||
77 | } |
||
78 | else |
||
79 | { |
||
80 | // |
||
81 | // List<Student> students = DaoFactory.getStudentDaoImpl().loadFromCoursesWithValidationRoles(comissionsRoles,UserSession.getNowConfiguration().getInterfaceImportYear()); |
||
82 | %> |
||
83 | <h2><bean:message key="user.role.${roleCourse}"/></h2> |
||
84 | <div class="alert alert-info alert-small"> |
||
85 | Foram encontrados <%=students.size()%> alunos, inscritos no ano ${UserSession.nowConfiguration.interfaceImportYear} |
||
86 | </div> |
||
87 | |||
88 | <table class="tablesorterfiltered"> |
||
89 | <thead> |
||
90 | <tr> |
||
91 | <th>Número</th> |
||
92 | <th>Nome</th> |
||
93 | <th>Email</th> |
||
94 | <th>Telefone</th> |
||
95 | <th class="filter-name filter-select">Situação de Propinas</th> |
||
96 | <th>Cadeiras Inscrito em ${UserSession.nowConfiguration.interfaceImportYear}</th> |
||
97 | <th>Notas</th> |
||
98 | </tr> |
||
99 | </thead> |
||
100 | <tbody> |
||
101 | <% |
||
102 | for(Object[] student: students) |
||
103 | { |
||
104 | Long studentId = (Long) student[0]; |
||
105 | Integer cadeirasInscrito = (Integer) student[1]; |
||
106 | String courseName = (String) student[2]; |
||
107 | Long courseId = (Long) student[3]; |
||
108 | String courseCode = (String) student[4]; |
||
109 | Student s = DaoFactory.getStudentDaoImpl().load(studentId); |
||
110 | request.setAttribute("student",s); |
||
111 | %> |
||
112 | <tr> |
||
113 | <td>${student.sigesCode}</td> |
||
114 | <td>${student.name}</td> |
||
115 | <td>${student.email}</td> |
||
116 | <td>${student.phonenumber}</td> |
||
1354 | jmachado | 117 | <td><bean:message key="yes.no.${student.propinasEmDia}"/></td> |
1353 | jmachado | 118 | <td> |
119 | <a class="btn btn-default" href="#" data-href="<%=request.getContextPath()%>/public/profile/profileHomeAjax.jsp?userId=${student.id}" data-title="Notas do aluno ${student.name} (${student.sigesCode})" data-toggle="modal" data-target="#modalAjaxRequest"> |
||
120 | <%=cadeirasInscrito%> |
||
121 | </a> |
||
122 | <td> |
||
123 | <a class="btn btn-default" href="#" data-href="<%=request.getContextPath()%>/public/profile/profileGradesAjax.jsp?userId=${student.id}" data-title="Notas do aluno ${student.name} (${student.sigesCode})" data-toggle="modal" data-target="#modalAjaxRequest"> |
||
124 | Notas |
||
125 | </a> |
||
126 | </td> |
||
127 | |||
128 | </tr> |
||
129 | <% |
||
130 | } |
||
131 | %> |
||
132 | </tbody> |
||
133 | </table> |
||
134 | |||
135 | <% |
||
136 | } |
||
137 | } |
||
138 | AbstractDao.getCurrentSession().getTransaction().commit(); |
||
139 | } |
||
140 | %> |
||
141 | |||
142 | </div> |
||
143 | </div> |