Subversion Repositories bacoAlunos

Rev

Rev 924 | Rev 961 | 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" %>
960 jmachado 9
<%@ page import="jomm.dao.utils.HibernateUtils" %>
10
<%@ page import="pt.estgp.estgweb.domain.dao.DaoFactory" %>
11
<%@ page import="pt.estgp.estgweb.domain.dao.impl.CourseUnitDaoImpl" %>
787 jmachado 12
<%@ page import="java.util.List" %>
960 jmachado 13
<%@ page import="pt.estgp.estgweb.domain.CourseUnit" %>
204 jmachado 14
<jsp:useBean id="UserSession" type="pt.estgp.estgweb.domain.UserSession" scope="request"/>
15
<div class="portal">
432 jmachado 16
    <logic:notMatch value="TeacherImpl" name="UserSession" property="user.class.name">
301 jmachado 17
    <ul>
18
        <li class="WARNING">
432 jmachado 19
            <bean:message key="profile.bad.profile.teacher.iregular.user.class"/>
301 jmachado 20
        </li>
21
    </ul>
432 jmachado 22
    </logic:notMatch>
204 jmachado 23
    <table class="columnTable" width="100%">
24
        <tbody>
25
            <tr>
215 jmachado 26
                <baco:isModuleOn module="courseunits">
27
                    <td class="column">
28
                        <div class="block">
787 jmachado 29
                            <%
30
                                java.util.List<String> years = new java.util.ArrayList<String>();
924 jmachado 31
                                years.add("201516");
891 jmachado 32
                                years.add("201415");
787 jmachado 33
 
34
                                java.util.Collections.sort(years, new java.util.Comparator<String>()
35
                                {
36
                                    public int compare(String o1, String o2) {
37
                                        return o2.compareTo(o1);
38
                                    }
39
                                });
40
 
41
                                for(String year: years)
