Subversion Repositories bacoAlunos

Rev

Rev 728 | Rev 789 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
204 jmachado 1
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
2
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
3
<%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %>
4
<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
5
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
6
<%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %>
7
<%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %>
8
<%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %>
787 jmachado 9
<%@ page import="java.util.List" %>
204 jmachado 10
<jsp:useBean id="UserSession" type="pt.estgp.estgweb.domain.UserSession" scope="request"/>
11
<div class="portal">
432 jmachado 12
    <logic:notMatch value="TeacherImpl" name="UserSession" property="user.class.name">
301 jmachado 13
    <ul>
14
        <li class="WARNING">
432 jmachado 15
            <bean:message key="profile.bad.profile.teacher.iregular.user.class"/>
301 jmachado 16
        </li>
17
    </ul>
432 jmachado 18
    </logic:notMatch>
204 jmachado 19
    <table class="columnTable" width="100%">
20
        <tbody>
21
            <tr>
215 jmachado 22
                <baco:isModuleOn module="courseunits">
23
                    <td class="column">
24
                        <div class="block">
787 jmachado 25
                            <%
26
                                java.util.List<String> years = new java.util.ArrayList<String>();
27
                                years.add("201314");
28
                                years.add("201213");
29
 
30
                                java.util.Collections.sort(years, new java.util.Comparator<String>()
31
                                {
32
                                    public int compare(String o1, String o2) {
33
                                        return o2.compareTo(o1);
34
                                    }
35
                                });
36
 
37
                                for(String year: years)
