Subversion Repositories bacoAlunos

Rev

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

Rev Author Line No. Line
1337 jmachado 1
<%@ page import="jomm.dao.impl.AbstractDao" %>
2
<%@ page import="pt.estgp.estgweb.domain.dao.DaoFactory" %>
1346 jmachado 3
<%@ page import="pt.estgp.estgweb.web.UserSessionProxy" %>
4
<%@ page import="pt.estgp.estgweb.domain.*" %>
1337 jmachado 5
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
6
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
7
<%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %>
8
<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
9
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
10
<%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %>
11
<%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %>
12
<%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %>
1346 jmachado 13
 
1337 jmachado 14
<%
15
    long cursoAfetoId = Long.parseLong(request.getParameter("cursoAfetoId"));
16
    AbstractDao.getCurrentSession().beginTransaction();
17
    QuestionarioPedagogicoCursoAfeto cursoAfeto = DaoFactory.getQuestionarioPedagogicoCursoAfetoDaoImpl().load(cursoAfetoId);
18
    cursoAfeto = DaoFactory.getQuestionarioPedagogicoCursoAfetoDaoImpl().narrow(cursoAfeto);
19
    request.setAttribute("CursoAfeto",cursoAfeto);
1346 jmachado 20
    Questionario q = cursoAfeto.getQuestionario();
21
     q = DaoFactory.getQuestionarioDaoImpl().narrow(q);
22
    ((QuestionarioImpl)q).initClearances((UserSessionImpl) UserSessionProxy.loadUserSessionFromRequest(request),false);
23
    request.setAttribute("Questionario",q);
1337 jmachado 24
%>
1346 jmachado 25
<jsp:useBean id="Questionario" type="pt.estgp.estgweb.domain.QuestionarioImpl" scope="request"/>
1338 jmachado 26
<script>
27
    $(document).ready(
28
 
29
            function()
30
            {
31
                $("#cursoAfetoTable${CursoAfeto.id} .usarCheck").each(function()
32
                {
33
                    if($(this).prop("checked"))
34
                    {
35
                        $(this).closest("td").addClass("usarChecked");
36
                        $(this).closest("td").removeClass("usarNotChecked");
37
                    }
38
                    else
39
                    {
40
                        $(this).closest("td").removeClass("usarChecked");
41
                        $(this).closest("td").addClass("usarNotChecked");
42
                    }
43
                }
44
                );
45
                $("#cursoAfetoTable${CursoAfeto.id} .vistaCheck").each(function()
46
                {
47
                    if($(this).prop("checked"))
48
                    {
49
                        $(this).closest("td").addClass("vistaChecked");
50
                        $(this).closest("td").removeClass("vistaNotChecked");
51
                    }
52
                    else
53
                    {
54
                        $(this).closest("td").removeClass("vistaChecked");
55
                        $(this).closest("td").addClass("vistaNotChecked");
56
                    }
57
                });
1378 jmachado 58
                $("#cursoAfetoTable${CursoAfeto.id} .vistaCheckProfs").each(function()
59
                {
60
                    if($(this).prop("checked"))
61
                    {
62
                        $(this).closest("td").addClass("vistaChecked");
63
                        $(this).closest("td").removeClass("vistaNotChecked");
64
                    }
65
                    else
66
                    {
67
                        $(this).closest("td").removeClass("vistaChecked");
68
                        $(this).closest("td").addClass("vistaNotChecked");
69
                    }
70
                });
1338 jmachado 71
 
72
                $("#cursoAfetoTable${CursoAfeto.id} .usarCheck").on("change",function()
73
                {
74
                    if($(this).prop("checked"))
75
                    {
76
                        $(this).closest("td").addClass("usarChecked");
77
                        $(this).closest("td").removeClass("usarNotChecked");
78
                    }
79
                    else
80
                    {
81
                        $(this).closest("td").removeClass("usarChecked");
82
                        $(this).closest("td").addClass("usarNotChecked");
83
                    }
84
                });
85
 
86
                $("#cursoAfetoTable${CursoAfeto.id} .vistaCheck").on("change",function()
87
                {
88
                    if($(this).prop("checked"))
89
                    {
90
                        $(this).closest("td").addClass("vistaChecked");
91
                        $(this).closest("td").removeClass("vistaNotChecked");
92
                    }
93
                    else
94
                    {
95
                        $(this).closest("td").removeClass("vistaChecked");
96
                        $(this).closest("td").addClass("vistaNotChecked");
97
                    }
98
                });
1378 jmachado 99
 
100
                $("#cursoAfetoTable${CursoAfeto.id} .vistaCheckProfs").on("change",function()
101
                {
102
                    if($(this).prop("checked"))
103
                    {
104
                        $(this).closest("td").addClass("vistaChecked");
105
                        $(this).closest("td").removeClass("vistaNotChecked");
106
                    }
107
                    else
108
                    {
109
                        $(this).closest("td").removeClass("vistaChecked");
110
                        $(this).closest("td").addClass("vistaNotChecked");
111
                    }
112
                });
1338 jmachado 113
            }
114
    );
