Subversion Repositories bacoAlunos

Rev

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

Rev Author Line No. Line
507 jmachado 1
<%@ page import="java.util.List" %>
2
<%@ page import="pt.estgp.estgweb.utils.ConfigProperties" %>
3
<%@ page import="pt.estgp.estgweb.Globals" %>
4
<%@ page import="java.util.ArrayList" %>
1283 jmachado 5
<%@ page import="pt.estgp.estgweb.web.filters.UserRoleProxy" %>
1505 jmachado 6
<%@ page import="jomm.dao.impl.AbstractDao" %>
7
<%@ page import="pt.estgp.estgweb.domain.dao.DaoFactory" %>
8
<%@ page import="pt.estgp.estgweb.domain.CourseDepartment" %>
214 jmachado 9
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
10
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
11
<%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %>
12
<%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %>
13
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
14
<%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %>
15
<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
16
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
17
<%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %>
18
<jsp:useBean id="CourseView" type="pt.estgp.estgweb.domain.views.CourseView" scope="request"/>
1133 jmachado 19
<script>
20
    function alertPermissions()
21
    {
1285 jmachado 22
        alert("Aviso a transmitir ao Centro Informático. Este procedimento afecta as permissões atuais no sistema de ficheiros da intranet. Após salvar estas alterações, por favor gere o BAT de geração de pastas e corra-o novamente na raiz do servidor IONLINE")
1133 jmachado 23
    }
24
    function alertFolders(place)
25
    {
1285 jmachado 26
        alert("Aviso a transmitir ao Centro Informático. Caro administrador, lembramos-lhe que alterar o " + place + " de uma unidade curricular implica trocar a pasta de ficheiros da intranet do " + place + " onde esta se encontrava para o " + place + " onde actualmente se encontra. O BACO irá actualizar a nova LOCALIZAÇÃO da pasta de ficheiros na sua base de dados. Mas a pasta terá de ser fisicamente alterada pela administração de sistemas.");
1133 jmachado 27
    }
28
 
29
</script>
444 jmachado 30
<html:errors/>
31
<jomm:messages/>
214 jmachado 32
<html:form action="/user/courseControllerFromServiceZone" enctype="multipart/form-data">
33
<input type="hidden" name="dispatch" value="submit"/>
34
<html:hidden property="courseView.id"/>
248 jmachado 35
<logic:present name="CourseView" property="htmlResult">
36
    <pre class="log">
37
        <bean:write name="CourseView" property="htmlResult"/>
38
    </pre>
39
</logic:present>
1133 jmachado 40
 
214 jmachado 41
<table class="form">
42
    <tr>
43
        <th>
44
            <bean:message key="course.code"/>
45
        </th>
46
        <td>
47
            <html:text property="courseView.code"/>
48
        </td>
49
    </tr>
50
    <tr>
51
        <th>
376 jmachado 52
            <bean:message key="course.area"/>
53
        </th>
54
 
55
        <td>
1505 jmachado 56
            <%
57
                AbstractDao.getCurrentSession().beginTransaction();
58
                List<CourseDepartment> departments = DaoFactory.getCourseDepartmentDaoImpl().findActives();
59
               request.setAttribute("departaments",departments);
60
            %>
376 jmachado 61
            <html:select property="courseView.area">
1505 jmachado 62
                <html:option value="">Nenhum</html:option>
63
                <logic:iterate id="area" name="departaments" type="pt.estgp.estgweb.domain.CourseDepartmentImpl">
64
 
65
                    <html:option value="${area.sigla}">${area.schoolFromInstitutionalCode} - ${area.name}</html:option>
376 jmachado 66
                </logic:iterate>
67
            </html:select>
1505 jmachado 68
            <%
69
                AbstractDao.getCurrentSession().getTransaction().commit();
70
            %>
376 jmachado 71
        </td>
72
    </tr>
73
    <tr>
74
        <th>
214 jmachado 75
            <bean:message key="name"/>
76
        </th>
77
        <td>
78
            <html:text property="courseView.name"/>
79
        </td>
80
    </tr>
81
    <tr>
82
        <th>
790 jmachado 83
            <bean:message key="status"/>
84
        </th>
85
        <td>
791 jmachado 86
            <html:select property="courseView.status">
797 jmachado 87
                <html:option value="true"><bean:message key="yes"/></html:option>
88
                <html:option value="false"><bean:message key="no"/></html:option>
790 jmachado 89
            </html:select>
90
        </td>
91
    </tr>
92
    <tr>
93
        <th>
214 jmachado 94
            <bean:message key="course.degree"/>
95
        </th>
96
        <td>
97
            <html:select property="courseView.degree">
