Subversion Repositories bacoAlunos

Rev

Rev 728 | Rev 789 | 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="java.util.List" %>
<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("201314");
                                years.add("201213");

                                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);

                                    %>

                                    <p><bean:message key="intranet.course.units"/> - <%=yearFormatted%></p>
                                    <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"/><%
                                                }
                                                if(cus != null && 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"/><%
                                                }
                                                if(cus != null && 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"/><%
                                                }
                                                if(cus != null && 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>
                </td>
            </tr>
        </tbody>
    </table>
</div>

Generated by GNU Enscript 1.6.5.2.