Subversion Repositories bacoAlunos

Rev

Rev 980 | Rev 995 | 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
                    <%
961 jmachado 213
                        try{
960 jmachado 214
                        HibernateUtils.getCurrentSession().beginTransaction();
215
                        List<CourseUnitDaoImpl.CourseMissingValidationProgram> result = DaoFactory.getCourseUnitDaoImpl().loadMissingProgramValidate(UserSession);
216
                        List<CourseUnitDaoImpl.CourseMissingValidationEvaluation> result2 = DaoFactory.getCourseUnitDaoImpl().loadMissingEvaluationValidate(UserSession);
967 jmachado 217
                        List<CourseUnitDaoImpl.CourseMissingValidationEvaluation> result3 = DaoFactory.getCourseUnitDaoImpl().loadMissingEvaluation(UserSession);
218
                        if(result.size() > 0 || result2.size() > 0 || result3.size()>0)
960 jmachado 219
                        {
220
                    %>
221
                            <div class="block">
965 jmachado 222
                                <p class="WARNING"><label class="WARNING"> Tarefas das Comissões de Curso</label></p>
981 jmachado 223
 
961 jmachado 224
                                <ul>
960 jmachado 225
 
226
 
227
                                    <%
228
                                      if(result.size()>0)
229
                                      {
230
                                    %>
961 jmachado 231
                                    <li>
980 jmachado 232
                                        <h1>Fichas curriculares por validar</h1>
961 jmachado 233
                                        <ul>
234
                                            <%
235
                                                for(CourseUnitDaoImpl.CourseMissingValidationProgram mis:result)
236
                                                {
237
                                            %>
238
                                            <li><a href="<%=request.getContextPath()%>/user/startLoadCoursesProgramsFromHome.do#<%=mis.course.getId()%>"><%=mis.course.getName()%> (<%=mis.courseUnits.size()%>)</a></li>
239
                                            <%
240
                                                }
241
                                            %>
242
                                        </ul>
243
                                    </li>
960 jmachado 244
                                    <%
245
                                      }
246
                                    %>
247
                                    <%
248
                                        if(result2.size()>0)
249
                                        {
961 jmachado 250
 
960 jmachado 251
                                    %>
961 jmachado 252
                                    <li>
980 jmachado 253
                                        <h1>Relatórios de avaliação por validar</h1>
981 jmachado 254
                                        <p>Expanda os cursos e clique nas unidades para validar os relatórios de avaliação.</p>
255
                                        <p>No final de cada relatório existe um botão de validação para os membros das comissões dos cursos respectivos.</p>
960 jmachado 256
                                        <ul>
257
                                            <%
258
                                                for(CourseUnitDaoImpl.CourseMissingValidationEvaluation mis:result2)
259
                                                {
260
                                                    %>
980 jmachado 261
                                                    <li>
262
                                                        <h2><a href="javascript:showOrHide('evaluationValidate<%=mis.course.getId()%>')"><%=mis.course.getName()%> / <%=mis.course.getCode()%></a> (<%=mis.courseUnits.size()%>)</h2>
263
                                                        <ul id="evaluationValidate<%=mis.course.getId()%>" style="display: none">
960 jmachado 264
                                                            <%
265
                                                                for(CourseUnit cu: mis.courseUnits)
266
                                                                {
267
                                                            %>
963 jmachado 268
                                                                    <li><a href="<%=request.getContextPath()%>/user/startLoadCourseUnitEvaluation.do?courseUnitId=<%=cu.getId()%>"><%=cu.getImportYear()%> / <%=cu.getName()%> / <%=cu.getCode()%></a></li>
960 jmachado 269
                                                            <%
270
                                                                }
271
                                                            %>
272
                                                        </ul>
273
 
274
                                                    </li>
275
                                                    <%
276
                                                }
277
                                            %>
278
                                        </ul>
961 jmachado 279
                                    </li>
960 jmachado 280
                                    <%
961 jmachado 281
 
960 jmachado 282
                                        }
283
                                    %>
967 jmachado 284
                                    <%
285
                                        if(result3.size()>0)
286
                                        {
287
 
288
                                    %>
289
                                    <li>
980 jmachado 290
                                        <h1>Relatórios de avaliação ainda não preenchidos</h1>
967 jmachado 291
                                        <ul>
292
                                            <%
293
                                                for(CourseUnitDaoImpl.CourseMissingValidationEvaluation mis:result3)
294
                                                {
295
                                            %>
980 jmachado 296
                                            <li>
297
                                                <h2><a href="javascript:showOrHide('evaluationFill<%=mis.course.getId()%>')"><%=mis.course.getName()%> / <%=mis.course.getCode()%></a> (<%=mis.courseUnits.size()%>)</h2>
298
                                                <ul id="evaluationFill<%=mis.course.getId()%>" style="display: none">
967 jmachado 299
                                                    <%
300
                                                        for(CourseUnit cu: mis.courseUnits)
301
                                                        {
302
                                                    %>
303
                                                    <li><a href="<%=request.getContextPath()%>/user/startLoadCourseUnitEvaluation.do?courseUnitId=<%=cu.getId()%>"><%=cu.getImportYear()%> / <%=cu.getName()%> / <%=cu.getCode()%></a></li>
304
                                                    <%
305
                                                        }
306
                                                    %>
307
                                                </ul>
308
 
309
                                            </li>
310
                                            <%
311
                                                }
312
                                            %>
313
                                        </ul>
314
                                    </li>
315
                                    <%
316
 
317
                                        }
318
                                    %>
961 jmachado 319
                                </ul>
960 jmachado 320
                            </div>
321
                    <%
322
                        }
323
                        HibernateUtils.getCurrentSession().getTransaction().commit();
961 jmachado 324
                        }catch(Throwable e)
325
                        {
326
                            System.out.println(e);
327
                            e.printStackTrace();
328
                        }
960 jmachado 329
                    %>
330
 
331
 
332
 
204 jmachado 333
                </td>
334
            </tr>
335
        </tbody>
336
    </table>
337
</div>