115
</script>
116
    <table id="cursoAfetoTable${CursoAfeto.id}" class="tablesorter-blue">
1337 jmachado 117
        <thead>
118
        <tr>
1338 jmachado 119
            <th></th>
1337 jmachado 120
            <th>Codigo</th>
121
            <th>Nome</th>
1338 jmachado 122
            <%--<th>Tipologias Manuais</th>--%>
1337 jmachado 123
            <th>Turmas</th>
124
            <th>Docentes</th>
1338 jmachado 125
            <th>Estudantes</th>
126
            <th>Alertas</th>
1341 jmachado 127
            <th>Docentes s/ sumario</th>
128
            <th>Turmas s/ sumario</th>
1338 jmachado 129
            <th>Usar</th>
1395 jmachado 130
            <th>Alunos OK</th>
131
            <th>Profs OK</th>
1338 jmachado 132
            <th>Obs.</th>
1394 jmachado 133
            <th data-toggle="tooltip" data-placement="top" title="Tipologias Requisitadas para Responder">TipReq</th>
134
            <th data-toggle="tooltip" data-placement="top" title="Respostas Requisitadas para Responder">RespReq</th>
1337 jmachado 135
        </tr>
136
        </thead>
137
        <tbody>
138
            <logic:iterate id="unidade" name="CursoAfeto" property="unidadesAfetas" type="pt.estgp.estgweb.domain.QuestionarioPedagogicoUnidadeCurricularAfetaImpl">
1338 jmachado 139
                 <tr id="unidadeAfetaRow${unidade.id}">
140
                     <td>
141
                         <script>
142
                             $(document).ready(
143
                                     function()
144
                                     {
145
                                         $('#tipologias${unidade.id}').on('shown.bs.collapse', function () {
146
                                             $("#tipologias${unidade.id}Button .glyphicon").removeClass("glyphicon-zoom-in").addClass("glyphicon-zoom-out");
147
                                         });
148
                                         $('#tipologias${unidade.id}').on('hidden.bs.collapse', function () {
149
                                             $("#tipologias${unidade.id}Button .glyphicon").removeClass("glyphicon-zoom-out").addClass("glyphicon-zoom-in");
150
                                         });
151
 
152
                                         $("#unidadeAfetaRow${unidade.id} .usarCheck").on("change",function(){
153
                                            var val =$(this).prop("checked") ? "true" : "false";
154
                                            var op = "usar";
155
                                            setUnidadeAfetaVar('${CursoAfeto.id}','${unidade.id}',op,val,$(this).closest("td"));
156
                                         });
157
                                         $("#unidadeAfetaRow${unidade.id} .vistaCheck").on("change",function()
158
                                         {
159
                                             var val =$(this).prop("checked") ? "true" : "false";
160
                                             var op = "vista";
161
                                             setUnidadeAfetaVar('${CursoAfeto.id}','${unidade.id}',op,val,$(this).closest("td"));
162
                                         });
1378 jmachado 163
                                         $("#unidadeAfetaRow${unidade.id} .vistaCheckProfs").on("change",function()
164
                                         {
165
                                             var val =$(this).prop("checked") ? "true" : "false";
166
                                             var op = "vistaProfs";
167
                                             setUnidadeAfetaVar('${CursoAfeto.id}','${unidade.id}',op,val,$(this).closest("td"));
168
                                         });
169
 
1338 jmachado 170
                                     }
171
 
172
                             );
173
                         </script>
174
                         <button id="tipologias${unidade.id}Button" class="btn btn-default btn-small" type="button" data-toggle="collapse" data-target="#tipologias${unidade.id}"><span class="glyphicon glyphicon-zoom-in"></span></button>
175
                         <script>
