Rev 1310 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1310 | Rev 1827 | ||
---|---|---|---|
1 | <%@ page import="jomm.dao.impl.AbstractDao" %> |
1 | <%@ page import="jomm.dao.impl.AbstractDao" %> |
2 | <%@ page import="pt.estgp.estgweb.domain.Teacher" %> |
2 | <%@ page import="pt.estgp.estgweb.domain.Teacher" %> |
3 | <%@ page import="pt.estgp.estgweb.domain.dao.DaoFactory" %> |
3 | <%@ page import="pt.estgp.estgweb.domain.dao.DaoFactory" %> |
4 | <%@ page import="pt.estgp.estgweb.domain.CourseUnit" %> |
4 | <%@ page import="pt.estgp.estgweb.domain.CourseUnit" %> |
5 | <%@ page contentType="text/html" %> |
5 | <%@ page contentType="text/html" %> |
6 | <%@ page pageEncoding="UTF-8" %> |
6 | <%@ page pageEncoding="UTF-8" %> |
7 | <%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %> |
7 | <%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %> |
8 | <%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %> |
8 | <%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %> |
9 | <%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %> |
9 | <%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %> |
10 | <%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %> |
10 | <%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %> |
11 | <%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %> |
11 | <%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %> |
12 | <html:html locale="true"> |
12 | <html:html> |
13 | <head> |
13 | <head> |
14 | <title>Consulta de Unidades Curriculares</title> |
14 | <title>Consulta de Unidades Curriculares</title> |
15 | <link type="text/css" rel="stylesheet" href="<%=request.getContextPath()%>/css/style.css"/> |
15 | <link type="text/css" rel="stylesheet" href="<%=request.getContextPath()%>/css/style.css"/> |
16 | 16 | ||
17 | </head> |
17 | </head> |
18 | <body class="small" marginwidth="0" marginheight="0" bgcolor="#ffffff" topmargin="0" leftmargin="0" |
18 | <body class="small" marginwidth="0" marginheight="0" bgcolor="#ffffff" topmargin="0" leftmargin="0" |
19 | style="text-align:center"> |
19 | style="text-align:center"> |
20 | <table align="center"> |
20 | <table align="center"> |
21 | <tr> |
21 | <tr> |
22 | <td align="center"> |
22 | <td align="center"> |
23 | <div id="body"> |
23 | <div id="body"> |
24 | 24 | ||
25 | <table id="page"> |
25 | <table id="page"> |
26 | <tr> |
26 | <tr> |
27 | <td> |
27 | <td> |
28 | <div id="header"> |
28 | <div id="header"> |
29 | <jsp:include page="layout/header.jsp"/> |
29 | <jsp:include page="layout/header.jsp"/> |
30 | </div> |
30 | </div> |
31 | </td> |
31 | </td> |
32 | </tr> |
32 | </tr> |
33 | <tr> |
33 | <tr> |
34 | <td id="content"> |
34 | <td id="content"> |
35 | <h1>Bem vindo à página de consulta de unidades curriculares</h1> |
35 | <h1>Bem vindo à página de consulta de unidades curriculares</h1> |
36 | <br> |
36 | <br> |
37 | 37 | ||
38 | <div class="listCircleWhite"> |
38 | <div class="listCircleWhite"> |
39 | <ul> |
39 | <ul> |
40 | <li> |
40 | <li> |
41 | Por favor confirme as suas unidades curriculares e informe caso seja detectado algum |
41 | Por favor confirme as suas unidades curriculares e informe caso seja detectado algum |
42 | erro |
42 | erro |
43 | </li> |
43 | </li> |
44 | <li> |
44 | <li> |
45 | O objectivo desta consulta é identificar erros de importação do sistema SIGES na nova plataforma do sitio da |
45 | O objectivo desta consulta é identificar erros de importação do sistema SIGES na nova plataforma do sitio da |
46 | ESTG |
46 | ESTG |
47 | </li> |
47 | </li> |
48 | <li> |
48 | <li> |
49 | Obrigado pela disponibilidade |
49 | Obrigado pela disponibilidade |
50 | </li> |
50 | </li> |
51 | </ul> |
51 | </ul> |
52 | </div> |
52 | </div> |
53 | <div class="portalContent"> |
53 | <div class="portalContent"> |
54 | <p>Exemplo:</p> |
54 | <p>Exemplo:</p> |
55 | <p>est12345</p> |
55 | <p>est12345</p> |
56 | <p>ou então o seu número de BI</p> |
56 | <p>ou então o seu número de BI</p> |
57 | <form action="units.jsp"> |
57 | <form action="units.jsp"> |
58 | <p>USERNAME NETPA: <input type="text" name="sigesTeacherCode"> |
58 | <p>USERNAME NETPA: <input type="text" name="sigesTeacherCode"> |
59 | <p>ou número de BI: <input type="text" name="bi"> </p> |
59 | <p>ou número de BI: <input type="text" name="bi"> </p> |
60 | <p><input type="submit"/></p> |
60 | <p><input type="submit"/></p> |
61 | </form> |
61 | </form> |
62 | <div> |
62 | <div> |
63 | <% |
63 | <% |
64 | try |
64 | try |
65 | { |
65 | { |
66 | AbstractDao.getCurrentSession().beginTransaction(); |
66 | AbstractDao.getCurrentSession().beginTransaction(); |
67 | String code = request.getParameter("sigesTeacherCode"); |
67 | String code = request.getParameter("sigesTeacherCode"); |
68 | String bi = request.getParameter("bi"); |
68 | String bi = request.getParameter("bi"); |
69 | if((code == null && code.length() == 0) || ( bi == null && bi.length() == 0)) |
69 | if((code == null && code.length() == 0) || ( bi == null && bi.length() == 0)) |
70 | { |
70 | { |
71 | %> |
71 | %> |
72 | <div class="statusERROR"> |
72 | <div class="statusERROR"> |
73 | <p>Por favor coloque o código de docente ou o número de bilhete de identidade</p> |
73 | <p>Por favor coloque o código de docente ou o número de bilhete de identidade</p> |
74 | </div> |
74 | </div> |
75 | <% |
75 | <% |
76 | } |
76 | } |
77 | else |
77 | else |
78 | { |
78 | { |
79 | try |
79 | try |
80 | { |
80 | { |
81 | Teacher teacher; |
81 | Teacher teacher; |
82 | if(code.startsWith("est")) |
82 | if(code.startsWith("est")) |
83 | code = code.substring(3); |
83 | code = code.substring(3); |
84 | if(code != null && code.trim().length()>0) |
84 | if(code != null && code.trim().length()>0) |
85 | teacher = DaoFactory.getTeacherDaoImpl().loadBySigesCode(Integer.parseInt(code)); |
85 | teacher = DaoFactory.getTeacherDaoImpl().loadBySigesCode(Integer.parseInt(code)); |
86 | else |
86 | else |
87 | teacher = DaoFactory.getTeacherDaoImpl().loadByBi(bi); |
87 | teacher = DaoFactory.getTeacherDaoImpl().loadByBi(bi); |
88 | 88 | ||
89 | 89 | ||
90 | 90 | ||
91 | if (teacher == null) |
91 | if (teacher == null) |
92 | { |
92 | { |
93 | %> |
93 | %> |
94 | <div class="statusERROR"> |
94 | <div class="statusERROR"> |
95 | <p>Docente não encontrado</p> |
95 | <p>Docente não encontrado</p> |
96 | </div> |
96 | </div> |
97 | <% |
97 | <% |
98 | } |
98 | } |
99 | else |
99 | else |
100 | { |
100 | { |
101 | teacher.setUnitCheck(true); |
101 | teacher.setUnitCheck(true); |
102 | %> |
102 | %> |
103 | <p>Docente: <%=teacher.getName()%> |
103 | <p>Docente: <%=teacher.getName()%> |
104 | </p> |
104 | </p> |
105 | 105 | ||
106 | <p>Email: <%=teacher.getEmail()%> |
106 | <p>Email: <%=teacher.getEmail()%> |
107 | </p> |
107 | </p> |
108 | <% |
108 | <% |
109 | if (teacher.getTeachedUnits() == null || teacher.getTeachedUnits().size() == 0) |
109 | if (teacher.getTeachedUnits() == null || teacher.getTeachedUnits().size() == 0) |
110 | { |
110 | { |
111 | %> |
111 | %> |
112 | <div class="statusERROR"> |
112 | <div class="statusERROR"> |
113 | <p>Não tem quaisquer unidades curriculares associadas</p> |
113 | <p>Não tem quaisquer unidades curriculares associadas</p> |
114 | </div> |
114 | </div> |
115 | <% |
115 | <% |
116 | } |
116 | } |
117 | else |
117 | else |
118 | { |
118 | { |
119 | %> |
119 | %> |
120 | <table border="1"> |
120 | <table border="1"> |
121 | <tr> |
121 | <tr> |
122 | <th> |
122 | <th> |
123 | Código de Curso |
123 | Código de Curso |
124 | </th> |
124 | </th> |
125 | <th> |
125 | <th> |
126 | Curso |
126 | Curso |
127 | </th> |
127 | </th> |
128 | <th> |
128 | <th> |
129 | Unidade |
129 | Unidade |
130 | </th> |
130 | </th> |
131 | <th> |
131 | <th> |
132 | Semestre |
132 | Semestre |
133 | </th> |
133 | </th> |
134 | </tr> |
134 | </tr> |
135 | <% |
135 | <% |
136 | for (CourseUnit cu : teacher.getTeachedUnits()) |
136 | for (CourseUnit cu : teacher.getTeachedUnits()) |
137 | { |
137 | { |
138 | %> |
138 | %> |
139 | <tr> |
139 | <tr> |
140 | <td> |
140 | <td> |
141 | <%=cu.getCourseCode()%> |
141 | <%=cu.getCourseCode()%> |
142 | </td> |
142 | </td> |
143 | <td> |
143 | <td> |
144 | <%=cu.getCourseName()%> |
144 | <%=cu.getCourseName()%> |
145 | </td> |
145 | </td> |
146 | <td> |
146 | <td> |
147 | <%=cu.getName()%> |
147 | <%=cu.getName()%> |
148 | </td> |
148 | </td> |
149 | <td> |
149 | <td> |
150 | <%=cu.getSemestre()%> |
150 | <%=cu.getSemestre()%> |
151 | </td> |
151 | </td> |
152 | </tr> |
152 | </tr> |
153 | <% |
153 | <% |
154 | } |
154 | } |
155 | %> |
155 | %> |
156 | </table> |
156 | </table> |
157 | <% |
157 | <% |
158 | 158 | ||
159 | } |
159 | } |
160 | } |
160 | } |
161 | 161 | ||
162 | } |
162 | } |
163 | catch (NumberFormatException e) |
163 | catch (NumberFormatException e) |
164 | { |
164 | { |
165 | %> |
165 | %> |
166 | <div class="statusERROR"> |
166 | <div class="statusERROR"> |
167 | <p>Por favor introduza um número</p> |
167 | <p>Por favor introduza um número</p> |
168 | </div> |
168 | </div> |
169 | <% |
169 | <% |
170 | } |
170 | } |
171 | } |
171 | } |
172 | 172 | ||
173 | AbstractDao.getCurrentSession().getTransaction().commit(); |
173 | AbstractDao.getCurrentSession().getTransaction().commit(); |
174 | } |
174 | } |
175 | catch (Throwable e) |
175 | catch (Throwable e) |
176 | 176 | ||
177 | { |
177 | { |
178 | response.sendError(500); |
178 | response.sendError(500); |
179 | } |
179 | } |
180 | %> |
180 | %> |
181 | </div> |
181 | </div> |
182 | <ul class="statusERROR" style="font-size:1.1em"> |
182 | <ul class="statusERROR" style="font-size:1.1em"> |
183 | <li>Por favor informe a equipa de desenvolvimento (<a href="mailto:jmachado@estgp.pt">jmachado@estgp.pt</a>) caso algum erro tenha sido detectado, em caso de estar tudo ok não é necessário feedback</li> |
183 | <li>Por favor informe a equipa de desenvolvimento (<a href="mailto:jmachado@estgp.pt">jmachado@estgp.pt</a>) caso algum erro tenha sido detectado, em caso de estar tudo ok não é necessário feedback</li> |
184 | </ul> |
184 | </ul> |
185 | </div> |
185 | </div> |
186 | 186 | ||
187 | </td> |
187 | </td> |
188 | </tr> |
188 | </tr> |
189 | </table> |
189 | </table> |
190 | <div id="footer"> |
190 | <div id="footer"> |
191 | <jsp:include page="layout/footer.jsp"/> |
191 | <jsp:include page="layout/footer.jsp"/> |
192 | </div> |
192 | </div> |
193 | </div> |
193 | </div> |
194 | </td> |
194 | </td> |
195 | </tr> |
195 | </tr> |
196 | </table> |
196 | </table> |
197 | </body> |
197 | </body> |
198 | </html:html> |
198 | </html:html> |