Subversion Repositories bacoAlunos

Rev

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

<%@ 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" %>
<%@ page import="jomm.dao.utils.HibernateUtils" %>
<%@ page import="pt.estgp.estgweb.domain.dao.DaoFactory" %>
<%@ page import="pt.estgp.estgweb.domain.dao.impl.CourseUnitDaoImpl" %>
<%@ page import="java.util.List" %>
<%@ page import="pt.estgp.estgweb.domain.CourseUnit" %>
<jsp:useBean id="UserSession" type="pt.estgp.estgweb.domain.UserSession" scope="request"/>
<div class="portal">
    <logic:notMatch value="TeacherImpl" name="UserSession" property="user.class.name">
    <ul>
        <li class="WARNING">
            <bean:message key="profile.bad.profile.teacher.iregular.user.class"/>        
        </li>
    </ul>
    </logic:notMatch>
    <table class="columnTable" width="100%">
        <tbody>
            <tr>
                <baco:isModuleOn module="courseunits">
                    <td class="column">
                        <div class="block">
                            <%
                                java.util.List<String> years = new java.util.ArrayList<String>();
                                years.add("201516");
                                years.add("201415");

                                java.util.Collections.sort(years, new java.util.Comparator<String>()
                                {
                                    public int compare(String o1, String o2) {
                                        return o2.compareTo(o1);
                                    }
                                });

                                for(String year: years)
                                {

                                    String yearFormatted = pt.estgp.estgweb.utils.DatesUtils.getImportYearFormatted(year);

                                    %>

                                    <h2><bean:message key="intranet.course.units"/> - <%=yearFormatted%></h2>
                                    <ul>
                                        <li>
                                            <p><bean:message key="courseunit.semestre"/> 1</p>
                                            <%
                                                List<pt.estgp.estgweb.domain.CourseUnit> cus = ((pt.estgp.estgweb.domain.TeacherImpl)UserSession.getUser()).getTeachedUnitsViewS1(year);
                                                if(cus == null || cus.size() == 0)
                                                {
                                                    %><bean:message key="courseunit.zero.units"/><%
                                                }
                                                else if(cus.size() > 0)
                                                {
                                                    %>
                                                    <ul>
                                                        <%
                                                            for(pt.estgp.estgweb.domain.CourseUnit unit:cus)
                                                            {
                                                                request.setAttribute("unit",unit);
                                                            %>
                                                                <li>
                                                                    <%
                                                                        String courseCode = "";
                                                                        if(unit.getCourse() != null)
                                                                        {
                                                                            String courseName = unit.getCourse().getName();
                                                                            String[] words = courseName.split(" ");
                                                                            for(String word: words)
                                                                            {
                                                                                if(word != null && word.length() > 3 && word.charAt(0) >= 'A' && word.charAt(0) <= 'Z' )
                                                                                {
                                                                                    courseCode += word.charAt(0);
                                                                                }
                                                                            }
                                                                        }

                                                                    %>
                                                                    <html:link action="/user/startLoadCourseUnitFromHome?id=${unit.id}">${unit.name} (${unit.courseName} (${unit.courseCode}))</html:link>
                                                                    <html:link action="/user/startLoadCourseUnitRootFromHome?courseUnitView.id=${unit.id}"><img border="0" alt="Pastas" src="<%=request.getContextPath()%>/imgs/folder.gif"></html:link>
                                                                </li>
                                                            <%
                                                            }
                                                        %>
                                                    </ul>
                                                    <%
                                                }
                                            %>


                                        </li>
                                        <li>
                                            <p><bean:message key="courseunit.semestre"/> 2</p>
                                            <%
                                                cus = ((pt.estgp.estgweb.domain.TeacherImpl)UserSession.getUser()).getTeachedUnitsViewS2(year);
                                                if(cus == null || cus.size() == 0)
                                                {
                                                    %><bean:message key="courseunit.zero.units"/><%
                                                }
                                                else if(cus.size() > 0)
                                                {
                                                    %>
                                                    <ul>
                                                        <%
                                                            for(pt.estgp.estgweb.domain.CourseUnit unit:cus)
                                                            {
                                                                request.setAttribute("unit",unit);
                                                            %>
                                                                <li>
                                                                    <%
                                                                        String courseCode = "";
                                                                        if(unit.getCourse() != null)
                                                                        {
                                                                            String courseName = unit.getCourse().getName();
                                                                            String[] words = courseName.split(" ");
                                                                            for(String word: words)
                                                                            {
                                                                                if(word != null && word.length() > 3 && word.charAt(0) >= 'A' && word.charAt(0) <= 'Z' )
                                                                                {
                                                                                    courseCode += word.charAt(0);
                                                                                }
                                                                            }
                                                                        }

                                                                    %>
                                                                    <html:link action="/user/startLoadCourseUnitFromHome?id=${unit.id}">${unit.name} (${unit.courseName} (${unit.courseCode}))</html:link>
                                                                    <html:link action="/user/startLoadCourseUnitRootFromHome?courseUnitView.id=${unit.id}"><img border="0" alt="Pastas" src="<%=request.getContextPath()%>/imgs/folder.gif"></html:link>
                                                                </li>
                                                            <%
                                                            }
                                                        %>
                                                    </ul>
                                                    <%
                                                }
                                            %>


                                        </li>
                                        <li>
                                            <p><bean:message key="courseunit.semestre"/> (Anuais)</p>
                                            <%
                                                cus = ((pt.estgp.estgweb.domain.TeacherImpl)UserSession.getUser()).getTeachedUnitsViewA(year);
                                                if(cus == null || cus.size() == 0)
                                                {
                                                    %><bean:message key="courseunit.zero.units"/><%
                                                }
                                                else if(cus.size() > 0)
                                                {
                                                    %>
                                                    <ul>
                                                        <%
                                                            for(pt.estgp.estgweb.domain.CourseUnit unit:cus)
                                                            {
                                                                request.setAttribute("unit",unit);
                                                            %>
                                                                <li>
                                                                    <%
                                                                        String courseCode = "";
                                                                        if(unit.getCourse() != null)
                                                                        {
                                                                            String courseName = unit.getCourse().getName();
                                                                            String[] words = courseName.split(" ");
                                                                            for(String word: words)
                                                                            {
                                                                                if(word != null && word.length() > 3 && word.charAt(0) >= 'A' && word.charAt(0) <= 'Z' )
                                                                                {
                                                                                    courseCode += word.charAt(0);
                                                                                }
                                                                            }
                                                                        }

                                                                    %>
                                                                    <html:link action="/user/startLoadCourseUnitFromHome?id=${unit.id}">${unit.name} (${unit.courseName} (${unit.courseCode}))</html:link>
                                                                    <html:link action="/user/startLoadCourseUnitRootFromHome?courseUnitView.id=${unit.id}"><img border="0" alt="Pastas" src="<%=request.getContextPath()%>/imgs/folder.gif"></html:link>
                                                                </li>
                                                            <%
                                                            }
                                                        %>
                                                    </ul>
                                                    <%
                                                }
                                            %>
                                        </li>
                                    </ul>
                            <%
                                }
                            %>

                        </div>
                        <div class="block">
                            <p><bean:message key="intranet.home.curricular"/></p>
                            <ul>
                                <li>
                                    <html:link action="/user/startLoadCoursesProgramsFromHome"><bean:message key="courseunit.programs"/></html:link>
                                </li>
                            </ul>
                        </div>
                    </td>
                </baco:isModuleOn>
                <td class="column">
                    <baco:isModuleOn module="courseunits">
                        <jsp:include page="/user/home/courseUnitsAnnouncements.jsp"/>
                    </baco:isModuleOn>
                    <baco:isModuleOn module="todos">
                        <jsp:include page="/user/home/todos.jsp"/>
                    </baco:isModuleOn>
                    <%
                        try{
                        HibernateUtils.getCurrentSession().beginTransaction();
                        List<CourseUnitDaoImpl.CourseMissingValidationProgram> result = DaoFactory.getCourseUnitDaoImpl().loadMissingProgramValidate(UserSession);
                        List<CourseUnitDaoImpl.CourseMissingValidationEvaluation> result2 = DaoFactory.getCourseUnitDaoImpl().loadMissingEvaluationValidate(UserSession);
                        List<CourseUnitDaoImpl.CourseMissingValidationEvaluation> result3 = DaoFactory.getCourseUnitDaoImpl().loadMissingEvaluation(UserSession);
                        if(result.size() > 0 || result2.size() > 0 || result3.size()>0)
                        {
                    %>
                            <div class="block">
                                <p class="WARNING"><label class="WARNING"> Tarefas das Comissões de Curso</label></p>
                                <ul>


                                    <%
                                      if(result.size()>0)
                                      {
                                    %>
                                    <li>
                                        <p>Fichas curriculares por validar</p>
                                        <ul>
                                            <%
                                                for(CourseUnitDaoImpl.CourseMissingValidationProgram mis:result)
                                                {
                                            %>
                                            <li><a href="<%=request.getContextPath()%>/user/startLoadCoursesProgramsFromHome.do#<%=mis.course.getId()%>"><%=mis.course.getName()%> (<%=mis.courseUnits.size()%>)</a></li>
                                            <%
                                                }
                                            %>
                                        </ul>
                                    </li>
                                    <%
                                      }
                                    %>
                                    <%
                                        if(result2.size()>0)
                                        {

                                    %>
                                    <li>
                                        <p>Relatórios de avaliação por validar</p>
                                        <ul>
                                            <%
                                                for(CourseUnitDaoImpl.CourseMissingValidationEvaluation mis:result2)
                                                {
                                                    %>
                                                    <li><%=mis.course.getName()%> / <%=mis.course.getCode()%>
                                                        <ul>
                                                            <%
                                                                for(CourseUnit cu: mis.courseUnits)
                                                                {
                                                            %>
                                                                    <li><a href="<%=request.getContextPath()%>/user/startLoadCourseUnitEvaluation.do?courseUnitId=<%=cu.getId()%>"><%=cu.getImportYear()%> / <%=cu.getName()%> / <%=cu.getCode()%></a></li>
                                                            <%
                                                                }
                                                            %>
                                                        </ul>

                                                    </li>
                                                    <%
                                                }
                                            %>
                                        </ul>
                                    </li>
                                    <%

                                        }
                                    %>
                                    <%
                                        if(result3.size()>0)
                                        {

                                    %>
                                    <li>
                                        <p>Relatórios de avaliação ainda não preenchidos</p>
                                        <ul>
                                            <%
                                                for(CourseUnitDaoImpl.CourseMissingValidationEvaluation mis:result3)
                                                {
                                            %>
                                            <li><%=mis.course.getName()%> / <%=mis.course.getCode()%>
                                                <ul>
                                                    <%
                                                        for(CourseUnit cu: mis.courseUnits)
                                                        {
                                                    %>
                                                    <li><a href="<%=request.getContextPath()%>/user/startLoadCourseUnitEvaluation.do?courseUnitId=<%=cu.getId()%>"><%=cu.getImportYear()%> / <%=cu.getName()%> / <%=cu.getCode()%></a></li>
                                                    <%
                                                        }
                                                    %>
                                                </ul>

                                            </li>
                                            <%
                                                }
                                            %>
                                        </ul>
                                    </li>
                                    <%

                                        }
                                    %>
                                </ul>
                            </div>
                    <%
                        }
                        HibernateUtils.getCurrentSession().getTransaction().commit();
                        }catch(Throwable e)
                        {
                            System.out.println(e);
                            e.printStackTrace();
                        }
                    %>



                </td>
            </tr>
        </tbody>
    </table>
</div>

Generated by GNU Enscript 1.6.5.2.