249 jmachado 98
                <html:option value="B"><bean:message key="course.B"/></html:option>
99
                <html:option value="L"><bean:message key="course.L"/></html:option>
100
                <html:option value="M"><bean:message key="course.M"/></html:option>
101
                <html:option value="P"><bean:message key="course.P"/></html:option>
102
                <html:option value="E"><bean:message key="course.E"/></html:option>
417 jmachado 103
                <html:option value="A"><bean:message key="course.A"/></html:option>
104
                <html:option value="C"><bean:message key="course.C"/></html:option>
105
                <html:option value="O"><bean:message key="course.O"/></html:option>
896 jmachado 106
                <html:option value="T"><bean:message key="course.T"/></html:option>
214 jmachado 107
            </html:select>
1133 jmachado 108
            ** SIGES: <bean:write name="CourseForm" property="courseView.degree"/> - Qualquer erro de atrbuição informar imediatamente a equipa de desenvolvimento
214 jmachado 109
        </td>
110
    </tr>
1312 jmachado 111
    <logic:notEmpty name="CourseForm" property="courseView.courseYearViews">
112
        <tr>
113
            <th>
114
                Politica de Separação de Turmas
115
            </th>
116
            <td colspan="2">
117
 
118
                <table class="tablesorterfiltered">
119
                    <thead>
120
                        <tr>
121
                            <th>Ano Lectivo</th>
122
                            <th>Usar Turmas Separadas</th>
123
                            <th>Ultima alteração</th>
124
                        </tr>
125
                    </thead>
126
                    <tbody>
127
                    <nested:iterate id="cyv" property="courseView.courseYearViews" type="pt.estgp.estgweb.domain.views.CourseView.CourseYearView">
128
                        <tr>
129
                            <td>${cyv.importYear}</td>
130
                            <td><nested:hidden property="id"/>
131
                                <nested:checkbox property="separatedTurmas"/></td>
132
                            <td>${cyv.updateDate}</td>
133
                        </tr>
134
                    </nested:iterate>
135
                    </tbody>
136
                </table>
137
 
138
 
139
            </td>
140
        </tr>
141
    </logic:notEmpty>
214 jmachado 142
    <tr>
143
        <th>
144
            <bean:message key="course.importYear"/>
145
        </th>
146
        <td>
147
            <html:select property="courseView.importYear">
148
                <logic:iterate id="item" name="CourseForm" property="importYears">
149
                    <html:option value="${item}">${item}</html:option>
150
                </logic:iterate>
151
            </html:select>
152
        </td>
153
    </tr>
154
    <tr>
155
        <th>
156
            <bean:message key="course.institutionalCode"/>
157
        </th>
158
        <td>
1505 jmachado 159
            <!--Dependente do app.properties-->
160
            <html:select property="courseView.institutionalCode">
161
                <html:option value="1"><%=ConfigProperties.getProperty("institution.code.prefix.1")%></html:option>
162
                <html:option value="2"><%=ConfigProperties.getProperty("institution.code.prefix.2")%></html:option>
163
                <html:option value="3"><%=ConfigProperties.getProperty("institution.code.prefix.3")%></html:option>
164
                <html:option value="4"><%=ConfigProperties.getProperty("institution.code.prefix.4")%></html:option>
165
            </html:select>
166
 
214 jmachado 167
        </td>
168
    </tr>
901 jmachado 169
 
214 jmachado 170
    <tr>
171
        <th>
901 jmachado 172
            <bean:message key="course.userGroupStudents"/>
173
        </th>
174
        <td>
1133 jmachado 175
            <html:text onchange="alertPermissions()" property="courseView.userGroupStudents"/>
901 jmachado 176
        </td>
177
    </tr>
178
 
179
    <tr>
180
        <th>
214 jmachado 181
            <bean:message key="course.description"/>
182
        </th>
183
        <td>
184
            <html:textarea property="courseView.description"/>
185
        </td>
186
    </tr>
187
    <tr>
188
        <th>
189
            <bean:message key="course.coordinator"/>
190
        </th>
191
        <td>
1133 jmachado 192
            <html:select onchange="alertPermissions()"  property="courseView.coordinator.id">
214 jmachado 193
                <html:option value="0">
194
                    <bean:message key="none"/>
195
                </html:option>
196
                <logic:present name="CourseForm" property="teachers">
197
                    <logic:iterate id="teacher" name="CourseForm" property="teachers" type="pt.estgp.estgweb.domain.views.UserView">
198
                        <html:option value="${teacher.id}">
199
                            (${teacher.code}) ${teacher.name}
200
                        </html:option>
201
                    </logic:iterate>
202
                </logic:present>
203
            </html:select>
204
        </td>