42
                                {
43
 
44
                                    String yearFormatted = pt.estgp.estgweb.utils.DatesUtils.getImportYearFormatted(year);
45
 
46
                                    %>
47
 
789 jmachado 48
                                    <h2><bean:message key="intranet.course.units"/> - <%=yearFormatted%></h2>
787 jmachado 49
                                    <ul>
50
                                        <li>
51
                                            <p><bean:message key="courseunit.semestre"/> 1</p>
52
                                            <%
53
                                                List<pt.estgp.estgweb.domain.CourseUnit> cus = ((pt.estgp.estgweb.domain.TeacherImpl)UserSession.getUser()).getTeachedUnitsViewS1(year);
54
                                                if(cus == null || cus.size() == 0)
55
                                                {
56
                                                    %><bean:message key="courseunit.zero.units"/><%
57
                                                }
789 jmachado 58
                                                else if(cus.size() > 0)
787 jmachado 59
                                                {
60
                                                    %>
61
                                                    <ul>
550 jmachado 62
                                                        <%
787 jmachado 63
                                                            for(pt.estgp.estgweb.domain.CourseUnit unit:cus)
550 jmachado 64
                                                            {
787 jmachado 65
                                                                request.setAttribute("unit",unit);
66
                                                            %>
67
                                                                <li>
68
                                                                    <%
69
                                                                        String courseCode = "";
70
                                                                        if(unit.getCourse() != null)
71
                                                                        {
72
                                                                            String courseName = unit.getCourse().getName();
73
                                                                            String[] words = courseName.split(" ");
74
                                                                            for(String word: words)
75
                                                                            {
76
                                                                                if(word != null && word.length() > 3 && word.charAt(0) >= 'A' && word.charAt(0) <= 'Z' )
77
                                                                                {
78
                                                                                    courseCode += word.charAt(0);
79
                                                                                }
80
                                                                            }
81
                                                                        }
82
 
83
                                                                    %>
84
                                                                    <html:link action="/user/startLoadCourseUnitFromHome?id=${unit.id}">${unit.name} (${unit.courseName} (${unit.courseCode}))</html:link>
85
                                                                    <html:link action="/user/startLoadCourseUnitRootFromHome?courseUnitView.id=${unit.id}"><img border="0" alt="Pastas" src="<%=request.getContextPath()%>/imgs/folder.gif"></html:link>
86
                                                                </li>
87
                                                            <%
550 jmachado 88
                                                            }
787 jmachado 89
                                                        %>
90
                                                    </ul>
91
                                                    <%
92
                                                }
93
                                            %>
550 jmachado 94
 
787 jmachado 95
 
96
                                        </li>
97
                                        <li>
98
                                            <p><bean:message key="courseunit.semestre"/> 2</p>
99
                                            <%
100
                                                cus = ((pt.estgp.estgweb.domain.TeacherImpl)UserSession.getUser()).getTeachedUnitsViewS2(year);
101
                                                if(cus == null || cus.size() == 0)
102
                                                {
103
                                                    %><bean:message key="courseunit.zero.units"/><%
104
                                                }
789 jmachado 105
                                                else if(cus.size() > 0)
787 jmachado 106
                                                {
107
                                                    %>
108
                                                    <ul>
109
                                                        <%
110
                                                            for(pt.estgp.estgweb.domain.CourseUnit unit:cus)
550 jmachado 111
                                                            {
787 jmachado 112
                                                                request.setAttribute("unit",unit);
113
                                                            %>
114
                                                                <li>
115
                                                                    <%
116
                                                                        String courseCode = "";
117
                                                                        if(unit.getCourse() != null)
118
                                                                        {
119
                                                                            String courseName = unit.getCourse().getName();
120
                                                                            String[] words = courseName.split(" ");
121
                                                                            for(String word: words)
122
                                                                            {
123
                                                                                if(word != null && word.length() > 3 && word.charAt(0) >= 'A' && word.charAt(0) <= 'Z' )
124
                                                                                {
125
                                                                                    courseCode += word.charAt(0);
126
                                                                                }
127
                                                                            }
128
                                                                        }
129
 
130
                                                                    %>
131
                                                                    <html:link action="/user/startLoadCourseUnitFromHome?id=${unit.id}">${unit.name} (${unit.courseName} (${unit.courseCode}))</html:link>
132
                                                                    <html:link action="/user/startLoadCourseUnitRootFromHome?courseUnitView.id=${unit.id}"><img border="0" alt="Pastas" src="<%=request.getContextPath()%>/imgs/folder.gif"></html:link>
133
                                                                </li>
134
                                                            <%
550 jmachado 135
                                                            }
787 jmachado 136
                                                        %>
137
                                                    </ul>
138
                                                    <%
139
                                                }
140
                                            %>
550 jmachado 141
 
787 jmachado 142
 
143
                                        </li>
144
                                        <li>
145
                                            <p><bean:message key="courseunit.semestre"/> (Anuais)</p>
146
                                            <%
147
                                                cus = ((pt.estgp.estgweb.domain.TeacherImpl)UserSession.getUser()).getTeachedUnitsViewA(year);
148
                                                if(cus == null || cus.size() == 0)
149
                                                {
150
                                                    %><bean:message key="courseunit.zero.units"/><%
151
                                                }
789 jmachado 152
                                                else if(cus.size() > 0)
787 jmachado 153
                                                {
154
                                                    %>
155
                                                    <ul>
728 jmachado 156
                                                        <%
787 jmachado 157
                                                            for(pt.estgp.estgweb.domain.CourseUnit unit:cus)
728 jmachado 158
                                                            {
787 jmachado 159
                                                                request.setAttribute("unit",unit);
160
                                                            %>
161
                                                                <li>
162
                                                                    <%
163
                                                                        String courseCode = "";
164
                                                                        if(unit.getCourse() != null)
165
                                                                        {
166
                                                                            String courseName = unit.getCourse().getName();
167
                                                                            String[] words = courseName.split(" ");
168
                                                                            for(String word: words)
169
                                                                            {
170
                                                                                if(word != null && word.length() > 3 && word.charAt(0) >= 'A' && word.charAt(0) <= 'Z' )
171
                                                                                {
172
                                                                                    courseCode += word.charAt(0);
173
                                                                                }
174
                                                                            }
175
                                                                        }
176
 
177
                                                                    %>
178
                                                                    <html:link action="/user/startLoadCourseUnitFromHome?id=${unit.id}">${unit.name} (${unit.courseName} (${unit.courseCode}))</html:link>
179
                                                                    <html:link action="/user/startLoadCourseUnitRootFromHome?courseUnitView.id=${unit.id}"><img border="0" alt="Pastas" src="<%=request.getContextPath()%>/imgs/folder.gif"></html:link>
180
                                                                </li>
181
                                                            <%
728 jmachado 182
                                                            }
787 jmachado 183
                                                        %>
184
                                                    </ul>
185
                                                    <%
186
                                                }
187
                                            %>
188
                                        </li>
189
                                    </ul>
190
                            <%
191
                                }
