Subversion Repositories bacoAlunos

Rev

Rev 1070 | Rev 1094 | 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" %>
1040 jmachado 10
<%@ page import="jomm.utils.MessageResources" %>
11
<%@ page import="pt.estgp.estgweb.domain.CourseUnit" %>
12
<%@ page import="pt.estgp.estgweb.domain.TeacherImpl" %>
960 jmachado 13
<%@ page import="pt.estgp.estgweb.domain.dao.DaoFactory" %>
14
<%@ page import="pt.estgp.estgweb.domain.dao.impl.CourseUnitDaoImpl" %>
995 jmachado 15
<%@ page import="pt.estgp.estgweb.utils.DatesUtils" %>
1040 jmachado 16
<%@ page import="java.util.List" %>
204 jmachado 17
<jsp:useBean id="UserSession" type="pt.estgp.estgweb.domain.UserSession" scope="request"/>
1040 jmachado 18
<link type="text/css" rel="stylesheet" href="<%=request.getContextPath()%>/css/variables.less"/>
19
<link type="text/css" rel="stylesheet" href="<%=request.getContextPath()%>/css/lavish-bootstrap.css"/>
20
 
21
<!-- PARA BOOTSTRAP NOVO PORTAL-->
1045 jmachado 22
<%--<link type="text/css" rel="stylesheet" href="<%=request.getContextPath()%>/css/offcanvas.css"/>--%>
1040 jmachado 23
 
204 jmachado 24
<div class="portal">
432 jmachado 25
    <logic:notMatch value="TeacherImpl" name="UserSession" property="user.class.name">
301 jmachado 26
    <ul>
27
        <li class="WARNING">
432 jmachado 28
            <bean:message key="profile.bad.profile.teacher.iregular.user.class"/>
301 jmachado 29
        </li>
30
    </ul>
432 jmachado 31
    </logic:notMatch>
204 jmachado 32
    <table class="columnTable" width="100%">
33
        <tbody>
34
            <tr>
215 jmachado 35
                <baco:isModuleOn module="courseunits">
36
                    <td class="column">
1040 jmachado 37
 
215 jmachado 38
                        <div class="block">
787 jmachado 39
                            <%
40
                                java.util.List<String> years = new java.util.ArrayList<String>();
995 jmachado 41
                                String nowImportYear = DaoFactory.getConfigurationDaoImpl().getInterfaceImportYearCreateTransaction();
42
                                years.add(DaoFactory.getConfigurationDaoImpl().getInterfaceImportYearCreateTransaction());
43
                                years.add(DatesUtils.getPreviousImportYear(nowImportYear));
787 jmachado 44
 
45
                                java.util.Collections.sort(years, new java.util.Comparator<String>()
46
                                {
47
                                    public int compare(String o1, String o2) {
48
                                        return o2.compareTo(o1);
49
                                    }
50
                                });
51
 
1040 jmachado 52
 
53
 
787 jmachado 54
                                for(String year: years)
