Subversion Repositories bacoAlunos

Rev

Rev 206 | Rev 215 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<%@ page import="pt.utl.ist.berserk.logic.serviceManager.IServiceManager" %>
<%@ page import="pt.estgp.estgweb.web.utils.RequestUtils" %>
<%@ page import="pt.estgp.estgweb.domain.views.CourseView" %>
<%@ page import="java.util.List" %>
<%@ page import="pt.utl.ist.berserk.logic.serviceManager.ServiceManager" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %>
<%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %>
<%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %>
<%
    IServiceManager sm = ServiceManager.getInstance();
    String[] names = new String[]{};
    Object[] args = new Object[]{};
    List<CourseView> courseViews = (List<CourseView>) sm.execute(RequestUtils.getRequester(request, response), "LoadCourses", args, names);
    request.setAttribute("Courses", courseViews);
%>
<jsp:useBean id="CourseUnitView" type="pt.estgp.estgweb.domain.views.CourseUnitView" scope="request"/>
<jsp:useBean id="UserSession" type="pt.estgp.estgweb.domain.UserSession" scope="request"/>
<html:errors/>
<jomm:messages/>
<html:form styleClass="form" action="/user/courseUnitControllerAdminFromServiceZone" enctype="multipart/form-data">
<input type="hidden" name="dispatch" value="createOrUpdateAdmin">
<html:hidden property="courseUnitView.id"/>
<html:hidden property="id"/>
<table>
<tr>
    <th>
        <bean:message key="courseunit.name"/>
    </th>
    <td>
        <html:text styleClass="text" property="courseUnitView.name"/>
    </td>
</tr>
<tr>
    <th>
        <bean:message key="courseunit.course"/>
    </th>
    <td>
        <html:select property="courseUnitView.courseId">
            <logic:iterate id="course" name="Courses" type="pt.estgp.estgweb.domain.views.CourseView">
                <html:option value="${course.id}">(${course.code}) ${course.name}</html:option>
            </logic:iterate>
        </html:select>
    </td>
</tr>
<tr>
    <th>
        <bean:message key="courseunit.code"/>
    </th>
    <td>
        <html:text styleClass="text" property="courseUnitView.code"/>
    </td>
</tr>
<tr>
    <th>
        <bean:message key="courseunit.semestre"/>
    </th>
    <td>
        <html:select property="courseUnitView.semestre">
            <html:option value="S1">S1</html:option>
            <html:option value="S2">S2</html:option>
        </html:select>
    </td>
</tr>
<tr>
    <th>
        <bean:message key="courseunit.importYear"/>
    </th>
    <td>
        <html:select property="courseUnitView.importYear">
            <logic:iterate id="item" name="CourseUnitsForm" property="importYears">
                <html:option value="${item}">${item}</html:option>
            </logic:iterate>
        </html:select>
    </td>
</tr>
<tr>
    <th>
        <bean:message key="courseunit.teachers"/>
    </th>
    <td>
        <html:select property="teacherId">
            <logic:present name="CourseUnitsForm" property="teachers">
                <logic:iterate id="teacher" name="CourseUnitsForm" property="teachers" type="pt.estgp.estgweb.domain.views.UserView">
                    <jomm:option itemName="teacher" itemProperty="id" comparableObjectName="CourseUnitsForm"
                                 comparableObjectProperty="teacherId">
                        (${teacher.code}) ${teacher.name}
                    </jomm:option>
                </logic:iterate>
                <input type="button" value="<bean:message key="add"/>"
                       onclick="set(this.form,'addTeacher');this.form.submit();">
            </logic:present>
        </html:select>
        <logic:greaterThan name="CourseUnitView" property="teachersSize" value="0">
            <table class="dataTable removeButton">
                <logic:iterate id="userView" name="CourseUnitView" property="teachers" type="pt.estgp.estgweb.domain.views.UserView">
                    <tr>
                        <th>
                                ${userView.code}
                        </th>
                        <th>
                                ${userView.name}
                        </th>
                        <td><input type="button" class="removeButton"
                                   onclick="CourseUnitsForm.id.value='${userView.id}';set(this.form,'removeTeacher');this.form.submit();">
                        </td>
                    </tr>
                </logic:iterate>
            </table>
        </logic:greaterThan>
    </td>
</tr>
<tr>
    <th>
        <bean:message key="courseunit.students"/>
    </th>
    <td>
        <html:text styleClass="text" property="studentCode"/>
        <input type="button" value="<bean:message key="add"/>"
               onclick="set(this.form,'addStudent');this.form.submit();">
        <logic:greaterThan name="CourseUnitView" property="studentsSize" value="0">
            <table class="dataTable removeButton">
                <logic:iterate id="userView" name="CourseUnitView" property="students" type="pt.estgp.estgweb.domain.views.UserView">
                    <tr>
                        <th>
                                ${userView.code}
                        </th>
                        <th>
                                ${userView.username}
                        </th>
                        <th>
                                ${userView.name}
                        </th>
                        <th>
                                ${userView.email}
                        </th>
                        <th>
                                ${userView.address}
                        </th>
                        <td><input type="button" class="removeButton"
                                   onclick="CourseUnitsForm.id.value='${userView.code}';set(this.form,'removeStudent');this.form.submit();">
                        </td>
                    </tr>
                </logic:iterate>
            </table>
        </logic:greaterThan>
    </td>
</tr>

</table>
<input type="button" onclick="set(form,'createOrUpdateAdmin');form.submit()" value="<bean:message key="confirm"/>">
</html:form>

Generated by GNU Enscript 1.6.5.2.