Rev 293 | Rev 728 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
214 | jmachado | 1 | <%@ page import="pt.utl.ist.berserk.logic.serviceManager.IServiceManager" %> |
2 | <%@ page import="pt.estgp.estgweb.web.utils.RequestUtils" %> |
||
3 | <%@ page import="pt.estgp.estgweb.domain.views.CourseView" %> |
||
4 | <%@ page import="java.util.List" %> |
||
5 | <%@ page import="pt.utl.ist.berserk.logic.serviceManager.ServiceManager" %> |
||
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); |
||
20 | %> |
||
215 | jmachado | 21 | |
206 | jmachado | 22 | <jsp:useBean id="CourseUnitView" type="pt.estgp.estgweb.domain.views.CourseUnitView" scope="request"/> |
23 | <jsp:useBean id="UserSession" type="pt.estgp.estgweb.domain.UserSession" scope="request"/> |
||
214 | jmachado | 24 | <html:errors/> |
25 | <jomm:messages/> |
||
206 | jmachado | 26 | <html:form styleClass="form" action="/user/courseUnitControllerAdminFromServiceZone" enctype="multipart/form-data"> |
214 | jmachado | 27 | <input type="hidden" name="dispatch" value="createOrUpdateAdmin"> |
28 | <html:hidden property="courseUnitView.id"/> |
||
29 | <html:hidden property="id"/> |
||
30 | <table> |
||
31 | <tr> |
||
32 | <th> |
||
33 | <bean:message key="courseunit.name"/> |
||
34 | </th> |
||
35 | <td> |
||
36 | <html:text styleClass="text" property="courseUnitView.name"/> |
||
37 | </td> |
||
38 | </tr> |
||
39 | <tr> |
||
40 | <th> |
||
41 | <bean:message key="courseunit.course"/> |
||
42 | </th> |
||
43 | <td> |
||
44 | <html:select property="courseUnitView.courseId"> |
||
45 | <logic:iterate id="course" name="Courses" type="pt.estgp.estgweb.domain.views.CourseView"> |
||
46 | <html:option value="${course.id}">(${course.code}) ${course.name}</html:option> |
||
47 | </logic:iterate> |
||
48 | </html:select> |
||
49 | </td> |
||
50 | </tr> |
||
51 | <tr> |
||
52 | <th> |
||
53 | <bean:message key="courseunit.code"/> |
||
54 | </th> |
||
55 | <td> |
||
56 | <html:text styleClass="text" property="courseUnitView.code"/> |
||
57 | </td> |
||
58 | </tr> |
||
59 | <tr> |
||
60 | <th> |
||
61 | <bean:message key="courseunit.semestre"/> |
||
62 | </th> |
||
63 | <td> |
||
64 | <html:select property="courseUnitView.semestre"> |
||
65 | <html:option value="S1">S1</html:option> |
||
66 | <html:option value="S2">S2</html:option> |
||
67 | </html:select> |
||
68 | </td> |
||
69 | </tr> |
||
70 | <tr> |
||
71 | <th> |
||
72 | <bean:message key="courseunit.importYear"/> |
||
73 | </th> |
||
74 | <td> |
||
75 | <html:select property="courseUnitView.importYear"> |
||
76 | <logic:iterate id="item" name="CourseUnitsForm" property="importYears"> |
||
77 | <html:option value="${item}">${item}</html:option> |
||
78 | </logic:iterate> |
||
79 | </html:select> |
||
80 | </td> |
||
81 | </tr> |
||
82 | <tr> |
||
83 | <th> |
||
84 | <bean:message key="courseunit.teachers"/> |
||
85 | </th> |
||
86 | <td> |
||
294 | jmachado | 87 | <logic:lessEqual value="0" name="CourseUnitView" property="id"> |
277 | jmachado | 88 | <i><bean:message key="courseunit.to.add.teachers.save.first"/></i> |
89 | </logic:lessEqual> |
||
90 | |||
294 | jmachado | 91 | <logic:greaterThan value="0" name="CourseUnitView" property="id"> |
277 | jmachado | 92 | <html:select property="teacherId"> |
93 | <logic:present name="CourseUnitsForm" property="teachers"> |
||
94 | <logic:iterate id="teacher" name="CourseUnitsForm" property="teachers" type="pt.estgp.estgweb.domain.views.UserView"> |
||
95 | <jomm:option itemName="teacher" itemProperty="id" comparableObjectName="CourseUnitsForm" |
||
96 | comparableObjectProperty="teacherId"> |
||
97 | (${teacher.code}) ${teacher.name} |
||
98 | </jomm:option> |
||
99 | </logic:iterate> |
||
100 | <input type="button" value="<bean:message key="add"/>" |
||
101 | onclick="set(this.form,'addTeacher');this.form.submit();"> |
||
102 | </logic:present> |
||
103 | </html:select> |
||
104 | <logic:greaterThan name="CourseUnitView" property="teachersSize" value="0"> |
||
105 | <table class="dataTable removeButton"> |
||
106 | <logic:iterate id="userView" name="CourseUnitView" property="teachers" type="pt.estgp.estgweb.domain.views.UserView"> |
||
107 | <tr> |
||
108 | <th> |
||
109 | ${userView.code} |
||
110 | </th> |
||
111 | <th> |
||
112 | ${userView.name} |
||
113 | </th> |
||
114 | <td><input type="button" class="removeButton" |
||
115 | onclick="CourseUnitsForm.id.value='${userView.id}';set(this.form,'removeTeacher');this.form.submit();"> |
||
116 | </td> |
||
117 | </tr> |
||
118 | </logic:iterate> |
||
119 | </table> |
||
120 | </logic:greaterThan> |
||
214 | jmachado | 121 | </logic:greaterThan> |
122 | </td> |
||
123 | </tr> |
||
276 | jmachado | 124 | |
214 | jmachado | 125 | <tr> |
126 | <th> |
||
127 | <bean:message key="courseunit.students"/> |
||
128 | </th> |
||
129 | <td> |
||
276 | jmachado | 130 | |
294 | jmachado | 131 | <logic:lessEqual value="0" name="CourseUnitView" property="id"> |
277 | jmachado | 132 | <i><bean:message key="courseunit.to.add.students.save.first"/></i> |
276 | jmachado | 133 | </logic:lessEqual> |
134 | |||
294 | jmachado | 135 | <logic:greaterThan value="0" name="CourseUnitView" property="id"> |
276 | jmachado | 136 | <html:text styleClass="text" property="studentCode"/> |
137 | <input type="button" value="<bean:message key="add"/>" |
||
138 | onclick="set(this.form,'addStudent');this.form.submit();"> |
||
139 | <logic:greaterThan name="CourseUnitView" property="studentsSize" value="0"> |
||
140 | <table class="dataTable removeButton"> |
||
141 | <logic:iterate id="userView" name="CourseUnitView" property="students" type="pt.estgp.estgweb.domain.views.UserView"> |
||
142 | <tr> |
||
143 | <th> |
||
144 | ${userView.code} |
||
145 | </th> |
||
146 | <th> |
||
147 | ${userView.username} |
||
148 | </th> |
||
149 | <th> |
||
150 | ${userView.name} |
||
151 | </th> |
||
152 | <th> |
||
153 | ${userView.email} |
||
154 | </th> |
||
155 | <th> |
||
156 | ${userView.address} |
||
157 | </th> |
||
158 | <td><input type="button" class="removeButton" |
||
159 | onclick="CourseUnitsForm.id.value='${userView.code}';set(this.form,'removeStudent');this.form.submit();"> |
||
160 | </td> |
||
161 | </tr> |
||
162 | </logic:iterate> |
||
163 | </table> |
||
164 | </logic:greaterThan> |
||
214 | jmachado | 165 | </logic:greaterThan> |
166 | </td> |
||
167 | </tr> |
||
206 | jmachado | 168 | |
276 | jmachado | 169 | |
214 | jmachado | 170 | </table> |
171 | <input type="button" onclick="set(form,'createOrUpdateAdmin');form.submit()" value="<bean:message key="confirm"/>"> |
||
206 | jmachado | 172 | </html:form> |