Rev 1670 | Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1626 | jmachado | 1 | <%@ page import="jomm.dao.impl.AbstractDao" %> |
2 | <%@ page import="pt.estgp.estgweb.Globals" %> |
||
3 | <%@ page import="pt.estgp.estgweb.domain.CourseDepartment" %> |
||
4 | <%@ page import="pt.estgp.estgweb.domain.CourseDepartmentImpl" %> |
||
5 | <%@ page import="pt.estgp.estgweb.domain.dao.DaoFactory" %> |
||
6 | <%@ page import="pt.estgp.estgweb.web.filters.UserRoleProxy" %> |
||
7 | <%@ page import="java.util.ArrayList" %> |
||
8 | <%@ page import="java.util.List" %> |
||
9 | <%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %> |
||
10 | <%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %> |
||
11 | <%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %> |
||
12 | <%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %> |
||
13 | <%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %> |
||
14 | <%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %> |
||
15 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> |
||
16 | <% |
||
17 | AbstractDao.getCurrentSession().beginTransaction(); |
||
18 | ArrayList<CourseDepartment> departments = (ArrayList<CourseDepartment>) DaoFactory.getCourseDepartmentDaoImpl().findAll(); |
||
19 | String jsonArrayDepartments = CourseDepartmentImpl.getJson(departments); |
||
20 | request.setAttribute("jsonArrayDepartments",jsonArrayDepartments); |
||
21 | request.setAttribute("departments",departments); |
||
22 | |||
23 | List<String> rolesBoardDepartamento = UserRoleProxy.getUserRolesByPrefix("department.board"); |
||
24 | List<String> rolesDiretorDepartamento = UserRoleProxy.getUserRolesByPrefix("department.diretor"); |
||
25 | request.setAttribute("rolesBoardDepartamento",rolesBoardDepartamento); |
||
26 | request.setAttribute("rolesDiretorDepartamento",rolesDiretorDepartamento); |
||
27 | |||
28 | %> |
||
29 | |||
30 | |||
31 | <div baco-model-class="pt.estgp.estgweb.domain.CourseDepartmentImpl" |
||
32 | id="departmentsModule" |
||
33 | ng-app="departmentsModule" |
||
34 | ng-controller="departmentsModuleController"> |
||
35 | |||
36 | <script> |
||
37 | //DECLARACAO DA APLICACAO LOCAL EM ANGULAR |
||
38 | var departmentsModule = angular.module('departmentsModule', []); |
||
39 | GLOBAL_BacoAngularAppDependencies.push('departmentsModule'); |
||
40 | |||
41 | departmentsModule.controller('departmentsModuleController', function($scope) { |
||
42 | $scope.departments = ${jsonArrayDepartments}; |
||
43 | }); |
||
44 | </script> |
||
45 | |||
46 | |||
47 | |||
48 | <p><label class="label-info">Papeis dos Departamentos:</label> Os papeis de departamento são escolhidos da lista de papeis do sistema considerando-se todos os papeis com os prefixos:</p> |
||
49 | <ul> |
||
50 | <li>department.board: para membros da direcção</li> |
||
51 | <li>department.diretor: para diretores direcção</li> |
||
52 | </ul> |
||
53 | <p>Caso seja necessário um novo papel deverá administrar os papeis institucionais dirija-se <html:link action="/user/configurationUserRoles">Aqui</html:link></p> |
||
54 | <div class="form-horizontal"> |
||
55 | |||
56 | <table class="tablesorter-blue"> |
||
57 | <thead> |
||
58 | <tr> |
||
59 | <th>Ativo</th> |
||
60 | <th>Instituição</th> |
||
61 | <th>Nome</th> |
||
62 | <th>Nome En</th> |
||
63 | <th>Nome Es</th> |
||
64 | <th>Nome Fr</th> |
||
65 | <th>Papel para Membro da Direcao</th> |
||
66 | <th>Papel para Director</th> |
||
67 | <th></th> |
||
68 | </tr> |
||
69 | </thead> |
||
70 | <tbody> |
||
71 | <tr ng-repeat="d in departments | orderBy:institutionalCode:false"> |
||
72 | <td> |
||
73 | <select class="chosenOff" ng-model="d.active"> |
||
74 | <option ng-value="true" ng-selected="d.active == true">Ativo</option> |
||
75 | <option ng-value="false" ng-selected="d.active == false">Inativo</option> |
||
76 | </select> |
||
77 | </td> |
||
78 | <td> |
||
79 | <select class="chosenOff" ng-model="d.institutionalCode"> |
||
80 | <option value="<%=Globals.INSTITUTIONAL_CODE_ESTG%>"><%=Globals.INSTITUTIONAL_SMALL_NAME_ESTG%></option> |
||
81 | <option value="<%=Globals.INSTITUTIONAL_CODE_ESAE%>"><%=Globals.INSTITUTIONAL_SMALL_NAME_ESAE%></option> |
||
82 | <option value="<%=Globals.INSTITUTIONAL_CODE_ESECS%>"><%=Globals.INSTITUTIONAL_SMALL_NAME_ESECS%></option> |
||
83 | <option value="<%=Globals.INSTITUTIONAL_CODE_ESS%>"><%=Globals.INSTITUTIONAL_SMALL_NAME_ESS%></option> |
||
84 | </select> |
||
85 | </td> |
||
86 | <td> |
||
87 | <input class="form-control" type="text" ng-model="d.name"> |
||
88 | </td> |
||
89 | <td> |
||
90 | <input class="form-control" type="text" ng-model="d.nameEn"> |
||
91 | </td> |
||
92 | <td> |
||
93 | <input class="form-control" type="text" ng-model="d.nameEs"> |
||
94 | </td> |
||
95 | <td> |
||
96 | <input class="form-control" type="text" ng-model="d.nameFr"> |
||
97 | </td> |
||
98 | <td> |
||
99 | <select class="chosenOff" ng-model="d.boardRole"> |
||
100 | <option value="">Escolha</option> |
||
101 | <logic:iterate id="role" name="rolesBoardDepartamento"> |
||
102 | <option value="${role}"><bean:message key="user.role.${role}"/></option> |
||
103 | </logic:iterate> |
||
104 | </select> |
||
105 | </td> |
||
106 | <td> |
||
107 | <select class="chosenOff" ng-model="d.directorRole"> |
||
108 | <option value="">Escolha</option> |
||
109 | <logic:iterate id="role" name="rolesDiretorDepartamento"> |
||
110 | <option value="${role}"><bean:message key="user.role.${role}"/></option> |
||
111 | </logic:iterate> |
||
112 | </select> |
||
113 | </td> |
||
114 | <td> |
||
115 | <button type="button" class="btn btn-danger btn-xs"> |
||
116 | <span class="glyphicon glyphicon-remove"/> |
||
117 | </button> |
||
118 | </td> |
||
119 | |||
120 | |||
121 | |||
122 | </tr> |
||
123 | </tbody> |
||
124 | </table> |
||
125 | <%-- |
||
126 | <model:id name="department" property="id"/> |
||
127 | <model:field name="department" property="name"/> |
||
128 | <model:field name="department" property="nameEn"/> |
||
129 | <model:field name="department" property="nameEs"/> |
||
130 | <model:field name="department" property="nameFr"/> |
||
131 | <model:remove name="department"/> |
||
132 | --%> |
||
133 | </div> |
||
134 | |||
135 | |||
136 | </div> |
||
137 | Teste |
||
138 | <% |
||
139 | AbstractDao.getCurrentSession().getTransaction().commit(); |
||
140 | %> |