176
                             $(document).ready(
177
                                     function(){
1346 jmachado 178
                                         $.post("<%=request.getContextPath()%>/user/questionarios/pedagogicoEstudante/pedagogicoCourseCheckUnidadeAfeta.jsp?unidadeAfetaId=${unidade.id}", function(data) {
1338 jmachado 179
                                             $("#tipologias${unidade.id} .tipologias")
180
                                                     .html(data);
181
                                             evaluateTableSortersInside("#tipologias${unidade.id} .tipologias");
182
                                         });
183
                                     }
184
                             );
185
                         </script>
186
                     </td>
1337 jmachado 187
                    <td>${unidade.codigoUnidade}</td>
188
                    <td>
189
                        <html:link target="_blank"  action="/user/startLoadCourseUnitFromHome.do?id=${unidade.courseUnit.id}">
190
                            ${unidade.nome}
191
                        </html:link>
192
                    </td>
1338 jmachado 193
                   <%-- <td>${unidade.addedTipologias}</td>--%>
1337 jmachado 194
                    <td>
1346 jmachado 195
                        <a href="#" data-href="<%=request.getContextPath()%>/user/questionarios/pedagogicoEstudante/listCunitTurmas.jsp?courseUnitId=${unidade.courseUnit.id}" data-title="Turmas da Unidade ${unidade.nome} (${unidade.codigoUnidade}) do curso de ${CursoAfeto.nome} (${CursoAfeto.codigoCurso})" data-toggle="modal" data-target="#modalAjaxRequest">
1337 jmachado 196
                            ${unidade.turmas}
197
                        </a>
198
                    <td>
199
                        <a href="#" data-href="<%=request.getContextPath()%>/user/courseunits/teachersInfo.jsp?courseUnitId=${unidade.courseUnit.id}" data-title="Docentes da unidade de ${unidade.nome} (${unidade.codigoUnidade}) do curso de ${CursoAfeto.nome} (${CursoAfeto.codigoCurso})" data-toggle="modal" data-target="#modalAjaxRequest">
200
                            ${unidade.profs}
201
                        </a>
202
 
203
                    </td>
1338 jmachado 204
                     <td>
1341 jmachado 205
 
206
                         <%
207
                             CourseUnitImpl courseUnitImpl = (CourseUnitImpl) DaoFactory.getCourseUnitDaoImpl().narrow(unidade.getCourseUnit());
208
                             int students = courseUnitImpl.studentsSize();
209
                             int studentsTurmasSize = courseUnitImpl.studentsTurmaSize();
210
                             if(students != studentsTurmasSize)
211
                             {
212
                                 unidade.setMarked(true);
213
                                 if(unidade.getObs() != null && unidade.getObs().indexOf("Nº Estudantes")< 0)
214
                                    unidade.setObs("Nº Estudantes diferente Somatorio Estudantes das turmas");
215
                         %>
1338 jmachado 216
                         <a href="#" data-href="<%=request.getContextPath()%>/user/courseunits/listStudentsService.jsp?courseUnitView.id=${unidade.courseUnit.id}" data-title="Alunos da unidade de ${unidade.nome} (${unidade.codigoUnidade}) do curso de ${CursoAfeto.nome} (${CursoAfeto.codigoCurso})" data-toggle="modal" data-target="#modalAjaxRequest">
1341 jmachado 217
                         <%=students%>
1338 jmachado 218
                         </a>
1341 jmachado 219
                         !=
220
                         <a href="#" data-href="<%=request.getContextPath()%>/user/courseunits/listStudentsService.jsp?courseUnitView.id=${unidade.courseUnit.id}" data-title="Alunos da unidade de ${unidade.nome} (${unidade.codigoUnidade}) do curso de ${CursoAfeto.nome} (${CursoAfeto.codigoCurso})" data-toggle="modal" data-target="#modalAjaxRequest">
221
                                     <%=studentsTurmasSize%>
222
                         </a>
223
                         <span class="glyphicon glyphicon-alert"></span>
224
 
225
                         <%
226
                         }
227
                         else
228
                         {
229
                         %>
230
                         <a href="#" data-href="<%=request.getContextPath()%>/user/courseunits/listStudentsService.jsp?courseUnitView.id=${unidade.courseUnit.id}" data-title="Alunos da unidade de ${unidade.nome} (${unidade.codigoUnidade}) do curso de ${CursoAfeto.nome} (${CursoAfeto.codigoCurso})" data-toggle="modal" data-target="#modalAjaxRequest">
231
                             <%=students%>
232
                         </a>
233
                         <%
234
                             }
