Subversion Repositories bacoAlunos

Rev

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

Rev Author Line No. Line
1338 jmachado 1
<%@ page import="pt.estgp.estgweb.domain.views.UserView" %>
2
<%@ page import="java.util.List" %>
209 jmachado 3
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
4
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
5
<%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %>
6
<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
7
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
8
<%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %>
9
<%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %>
10
<%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %>
11
<jsp:useBean id="CourseUnitView" type="pt.estgp.estgweb.domain.views.CourseUnitView" scope="request"/>
215 jmachado 12
 
13
<%
1338 jmachado 14
    String turma = request.getParameter("filterTurma");
15
    if(turma == null && request.getAttribute("filterTurma")!=null)
16
        turma = (String) request.getAttribute("filterTurma");
17
 
215 jmachado 18
    String fromAction = "";
19
    String user = "";
20
    if (request.getParameter("from") != null)
21
    {
22
        user = "/user";
23
        fromAction = "From" + request.getParameter("from");
24
        if(request.getParameter("from").equals("CourseUnit"))
25
        {
26
            fromAction = "FromHome";
27
        }
28
    }
29
    request.setAttribute("user", user);
30
    request.setAttribute("fromAction", fromAction);
405 jmachado 31
 
32
    String orderBy = request.getParameter("order");
1338 jmachado 33
 
34
    List<UserView> students = null;
35
    if(turma != null)
36
    {
37
        if(orderBy != null && orderBy.equals("byNumber"))
38
            students = CourseUnitView.getStudentsTurmaOrderedByNumber(turma);
39
        else
40
            students = CourseUnitView.getStudentsTurmaOrderedByName(turma);
41
    }
405 jmachado 42
    else
1338 jmachado 43
    {
44
        if(orderBy != null && orderBy.equals("byNumber"))
45
            students = CourseUnitView.getStudentsOrderedByNumber();
46
        else
47
            students = CourseUnitView.getStudentsOrderedByName();
48
    }
49
 
50
    request.setAttribute("turma",turma);
51
    request.setAttribute("students",students);
52
    request.setAttribute("studentsSize",students.size());
53
 
54
 
215 jmachado 55
%>
1312 jmachado 56
<div class="panel panel-default">
57
    <div class="panel-body">
1338 jmachado 58
        <p>
59
            <logic:notEmpty name="turma">
60
                (${turma})
61
            </logic:notEmpty>
62
            <bean:message key="courseunit.students.count"/>: ${studentsSize}
63
        </p>
1315 jmachado 64
        <table id="myTable" class="tablesorterfiltered">
843 jmachado 65
            <thead>
209 jmachado 66
            <tr>
842 jmachado 67
                <%/*<th><html:link action="${user}/startLoadCourseUnitStudents${fromAction}?courseUnitView.id=${CourseUnitView.id}&order=byNumber"><bean:message key="number"/></html:link></th>
405 jmachado 68
                <th><html:link action="${user}/startLoadCourseUnitStudents${fromAction}?courseUnitView.id=${CourseUnitView.id}&order=byName"><bean:message key="name"/></html:link></th>
842 jmachado 69
                */%>
70
                <th><bean:message key="number"/></th>
71
                <th><bean:message key="name"/></th>
72
 
214 jmachado 73
                <th><bean:message key="user"/></th>
842 jmachado 74
 
214 jmachado 75
                <th><bean:message key="email"/></th>
844 jmachado 76
 
77
                <baco:hasRole role="teacher">
78
                    <th><bean:message key="phone.number"/></th>
1354 jmachado 79
                    <th>Notas</th>
844 jmachado 80
                </baco:hasRole>
81
 
1316 jmachado 82
                <th class="filter-name filter-select" data-placeholder="Todas">Turma</th>
209 jmachado 83
            </tr>
843 jmachado 84
            </thead>
85
            <tbody>
405 jmachado 86
            <logic:iterate id="student" name="students" type="pt.estgp.estgweb.domain.views.UserView">
214 jmachado 87
                <tr>
88
                    <td>
89
                            ${student.code}
90
                    </td>
91
                    <td>
1338 jmachado 92
                        <logic:notEmpty name="fromAction">
215 jmachado 93
                            <html:link action="${user}/startLoadStudentCourseUnit${fromAction}?code=${student.code}&courseUnitView.id=${CourseUnitView.id}">${student.name}</html:link>
1338 jmachado 94
                        </logic:notEmpty>
95
                        <logic:empty name="fromAction">
96
                            <html:link target="_blank" action="/user/startProfileFromHome.do?userView.id=${student.id}">${student.name}</html:link>