38
                                {
39
 
40
                                    String yearFormatted = pt.estgp.estgweb.utils.DatesUtils.getImportYearFormatted(year);
41
 
42
                                    %>
43
 
44
                                    <p><bean:message key="intranet.course.units"/> - <%=yearFormatted%></p>
45
                                    <ul>
46
                                        <li>
47
                                            <p><bean:message key="courseunit.semestre"/> 1</p>
48
                                            <%
49
                                                List<pt.estgp.estgweb.domain.CourseUnit> cus = ((pt.estgp.estgweb.domain.TeacherImpl)UserSession.getUser()).getTeachedUnitsViewS1(year);
50
                                                if(cus == null || cus.size() == 0)
51
                                                {
52
                                                    %><bean:message key="courseunit.zero.units"/><%
53
                                                }
54
                                                if(cus != null && cus.size() > 0)
55
                                                {
56
                                                    %>
57
                                                    <ul>
550 jmachado 58
                                                        <%
787 jmachado 59
                                                            for(pt.estgp.estgweb.domain.CourseUnit unit:cus)
550 jmachado 60
                                                            {
787 jmachado 61
                                                                request.setAttribute("unit",unit);
62
                                                            %>
63
                                                                <li>
64
                                                                    <%
65
                                                                        String courseCode = "";
66
                                                                        if(unit.getCourse() != null)
67
                                                                        {
68
                                                                            String courseName = unit.getCourse().getName();
69
                                                                            String[] words = courseName.split(" ");
70
                                                                            for(String word: words)
71
                                                                            {
72
                                                                                if(word != null && word.length() > 3 && word.charAt(0) >= 'A' && word.charAt(0) <= 'Z' )
73
                                                                                {
74
                                                                                    courseCode += word.charAt(0);
75
                                                                                }
76
                                                                            }
77
                                                                        }
78
 
79
                                                                    %>
80
                                                                    <html:link action="/user/startLoadCourseUnitFromHome?id=${unit.id}">${unit.name} (${unit.courseName} (${unit.courseCode}))</html:link>
81
                                                                    <html:link action="/user/startLoadCourseUnitRootFromHome?courseUnitView.id=${unit.id}"><img border="0" alt="Pastas" src="<%=request.getContextPath()%>/imgs/folder.gif"></html:link>
82
                                                                </li>
83
                                                            <%
550 jmachado 84
                                                            }
787 jmachado 85
                                                        %>
86
                                                    </ul>
87
                                                    <%
88
                                                }
89
                                            %>
550 jmachado 90
 
787 jmachado 91
 
92
                                        </li>
93
                                        <li>
94
                                            <p><bean:message key="courseunit.semestre"/> 2</p>
95
                                            <%
96
                                                cus = ((pt.estgp.estgweb.domain.TeacherImpl)UserSession.getUser()).getTeachedUnitsViewS2(year);
97
                                                if(cus == null || cus.size() == 0)
98
                                                {
99
                                                    %><bean:message key="courseunit.zero.units"/><%
100
                                                }
101
                                                if(cus != null && cus.size() > 0)
102
                                                {
103
                                                    %>
104
                                                    <ul>
105
                                                        <%
106
                                                            for(pt.estgp.estgweb.domain.CourseUnit unit:cus)
550 jmachado 107
                                                            {
787 jmachado 108
                                                                request.setAttribute("unit",unit);
109
                                                            %>
110
                                                                <li>
111
                                                                    <%
112
                                                                        String courseCode = "";
113
                                                                        if(unit.getCourse() != null)
114
                                                                        {
115
                                                                            String courseName = unit.getCourse().getName();
116
                                                                            String[] words = courseName.split(" ");
117
                                                                            for(String word: words)
118
                                                                            {
119
                                                                                if(word != null && word.length() > 3 && word.charAt(0) >= 'A' && word.charAt(0) <= 'Z' )
120
                                                                                {
121
                                                                                    courseCode += word.charAt(0);
122
                                                                                }
123
                                                                            }
124
                                                                        }
125
 
126
                                                                    %>
127
                                                                    <html:link action="/user/startLoadCourseUnitFromHome?id=${unit.id}">${unit.name} (${unit.courseName} (${unit.courseCode}))</html:link>
128
                                                                    <html:link action="/user/startLoadCourseUnitRootFromHome?courseUnitView.id=${unit.id}"><img border="0" alt="Pastas" src="<%=request.getContextPath()%>/imgs/folder.gif"></html:link>
129
                                                                </li>
130
                                                            <%
550 jmachado 131
                                                            }
787 jmachado 132
                                                        %>
133
                                                    </ul>
134
                                                    <%
135
                                                }
136
                                            %>
550 jmachado 137
 
787 jmachado 138
 
139
                                        </li>
140
                                        <li>
141
                                            <p><bean:message key="courseunit.semestre"/> (Anuais)</p>
142
                                            <%
143
                                                cus = ((pt.estgp.estgweb.domain.TeacherImpl)UserSession.getUser()).getTeachedUnitsViewA(year);
144
                                                if(cus == null || cus.size() == 0)
145
                                                {
146
                                                    %><bean:message key="courseunit.zero.units"/><%
147
                                                }
148
                                                if(cus != null && cus.size() > 0)
149
                                                {
150
                                                    %>
151
                                                    <ul>
728 jmachado 152
                                                        <%
787 jmachado 153
                                                            for(pt.estgp.estgweb.domain.CourseUnit unit:cus)
728 jmachado 154
                                                            {
787 jmachado 155
                                                                request.setAttribute("unit",unit);
156
                                                            %>
157
                                                                <li>
158
                                                                    <%
159
                                                                        String courseCode = "";
160
                                                                        if(unit.getCourse() != null)
161
                                                                        {
162
                                                                            String courseName = unit.getCourse().getName();
163
                                                                            String[] words = courseName.split(" ");
164
                                                                            for(String word: words)
165
                                                                            {
166
                                                                                if(word != null && word.length() > 3 && word.charAt(0) >= 'A' && word.charAt(0) <= 'Z' )
167
                                                                                {
168
                                                                                    courseCode += word.charAt(0);
169
                                                                                }
170
                                                                            }
171
                                                                        }
172
 
173
                                                                    %>
174
                                                                    <html:link action="/user/startLoadCourseUnitFromHome?id=${unit.id}">${unit.name} (${unit.courseName} (${unit.courseCode}))</html:link>
175
                                                                    <html:link action="/user/startLoadCourseUnitRootFromHome?courseUnitView.id=${unit.id}"><img border="0" alt="Pastas" src="<%=request.getContextPath()%>/imgs/folder.gif"></html:link>
176
                                                                </li>
177
                                                            <%
728 jmachado 178
                                                            }
787 jmachado 179
                                                        %>
180
                                                    </ul>
181
                                                    <%
182
                                                }
183
                                            %>
184
                                        </li>
185
                                    </ul>
186
                            <%
187
                                }
188
                            %>
728 jmachado 189
 
215 jmachado 190
                        </div>
376 jmachado 191
                        <div class="block">
192
                            <p><bean:message key="intranet.home.curricular"/></p>
193
                            <ul>
194
                                <li>
195
                                    <html:link action="/user/startLoadCoursesProgramsFromHome"><bean:message key="courseunit.programs"/></html:link>
196
                                </li>
197
                            </ul>
198
                        </div>
215 jmachado 199
                    </td>
200
                </baco:isModuleOn>
204 jmachado 201
                <td class="column">
215 jmachado 202
                    <baco:isModuleOn module="courseunits">
203
                        <jsp:include page="/user/home/courseUnitsAnnouncements.jsp"/>
204
                    </baco:isModuleOn>
205
                    <baco:isModuleOn module="todos">
206
                        <jsp:include page="/user/home/todos.jsp"/>
207
                    </baco:isModuleOn>
204 jmachado 208
                </td>
209
            </tr>
210
        </tbody>
211
    </table>
212
</div>