Rev 1506 | Rev 1509 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1506 | Rev 1507 | ||
---|---|---|---|
Line 8... | Line 8... | ||
8 | <%@ page import="pt.estgp.estgweb.web.filters.UserRoleProxy" %> |
8 | <%@ page import="pt.estgp.estgweb.web.filters.UserRoleProxy" %> |
9 | <%@ page import="java.util.ArrayList" %> |
9 | <%@ page import="java.util.ArrayList" %> |
10 | <%@ page import="java.util.Collection" %> |
10 | <%@ page import="java.util.Collection" %> |
11 | <%@ page import="java.util.List" %> |
11 | <%@ page import="java.util.List" %> |
12 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> |
12 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> |
13 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> |
- | |
14 | <%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %> |
13 | <%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %> |
15 | <%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %> |
14 | <%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %> |
16 | <%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %> |
15 | <%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %> |
17 | <%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %> |
16 | <%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %> |
18 | <%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %> |
17 | <%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %> |
Line 108... | Line 107... | ||
108 | <html:option value="false"><bean:message key="no"/></html:option> |
107 | <html:option value="false"><bean:message key="no"/></html:option> |
109 | </html:select> |
108 | </html:select> |
110 | </div> |
109 | </div> |
111 | </div> |
110 | </div> |
112 | <div class="form-group"> |
111 | <div class="form-group"> |
113 | <label class="control-label col-sm-2"><bean:message key="course.degree"/> FR</label> |
112 | <label class="control-label col-sm-2"><bean:message key="course.degree"/></label> |
114 | <div class="col-sm-10"> |
113 | <div class="col-sm-10"> |
115 | <html:select styleClass="form-control" property="courseView.degree"> |
114 | <html:select styleClass="form-control" property="courseView.degree"> |
116 | <html:option value="B"><bean:message key="course.B"/></html:option> |
115 | <html:option value="B"><bean:message key="course.B"/></html:option> |
117 | <html:option value="L"><bean:message key="course.L"/></html:option> |
116 | <html:option value="L"><bean:message key="course.L"/></html:option> |
118 | <html:option value="M"><bean:message key="course.M"/></html:option> |
117 | <html:option value="M"><bean:message key="course.M"/></html:option> |
Line 229... | Line 228... | ||
229 | 228 | ||
230 | 229 | ||
231 | <% |
230 | <% |
232 | request.setAttribute("teachersForComissions", CourseForm.getTeachers()); |
231 | request.setAttribute("teachersForComissions", CourseForm.getTeachers()); |
233 | request.setAttribute("courseIdForComissions", CourseView.getId()); |
232 | request.setAttribute("courseIdForComissions", CourseView.getId()); |
- | 233 | //CourseView needed ja la esta neste caso |
|
234 | %> |
234 | %> |
235 | 235 | ||
236 | <%-- PAINEL INDEPENDENTE PARA GERIR COMISSAO DE CURSO --%> |
- | |
237 | <% |
- | |
238 | Long courseIdForComissions = (Long) request.getAttribute("courseIdForComissions"); |
- | |
239 | Collection<UserView> teachersForComissions = (Collection<UserView>) request.getAttribute("teachersForComissions"); |
- | |
240 | - | ||
241 | %> |
- | |
242 | <script> |
- | |
243 | function removeCourseComissionTeacher(teacherId) |
- | |
244 | { |
- | |
245 | $.getJSON('<%=request.getContextPath()%>/user/courses/courseApiJson.jsp', |
- | |
246 | { |
- | |
247 | service:"removeCourseComissionTeacher", |
- | |
248 | teacherId:teacherId, |
- | |
249 | courseId: <%=courseIdForComissions%> |
- | |
250 | }, |
- | |
251 | function(data) |
- | |
252 | { |
- | |
253 | if(data.response == "done") |
- | |
254 | { |
- | |
255 | $("#courseComissionTeacher" + teacherId).remove(); |
- | |
256 | } |
- | |
257 | else |
- | |
258 | { |
- | |
259 | $("#courseComissionTeacher" + teacherId).css( |
- | |
260 | { |
- | |
261 | "background-color":"red" |
- | |
262 | } |
- | |
263 | ); |
- | |
264 | alert("ERRO NO SERVIÇO: " + data.msg); |
- | |
265 | } |
- | |
266 | }); |
- | |
267 | } |
- | |
268 | function addCourseComissionTeacher(teacherId) |
236 | <jsp:include page="courseComissionEditPanel.jsp"/> |
269 | { |
- | |
270 | - | ||
271 | $.getJSON('<%=request.getContextPath()%>/user/courses/courseApiJson.jsp', |
- | |
272 | { |
- | |
273 | service:"addCourseComissionTeacher", |
- | |
274 | teacherId:teacherId, |
- | |
275 | courseId: <%=CourseView.getId()%> |
- | |
276 | }, |
- | |
277 | function(data) |
- | |
278 | { |
- | |
279 | if(data.response == "done") |
- | |
280 | { |
- | |
281 | - | ||
282 | newLine = $( |
- | |
283 | "<tr id=\"courseComissionTeacher" + teacherId + "\" >" + |
- | |
284 | "<td>" + data.teacherCode + "</td>" + |
- | |
285 | "<td>" + data.teacherName + "</td>" + |
- | |
286 | "<td>" + data.teacherEmail + "</td>" + |
- | |
287 | "<td>" + |
- | |
288 | "<a class=\"btn btn-warning\" target=\"_blank\" href=\"<%=request.getContextPath()%>/user/startProfileFromSearchUsers.do?id=" + teacherId + "\"><span class=\"glyphicon glyphicon-pencil\"></span></a>" + |
- | |
289 | "<button type=\"button\" class=\"btn btn-danger\" onclick=\"removeCourseComissionTeacher(" + teacherId + ")\"><span class=\"glyphicon glyphicon-remove\"></span></button>"+ |
- | |
290 | "</td>" + |
- | |
291 | "</tr>"); |
- | |
292 | $("#teacherContainer").append(newLine); |
- | |
293 | evaluateTableSortersInside("#teachersTable"); |
- | |
294 | - | ||
295 | } |
- | |
296 | else |
- | |
297 | { |
- | |
298 | $("#courseComissionTeacher" + teacherId).css( |
- | |
299 | { |
- | |
300 | "background-color":"red" |
- | |
301 | } |
- | |
302 | ); |
- | |
303 | alert("ERRO NO SERVIÇO: " + data.msg); |
- | |
304 | } |
- | |
305 | }); |
- | |
306 | } |
- | |
307 | </script> |
- | |
308 | <div class="form-group"> |
- | |
309 | <label class="control-label col-sm-2">Escolher um Membro para a Comissão</label> |
- | |
310 | <div class="col-sm-10"> |
- | |
311 | <select id="teacherSelectedForComission" class="form-control"> |
- | |
312 | <option> |
- | |
313 | <bean:message key="none"/> |
- | |
314 | </option> |
- | |
315 | <logic:present name="teachersForComissions"> |
- | |
316 | <logic:iterate id="teacher" name="teachersForComissions" type="pt.estgp.estgweb.domain.views.UserView"> |
- | |
317 | <option value="${teacher.id}"> |
- | |
318 | (${teacher.code}) ${teacher.name} |
- | |
319 | </option> |
- | |
320 | </logic:iterate> |
- | |
321 | </logic:present> |
- | |
322 | </select> |
- | |
323 | <button type="button" class="btn btn-success" onclick="addCourseComissionTeacher($('#teacherSelectedForComission').val())"><span class="glyphicon glyphicon-plus"></span></button> |
- | |
324 | </div> |
- | |
325 | </div> |
- | |
326 | - | ||
327 | - | ||
328 | <table id="teachersTable" class="tablesorterfiltered"> |
- | |
329 | <thead> |
- | |
330 | <tr> |
- | |
331 | <th>Código</th> |
- | |
332 | <th>Nome</th> |
- | |
333 | <th>Contacto</th> |
- | |
334 | <th>Editar</th> |
- | |
335 | </tr> |
- | |
336 | </thead> |
- | |
337 | <tbody id="teacherContainer"> |
- | |
338 | <% |
- | |
339 | AbstractDao.getCurrentSession().beginTransaction(); |
- | |
340 | for(User u:DaoFactory.getUserDaoImpl().loadRoleUsers(CourseView.getValidationRole())) |
- | |
341 | { |
- | |
342 | %> |
- | |
343 | <tr id="courseComissionTeacher<%=u.getId()%>"> |
- | |
344 | <td><%=((Teacher)u).getSigesCode()%></td> |
- | |
345 | <td><%=u.getName()%></td> |
- | |
346 | <td><%=u.getEmail()%></td> |
- | |
347 | <td> |
- | |
348 | <a class="btn btn-warning" target="_blank" href="<%=request.getContextPath()%>/user/startProfileFromSearchUsers.do?id=<%=u.getId()%>"><span class="glyphicon glyphicon-pencil"></span></a> |
- | |
349 | <button type="button" class="btn btn-danger" onclick="removeCourseComissionTeacher(<%=u.getId()%>)"><span class="glyphicon glyphicon-remove"></span></button> |
- | |
350 | </td> |
- | |
351 | </tr> |
- | |
352 | <% |
- | |
353 | } |
- | |
354 | AbstractDao.getCurrentSession().getTransaction().commit(); |
- | |
355 | %> |
- | |
356 | </tbody> |
- | |
357 | </table> |
- | |
358 | <%-- // PAINEL INDEPENDENTE PARA GERIR COMISSAO DE CURSO --%> |
237 | <%-- // PAINEL INDEPENDENTE PARA GERIR COMISSAO DE CURSO --%> |
359 | </div> |
238 | </div> |
360 | </div> |
239 | </div> |
361 | 240 | ||
362 | 241 | ||
Line 388... | Line 267... | ||
388 | </logic:notPresent> |
267 | </logic:notPresent> |
389 | 268 | ||
390 | </div> |
269 | </div> |
391 | </div> |
270 | </div> |
392 | 271 | ||
393 | <%-- |
272 | |
394 | 273 | ||
395 | <div class="form-group"> |
274 | <div class="form-group"> |
396 | <label class="control-label col-sm-2"> |
275 | <label class="control-label col-sm-2"> |
397 | <bean:message key="course.studies.plan"/>(Versão nova PAE) |
276 | <bean:message key="course.studies.plan"/>(Versão nova PAE) |
- | 277 | <baco:hasRole role="admin,all,servicesStudiesPlans"> |
|
398 | <a class="btn btn-default" href="<%=request.getContextPath()%>/user/adminStudyPlans.do?courseId=<%=CourseView.getId()%>">Gerir Planos</a> |
278 | <a class="btn btn-default" href="<%=request.getContextPath()%>/user/adminStudyPlans.do?courseId=<%=CourseView.getId()%>">Gerir Planos</a> |
- | 279 | </baco:hasRole> |
|
- | 280 | <baco:hasNotRole role="admin,all,servicesStudiesPlans"> |
|
- | 281 | <label class="text-info"> Necessita do papel de Gestão de Planos de Estudos para editar os planos</label> |
|
- | 282 | </baco:hasNotRole> |
|
399 | </label> |
283 | </label> |
400 | <div class="col-sm-10"> |
284 | <div class="col-sm-10"> |
401 | <logic:present name="CourseView" property="courseStudiesPlans"> |
285 | <logic:present name="CourseView" property="courseStudiesPlans"> |
402 | <table class="tablesorterfiltered"> |
286 | <table class="tablesorterfiltered"> |
403 | <thead> |
287 | <thead> |
Line 420... | Line 304... | ||
420 | </tbody> |
304 | </tbody> |
421 | </table> |
305 | </table> |
422 | </logic:present> |
306 | </logic:present> |
423 | </div> |
307 | </div> |
424 | </div> |
308 | </div> |
425 | --%> |
309 | |
426 | 310 | ||
427 | 311 | ||
428 | 312 | ||
429 | <%-- |
313 | <%-- |
430 | 314 |