Rev 748 | Rev 751 | 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" %> |
206 | jmachado | 6 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> |
7 | <%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %> |
||
8 | <%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %> |
||
9 | <%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %> |
||
10 | <%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %> |
||
11 | <%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %> |
||
12 | <%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %> |
||
13 | <%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %> |
||
214 | jmachado | 14 | <% |
15 | IServiceManager sm = ServiceManager.getInstance(); |
||
16 | String[] names = new String[]{}; |
||
17 | Object[] args = new Object[]{}; |
||
18 | List<CourseView> courseViews = (List<CourseView>) sm.execute(RequestUtils.getRequester(request, response), "LoadCourses", args, names); |
||
19 | request.setAttribute("Courses", courseViews); |
||
749 | jmachado | 20 | |
21 | List<pt.estgp.estgweb.domain.views.UserView> teachers =(List<pt.estgp.estgweb.domain.views.UserView>) sm.execute(RequestUtils.getRequester(request, response), "LoadTeachers", args, names); |
||
22 | request.setAttribute("Teachers", teachers); |
||
214 | jmachado | 23 | %> |
215 | jmachado | 24 | |
206 | jmachado | 25 | <jsp:useBean id="CourseUnitView" type="pt.estgp.estgweb.domain.views.CourseUnitView" scope="request"/> |
26 | <jsp:useBean id="UserSession" type="pt.estgp.estgweb.domain.UserSession" scope="request"/> |
||
214 | jmachado | 27 | <html:errors/> |
28 | <jomm:messages/> |
||
749 | jmachado | 29 | |
30 | <ul> |
||
31 | <li><html:link action="/user/startLoadCourseUnitFromHome.do?id=${CourseUnitView.id}">Página da Unidade</html:link></li> |
||
32 | <li><html:link action="/startLoadCourseUnitProgram.do?courseUnitId=${CourseUnitView.id}">Ficha Curricular</html:link></li> |
||
33 | </ul> |
||
206 | jmachado | 34 | <html:form styleClass="form" action="/user/courseUnitControllerAdminFromServiceZone" enctype="multipart/form-data"> |
214 | jmachado | 35 | <input type="hidden" name="dispatch" value="createOrUpdateAdmin"> |
36 | <html:hidden property="courseUnitView.id"/> |
||
37 | <html:hidden property="id"/> |
||
38 | <table> |
||
39 | <tr> |
||
40 | <th> |
||
41 | <bean:message key="courseunit.name"/> |
||
42 | </th> |
||
43 | <td> |
||
44 | <html:text styleClass="text" property="courseUnitView.name"/> |
||
45 | </td> |
||
46 | </tr> |
||
47 | <tr> |
||
48 | <th> |
||
49 | <bean:message key="courseunit.course"/> |
||
50 | </th> |
||
51 | <td> |
||
52 | <html:select property="courseUnitView.courseId"> |
||
53 | <logic:iterate id="course" name="Courses" type="pt.estgp.estgweb.domain.views.CourseView"> |
||
54 | <html:option value="${course.id}">(${course.code}) ${course.name}</html:option> |
||
55 | </logic:iterate> |
||
56 | </html:select> |
||
57 | </td> |
||
58 | </tr> |
||
59 | <tr> |
||
60 | <th> |
||
61 | <bean:message key="courseunit.code"/> |
||
62 | </th> |
||
63 | <td> |
||
64 | <html:text styleClass="text" property="courseUnitView.code"/> |
||
65 | </td> |
||
66 | </tr> |
||
67 | <tr> |
||
68 | <th> |
||
69 | <bean:message key="courseunit.semestre"/> |
||
70 | </th> |
||
71 | <td> |
||
72 | <html:select property="courseUnitView.semestre"> |
||
73 | <html:option value="S1">S1</html:option> |
||
74 | <html:option value="S2">S2</html:option> |
||
728 | jmachado | 75 | <html:option value="A">A</html:option> |
214 | jmachado | 76 | </html:select> |
77 | </td> |
||
78 | </tr> |
||
79 | <tr> |
||
80 | <th> |
||
81 | <bean:message key="courseunit.importYear"/> |
||
82 | </th> |
||
83 | <td> |
||
84 | <html:select property="courseUnitView.importYear"> |
||
85 | <logic:iterate id="item" name="CourseUnitsForm" property="importYears"> |
||
86 | <html:option value="${item}">${item}</html:option> |
||
87 | </logic:iterate> |
||
88 | </html:select> |
||
89 | </td> |
||
90 | </tr> |
||
749 | jmachado | 91 | |
214 | jmachado | 92 | <tr> |
93 | <th> |
||
749 | jmachado | 94 | <bean:message key="courseunit.responsable"/> |
95 | </th> |
||
96 | <td> |
||
97 | <html:select property="courseUnitView.responsableId"> |
||
98 | <logic:iterate id="teacher" name="Teachers" type="pt.estgp.estgweb.domain.views.UserView"> |
||
99 | <html:option value="${teacher.id}">(${teacher.code}) ${teacher.name}</html:option> |
||
100 | </logic:iterate> |
||
101 | </html:select> |
||
102 | </td> |
||
103 | </tr> |
||
104 | <tr> |
||
105 | <th> |
||
214 | jmachado | 106 | <bean:message key="courseunit.teachers"/> |
107 | </th> |
||
108 | <td> |
||
294 | jmachado | 109 | <logic:lessEqual value="0" name="CourseUnitView" property="id"> |
277 | jmachado | 110 | <i><bean:message key="courseunit.to.add.teachers.save.first"/></i> |
111 | </logic:lessEqual> |
||
112 | |||
294 | jmachado | 113 | <logic:greaterThan value="0" name="CourseUnitView" property="id"> |
277 | jmachado | 114 | <html:select property="teacherId"> |
115 | <logic:present name="CourseUnitsForm" property="teachers"> |
||
116 | <logic:iterate id="teacher" name="CourseUnitsForm" property="teachers" type="pt.estgp.estgweb.domain.views.UserView"> |
||
117 | <jomm:option itemName="teacher" itemProperty="id" comparableObjectName="CourseUnitsForm" |
||
118 | comparableObjectProperty="teacherId"> |
||
119 | (${teacher.code}) ${teacher.name} |
||
120 | </jomm:option> |
||
121 | </logic:iterate> |
||
122 | <input type="button" value="<bean:message key="add"/>" |
||
123 | onclick="set(this.form,'addTeacher');this.form.submit();"> |
||
124 | </logic:present> |
||
125 | </html:select> |
||
126 | <logic:greaterThan name="CourseUnitView" property="teachersSize" value="0"> |
||
127 | <table class="dataTable removeButton"> |
||
128 | <logic:iterate id="userView" name="CourseUnitView" property="teachers" type="pt.estgp.estgweb.domain.views.UserView"> |
||
129 | <tr> |
||
130 | <th> |
||
131 | ${userView.code} |
||
132 | </th> |
||
133 | <th> |
||
134 | ${userView.name} |
||
135 | </th> |
||
136 | <td><input type="button" class="removeButton" |
||
137 | onclick="CourseUnitsForm.id.value='${userView.id}';set(this.form,'removeTeacher');this.form.submit();"> |
||
138 | </td> |
||
139 | </tr> |
||
140 | </logic:iterate> |
||
141 | </table> |
||
142 | </logic:greaterThan> |
||
214 | jmachado | 143 | </logic:greaterThan> |
144 | </td> |
||
145 | </tr> |
||
276 | jmachado | 146 | |
214 | jmachado | 147 | <tr> |
148 | <th> |
||
149 | <bean:message key="courseunit.students"/> |
||
150 | </th> |
||
151 | <td> |
||
276 | jmachado | 152 | |
294 | jmachado | 153 | <logic:lessEqual value="0" name="CourseUnitView" property="id"> |
277 | jmachado | 154 | <i><bean:message key="courseunit.to.add.students.save.first"/></i> |
276 | jmachado | 155 | </logic:lessEqual> |
156 | |||
294 | jmachado | 157 | <logic:greaterThan value="0" name="CourseUnitView" property="id"> |
276 | jmachado | 158 | <html:text styleClass="text" property="studentCode"/> |
159 | <input type="button" value="<bean:message key="add"/>" |
||
160 | onclick="set(this.form,'addStudent');this.form.submit();"> |
||
161 | <logic:greaterThan name="CourseUnitView" property="studentsSize" value="0"> |
||
162 | <table class="dataTable removeButton"> |
||
748 | jmachado | 163 | <logic:iterate id="userView" name="CourseUnitView" property="studentsOrderedByNumber" type="pt.estgp.estgweb.domain.views.UserView"> |
276 | jmachado | 164 | <tr> |
165 | <th> |
||
166 | ${userView.code} |
||
167 | </th> |
||
168 | <th> |
||
169 | ${userView.username} |
||
170 | </th> |
||
171 | <th> |
||
172 | ${userView.name} |
||
173 | </th> |
||
174 | <th> |
||
175 | ${userView.email} |
||
176 | </th> |
||
177 | <th> |
||
178 | ${userView.address} |
||
179 | </th> |
||
180 | <td><input type="button" class="removeButton" |
||
181 | onclick="CourseUnitsForm.id.value='${userView.code}';set(this.form,'removeStudent');this.form.submit();"> |
||
182 | </td> |
||
183 | </tr> |
||
184 | </logic:iterate> |
||
185 | </table> |
||
186 | </logic:greaterThan> |
||
214 | jmachado | 187 | </logic:greaterThan> |
188 | </td> |
||
189 | </tr> |
||
206 | jmachado | 190 | |
276 | jmachado | 191 | |
214 | jmachado | 192 | </table> |
193 | <input type="button" onclick="set(form,'createOrUpdateAdmin');form.submit()" value="<bean:message key="confirm"/>"> |
||
206 | jmachado | 194 | </html:form> |