Subversion Repositories bacoAlunos

Rev

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

<%@ page import="java.util.List" %>
<%@ page import="pt.estgp.estgweb.utils.ConfigProperties" %>
<%@ page import="pt.estgp.estgweb.Globals" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="pt.estgp.estgweb.web.filters.UserRoleProxy" %>
<%@ page import="jomm.dao.impl.AbstractDao" %>
<%@ page import="pt.estgp.estgweb.domain.dao.DaoFactory" %>
<%@ page import="pt.estgp.estgweb.domain.CourseDepartment" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %>
<%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %>
<%@ 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" %>
<jsp:useBean id="CourseView" type="pt.estgp.estgweb.domain.views.CourseView" scope="request"/>
<script>
    function alertPermissions()
    {
        alert("Aviso a transmitir ao Centro Informático. 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")
    }
    function alertFolders(place)
    {
        alert("Aviso a transmitir ao Centro Informático. 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.");
    }

</script>
<html:errors/>
<jomm:messages/>
<html:form action="/user/courseControllerFromServiceZone" enctype="multipart/form-data">
<input type="hidden" name="dispatch" value="submit"/>
<html:hidden property="courseView.id"/>
<logic:present name="CourseView" property="htmlResult">
    <pre class="log">
        <bean:write name="CourseView" property="htmlResult"/>
    </pre>
</logic:present>

