Rev 1040 | Rev 1146 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
749 | jmachado | 1 | <%@ page import="pt.estgp.estgweb.domain.views.CourseView" %> |
2 | <%@ page import="pt.estgp.estgweb.web.utils.RequestUtils" %> |
||
214 | jmachado | 3 | <%@ page import="pt.utl.ist.berserk.logic.serviceManager.IServiceManager" %> |
749 | jmachado | 4 | <%@ page import="pt.utl.ist.berserk.logic.serviceManager.ServiceManager" %> |
214 | jmachado | 5 | <%@ page import="java.util.List" %> |
833 | jmachado | 6 | <%@ page import="java.util.Collections" %> |
206 | jmachado | 7 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> |
8 | <%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %> |
||
9 | <%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %> |
||
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-tiles.tld" prefix="tiles" %> |
||
13 | <%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %> |
||
14 | <%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %> |
||
1133 | jmachado | 15 | <script> |
16 | function alertPermissions() |
||
17 | { |
||
18 | alert("Este procedimento afecta as permissões atuais no sistema de ficheiros da intranet. Após salvar estas alterações, por favor gere o BAT de geração de pastas e corra-o novamente na raiz do servidor IONLINE") |
||
19 | } |
||
20 | function alertFolders(place) |
||
21 | { |
||
22 | alert("Caro administrador, lembramos-lhe que alterar o " + place + " de uma unidade curricular implica trocar a pasta de ficheiros da intranet do " + place + " onde esta se encontrava para o " + place + " onde actualmente se encontra. O BACO irá actualizar a nova LOCALIZAÇÃO da pasta de ficheiros na sua base de dados. Mas a pasta terá de ser fisicamente alterada pela administração de sistemas."); |
||
23 | } |
||
24 | |||
25 | </script> |
||
214 | jmachado | 26 | <% |
27 | IServiceManager sm = ServiceManager.getInstance(); |
||
28 | String[] names = new String[]{}; |
||
29 | Object[] args = new Object[]{}; |
||
30 | List<CourseView> courseViews = (List<CourseView>) sm.execute(RequestUtils.getRequester(request, response), "LoadCourses", args, names); |
||
31 | request.setAttribute("Courses", courseViews); |
||
749 | jmachado | 32 | |
33 | List<pt.estgp.estgweb.domain.views.UserView> teachers =(List<pt.estgp.estgweb.domain.views.UserView>) sm.execute(RequestUtils.getRequester(request, response), "LoadTeachers", args, names); |
||
833 | jmachado | 34 | /*Collections.sort(teachers,new Comparator<pt.estgp.estgweb.domain.views.UserView>(){ |
35 | |||
36 | @Override |
||
37 | public int compare(pt.estgp.estgweb.domain.views.UserView o1, pt.estgp.estgweb.domain.views.UserView o2) { |
||
38 | if(o1.getName()!=null && o2.getName() != null) |
||
39 | return o1.getName().compareTo(o2.getName()); |
||
40 | if(o1.getName()==null) |
||
41 | return 1; |
||
42 | return -1; |
||
43 | } |
||
44 | |||
45 | });*/ |
||
749 | jmachado | 46 | request.setAttribute("Teachers", teachers); |
214 | jmachado | 47 | %> |
215 | jmachado | 48 | |
206 | jmachado | 49 | <jsp:useBean id="CourseUnitView" type="pt.estgp.estgweb.domain.views.CourseUnitView" scope="request"/> |
50 | <jsp:useBean id="UserSession" type="pt.estgp.estgweb.domain.UserSession" scope="request"/> |
||
214 | jmachado | 51 | <html:errors/> |
52 | <jomm:messages/> |
||
749 | jmachado | 53 | |
54 | <ul> |
||
55 | <li><html:link action="/user/startLoadCourseUnitFromHome.do?id=${CourseUnitView.id}">Página da Unidade</html:link></li> |
||
56 | <li><html:link action="/startLoadCourseUnitProgram.do?courseUnitId=${CourseUnitView.id}">Ficha Curricular</html:link></li> |
||
57 | </ul> |
||
206 | jmachado | 58 | <html:form styleClass="form" action="/user/courseUnitControllerAdminFromServiceZone" enctype="multipart/form-data"> |
214 | jmachado | 59 | <input type="hidden" name="dispatch" value="createOrUpdateAdmin"> |
60 | <html:hidden property="courseUnitView.id"/> |
||
61 | <html:hidden property="id"/> |
||
62 | <table> |
||
63 | <tr> |
||
64 | <th> |
||
65 | <bean:message key="courseunit.name"/> |
||
66 | </th> |
||
67 | <td> |
||
68 | <html:text styleClass="text" property="courseUnitView.name"/> |
||
69 | </td> |
||
70 | </tr> |
||
71 | <tr> |
||
72 | <th> |
||
73 | <bean:message key="courseunit.course"/> |
||
74 | </th> |
||
75 | <td> |
||
1133 | jmachado | 76 | <html:select onchange="alertFolders('curso')" property="courseUnitView.courseId"> |
214 | jmachado | 77 | <logic:iterate id="course" name="Courses" type="pt.estgp.estgweb.domain.views.CourseView"> |
78 | <html:option value="${course.id}">(${course.code}) ${course.name}</html:option> |
||
79 | </logic:iterate> |
||
80 | </html:select> |
||
81 | </td> |
||
82 | </tr> |
||
83 | <tr> |
||
84 | <th> |
||
85 | <bean:message key="courseunit.code"/> |
||
86 | </th> |
||
87 | <td> |
||
88 | <html:text styleClass="text" property="courseUnitView.code"/> |
||
89 | </td> |
||
90 | </tr> |
||
91 | <tr> |
||
92 | <th> |
||
93 | <bean:message key="courseunit.semestre"/> |
||
94 | </th> |
||
95 | <td> |
||
1133 | jmachado | 96 | <html:select onchange="alertFolders('semestre')" property="courseUnitView.semestre"> |
97 | <html:option value="S1"><bean:message key="courseunit.S1"/></html:option> |
||
98 | <html:option value="S2"><bean:message key="courseunit.S2"/></html:option> |
||
99 | <html:option value="A"><bean:message key="courseunit.A"/></html:option> |
||
100 | <html:option value="T1"><bean:message key="courseunit.T1"/></html:option> |
||
101 | <html:option value="T2"><bean:message key="courseunit.T2"/></html:option> |
||
102 | <html:option value="T3"><bean:message key="courseunit.T3"/></html:option> |
||
103 | <html:option value="T4"><bean:message key="courseunit.T4"/></html:option> |
||
214 | jmachado | 104 | </html:select> |
105 | </td> |
||
106 | </tr> |
||
107 | <tr> |
||
108 | <th> |
||
109 | <bean:message key="courseunit.importYear"/> |
||
110 | </th> |
||
111 | <td> |
||
1133 | jmachado | 112 | <html:select onchange="alertFolders('ano')" property="courseUnitView.importYear"> |
214 | jmachado | 113 | <logic:iterate id="item" name="CourseUnitsForm" property="importYears"> |
114 | <html:option value="${item}">${item}</html:option> |
||
115 | </logic:iterate> |
||
116 | </html:select> |
||
117 | </td> |
||
118 | </tr> |
||
833 | jmachado | 119 | <tr> |
120 | <th> |
||
121 | <bean:message key="courseunit.pathIntranet"/> |
||
122 | </th> |
||
123 | <td> |
||
834 | jmachado | 124 | <html:text styleClass="text" readonly="true" property="courseUnitView.pathIntranet"/> (Para preencher gerar pastas nos serviços) |
833 | jmachado | 125 | </td> |
126 | </tr> |
||
749 | jmachado | 127 | |
214 | jmachado | 128 | <tr> |
129 | <th> |
||
749 | jmachado | 130 | <bean:message key="courseunit.responsable"/> |
131 | </th> |
||
132 | <td> |
||
1133 | jmachado | 133 | <html:select onchange="alertPermissions();" property="courseUnitView.responsableId"> |
751 | jmachado | 134 | <html:option value="0"></html:option> |
836 | jmachado | 135 | <logic:iterate id="teacher" name="CourseUnitsForm" property="teachers" type="pt.estgp.estgweb.domain.views.UserView"> |
749 | jmachado | 136 | <html:option value="${teacher.id}">(${teacher.code}) ${teacher.name}</html:option> |
137 | </logic:iterate> |
||
138 | </html:select> |
||
139 | </td> |
||
140 | </tr> |
||
141 | <tr> |
||
142 | <th> |
||
214 | jmachado | 143 | <bean:message key="courseunit.teachers"/> |
144 | </th> |
||
145 | <td> |
||
294 | jmachado | 146 | <logic:lessEqual value="0" name="CourseUnitView" property="id"> |
277 | jmachado | 147 | <i><bean:message key="courseunit.to.add.teachers.save.first"/></i> |
148 | </logic:lessEqual> |
||
149 | |||
294 | jmachado | 150 | <logic:greaterThan value="0" name="CourseUnitView" property="id"> |
277 | jmachado | 151 | <html:select property="teacherId"> |
152 | <logic:present name="CourseUnitsForm" property="teachers"> |
||
153 | <logic:iterate id="teacher" name="CourseUnitsForm" property="teachers" type="pt.estgp.estgweb.domain.views.UserView"> |
||
154 | <jomm:option itemName="teacher" itemProperty="id" comparableObjectName="CourseUnitsForm" |
||
155 | comparableObjectProperty="teacherId"> |
||
156 | (${teacher.code}) ${teacher.name} |
||
157 | </jomm:option> |
||
158 | </logic:iterate> |
||
159 | <input type="button" value="<bean:message key="add"/>" |
||
1133 | jmachado | 160 | onclick="alertPermissions();set(this.form,'addTeacher');this.form.submit();"> |
277 | jmachado | 161 | </logic:present> |
162 | </html:select> |
||
163 | <logic:greaterThan name="CourseUnitView" property="teachersSize" value="0"> |
||
164 | <table class="dataTable removeButton"> |
||
165 | <logic:iterate id="userView" name="CourseUnitView" property="teachers" type="pt.estgp.estgweb.domain.views.UserView"> |
||
166 | <tr> |
||
167 | <th> |
||
168 | ${userView.code} |
||
169 | </th> |
||
170 | <th> |
||
171 | ${userView.name} |
||
172 | </th> |
||
173 | <td><input type="button" class="removeButton" |
||
174 | onclick="CourseUnitsForm.id.value='${userView.id}';set(this.form,'removeTeacher');this.form.submit();"> |
||
175 | </td> |
||
176 | </tr> |
||
177 | </logic:iterate> |
||
178 | </table> |
||
179 | </logic:greaterThan> |
||
214 | jmachado | 180 | </logic:greaterThan> |
181 | </td> |
||
182 | </tr> |
||
276 | jmachado | 183 | |
214 | jmachado | 184 | <tr> |
185 | <th> |
||
186 | <bean:message key="courseunit.students"/> |
||
187 | </th> |
||
188 | <td> |
||
276 | jmachado | 189 | |
294 | jmachado | 190 | <logic:lessEqual value="0" name="CourseUnitView" property="id"> |
277 | jmachado | 191 | <i><bean:message key="courseunit.to.add.students.save.first"/></i> |
276 | jmachado | 192 | </logic:lessEqual> |
193 | |||
294 | jmachado | 194 | <logic:greaterThan value="0" name="CourseUnitView" property="id"> |
276 | jmachado | 195 | <html:text styleClass="text" property="studentCode"/> |
196 | <input type="button" value="<bean:message key="add"/>" |
||
1133 | jmachado | 197 | onclick="if(this.form.studentCode.value=='0' || this.form.studentCode.value==''){alert('Por favor coloque o numero de aluno antes de adicionar');}else{alertPermissions();set(this.form,'addStudent');this.form.submit();}"> |
276 | jmachado | 198 | <logic:greaterThan name="CourseUnitView" property="studentsSize" value="0"> |
837 | jmachado | 199 | |
200 | <table id="myTable" class="tablesorter dataTable removeButton"> |
||
201 | <thead> |
||
202 | <tr> |
||
203 | <th>Código Siges</th> |
||
204 | <th>Username</th> |
||
205 | <th>Nome</th> |
||
206 | <th>Email</th> |
||
207 | <th>Telefone</th> |
||
208 | </tr> |
||
209 | </thead> |
||
210 | <tbody> |
||
748 | jmachado | 211 | <logic:iterate id="userView" name="CourseUnitView" property="studentsOrderedByNumber" type="pt.estgp.estgweb.domain.views.UserView"> |
276 | jmachado | 212 | <tr> |
837 | jmachado | 213 | <td> |
276 | jmachado | 214 | ${userView.code} |
837 | jmachado | 215 | </td> |
216 | <td> |
||
276 | jmachado | 217 | ${userView.username} |
837 | jmachado | 218 | </td> |
219 | <td> |
||
276 | jmachado | 220 | ${userView.name} |
837 | jmachado | 221 | </td> |
222 | <td> |
||
276 | jmachado | 223 | ${userView.email} |
837 | jmachado | 224 | </td> |
225 | <td> |
||
226 | ${userView.phonenumber} |
||
227 | </td> |
||
276 | jmachado | 228 | <td><input type="button" class="removeButton" |
229 | onclick="CourseUnitsForm.id.value='${userView.code}';set(this.form,'removeStudent');this.form.submit();"> |
||
230 | </td> |
||
231 | </tr> |
||
232 | </logic:iterate> |
||
837 | jmachado | 233 | </tbody> |
276 | jmachado | 234 | </table> |
235 | </logic:greaterThan> |
||
214 | jmachado | 236 | </logic:greaterThan> |
237 | </td> |
||
238 | </tr> |
||
206 | jmachado | 239 | |
276 | jmachado | 240 | |
214 | jmachado | 241 | </table> |
242 | <input type="button" onclick="set(form,'createOrUpdateAdmin');form.submit()" value="<bean:message key="confirm"/>"> |
||
206 | jmachado | 243 | </html:form> |