Subversion Repositories bacoAlunos

Rev

Rev 1366 | Rev 1428 | 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" %>
1353 jmachado 17
<jsp:useBean id="UserSession" type="pt.estgp.estgweb.domain.UserSessionImpl" scope="request"/>
1040 jmachado 18
 
19
<!-- PARA BOOTSTRAP NOVO PORTAL-->
1045 jmachado 20
<%--<link type="text/css" rel="stylesheet" href="<%=request.getContextPath()%>/css/offcanvas.css"/>--%>
1040 jmachado 21
 
1312 jmachado 22
 
432 jmachado 23
    <logic:notMatch value="TeacherImpl" name="UserSession" property="user.class.name">
1312 jmachado 24
        <div class="alert alert-warning">
432 jmachado 25
            <bean:message key="profile.bad.profile.teacher.iregular.user.class"/>
1312 jmachado 26
        </div>
432 jmachado 27
    </logic:notMatch>
1312 jmachado 28
 
1254 jmachado 29
    <jsp:include page="todosAfazer.jsp"/>
1040 jmachado 30
 
1312 jmachado 31
    <div class="row">
1320 jmachado 32
        <div class="col-md-6 col-sm-12 col-xs-12" style="padding-right: 6px">
1353 jmachado 33
 
1312 jmachado 34
            <baco:isModuleOn module="courseunits">
1353 jmachado 35
                <div class="panel panel-primary">
36
                    <div class="panel-heading"><bean:message key="intranet.home.curricular"/></div>
37
                    <div class="panel-body">
38
                        <!--<p><bean:message key="intranet.home.curricular"/></p>-->
39
                        <!--<ul>
40
                            <li>-->
41
                        <div class="list-group">
42
                            <div class="list-group-item">
43
                                <html:link action="/user/startLoadCoursesProgramsFromHome"><bean:message key="courseunit.indexes"/></html:link>
44
                            </div>
45
                            <div class="list-group-item">
46
                                <html:link action="/user/courseComissions"><bean:message key="course.comissions"/></html:link>
47
                            </div>
1371 jmachado 48
                            <div class="list-group-item">
49
                                <a href="<%=request.getContextPath()%>/dir/utilsIntranet/comAvalDesemp">Avaliação de Desempenho Docente</a>
50
                            </div>
1353 jmachado 51
                        </div>
52
                        <!--</li>
53
                    </ul>-->
54
                    </div>
55
                </div>
787 jmachado 56
 
57
 
1312 jmachado 58
                <%
59
                    java.util.List<String> years = new java.util.ArrayList<String>();
60
                    String nowImportYear = DaoFactory.getConfigurationDaoImpl().getInterfaceImportYearCreateTransaction();
61
                    years.add(DaoFactory.getConfigurationDaoImpl().getInterfaceImportYearCreateTransaction());
62
                    years.add(DatesUtils.getPreviousImportYear(nowImportYear));
1040 jmachado 63
 
1312 jmachado 64
                    java.util.Collections.sort(years, new java.util.Comparator<String>()
65
                    {
66
                        public int compare(String o1, String o2) {
67
                            return o2.compareTo(o1);
68
                        }
69
                    });
1040 jmachado 70
 
787 jmachado 71
 
72
 
1312 jmachado 73
                    for(String year: years)