192
                            %>
728 jmachado 193
 
215 jmachado 194
                        </div>
376 jmachado 195
                        <div class="block">
196
                            <p><bean:message key="intranet.home.curricular"/></p>
197
                            <ul>
198
                                <li>
199
                                    <html:link action="/user/startLoadCoursesProgramsFromHome"><bean:message key="courseunit.programs"/></html:link>
200
                                </li>
201
                            </ul>
202
                        </div>
215 jmachado 203
                    </td>
204
                </baco:isModuleOn>
204 jmachado 205
                <td class="column">
215 jmachado 206
                    <baco:isModuleOn module="courseunits">
207
                        <jsp:include page="/user/home/courseUnitsAnnouncements.jsp"/>
208
                    </baco:isModuleOn>
209
                    <baco:isModuleOn module="todos">
210
                        <jsp:include page="/user/home/todos.jsp"/>
211
                    </baco:isModuleOn>
960 jmachado 212
                    <%
213
                        HibernateUtils.getCurrentSession().beginTransaction();
214
                        List<CourseUnitDaoImpl.CourseMissingValidationProgram> result = DaoFactory.getCourseUnitDaoImpl().loadMissingProgramValidate(UserSession);
215
                        List<CourseUnitDaoImpl.CourseMissingValidationEvaluation> result2 = DaoFactory.getCourseUnitDaoImpl().loadMissingEvaluationValidate(UserSession);
216
                        if(result.size() > 0 || result2.size() > 0)
217
                        {
218
                    %>
219
                            <div class="block">
220
                                <p>Tarefas das Comissões de Curso</p>
221
 
222
 
223
 
224
                                    <%
225
                                      if(result.size()>0)
226
                                      {
227
                                    %>
228
                                        <div class="block">
229
                                            <p>Fichas curriculares por validar</p>
230
                                            <ul>
231
                                                <%
232
                                                    for(CourseUnitDaoImpl.CourseMissingValidationProgram mis:result)
233
                                                    {
234
                                                %>
235
                                                <li><a href="<%=request.getContextPath()%>//user/startLoadCoursesProgramsFromHome.do#<%=mis.course.getId()%>"><%=mis.course.getName()%> (<%=mis.courseUnits.size()%> %>)</a></li>
236
                                                <%
237
                                                    }
238
                                                %>
239
                                            </ul>
240
                                        </div>
241
                                    <%
242
                                      }
243
                                    %>
244
                                    <%
245
                                        if(result2.size()>0)
246
                                        {
247
                                    %>
248
                                    <div class="block">
249
                                        <p>Relatórios de avaliação por validar</p>
250
                                        <ul>
251
                                            <%
252
                                                for(CourseUnitDaoImpl.CourseMissingValidationEvaluation mis:result2)
253
                                                {
254
                                                    %>
255
                                                    <li><%=mis.course.getName()%> / <%=mis.course.getCode()%>
256
                                                        <ul>
257
                                                            <%
258
                                                                for(CourseUnit cu: mis.courseUnits)
259
                                                                {
260
                                                            %>
261
                                                                    <li><a href="<%=request.getContextPath()%>/user/startLoadCourseUnitFromHome.do?id=<%=cu.getId()%>"><%=cu.getImportYear()%> / <%=cu.getName()%> / <%=cu.getCode()%></a></li>
262
                                                            <%
263
                                                                }
264
                                                            %>
265
                                                        </ul>
266
 
267
                                                    </li>
268
                                                    <%
269
                                                }
270
                                            %>
271
                                        </ul>
272
                                    </div>
273
                                    <%
274
                                        }
275
                                    %>
276
 
277
                                /user/startLoadCoursesProgramsFromHome.do#courseId
278
 
279
 
280
                            </div>
281
                    <%
282
                        }
283
                        HibernateUtils.getCurrentSession().getTransaction().commit();
284
                    %>
285
 
286
 
287
 
204 jmachado 288
                </td>
289
            </tr>
290
        </tbody>
291
    </table>
292
</div>