55
                                {
56
 
57
                                    String yearFormatted = pt.estgp.estgweb.utils.DatesUtils.getImportYearFormatted(year);
58
 
59
 
1040 jmachado 60
                %>
787 jmachado 61
 
550 jmachado 62
 
1040 jmachado 63
                            <div class="panel panel-primary">
64
                                <div class="panel-heading"><bean:message key="intranet.course.units"/> - <%=yearFormatted%></div>
65
                                <div class="panel-body">
787 jmachado 66
 
1040 jmachado 67
                                    <!--<h2><bean:message key="intranet.course.units"/> - <%=yearFormatted%></h2>-->
68
                                    <ul>
69
 
787 jmachado 70
                                            <%
1040 jmachado 71
                                                String[] semestres = new String[]{"A","S1","S2","T1","T2","T3","T4"};
72
                                                String[] semestreLabel = new String[]{
73
                                                        MessageResources.getMessage(request,"courseunit.anuais"),
74
                                                        MessageResources.getMessage(request,"courseunit.semestre") + "1",
75
                                                        MessageResources.getMessage(request,"courseunit.semestre") + "2",
76
                                                        MessageResources.getMessage(request,"courseunit.trimestre") + "1",
77
                                                        MessageResources.getMessage(request,"courseunit.trimestre") + "2",
78
                                                        MessageResources.getMessage(request,"courseunit.trimestre") + "3",
79
                                                        MessageResources.getMessage(request,"courseunit.trimestre") + "4"};
787 jmachado 80
 
1040 jmachado 81
                                                for(int i =0;i< semestres.length;i++)
82
                                                {
83
                                                    request.setAttribute("LABEL",semestreLabel[i]);
787 jmachado 84
                                            %>
550 jmachado 85
 
1040 jmachado 86
                                                    <jsp:useBean id="LABEL" scope="request" type="java.lang.String"/>
787 jmachado 87
                                            <%
1040 jmachado 88
                                                    TeacherImpl u = ((pt.estgp.estgweb.domain.TeacherImpl)UserSession.getUser());
89
                                                    List<pt.estgp.estgweb.domain.CourseUnit> cus=
90
                                                            (List<CourseUnit>)
91
                                                                    u.getClass().getMethod("getTeachedUnitsView" + semestres[i],String.class)
92
                                                        .invoke(u,year);
93
                                                    request.setAttribute("units",cus);
94
                                                    if(cus == null || cus.size() == 0)
95
                                                    {}
96
                                                    else if(cus.size() > 0)
97
                                                    {
787 jmachado 98
                                                    %>
1040 jmachado 99
                                                        <jsp:useBean id="units" scope="request" type="java.util.Collection"/>
100
                                                        <li>
101
                                                            <p><bean:write name="LABEL"/></<p>
102
                                                            <ul>
103
                                                                <logic:iterate id="unit" name="units" type="pt.estgp.estgweb.domain.CourseUnit">
104
                                                                    <li>
105
                                                                        <html:link action="/user/startLoadCourseUnitFromHome?id=${unit.id}">${unit.name} (${unit.courseName} (${unit.courseCode}))</html:link>
106
                                                                        <html:link action="/user/startLoadCourseUnitRootFromHome?courseUnitView.id=${unit.id}"><img border="0" alt="Pastas" src="<%=request.getContextPath()%>/imgs/folder.gif"></html:link>
107
                                                                    </li>
108
                                                                </logic:iterate>
109
                                                            </ul>
110
                                                        </li>
787 jmachado 111
                                                    <%
1040 jmachado 112
                                                    }
787 jmachado 113
                                                }
1040 jmachado 114
 
115
                                        %>
787 jmachado 116
                                    </ul>
1040 jmachado 117
                                </div>
118
                            </div>
787 jmachado 119
                            <%
120
                                }
121
                            %>
215 jmachado 122
                        </div>
1040 jmachado 123
                        </baco:isModuleOn>
124
                        <baco:isModuleOn module="todos">
125
                            <jsp:include page="/user/home/todos.jsp"/>
126
                        </baco:isModuleOn>
127
                        <baco:isModuleOn module="courseunits">
128
                            <jsp:include page="/user/home/courseUnitsAnnouncements.jsp"/>
129
                        </baco:isModuleOn>
215 jmachado 130
                    </td>
1040 jmachado 131
 
132
 
204 jmachado 133
                <td class="column">
1024 jmachado 134
 
1040 jmachado 135
                    <div class="block">
136
                        <div class="panel panel-primary">
137
                            <div class="panel-heading"><bean:message key="intranet.home.curricular"/></div>
138
                            <div class="panel-body">
139
                                <!--<p><bean:message key="intranet.home.curricular"/></p>-->
140
                                <!--<ul>
141
                                    <li>-->
142
                                <html:link action="/user/startLoadCoursesProgramsFromHome"><bean:message key="courseunit.indexes"/> (Novo Estilo) </html:link>
143
                                <!--</li>
144
                            </ul>-->
145
                            </div>
146
                        </div>
147
                    </div>
960 jmachado 148
                    <%