235
                         %>
236
 
1338 jmachado 237
                     </td>
1337 jmachado 238
                    <td>
239
                        <logic:equal value="true" name="unidade" property="marked">
240
                            <span class="glyphicon glyphicon-alert"></span>
241
                        </logic:equal>
242
                    </td>
243
                    <td>${unidade.profsWithoutTurma}</td>
244
                    <td>${unidade.turmaWithoutProf}</td>
245
                    <td>
1395 jmachado 246
                        <baco:clearOperation name="Questionario" op="QUESTIONARIO_CHANGE_ASSIGNEMENTS_USE_UNIT">
1346 jmachado 247
                            <html:checkbox styleClass="usarCheck" name="unidade" property="usar"/>
248
                        </baco:clearOperation>
1337 jmachado 249
                    </td>
1338 jmachado 250
                    <td>
1346 jmachado 251
                        <baco:clearOperation name="Questionario" op="QUESTIONARIO_CHANGE_ASSIGNEMENTS">
252
                            <html:checkbox styleClass="vistaCheck" name="unidade" property="vista"/>
253
                        </baco:clearOperation>
1378 jmachado 254
                        <baco:notClearOperation name="Questionario" op="QUESTIONARIO_CHANGE_ASSIGNEMENTS">
255
                            <html:checkbox disabled="true" styleClass="vistaCheck" name="unidade" property="vista"/>
256
                        </baco:notClearOperation>
1338 jmachado 257
                    </td>
1378 jmachado 258
                    <td>
259
                         <baco:clearOperation name="Questionario" op="QUESTIONARIO_CHANGE_ASSIGNEMENTS_CHECK_TEACHERS">
260
                             <html:checkbox styleClass="vistaCheckProfs" name="unidade" property="vistaProfs"/>
261
                         </baco:clearOperation>
262
                        <baco:notClearOperation name="Questionario" op="QUESTIONARIO_CHANGE_ASSIGNEMENTS_CHECK_TEACHERS">
263
                            <html:checkbox disabled="true" styleClass="vistaCheckProfs" name="unidade" property="vistaProfs"/>
264
                        </baco:notClearOperation>
265
                    </td>
1340 jmachado 266
                    <td id="editObsTd${unidade.id}" <%=unidade.getObs() != null && unidade.getObs().trim().length() > 0 ? "class=\"obsContent\"":""%>>
1346 jmachado 267
                         <button class="btn btn-warning btn-small" type="button" data-href="<%=request.getContextPath()%>/user/questionarios/pedagogicoEstudante/questionarioObsEdit.jsp?unidadeAfetaId=${unidade.id}&targetSetVarId=editObsTd${unidade.id}" data-title="Observações para a unidade ${unidade.nome} (${unidade.codigoUnidade}) do curso de ${CursoAfeto.nome} (${CursoAfeto.codigoCurso})" data-toggle="modal" data-target="#modalAjaxRequest"><span class="glyphicon glyphicon-pencil"></span></button>
1338 jmachado 268
                    </td>
1394 jmachado 269
                     <td><%=unidade.getStatTipologiasRequisitadas()%></td>
270
                     <td><%=unidade.getStatRespostasRequisitadas()%></td>
1337 jmachado 271
                </tr>
272
                <tr class="collapse" id="tipologias${unidade.id}">
1338 jmachado 273
                    <td></td>
1394 jmachado 274
                    <td colspan="12" class="tipologias" style="padding-left: 25px">
1337 jmachado 275
 
276
                        <div class="panel panel-default">
277
                            <div class="panel-body">
278
                                <p>Por favor aguarde um momento, o sistema está a carregar as tipologias <img src="<%=request.getContextPath()%>/imgs/wait.gif"/></p>
279
                            </div>
280
                        </div>
281
                    </td>
282
                </tr>
283
            <%
1341 jmachado 284
                    //DaoFactory.getQuestionarioPedagogicoUnidadeCurricularAfetaDaoImpl().evict(unidade);
1337 jmachado 285
            %>
286
            </logic:iterate>
287
        </tbody>
288
    </table>
289
 
290
<%
291
    DaoFactory.getQuestionarioPedagogicoCursoAfetoDaoImpl().evict(cursoAfeto);
292
    AbstractDao.getCurrentSession().getTransaction().commit();
293
%>