97
                        </logic:empty>
214 jmachado 98
                    </td>
99
                    <td>
100
                            ${student.username}
101
                    </td>
102
                    <td>
1338 jmachado 103
                        <logic:empty name="UserSession" property="user">
298 jmachado 104
                            ${student.safeEmail}
1338 jmachado 105
                        </logic:empty>
106
                        <logic:notEmpty name="UserSession" property="user">
107
                            ${student.email}
108
                        </logic:notEmpty>
214 jmachado 109
                    </td>
844 jmachado 110
                    <baco:hasRole role="teacher">
111
                        <td>${student.phonenumber} </td>
1354 jmachado 112
                        <td>
113
                            <a class="btn btn-default" href="#" data-href="<%=request.getContextPath()%>/public/profile/profileGradesAjax.jsp?userId=${student.id}" data-title="Notas do aluno ${student.name} (${student.code})" data-toggle="modal" data-target="#modalAjaxRequest">
114
                                Notas
115
                            </a>
116
                        </td>
117
 
844 jmachado 118
                    </baco:hasRole>
1315 jmachado 119
                    <td>
120
                        ${student.studentTurma}
121
                    </td>
214 jmachado 122
                </tr>
123
            </logic:iterate>
843 jmachado 124
            </tbody>
214 jmachado 125
        </table>
1366 jmachado 126
 
214 jmachado 127
    </div>
1341 jmachado 128
</div>
129
 
130
 
131
<%
132
    if(CourseUnitView.getStudentsWithoutTurma() != null && CourseUnitView.getStudentsWithoutTurma().size() > 0)
133
    {
134
        request.setAttribute("students",CourseUnitView.getStudentsWithoutTurma());
135
        request.setAttribute("studentsSize",CourseUnitView.getStudentsWithoutTurma().size());
136
%>
137
<h2>Estudantes MAL ATRIBUIDOS, SEM TURMA, contactar a administração do sistema informático</h2>
138
<div class="panel panel-default">
139
    <div class="panel-body">
140
        <p>
141
            <logic:notEmpty name="turma">
142
                (${turma})
143
            </logic:notEmpty>
144
            <bean:message key="courseunit.students.count"/>: ${studentsSize}
145
        </p>
146
        <table class="tablesorterfiltered">
147
            <thead>
148
            <tr>
149
                <%/*<th><html:link action="${user}/startLoadCourseUnitStudents${fromAction}?courseUnitView.id=${CourseUnitView.id}&order=byNumber"><bean:message key="number"/></html:link></th>
150
                <th><html:link action="${user}/startLoadCourseUnitStudents${fromAction}?courseUnitView.id=${CourseUnitView.id}&order=byName"><bean:message key="name"/></html:link></th>
151
                */%>
152
                <th><bean:message key="number"/></th>
153
                <th><bean:message key="name"/></th>
154
 
155
                <th><bean:message key="user"/></th>
156
 
157
                <th><bean:message key="email"/></th>
158
 
159
                <baco:hasRole role="teacher">
160
                    <th><bean:message key="phone.number"/></th>
161
                </baco:hasRole>
162
            </tr>
163
            </thead>
164
            <tbody>
165
            <logic:iterate id="student" name="students" type="pt.estgp.estgweb.domain.views.UserView">
166
                <tr>
167
                    <td>
168
                            ${student.code}
169
                    </td>
170
                    <td>
171
                        <logic:notEmpty name="fromAction">
172
                            <html:link action="${user}/startLoadStudentCourseUnit${fromAction}?code=${student.code}&courseUnitView.id=${CourseUnitView.id}">${student.name}</html:link>
173
                        </logic:notEmpty>
174
                        <logic:empty name="fromAction">
175
                            <html:link target="_blank" action="/user/startProfileFromHome.do?userView.id=${student.id}">${student.name}</html:link>
176
                        </logic:empty>
177
                    </td>
178
                    <td>
179
                            ${student.username}
180
                    </td>
181
                    <td>
182
                        <logic:empty name="UserSession" property="user">
183
                            ${student.safeEmail}
184
                        </logic:empty>
185
                        <logic:notEmpty name="UserSession" property="user">
186
                            ${student.email}
187
                        </logic:notEmpty>
188
                    </td>
189
                    <baco:hasRole role="teacher">
190
                        <td>${student.phonenumber} </td>
191
                    </baco:hasRole>
192
                </tr>
193
            </logic:iterate>
194
            </tbody>
195
        </table>
196
    </div>
197
</div>
198
<%
199
    }
200
%>