961 jmachado 149
                        try{
1024 jmachado 150
                            HibernateUtils.getCurrentSession().beginTransaction();
1029 jmachado 151
                            String activeYear = DaoFactory.getConfigurationDaoImpl().getCourseUnitEvaluationActiveYear();
1070 jmachado 152
                            List<String> activeDegrees = DaoFactory.getConfigurationDaoImpl().getCourseUnitEvaluationActiveDegrees();
153
 
1040 jmachado 154
                                List<CourseUnit> evaluations = DaoFactory.getCourseUnitDaoImpl().loadTeacherUnitsMissingEvaluation(UserSession);
155
                                List<CourseUnit> programs = DaoFactory.getCourseUnitDaoImpl().loadMissingPrograms(UserSession.getUser().getId());
156
                                if(programs != null && programs.size() > 0 || evaluations!= null && evaluations.size() > 0)
1029 jmachado 157
                                {
158
                        %>
1040 jmachado 159
 
160
 
161
                                <div class="block">
162
 
163
                                    <div class="panel panel-primary">
164
                                        <div class="panel-heading">Tarefas Docente Relativas a Unidades (<%=activeYear%>)</div>
165
                                        <div class="panel-body">
166
                                            <%
167
                                                if(programs != null && programs.size() > 0)
1029 jmachado 168
                                                {
169
                                            %>
1040 jmachado 170
                                            <div class="panel-body-h1">Fichas Curriculares por preencher</div>
171
                                            <ul>
172
                                               <%
173
                                                    for(CourseUnit cu: programs)
174
                                                    {
175
                                                %>
176
                                                <li><a href="<%=request.getContextPath()%>/user/startLoadCourseUnitEvaluation.do?courseUnitId=<%=cu.getId()%>"><%=cu.getName()%>/<%=cu.getCode()%> (<%=cu.getCourseName() + "/" +cu.getCourseCode()%>)</a></li>
177
                                                <%
178
                                                    }
179
                                                %>
180
                                            </ul>
181
 
1029 jmachado 182
                                            <%
183
                                                }
1040 jmachado 184
                                                if(evaluations != null && evaluations.size() > 0)
185
                                                {
1029 jmachado 186
                                            %>
1077 jmachado 187
                                            <div class="panel-body-h1">Relatórios de avaliação por preencher/entregar
1070 jmachado 188
                                                <%
1077 jmachado 189
                                                    if(activeDegrees != null)
1070 jmachado 190
                                                    {
1077 jmachado 191
                                                    %>
192
                                                    (graus em processo de validação:
193
                                                    <%
194
                                                        String sep = "";
195
                                                        for(String activeDegree: activeDegrees)
196
                                                        {
197
                                                    %>
198
                                                    <%=sep + MessageResources.getInstance(request).getMessage("course."+activeDegree)%>
199
                                                    <%
200
                                                            sep = ", ";
201
                                                        }
202
                                                    %>
203
                                                    )
204
                                                    <%
1070 jmachado 205
                                                    }
206
                                                %>
1077 jmachado 207
 
1070 jmachado 208
                                            </div>
1040 jmachado 209
                                            <ul>
210
                                                <%
211
                                                    for(CourseUnit cu: evaluations)
212
                                                    {
213
                                                %>
214
                                                <li><a href="<%=request.getContextPath()%>/user/startLoadCourseUnitFromHome.do?id=<%=cu.getId()%>"><%=cu.getName()%>/<%=cu.getCode()%> (<%=cu.getCourseName() + "/" +cu.getCourseCode()%>)</a></li>
215
                                                <%
216
                                                    }
217
                                                %>
218
                                            </ul>
219
                                            <%
220
                                                }
221
                                            %>
222
                                        </div>
1029 jmachado 223
                                    </div>
1040 jmachado 224
                                </div>
1029 jmachado 225
                        <%
226
                                }
1070 jmachado 227
 
1024 jmachado 228
                            HibernateUtils.getCurrentSession().getTransaction().commit();
229
                        }catch(Throwable e)
230
                        {
231
                            System.out.println(e);
232
                            e.printStackTrace();
233
                        }
234
                    %>
235
 
236
 
237
                    <%
1034 jmachado 238
 