74
                    {
787 jmachado 75
 
1312 jmachado 76
                        String yearFormatted = pt.estgp.estgweb.utils.DatesUtils.getImportYearFormatted(year);
77
 
78
 
1040 jmachado 79
                %>
787 jmachado 80
 
550 jmachado 81
 
1312 jmachado 82
                <div class="panel panel-primary">
83
                    <div class="panel-heading"><bean:message key="intranet.course.units"/> - <%=yearFormatted%></div>
84
                    <div class="panel-body">
787 jmachado 85
 
1040 jmachado 86
 
787 jmachado 87
 
1312 jmachado 88
                            <%
89
                                String[] semestres = new String[]{"A","S1","S2","T1","T2","T3","T4"};
90
                                String[] semestreLabel = new String[]{
91
                                        MessageResources.getMessage(request,"courseunit.anuais"),
92
                                        MessageResources.getMessage(request,"courseunit.semestre") + "1",
93
                                        MessageResources.getMessage(request,"courseunit.semestre") + "2",
94
                                        MessageResources.getMessage(request,"courseunit.trimestre") + "1",
95
                                        MessageResources.getMessage(request,"courseunit.trimestre") + "2",
96
                                        MessageResources.getMessage(request,"courseunit.trimestre") + "3",
97
                                        MessageResources.getMessage(request,"courseunit.trimestre") + "4"};
550 jmachado 98
 
1312 jmachado 99
                                for(int i =0;i< semestres.length;i++)
100
                                {
101
                                    request.setAttribute("LABEL",semestreLabel[i]);
102
                            %>
103
 
104
                            <jsp:useBean id="LABEL" scope="request" type="java.lang.String"/>
105
                            <%
106
                                TeacherImpl u = ((pt.estgp.estgweb.domain.TeacherImpl)UserSession.getUser());
107
                                List<pt.estgp.estgweb.domain.CourseUnit> cus=
108
                                        (List<CourseUnit>)
109
                                                u.getClass().getMethod("getTeachedUnitsView" + semestres[i],String.class)
1040 jmachado 110
                                                        .invoke(u,year);
1312 jmachado 111
                                request.setAttribute("units",cus);
112
                                if(cus == null || cus.size() == 0)
113
                                {}
114
                                else if(cus.size() > 0)
115
                                {
116
                            %>
117
                            <jsp:useBean id="units" scope="request" type="java.util.Collection"/>
118
                            <div class="list-group">
119
                                <div class="list-group-item list-group-item-heading"><bean:write name="LABEL"/></div>
1040 jmachado 120
 
1312 jmachado 121
                                <logic:iterate id="unit" name="units" type="pt.estgp.estgweb.domain.CourseUnit">
122
                                    <div class="list-group-item">
123
                                        <div class="row">
124
                                            <div class="col-sm-10"><html:link action="/user/startLoadCourseUnitFromHome?id=${unit.id}">${unit.name} (${unit.courseName} (${unit.courseCode}) ${unit.cdTurma}</html:link></div>
125
                                            <div class="col-sm-2"><html:link action="/user/startLoadCourseUnitRootFromHome?courseUnitView.id=${unit.id}"> <span style="padding:5px" class="glyphicon glyphicon-folder-open"></span> </html:link></div>
126
                                        </div>
127
                                    </div>
128
                                </logic:iterate>
1040 jmachado 129
                            </div>
787 jmachado 130
                            <%
1312 jmachado 131
                                    }
787 jmachado 132
                                }
1312 jmachado 133
 
787 jmachado 134
                            %>
1040 jmachado 135
 
1312 jmachado 136
                    </div>
137
                </div>
138
                <%
139
                    }
140
                %>
1040 jmachado 141
 
1312 jmachado 142
            </baco:isModuleOn>
143
            <%--
144
            <baco:isModuleOn module="todos">
145
                <jsp:include page="/user/home/todos.jsp"/>
146
            </baco:isModuleOn>--%>
147
            <baco:isModuleOn module="courseunits">
148
                <jsp:include page="/user/home/courseUnitsAnnouncements.jsp"/>
149
            </baco:isModuleOn>
1024 jmachado 150
 
1312 jmachado 151
 
152
        </div>
1320 jmachado 153
        <div class="col-md-6 col-sm-12 col-xs-12" style="padding-left: 6px">
1312 jmachado 154
 
1353 jmachado 155
            <%
156
                if(UserSession.getUser().getRoles().indexOf("courseValidateProgram")>=0)
157
                {
158
            %>
159
                    <div class="panel panel-primary">
160
                        <div class="panel-heading">As minhas Comissões de Curso</div>
161
                        <div class="panel-body">
1312 jmachado 162
 
1353 jmachado 163
                            <div class="list-group">
164
                                <div class="list-group-item">
165
                                    <html:link action="/user/startSubmitMessageCourseComission">
166
                                        Enviar email aos alunos
167
                                    </html:link>
168
                                </div>
169
                                <div class="list-group-item">
1354 jmachado 170
                                    <html:link action="/user/startLoadCourseCourseUnitsStatistics">Consultar estatisticas das Unidades Curriculares</html:link>
1353 jmachado 171
                                </div>
172
                                <div class="list-group-item">
173
                                    <html:link action="/user/listStudentsCourseComission">
174
                                        Consultar Alunos
175
                                    </html:link>
176
                                </div>
1366 jmachado 177
                                <!--<div class="list-group-item">
1353 jmachado 178
                                    <html:link action="/user/startSubmitMessageCourseComission">
179
                                        Consultar Docentes
180
                                    </html:link>
1366 jmachado 181
                                </div>-->
1353 jmachado 182
                                <div class="list-group-item">
183
                                    <html:link action="/user/startLoadCoursesProgramsFromHome?importYear=${UserSession.nowConfiguration.interfaceImportYear}&forUser=courseCommission">Atalho para as validações (${UserSession.nowConfiguration.interfaceImportYear})</html:link>
184
                                </div>
185
                                <div class="list-group-item">
186
                                    <html:link action="/user/startLoadCoursesProgramsFromHome?importYear=${UserSession.nowConfiguration.previousInterfaceImportYear}&forUser=courseCommission">Atalho para as validações (${UserSession.nowConfiguration.previousInterfaceImportYear})</html:link>
187
                                </div>
188
                            </div>
189
                            <!--</li>
190
                        </ul>-->
1040 jmachado 191
                        </div>
192
                    </div>
1353 jmachado 193
                    <jsp:include page="courseComission.jsp"/>
194
            <%
195
                }
196
            %>
1070 jmachado 197
 
1353 jmachado 198
 
1312 jmachado 199
            <%
200
                try{
201
                    HibernateUtils.getCurrentSession().beginTransaction();
202
                    String activeYear = DaoFactory.getConfigurationDaoImpl().getCourseUnitEvaluationActiveYear();
203
                    List<String> activeDegrees = DaoFactory.getConfigurationDaoImpl().getCourseUnitEvaluationActiveDegrees();
1040 jmachado 204
 
1312 jmachado 205
                    List<CourseUnit> evaluations = DaoFactory.getCourseUnitDaoImpl().loadTeacherUnitsMissingEvaluation(UserSession);
206
                    List<CourseUnit> programs = DaoFactory.getCourseUnitDaoImpl().loadMissingPrograms(UserSession.getUser().getId());
207
                    if(programs != null && programs.size() > 0 || evaluations!= null && evaluations.size() > 0)
208
                    {
209
            %>
1040 jmachado 210
 
211
 
212
 
1077 jmachado 213
 
1312 jmachado 214
            <div class="panel panel-primary">
215
                <div class="panel-heading">Tarefas Docente Relativas a Unidades (<%=activeYear%>)</div>
216
                <div class="panel-body">
217
                    <%
218
                        if(programs != null && programs.size() > 0)
219
                        {
220
                    %>
221
 
222
                    <div class="list-group">
223
                        <div class="list-group-item active">Fichas Curriculares por preencher</div>
1029 jmachado 224
                        <%
1312 jmachado 225
                            for(CourseUnit cu: programs)
226
                            {
227
                        %>
228
                        <div class="list-group-item"><a href="<%=request.getContextPath()%>/user/startLoadCourseUnitProgram.do?courseUnitId=<%=cu.getId()%>"><%=cu.getName()%>/<%=cu.getCode()%> (<%=cu.getCourseName() + "/" +cu.getCourseCode()%>)</a></div>
229
                        <%
230
                            }
231
                        %>
232
                    </div>
1070 jmachado 233
 
1312 jmachado 234
                    <%
235
                        }
236
                        if(evaluations != null && evaluations.size() > 0)
1024 jmachado 237
                        {
1312 jmachado 238
                    %>
239
                    <div class="list-group">
240
                        <div class="list-group-item active">Relatórios de avaliação por preencher/entregar
241
                        <%
242
                            if(activeDegrees != null)
243
                            {
244
                        %>
245
                        (graus em processo de validação:
246
                        <%
247
                            String sep = "";
248
                            for(String activeDegree: activeDegrees)
249
                            {
250
                        %>
251
                        <%=sep + MessageResources.getInstance(request).getMessage("course."+activeDegree)%>
252
                        <%
253
                                sep = ", ";
254
                            }
255
                        %>
256
                        )
257
                        <%
258
                            }
259
                        %>
260
 
261
                    </div>
262
 
263
                        <%
264
                            for(CourseUnit cu: evaluations)
265
                            {
266
                        %>
267
                        <div class="list-group-item"><a href="<%=request.getContextPath()%>/user/startLoadCourseUnitFromHome.do?id=<%=cu.getId()%>"><%=cu.getName()%>/<%=cu.getCode()%> (<%=cu.getCourseName() + "/" +cu.getCourseCode()%>)</a></div>
268
                        <%
269
                            }
270
                        %>
271
                    </div>
272
                    <%
1024 jmachado 273
                        }
274
                    %>
1312 jmachado 275
                </div>
276
            </div>
1024 jmachado 277
 
1312 jmachado 278
            <%
279
                    }
1024 jmachado 280
 
1312 jmachado 281
                    HibernateUtils.getCurrentSession().getTransaction().commit();
282
                }catch(Throwable e)
283
                {
284
                    System.out.println(e);
285
                    e.printStackTrace();
286
                }
287
            %>
1034 jmachado 288
 
1070 jmachado 289
 
1353 jmachado 290
 
1312 jmachado 291
    </div>
292
</div>
981 jmachado 293