205
    </tr>
206
    <tr>
207
        <th>
208
            <bean:message key="course.director"/>
209
        </th>
210
        <td>
1133 jmachado 211
            <html:select onchange="alertPermissions()"  property="courseView.director.id">
214 jmachado 212
                <html:option value="0">
213
                    <bean:message key="none"/>
214
                </html:option>
215
                <logic:present name="CourseForm" property="teachers">
216
                    <logic:iterate id="teacher" name="CourseForm" property="teachers" type="pt.estgp.estgweb.domain.views.UserView">
217
                        <html:option value="${teacher.id}">
218
                            (${teacher.code}) ${teacher.name}
219
                        </html:option>
220
                    </logic:iterate>
221
                </logic:present>
222
            </html:select>
223
        </td>
224
    </tr>
507 jmachado 225
 
226
 
227
 
228
 
229
 
214 jmachado 230
    <tr>
507 jmachado 231
        <th>
232
            <bean:message key="course.validation.role"/>
233
        </th>
234
        <%
235
 
236
            List<String> targetRoles = new ArrayList<String>();
1283 jmachado 237
            for(String role: UserRoleProxy.getUserRoles())
507 jmachado 238
            {
239
                if(role.startsWith("courseValidateProgram"))
240
                    targetRoles.add(role);
241
            }
242
            request.setAttribute("targetRoles",targetRoles);
243
        %>
249 jmachado 244
        <td>
1133 jmachado 245
            <html:select onchange="alertPermissions()" property="courseView.validationRole">
507 jmachado 246
                 <logic:iterate id="role" name="targetRoles">
247
                     <html:option value="${role}" key="user.role.${role}"/>
248
                </logic:iterate>
249
            </html:select>
250
        </td>
251
    </tr>
249 jmachado 252
 
507 jmachado 253
 
254
 
255
 
256
 
257
    <tr>
1133 jmachado 258
        <th>
249 jmachado 259
             <bean:message key="course.externalSite"/>
1133 jmachado 260
        </th>
249 jmachado 261
        <td>
262
            <html:select property="courseView.externalSiteServer">
263
                <html:option value="estgp">ESTG</html:option>
264
            </html:select>
265
            <html:text property="courseView.externalSitePath"/>
266
        </td>
267
    </tr>
268
    <tr>
214 jmachado 269
        <th>
270
            <bean:message key="course.studies.plan"/>
271
        </th>
272
        <td>
273
            <html:file property="studiesPlan"/>
274
            <logic:present name="CourseView" property="studiesPlan">
275
                <a href="<%=request.getContextPath()%>/repositoryStream/${CourseView.studiesPlanStreamId}"><bean:message key="course.studies.plan"/></a> (${CourseView.studiesPlanSizeKb} Kb - ${CourseView.studiesPlanDate})
276
            </logic:present>
277
            <logic:notPresent name="CourseView" property="studiesPlan">
278
                <bean:message key="course.studies.plan.not.available"/>
279
            </logic:notPresent>
280
        </td>
281
    </tr>
1505 jmachado 282
 
283
    <tr>
284
        <th>
285
            <bean:message key="course.studies.plan"/> (Versão nova PAE)
286
            <a class="btn btn-default" href="<%=request.getContextPath()%>/user/adminStudyPlans.do?courseId=<%=CourseView.getId()%>">Gerir Planos</a>
287
        </th>
288
        <td>
289
            <logic:present name="CourseView" property="courseStudiesPlans">
290
 
291
                <table class="tablesorterfiltered">
292
                    <thead>
293
                    <tr>
294
                        <th>Versão</th>
295
                        <th>Data Produção</th>
296
                        <th>Ultima alteração</th>
297
                        <th>Descrição</th>
298
                    </tr>
299
                    </thead>
300
                    <tbody>
301
                    <logic:iterate id="studyPlan" name="CourseView" property="courseStudiesPlans" type="pt.estgp.estgweb.domain.CourseStudiesPlan">
302
                        <tr>
303
                            <td>${studyPlan.version}</td>
304
                            <td>${studyPlan.saveDate}</td>
305
                            <td>${studyPlan.updateDate}</td>
306
                            <td>${studyPlan.versionDescription}</td>
307
                        </tr>
308
                    </logic:iterate>
309
                    </tbody>
310
                </table>
311
            </logic:present>
312
 
313
        </td>
314
    </tr>
214 jmachado 315
    <tr class="buttons">
316
        <td colspan="2">
317
            <input type="button"
318
                   onclick="set(this.form,'submit');this.form.submit()"
319
                   value="<bean:message key="confirm"/>"/>
320
        </td>
321
    </tr>
322
</table>
323
 
324
</html:form>