Rev 833 | Rev 835 | 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" %> |
||
214 | jmachado | 15 | <% |
16 | IServiceManager sm = ServiceManager.getInstance(); |
||
17 | String[] names = new String[]{}; |
||
18 | Object[] args = new Object[]{}; |
||
19 | List<CourseView> courseViews = (List<CourseView>) sm.execute(RequestUtils.getRequester(request, response), "LoadCourses", args, names); |
||
20 | request.setAttribute("Courses", courseViews); |
||
749 | jmachado | 21 | |
22 | 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 | 23 | /*Collections.sort(teachers,new Comparator<pt.estgp.estgweb.domain.views.UserView>(){ |
24 | |||
25 | @Override |
||
26 | public int compare(pt.estgp.estgweb.domain.views.UserView o1, pt.estgp.estgweb.domain.views.UserView o2) { |
||
27 | if(o1.getName()!=null && o2.getName() != null) |
||
28 | return o1.getName().compareTo(o2.getName()); |
||
29 | if(o1.getName()==null) |
||
30 | return 1; |
||
31 | return -1; |
||
32 | } |
||
33 | |||
34 | });*/ |
||
749 | jmachado | 35 | request.setAttribute("Teachers", teachers); |
214 | jmachado | 36 | %> |
215 | jmachado | 37 | |
206 | jmachado | 38 | <jsp:useBean id="CourseUnitView" type="pt.estgp.estgweb.domain.views.CourseUnitView" scope="request"/> |
39 | <jsp:useBean id="UserSession" type="pt.estgp.estgweb.domain.UserSession" scope="request"/> |
||
214 | jmachado | 40 | <html:errors/> |
41 | <jomm:messages/> |
||
749 | jmachado | 42 | |
43 | <ul> |
||
44 | <li><html:link action="/user/startLoadCourseUnitFromHome.do?id=${CourseUnitView.id}">Página da Unidade</html:link></li> |
||
45 | <li><html:link action="/startLoadCourseUnitProgram.do?courseUnitId=${CourseUnitView.id}">Ficha Curricular</html:link></li> |
||
46 | </ul> |
||
206 | jmachado | 47 | <html:form styleClass="form" action="/user/courseUnitControllerAdminFromServiceZone" enctype="multipart/form-data"> |
214 | jmachado | 48 | <input type="hidden" name="dispatch" value="createOrUpdateAdmin"> |
49 | <html:hidden property="courseUnitView.id"/> |
||
50 | <html:hidden property="id"/> |
||
51 | <table> |
||
52 | <tr> |
||
53 | <th> |
||
54 | <bean:message key="courseunit.name"/> |
||
55 | </th> |
||
56 | <td> |
||
57 | <html:text styleClass="text" property="courseUnitView.name"/> |
||
58 | </td> |
||
59 | </tr> |
||
60 | <tr> |
||
61 | <th> |
||
62 | <bean:message key="courseunit.course"/> |
||
63 | </th> |
||
64 | <td> |
||
65 | <html:select property="courseUnitView.courseId"> |
||
66 | <logic:iterate id="course" name="Courses" type="pt.estgp.estgweb.domain.views.CourseView"> |
||
67 | <html:option value="${course.id}">(${course.code}) ${course.name}</html:option> |
||
68 | </logic:iterate> |
||
69 | </html:select> |
||
70 | </td> |
||
71 | </tr> |
||
72 | <tr> |
||
73 | <th> |
||
74 | <bean:message key="courseunit.code"/> |
||
75 | </th> |
||
76 | <td> |
||
77 | <html:text styleClass="text" property="courseUnitView.code"/> |
||
78 | </td> |
||
79 | </tr> |
||
80 | <tr> |
||
81 | <th> |
||
82 | <bean:message key="courseunit.semestre"/> |
||
83 | </th> |
||
84 | <td> |
||
85 | <html:select property="courseUnitView.semestre"> |
||
86 | <html:option value="S1">S1</html:option> |
||
87 | <html:option value="S2">S2</html:option> |
||
728 | jmachado | 88 | <html:option value="A">A</html:option> |
214 | jmachado | 89 | </html:select> |
90 | </td> |
||
91 | </tr> |
||
92 | <tr> |
||
93 | <th> |
||
94 | <bean:message key="courseunit.importYear"/> |
||
95 | </th> |
||
96 | <td> |
||
97 | <html:select property="courseUnitView.importYear"> |
||
98 | <logic:iterate id="item" name="CourseUnitsForm" property="importYears"> |
||
99 | <html:option value="${item}">${item}</html:option> |
||
100 | </logic:iterate> |
||
101 | </html:select> |
||
102 | </td> |
||
103 | </tr> |
||
833 | jmachado | 104 | <tr> |
105 | <th> |
||
106 | <bean:message key="courseunit.pathIntranet"/> |
||
107 | </th> |
||
108 | <td> |
||
834 | jmachado | 109 | <html:text styleClass="text" readonly="true" property="courseUnitView.pathIntranet"/> (Para preencher gerar pastas nos serviços) |
833 | jmachado | 110 | </td> |
111 | </tr> |
||
749 | jmachado | 112 | |
214 | jmachado | 113 | <tr> |
114 | <th> |
||
749 | jmachado | 115 | <bean:message key="courseunit.responsable"/> |
116 | </th> |
||
117 | <td> |
||
118 | <html:select property="courseUnitView.responsableId"> |
||
751 | jmachado | 119 | <html:option value="0"></html:option> |
833 | jmachado | 120 | <logic:iterate id="userView" name="CourseUnitView" property="teachers" type="pt.estgp.estgweb.domain.views.UserView"> |
749 | jmachado | 121 | <html:option value="${teacher.id}">(${teacher.code}) ${teacher.name}</html:option> |
122 | </logic:iterate> |
||
123 | </html:select> |
||
124 | </td> |
||
125 | </tr> |
||
126 | <tr> |
||
127 | <th> |
||
214 | jmachado | 128 | <bean:message key="courseunit.teachers"/> |
129 | </th> |
||
130 | <td> |
||
294 | jmachado | 131 | <logic:lessEqual value="0" name="CourseUnitView" property="id"> |
277 | jmachado | 132 | <i><bean:message key="courseunit.to.add.teachers.save.first"/></i> |
133 | </logic:lessEqual> |
||
134 | |||
294 | jmachado | 135 | <logic:greaterThan value="0" name="CourseUnitView" property="id"> |
277 | jmachado | 136 | <html:select property="teacherId"> |
137 | <logic:present name="CourseUnitsForm" property="teachers"> |
||
138 | <logic:iterate id="teacher" name="CourseUnitsForm" property="teachers" type="pt.estgp.estgweb.domain.views.UserView"> |
||
139 | <jomm:option itemName="teacher" itemProperty="id" comparableObjectName="CourseUnitsForm" |
||
140 | comparableObjectProperty="teacherId"> |
||
141 | (${teacher.code}) ${teacher.name} |
||
142 | </jomm:option> |
||
143 | </logic:iterate> |
||
144 | <input type="button" value="<bean:message key="add"/>" |
||
145 | onclick="set(this.form,'addTeacher');this.form.submit();"> |
||
146 | </logic:present> |
||
147 | </html:select> |
||
148 | <logic:greaterThan name="CourseUnitView" property="teachersSize" value="0"> |
||
149 | <table class="dataTable removeButton"> |
||
150 | <logic:iterate id="userView" name="CourseUnitView" property="teachers" type="pt.estgp.estgweb.domain.views.UserView"> |
||
151 | <tr> |
||
152 | <th> |
||
153 | ${userView.code} |
||
154 | </th> |
||
155 | <th> |
||
156 | ${userView.name} |
||
157 | </th> |
||
158 | <td><input type="button" class="removeButton" |
||
159 | onclick="CourseUnitsForm.id.value='${userView.id}';set(this.form,'removeTeacher');this.form.submit();"> |
||
160 | </td> |
||
161 | </tr> |
||
162 | </logic:iterate> |
||
163 | </table> |
||
164 | </logic:greaterThan> |
||
214 | jmachado | 165 | </logic:greaterThan> |
166 | </td> |
||
167 | </tr> |
||
276 | jmachado | 168 | |
214 | jmachado | 169 | <tr> |
170 | <th> |
||
171 | <bean:message key="courseunit.students"/> |
||
172 | </th> |
||
173 | <td> |
||
276 | jmachado | 174 | |
294 | jmachado | 175 | <logic:lessEqual value="0" name="CourseUnitView" property="id"> |
277 | jmachado | 176 | <i><bean:message key="courseunit.to.add.students.save.first"/></i> |
276 | jmachado | 177 | </logic:lessEqual> |
178 | |||
294 | jmachado | 179 | <logic:greaterThan value="0" name="CourseUnitView" property="id"> |
276 | jmachado | 180 | <html:text styleClass="text" property="studentCode"/> |
181 | <input type="button" value="<bean:message key="add"/>" |
||
761 | jmachado | 182 | onclick="if(this.form.studentCode.value=='0' || this.form.studentCode.value==''){alert('Por favor coloque o numero de aluno antes de adicionar');}else{set(this.form,'addStudent');this.form.submit();}"> |
276 | jmachado | 183 | <logic:greaterThan name="CourseUnitView" property="studentsSize" value="0"> |
184 | <table class="dataTable removeButton"> |
||
748 | jmachado | 185 | <logic:iterate id="userView" name="CourseUnitView" property="studentsOrderedByNumber" type="pt.estgp.estgweb.domain.views.UserView"> |
276 | jmachado | 186 | <tr> |
187 | <th> |
||
188 | ${userView.code} |
||
189 | </th> |
||
190 | <th> |
||
191 | ${userView.username} |
||
192 | </th> |
||
193 | <th> |
||
194 | ${userView.name} |
||
195 | </th> |
||
196 | <th> |
||
197 | ${userView.email} |
||
198 | </th> |
||
199 | <th> |
||
200 | ${userView.address} |
||
201 | </th> |
||
202 | <td><input type="button" class="removeButton" |
||
203 | onclick="CourseUnitsForm.id.value='${userView.code}';set(this.form,'removeStudent');this.form.submit();"> |
||
204 | </td> |
||
205 | </tr> |
||
206 | </logic:iterate> |
||
207 | </table> |
||
208 | </logic:greaterThan> |
||
214 | jmachado | 209 | </logic:greaterThan> |
210 | </td> |
||
211 | </tr> |
||
206 | jmachado | 212 | |
276 | jmachado | 213 | |
214 | jmachado | 214 | </table> |
215 | <input type="button" onclick="set(form,'createOrUpdateAdmin');form.submit()" value="<bean:message key="confirm"/>"> |
||
206 | jmachado | 216 | </html:form> |