1024 jmachado 239
                        try{
1034 jmachado 240
                            HibernateUtils.getCurrentSession().beginTransaction();
241
                            String activeYear = DaoFactory.getConfigurationDaoImpl().getCourseUnitEvaluationActiveYear();
1070 jmachado 242
                            List<String> activeDegrees = DaoFactory.getConfigurationDaoImpl().getCourseUnitEvaluationActiveDegrees();
243
 
1040 jmachado 244
                                List<CourseUnitDaoImpl.CourseMissingValidationProgram> result0 = DaoFactory.getCourseUnitDaoImpl().loadMissingPrograms(UserSession);
245
                                List<CourseUnitDaoImpl.CourseMissingValidationProgram> result1 = DaoFactory.getCourseUnitDaoImpl().loadMissingProgramValidate(UserSession);
1034 jmachado 246
                                List<CourseUnitDaoImpl.CourseMissingValidationEvaluation> result2 = DaoFactory.getCourseUnitDaoImpl().loadMissingEvaluationValidate(UserSession);
247
                                List<CourseUnitDaoImpl.CourseMissingValidationEvaluation> result3 = DaoFactory.getCourseUnitDaoImpl().loadMissingEvaluation(UserSession);
1040 jmachado 248
                                if(result0.size() > 0 || result1.size() > 0 || result2.size() > 0 || result3.size()>0)
1034 jmachado 249
                                {
250
                            %>
251
                                    <div class="block">
1040 jmachado 252
                                        <div class="panel panel-primary">
253
                                            <div class="panel-heading">Tarefas das Comissões de Curso (<%=activeYear%>)</div>
254
                                            <div class="panel-body">
1041 jmachado 255
                                                <p>Expanda os cursos e clique nas unidades para validar os relatórios de avaliação.</p>
256
                                                <p>No final de cada relatório existe um botão de validação para os membros das comissões dos cursos respectivos.</p>
981 jmachado 257
 
960 jmachado 258
 
259
 
1040 jmachado 260
 
261
 
1041 jmachado 262
 
263
                                                <%
1040 jmachado 264
                                                      if(result1.size()>0)
265
                                                      {
266
                                                    %>
267
 
268
                                                        <div class="panel-body-h1">Fichas curriculares por validar</div>
269
                                                        <ul>
270
                                                            <%
271
                                                                for(CourseUnitDaoImpl.CourseMissingValidationProgram mis:result1)
272
                                                                {
273
                                                            %>
274
                                                            <li><a href="<%=request.getContextPath()%>/user/startLoadCoursesProgramsFromHome.do?courseId=<%=mis.course.getId()%>#<%=mis.course.getId()%>"><%=mis.course.getName()%> (<%=mis.courseUnits.size()%>)</a></li>
275
                                                            <%
276
                                                                }
277
                                                            %>
278
                                                        </ul>
279
 
280
                                                    <%
281
                                                      }
282
                                                    %>
283
 
284
                                                <%
285
                                                    if(result0.size()>0)
286
                                                    {
287
                                                %>
288
 
289
                                                <div class="panel-body-h1">Fichas curriculares por preencher</div>
1034 jmachado 290
                                                <ul>
291
                                                    <%
1040 jmachado 292
                                                        for(CourseUnitDaoImpl.CourseMissingValidationProgram mis:result0)
1034 jmachado 293
                                                        {
294
                                                    %>
1039 jmachado 295
                                                    <li><a href="<%=request.getContextPath()%>/user/startLoadCoursesProgramsFromHome.do?courseId=<%=mis.course.getId()%>#<%=mis.course.getId()%>"><%=mis.course.getName()%> (<%=mis.courseUnits.size()%>)</a></li>
1034 jmachado 296
                                                    <%
297
                                                        }
298
                                                    %>
299
                                                </ul>
300
 
1040 jmachado 301
                                                <%
302
                                                    }
303
                                                %>
304
 
1034 jmachado 305
                                                    <%
1040 jmachado 306
                                                        if(result2.size()>0)
1034 jmachado 307
                                                        {
1040 jmachado 308
 
309
                                                    %>
310
 
1077 jmachado 311
                                                        <div class="panel-body-h1">Relatórios de avaliação por validar
1070 jmachado 312
                                                            <%
313
                                                                String sep = "";
1077 jmachado 314
                                                            if(activeDegrees != null)
1070 jmachado 315
                                                            {
316
                                                            %>
1077 jmachado 317
                                                            (graus em processo de validação:
318
                                                            <%
319
                                                                for(String activeDegree: activeDegrees)
320
                                                                {
321
                                                            %>
1070 jmachado 322
                                                                <%=sep + MessageResources.getInstance(request).getMessage("course."+activeDegree)%>
323
                                                            <%
324
                                                                sep = ", ";
1077 jmachado 325
                                                                }
326
                                                            %>
327
                                                            )
328
                                                            <%
1070 jmachado 329
                                                            }
1077 jmachado 330
                                                            %>
1070 jmachado 331
                                                        </div>
1040 jmachado 332
 
333
                                                            <%
334
                                                                for(CourseUnitDaoImpl.CourseMissingValidationEvaluation mis:result2)
335
                                                                {
1034 jmachado 336
                                                                    %>
1040 jmachado 337
 
338
                                                                        <h2><a href="javascript:showOrHide('evaluationValidate<%=mis.course.getId()%>')"><%=mis.course.getName()%> / <%=mis.course.getCode()%></a> (<%=mis.courseUnits.size()%>)</h2>
339
                                                                        <div id="evaluationValidate<%=mis.course.getId()%>" style="display: none">
340
                                                                            <ul>
341
                                                                                <%
342
                                                                                    for(CourseUnit cu: mis.courseUnits)
343
                                                                                    {
344
                                                                                %>
1070 jmachado 345
                                                                                        <li><a href="<%=request.getContextPath()%>/user/startLoadCourseUnitEvaluation.do?courseUnitId=<%=cu.getId()%>"><%=cu.getName()%> / <%=cu.getCode()%></a></li>
1040 jmachado 346
                                                                                <%
347
                                                                                    }
348
                                                                                %>
349
                                                                            </ul>
350
                                                                        </div>
351
 
352
 
1034 jmachado 353
                                                                    <%
1040 jmachado 354
                                                                }
355
                                                            %>
1034 jmachado 356
 
1040 jmachado 357
                                                    <%
358
 
1034 jmachado 359
                                                        }
360
                                                    %>
361
                                                    <%
1040 jmachado 362
                                                        if(result3.size()>0)
1034 jmachado 363
                                                        {
1040 jmachado 364
 
960 jmachado 365
                                                    %>
1040 jmachado 366
 
1077 jmachado 367
                                                        <div class="panel-body-h1">Relatórios de avaliação ainda não preenchidos
1070 jmachado 368
                                                            <%
369
                                                                String sep = "";
1077 jmachado 370
                                                            if(activeDegrees != null)
371
                                                            {
372
                                                            %>
373
                                                            (graus em processo de validação:
374
                                                            <%
1070 jmachado 375
                                                                for(String activeDegree: activeDegrees)
376
                                                                {
377
                                                            %>
378
                                                            <%=sep + MessageResources.getInstance(request).getMessage("course."+activeDegree)%>
379
                                                            <%
380
                                                                    sep = ",";
381
                                                                }
1077 jmachado 382
                                                            %>
383
                                                            )
384
                                                            <%
385
                                                                }
386
                                                            %>
1070 jmachado 387
                                                        </div>
1040 jmachado 388
 
960 jmachado 389
                                                            <%
1040 jmachado 390
                                                                for(CourseUnitDaoImpl.CourseMissingValidationEvaluation mis:result3)
960 jmachado 391
                                                                {
392
                                                            %>
1040 jmachado 393
 
394
                                                                <h2><a href="javascript:showOrHide('evaluationFill<%=mis.course.getId()%>')"><%=mis.course.getName()%> / <%=mis.course.getCode()%></a> (<%=mis.courseUnits.size()%>)</h2>
395
                                                                <div id="evaluationFill<%=mis.course.getId()%>" style="display: none">
396
                                                                    <ul>
397
                                                                    <%
398
                                                                        for(CourseUnit cu: mis.courseUnits)
399
                                                                        {
400
                                                                    %>
1070 jmachado 401
                                                                    <li><a href="<%=request.getContextPath()%>/user/startLoadCourseUnitEvaluation.do?courseUnitId=<%=cu.getId()%>"><%=cu.getName()%> / <%=cu.getCode()%></a></li>
1040 jmachado 402
                                                                    <%
403
                                                                        }
404
                                                                    %>
405
                                                                    </ul>
406
                                                                </div>
960 jmachado 407
                                                            <%
408
                                                                }
409
                                                            %>
410
 
411
                                                    <%
1040 jmachado 412
 
967 jmachado 413
                                                        }
414
                                                    %>
1034 jmachado 415
 
1040 jmachado 416
                                            </div>
417
                                        </div>
1034 jmachado 418
                                    </div>
419
                            <%
420
                                }
1070 jmachado 421
 
1034 jmachado 422
                            HibernateUtils.getCurrentSession().getTransaction().commit();
961 jmachado 423
                        }catch(Throwable e)
424
                        {
425
                            System.out.println(e);
426
                            e.printStackTrace();
427
                        }
960 jmachado 428
                    %>
429
 
430
 
431
 
204 jmachado 432
                </td>
433
            </tr>
434
        </tbody>
435
    </table>
436
</div>