<table class="form">
    <tr>
        <th>
            <bean:message key="course.code"/>
        </th>
        <td>
            <html:text property="courseView.code"/>
        </td>
    </tr>
    <tr>
        <th>
            <bean:message key="course.area"/>
        </th>

        <td>
            <%
                AbstractDao.getCurrentSession().beginTransaction();
                List<CourseDepartment> departments = DaoFactory.getCourseDepartmentDaoImpl().findActives();
               request.setAttribute("departaments",departments);
            %>
            <html:select property="courseView.area">
                <html:option value="">Nenhum</html:option>
                <logic:iterate id="area" name="departaments" type="pt.estgp.estgweb.domain.CourseDepartmentImpl">

                    <html:option value="${area.sigla}">${area.schoolFromInstitutionalCode} - ${area.name}</html:option>
                </logic:iterate>
            </html:select>
            <%
                AbstractDao.getCurrentSession().getTransaction().commit();
            %>
        </td>
    </tr>
    <tr>
        <th>
            <bean:message key="name"/>
        </th>
        <td>
            <html:text property="courseView.name"/>
        </td>
    </tr>
    <tr>
        <th>
            <bean:message key="status"/>
        </th>
        <td>
            <html:select property="courseView.status">
                <html:option value="true"><bean:message key="yes"/></html:option>
                <html:option value="false"><bean:message key="no"/></html:option>
            </html:select>
        </td>
    </tr>
    <tr>
        <th>
            <bean:message key="course.degree"/>
        </th>
        <td>
            <html:select property="courseView.degree">
                <html:option value="B"><bean:message key="course.B"/></html:option>
                <html:option value="L"><bean:message key="course.L"/></html:option>
                <html:option value="M"><bean:message key="course.M"/></html:option>
                <html:option value="P"><bean:message key="course.P"/></html:option>
                <html:option value="E"><bean:message key="course.E"/></html:option>
                <html:option value="A"><bean:message key="course.A"/></html:option>
                <html:option value="C"><bean:message key="course.C"/></html:option>
                <html:option value="O"><bean:message key="course.O"/></html:option>
                <html:option value="T"><bean:message key="course.T"/></html:option>
            </html:select>
            ** SIGES: <bean:write name="CourseForm" property="courseView.degree"/> - Qualquer erro de atrbuição informar imediatamente a equipa de desenvolvimento
        </td>
    </tr>
    <logic:notEmpty name="CourseForm" property="courseView.courseYearViews">
        <tr>
            <th>
                Politica de Separação de Turmas
            </th>
            <td colspan="2">

                <table class="tablesorterfiltered">
                    <thead>
                        <tr>
                            <th>Ano Lectivo</th>
                            <th>Usar Turmas Separadas</th>
                            <th>Ultima alteração</th>
                        </tr>
                    </thead>
                    <tbody>
                    <nested:iterate id="cyv" property="courseView.courseYearViews" type="pt.estgp.estgweb.domain.views.CourseView.CourseYearView">
                        <tr>
                            <td>${cyv.importYear}</td>
                            <td><nested:hidden property="id"/>
                                <nested:checkbox property="separatedTurmas"/></td>
                            <td>${cyv.updateDate}</td>
                        </tr>
                    </nested:iterate>
                    </tbody>
                </table>


            </td>
        </tr>
    </logic:notEmpty>
    <tr>
        <th>
            <bean:message key="course.importYear"/>
        </th>
        <td>
            <html:select property="courseView.importYear">
                <logic:iterate id="item" name="CourseForm" property="importYears">
                    <html:option value="${item}">${item}</html:option>
                </logic:iterate>
            </html:select>
        </td>
    </tr>
    <tr>
        <th>
            <bean:message key="course.institutionalCode"/>
        </th>
        <td>
            <!--Dependente do app.properties-->
            <html:select property="courseView.institutionalCode">
                <html:option value="1"><%=ConfigProperties.getProperty("institution.code.prefix.1")%></html:option>
                <html:option value="2"><%=ConfigProperties.getProperty("institution.code.prefix.2")%></html:option>
                <html:option value="3"><%=ConfigProperties.getProperty("institution.code.prefix.3")%></html:option>
                <html:option value="4"><%=ConfigProperties.getProperty("institution.code.prefix.4")%></html:option>
            </html:select>

        </td>
    </tr>

    <tr>
        <th>
            <bean:message key="course.userGroupStudents"/>
        </th>
        <td>
            <html:text onchange="alertPermissions()" property="courseView.userGroupStudents"/>
        </td>
    </tr>

    <tr>
        <th>
            <bean:message key="course.description"/>
        </th>
        <td>
            <html:textarea property="courseView.description"/>
        </td>
    </tr>
    <tr>
        <th>
            <bean:message key="course.coordinator"/>
        </th>
        <td>
            <html:select onchange="alertPermissions()"  property="courseView.coordinator.id">
                <html:option value="0">
                    <bean:message key="none"/>
                </html:option>
                <logic:present name="CourseForm" property="teachers">
                    <logic:iterate id="teacher" name="CourseForm" property="teachers" type="pt.estgp.estgweb.domain.views.UserView">
                        <html:option value="${teacher.id}">
                            (${teacher.code}) ${teacher.name}
                        </html:option>
                    </logic:iterate>
                </logic:present>
            </html:select>
        </td>
    </tr>
    <tr>
        <th>
            <bean:message key="course.director"/>
        </th>
        <td>
            <html:select onchange="alertPermissions()"  property="courseView.director.id">
                <html:option value="0">
                    <bean:message key="none"/>
                </html:option>
                <logic:present name="CourseForm" property="teachers">
                    <logic:iterate id="teacher" name="CourseForm" property="teachers" type="pt.estgp.estgweb.domain.views.UserView">
                        <html:option value="${teacher.id}">
                            (${teacher.code}) ${teacher.name}
                        </html:option>
                    </logic:iterate>
                </logic:present>
            </html:select>
        </td>
    </tr>





    <tr>
        <th>
            <bean:message key="course.validation.role"/>
        </th>
        <%

            List<String> targetRoles = new ArrayList<String>();
            for(String role: UserRoleProxy.getUserRoles())
            {
                if(role.startsWith("courseValidateProgram"))
                    targetRoles.add(role);
            }
            request.setAttribute("targetRoles",targetRoles);
        %>
        <td>
            <html:select onchange="alertPermissions()" property="courseView.validationRole">
                 <logic:iterate id="role" name="targetRoles">
                     <html:option value="${role}" key="user.role.${role}"/>
                </logic:iterate>
            </html:select>
        </td>
    </tr>





    <tr>
        <th>
             <bean:message key="course.externalSite"/>
        </th>
        <td>
            <html:select property="courseView.externalSiteServer">
                <html:option value="estgp">ESTG</html:option>
            </html:select>
            <html:text property="courseView.externalSitePath"/>
        </td>
    </tr>
    <tr>
        <th>
            <bean:message key="course.studies.plan"/>
        </th>
        <td>
            <html:file property="studiesPlan"/>
            <logic:present name="CourseView" property="studiesPlan">
                <a href="<%=request.getContextPath()%>/repositoryStream/${CourseView.studiesPlanStreamId}"><bean:message key="course.studies.plan"/></a> (${CourseView.studiesPlanSizeKb} Kb - ${CourseView.studiesPlanDate})
            </logic:present>
            <logic:notPresent name="CourseView" property="studiesPlan">
                <bean:message key="course.studies.plan.not.available"/>
            </logic:notPresent>
        </td>
    </tr>

    <tr>
        <th>
            <bean:message key="course.studies.plan"/> (Versão nova PAE)
            <a class="btn btn-default" href="<%=request.getContextPath()%>/user/adminStudyPlans.do?courseId=<%=CourseView.getId()%>">Gerir Planos</a>
        </th>
        <td>
            <logic:present name="CourseView" property="courseStudiesPlans">

                <table class="tablesorterfiltered">
                    <thead>
                    <tr>
                        <th>Versão</th>
                        <th>Data Produção</th>
                        <th>Ultima alteração</th>
                        <th>Descrição</th>
                    </tr>
                    </thead>
                    <tbody>
                    <logic:iterate id="studyPlan" name="CourseView" property="courseStudiesPlans" type="pt.estgp.estgweb.domain.CourseStudiesPlan">
                        <tr>
                            <td>${studyPlan.version}</td>
                            <td>${studyPlan.saveDate}</td>
                            <td>${studyPlan.updateDate}</td>
                            <td>${studyPlan.versionDescription}</td>
                        </tr>
                    </logic:iterate>
                    </tbody>
                </table>
            </logic:present>

        </td>
    </tr>
    <tr class="buttons">
        <td colspan="2">
            <input type="button"
                   onclick="set(this.form,'submit');this.form.submit()"
                   value="<bean:message key="confirm"/>"/>
        </td>
    </tr>
</table>

</html:form>