Rev 1527 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
<%@ page import="jomm.dao.impl.AbstractDao" %>
<%@ page import="pt.estgp.estgweb.domain.CourseImpl" %>
<%@ page import="pt.estgp.estgweb.domain.dao.DaoFactory" %>
<%@ page import="pt.estgp.estgweb.domain.User" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %>
<%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %>
<jsp:useBean id="CourseForm" type="pt.estgp.estgweb.web.form.courses.CourseForm" scope="request"/>
<jsp:useBean id="UserSession" type="pt.estgp.estgweb.domain.UserSession" scope="request"/>
<jsp:useBean id="SEMESTRE" type="java.lang.String" scope="request"/>
<jsp:useBean id="courseView" type="pt.estgp.estgweb.domain.views.CourseView" scope="request"/>
<%
AbstractDao.getCurrentSession().beginTransaction();
CourseImpl cImpl = (CourseImpl) DaoFactory.getCourseDaoImpl().narrow(DaoFactory.getCourseDaoImpl().get(courseView.getId()));
boolean isFromCourseComission = cImpl.isFromCourseCommission(UserSession);
boolean isValidatorPrograms = UserSession.getUser().hasRole("courseValidatePrograms");
boolean canChangeValidations = isFromCourseComission || isValidatorPrograms;
request.setAttribute("canChangeValidations",canChangeValidations);
AbstractDao.getCurrentSession().getTransaction().commit();
boolean canChange = false;
%>
<div class="panel-body">
<%
if(courseView.isSeparatedUnits(CourseForm.getImportYear()))
{
%>
<div class="alert alert-info">
Este curso está configurado para <strong>separar</strong> as turmas em diferentes unidades
</div>
<%
}
%>
<!-- ++++++++++++++++++++++++++++++++++++++++++++ -->
<!-- CADEIRAS DO SEMESTRE 1 - SEM PROGRAMA -->
<!-- ++++++++++++++++++++++++++++++++++++++++++++ -->
<logic:equal value="true" name="courseView" property="hasCourseUnitsWithNoProgram${SEMESTRE}">
<logic:notEmpty name="courseView" property="courseUnitsWithNoProgram${SEMESTRE}">
<div class="panel panel-danger">
<div class="panel-heading"><bean:message key="course.units.no.program"/></div>
<div class="panel-body">
<script type="text/javascript" language="JavaScript">
//TABLE SORTER
$(document).ready(function()
{
$("#myTable${SEMESTRE}NP${courseView.id}").tablesorter();
}
);
</script>
<table id="myTable${SEMESTRE}NP${courseView.id}" class="tablesorter tablesorterfiltered">
<thead>
<tr>
<th>Código</th>
<th>Unidade</th>
<%
if(courseView.isSeparatedUnits(CourseForm.getImportYear()))
{
%>
<th>Turma</th>
<%
}
%>
<th>Docente</th>
<th class="filter-false" data-sorter="false">Ficha</th>
<th class="filter-false" data-sorter="false">Abrir Avaliação Extraordináriamente</th>
<th class="filter-false" data-sorter="false">Relatório</th>
</tr>
</thead>
<tbody>
<nested:iterate id="courseUnitView" property="courseUnitsWithNoProgram${SEMESTRE}" type="pt.estgp.estgweb.domain.views.CourseUnitView">
<tr>
<td style="text-align: right">${courseUnitView.code}</td>
<td><a href="<%=request.getContextPath()%>/user/startLoadCourseUnitFromHome.do?id=${courseUnitView.id}">${courseUnitView.name}</a></td>
<%
if(courseView.isSeparatedUnits(CourseForm.getImportYear()))
{
%>
<td>${courseUnitView.cdTurma}</td>
<%
}
%>
<td>${courseUnitView.teachersSnipet}</td>
<td class="icons">
<a class="btn btn-small" href="<%=request.getContextPath()%>/repositoryStream/${courseUnitView.programStreamId}"><span class="glyphicon glyphicon-file"></span></a>
<baco:isNotAdmin>
<logic:equal value="false" name="courseUnitView" property="validProgram">
<logic:equal value="${courseView.coordinator.id}" name="UserSession" property="user.id">
<html:link styleClass="btn btn-small" action="/user/startLoadCourseUnitProgram?courseUnitId=${courseUnitView.id}"><span class="glyphicon glyphicon-pencil"></span></html:link>
</logic:equal>
<logic:notEqual value="${courseView.coordinator.id}" name="UserSession" property="user.id">
<baco:hasRole role="${courseView.validationRole},courseValidatePrograms,servicesPrograms">
<html:link styleClass="btn btn-small" action="/user/startLoadCourseUnitProgram?courseUnitId=${courseUnitView.id}"><span class="glyphicon glyphicon-pencil"></span></html:link>
</baco:hasRole>
</logic:notEqual>
<logic:notEqual value="${courseView.coordinator.id}" name="UserSession" property="user.id">
<baco:isTeacherOfCourseUnit courseUnitId="${courseUnitView.id}">
<baco:hasNotRole role="${courseView.validationRole},courseValidatePrograms,servicesPrograms">
<html:link styleClass="btn btn-small" action="/user/startLoadCourseUnitProgram?courseUnitId=${courseUnitView.id}"><span class="glyphicon glyphicon-pencil"></span></html:link>
</baco:hasNotRole>
</baco:isTeacherOfCourseUnit>
</logic:notEqual>
</logic:equal>
</baco:isNotAdmin>
<baco:isAdmin>
<html:link styleClass="btn btn-small" action="/user/startLoadCourseUnitProgram?courseUnitId=${courseUnitView.id}"><span class="glyphicon glyphicon-pencil"></span></html:link>
</baco:isAdmin>
</td>
<td class="icons" style="text-align: center; vertical-align: middle">
<baco:hasRole role="${courseView.validationRole},courseValidatePrograms" >
<nested:checkbox styleClass="btn" property="evaluationOpenByAdmin"/>
</baco:hasRole>
</td>
<td class="icons">
<baco:isNotAdmin>
<baco:hasRole role="${courseView.validationRole},courseValidatePrograms,servicesPrograms">
<logic:equal value="true" name="courseUnitView" property="validEvaluation">
<a class="btn btn-small" href="<%=request.getContextPath()%>/repositoryStream/${courseUnitView.evaluationStreamId}"><span class="glyphicon glyphicon-check"></span></a>
</logic:equal>
<html:link styleClass="btn btn-small" action="/user/startLoadCourseUnitEvaluation.do?courseUnitId=${courseUnitView.id}"><span class="glyphicon glyphicon-pencil"></span></html:link>
</baco:hasRole>
<baco:hasNotRole role="${courseView.validationRole},courseValidatePrograms,servicesPrograms">
<baco:isTeacherOfCourseUnit courseUnitId="${courseUnitView.id}">
<logic:equal value="true" name="courseUnitView" property="validEvaluation">
<a class="btn btn-small" href="<%=request.getContextPath()%>/repositoryStream/${courseUnitView.evaluationStreamId}"><span class="glyphicon glyphicon-check"></span></a>
</logic:equal>
<html:link styleClass="btn btn-small" action="/user/startLoadCourseUnitEvaluation.do?courseUnitId=${courseUnitView.id}"><span class="glyphicon glyphicon-pencil"></span></html:link>
</baco:isTeacherOfCourseUnit>
</baco:hasNotRole>
</baco:isNotAdmin>
<baco:isAdmin>
<logic:equal value="true" name="courseUnitView" property="validEvaluation">
<a class="btn btn-small" href="<%=request.getContextPath()%>/repositoryStream/${courseUnitView.evaluationStreamId}"><span class="glyphicon glyphicon-check"></span></a>
</logic:equal>
<html:link styleClass="btn btn-small" action="/user/startLoadCourseUnitEvaluation.do?courseUnitId=${courseUnitView.id}"><span class="glyphicon glyphicon-pencil"></span></html:link>
</baco:isAdmin>
</td>
</tr>
</nested:iterate>
</tbody>
</table>
</div><!--panel body-->
</div><!--panel-->
</logic:notEmpty>
</logic:equal>
<!-- ++++++++++++++++++++++++++++++++++++++++++++++ -->
<!-- CADEIRAS DO SEMESTRE 1 - COM PROGRAMA INVALIDO -->
<!-- ++++++++++++++++++++++++++++++++++++++++++++++ -->
<logic:equal value="true" name="courseView" property="hasCourseUnitsWithProgramNotChecked${SEMESTRE}">
<logic:notEmpty name="courseView" property="courseUnitsWithProgramNotChecked${SEMESTRE}">
<%--<html:hidden property="courseUnitsWithProgramNotCheckedS1size"/>--%>
<div class="panel panel-warning">
<div class="panel-heading"><bean:message key="course.units.with.program.not.checked"/></div>
<div class="panel-body">
<script type="text/javascript" language="JavaScript">
//TABLE SORTER
$(document).ready(function()
{
$("#myTable${SEMESTRE}PI${courseView.id}").tablesorter();
}
);
</script>
<table id="myTable${SEMESTRE}PI${courseView.id}" class="dataTable tablesorter tablesorterfiltered">
<thead>
<tr>
<th>Código</th>
<th>Unidade</th>
<%
if(courseView.isSeparatedUnits(CourseForm.getImportYear()))
{
%>
<th>Turma</th>
<%
}
%>
<th>Docente</th>
<th class="filter-false" data-sorter="false">Validar Ficha</th>
<th class="filter-false" data-sorter="false">Ficha</th>
<th class="filter-false" data-sorter="false">Abrir Relatório de Avaliação (Procedimento Extraordinário)</th>
<th class="filter-false" data-sorter="false">Relatório</th>
</tr>
</thead>
<tbody>
<nested:iterate id="courseUnitView" property="courseUnitsWithProgramNotChecked${SEMESTRE}" type="pt.estgp.estgweb.domain.views.CourseUnitView">
<tr>
<%--<logic:notEqual value="${courseView.coordinator.id}" name="UserSession" property="user.id">--%>
<!--<td></td>-->
<%--</logic:notEqual>--%>
<%--<logic:equal value="${courseView.coordinator.id}" name="UserSession" property="user.id">--%>
<%--<%--%>
<!--// canChange=true;-->
<%--%>--%>
<!--<td><nested:hidden property="programStreamId"/>-->
<%--<nested:hidden property="id"/>--%>
<%--<nested:checkbox property="validProgram"/></td>--%>
<%--</logic:equal>--%>
<%--NOVO VALIDATION ROLE--%>
<%-- <baco:hasNotRole role="${courseView.validationRole},courseValidatePrograms" >
<td></td>
</baco:hasNotRole>
<baco:hasRole role="${courseView.validationRole},courseValidatePrograms" >
<%
canChange=true;
%>
<td><nested:hidden property="programStreamId"/>
<nested:hidden property="id"/>
<nested:checkbox property="validProgram"/></td>
</baco:hasRole>--%>
<td style="text-align: right">${courseUnitView.code}</td>
<td><a href="<%=request.getContextPath()%>/user/startLoadCourseUnitFromHome.do?id=${courseUnitView.id}">${courseUnitView.name}</a></td>
<%--<td>${courseUnitView.cdTurma}</td>--%>
<%
if(courseView.isSeparatedUnits(CourseForm.getImportYear()))
{
%>
<td>${courseUnitView.cdTurma}</td>
<%
}
%>
<td>${courseUnitView.teachersSnipet}</td>
<td class="icons" style="text-align: center; vertical-align: middle">
<logic:equal value="true" name="canChangeValidations">
<nested:hidden property="programStreamId"/>
<nested:hidden property="id"/>
<nested:checkbox styleClass="btn" property="validProgram"/>
</logic:equal>
</td>
<td class="icons">
<a class="btn btn-small" href="<%=request.getContextPath()%>/repositoryStream/${courseUnitView.programStreamId}"><span class="glyphicon glyphicon-file"></span></a>
<baco:isNotAdmin>
<logic:equal value="false" name="courseUnitView" property="validProgram">
<logic:equal value="${courseView.coordinator.id}" name="UserSession" property="user.id">
<html:link styleClass="btn btn-small" action="/user/startLoadCourseUnitProgram?courseUnitId=${courseUnitView.id}"><span class="glyphicon glyphicon-pencil"></span></html:link>
</logic:equal>
<logic:notEqual value="${courseView.coordinator.id}" name="UserSession" property="user.id">
<baco:hasRole role="${courseView.validationRole},courseValidatePrograms,servicesPrograms">
<html:link styleClass="btn btn-small" action="/user/startLoadCourseUnitProgram?courseUnitId=${courseUnitView.id}"><span class="glyphicon glyphicon-pencil"></span></html:link>
</baco:hasRole>
</logic:notEqual>
<logic:notEqual value="${courseView.coordinator.id}" name="UserSession" property="user.id">
<baco:isTeacherOfCourseUnit courseUnitId="${courseUnitView.id}">
<baco:hasNotRole role="${courseView.validationRole},courseValidatePrograms,servicesPrograms">
<html:link styleClass="btn btn-small" action="/user/startLoadCourseUnitProgram?courseUnitId=${courseUnitView.id}"><span class="glyphicon glyphicon-pencil"></span></html:link>
</baco:hasNotRole>
</baco:isTeacherOfCourseUnit>
</logic:notEqual>
</logic:equal>
</baco:isNotAdmin>
<baco:isAdmin>
<html:link styleClass="btn btn-small" action="/user/startLoadCourseUnitProgram?courseUnitId=${courseUnitView.id}"><span class="glyphicon glyphicon-pencil"></span></html:link>
</baco:isAdmin>
</td>
<td class="icons" style="text-align: center; vertical-align: middle">
<baco:hasRole role="${courseView.validationRole},courseValidatePrograms" >
<nested:checkbox styleClass="btn" property="evaluationOpenByAdmin"/>
</baco:hasRole>
</td>
<td class="icons">
<baco:isNotAdmin>
<baco:hasRole role="${courseView.validationRole},courseValidatePrograms,servicesPrograms">
<logic:equal value="true" name="courseUnitView" property="validEvaluation">
<a class="btn btn-small" href="<%=request.getContextPath()%>/repositoryStream/${courseUnitView.evaluationStreamId}"><span class="glyphicon glyphicon-check"></span></a>
</logic:equal>
<html:link styleClass="btn btn-small" action="/user/startLoadCourseUnitEvaluation.do?courseUnitId=${courseUnitView.id}"><span class="glyphicon glyphicon-pencil"></span></html:link>
</baco:hasRole>
<baco:hasNotRole role="${courseView.validationRole},courseValidatePrograms,servicesPrograms">
<baco:isTeacherOfCourseUnit courseUnitId="${courseUnitView.id}">
<logic:equal value="true" name="courseUnitView" property="validEvaluation">
<a class="btn btn-small" href="<%=request.getContextPath()%>/repositoryStream/${courseUnitView.evaluationStreamId}"><span class="glyphicon glyphicon-check"></span></a>
</logic:equal>
<html:link styleClass="btn btn-small" action="/user/startLoadCourseUnitEvaluation.do?courseUnitId=${courseUnitView.id}"><span class="glyphicon glyphicon-pencil"></span></html:link>
</baco:isTeacherOfCourseUnit>
</baco:hasNotRole>
</baco:isNotAdmin>
<baco:isAdmin>
<logic:equal value="true" name="courseUnitView" property="validEvaluation">
<a class="btn btn-small" href="<%=request.getContextPath()%>/repositoryStream/${courseUnitView.evaluationStreamId}"><span class="glyphicon glyphicon-check"></span></a>
</logic:equal>
<html:link styleClass="btn btn-small" action="/user/startLoadCourseUnitEvaluation.do?courseUnitId=${courseUnitView.id}"><span class="glyphicon glyphicon-pencil"></span></html:link>
</baco:isAdmin>
</td>
</tr>
</nested:iterate>
</tbody>
</table>
</div><!--panel body-->
</div><!--panel-->
</logic:notEmpty>
</logic:equal>
<!-- ++++++++++++++++++++++++++++++++++++++++++++ -->
<!-- CADEIRAS DO SEMESTRE 1 - COM PROGRAMA VALIDO -->
<!-- ++++++++++++++++++++++++++++++++++++++++++++ -->
<logic:equal value="true" name="courseView" property="hasCourseUnitsWithProgramChecked${SEMESTRE}">
<logic:notEmpty name="courseView" property="courseUnitsWithProgramChecked${SEMESTRE}">
<%--<html:hidden property="courseUnitsWithProgramCheckedS1size"/>--%>
<div class="panel panel-success">
<div class="panel-heading"><bean:message key="course.units.with.program.checked"/></div>
<div class="panel-body">
<script type="text/javascript" language="JavaScript">
//TABLE SORTER
$(document).ready(function()
{
$("#myTable${SEMESTRE}PV${courseView.id}").tablesorter();
}
);
</script>
<table id="myTable${SEMESTRE}PV${courseView.id}" class="dataTable tablesorter tablesorterfiltered">
<thead>
<tr>
<%--<td></td>--%>
<th>Código</th>
<th>Unidade</th>
<%
if(courseView.isSeparatedUnits(CourseForm.getImportYear()))
{
%>
<th>Turma</th>
<%
}
%>
<th>Docente</th>
<th class="filter-false" data-sorter="false">Validar Ficha</th>
<th class="filter-false" data-sorter="false">Ficha</th>
<th class="filter-false" data-sorter="false">Abrir Relatório de Avaliação (Procedimento Extraordinário)</th>
<th class="filter-false" data-sorter="false">Relatório</th>
</tr>
</thead>
<tbody>
<nested:iterate id="courseUnitView" property="courseUnitsWithProgramChecked${SEMESTRE}" type="pt.estgp.estgweb.domain.views.CourseUnitView">
<tr>
<%--<logic:notEqual value="${courseView.coordinator.id}" name="UserSession" property="user.id">--%>
<!--<td></td>-->
<%--</logic:notEqual>--%>
<%--<logic:equal value="${courseView.coordinator.id}" name="UserSession" property="user.id">--%>
<%--<%--%>
<!--// canChange=true;-->
<%--%>--%>
<!--<td><nested:hidden property="programStreamId"/>-->
<%--<nested:hidden property="id"/>--%>
<%--<nested:checkbox property="validProgram"/></td>--%>
<%--</logic:equal>--%>
<%--NOVO ROLE VALIDACAOO--%>
<%-- <baco:hasNotRole role="${courseView.validationRole},courseValidatePrograms" >
<td></td>
</baco:hasNotRole>
<baco:hasRole role="${courseView.validationRole},courseValidatePrograms" >
<%
canChange=true;
%>
<td><nested:hidden property="programStreamId"/>
<nested:hidden property="id"/>
<nested:checkbox property="validProgram"/></td>
</baco:hasRole>--%>
<td style="text-align: right">${courseUnitView.code}</td>
<td><a href="<%=request.getContextPath()%>/user/startLoadCourseUnitFromHome.do?id=${courseUnitView.id}">${courseUnitView.name}</a></td>
<%--<td>${courseUnitView.cdTurma}</td>--%>
<%
if(courseView.isSeparatedUnits(CourseForm.getImportYear()))
{
%>
<td>${courseUnitView.cdTurma}</td>
<%
}
%>
<td>${courseUnitView.teachersSnipet}</td>
<td class="icons" style="text-align: center; vertical-align: middle">
<logic:equal value="true" name="canChangeValidations">
<nested:hidden property="programStreamId"/>
<nested:hidden property="id"/>
<nested:checkbox styleClass="btn" property="validProgram"/>
</logic:equal>
</td>
<td class="icons">
<a class="btn btn-small" href="<%=request.getContextPath()%>/repositoryStream/${courseUnitView.programStreamId}"><span class="glyphicon glyphicon-file"></span></a>
<baco:isNotAdmin>
<logic:equal value="false" name="courseUnitView" property="validProgram">
<logic:equal value="${courseView.coordinator.id}" name="UserSession" property="user.id">
<html:link styleClass="btn btn-small" action="/user/startLoadCourseUnitProgram?courseUnitId=${courseUnitView.id}"><span class="glyphicon glyphicon-pencil"></span></html:link>
</logic:equal>
<logic:notEqual value="${courseView.coordinator.id}" name="UserSession" property="user.id">
<baco:hasRole role="${courseView.validationRole},courseValidatePrograms,servicesPrograms">
<html:link styleClass="btn btn-small" action="/user/startLoadCourseUnitProgram?courseUnitId=${courseUnitView.id}"><span class="glyphicon glyphicon-pencil"></span></html:link>
</baco:hasRole>
</logic:notEqual>
<logic:notEqual value="${courseView.coordinator.id}" name="UserSession" property="user.id">
<baco:isTeacherOfCourseUnit courseUnitId="${courseUnitView.id}">
<baco:hasNotRole role="${courseView.validationRole},courseValidatePrograms,servicesPrograms">
<html:link styleClass="btn btn-small" action="/user/startLoadCourseUnitProgram?courseUnitId=${courseUnitView.id}"><span class="glyphicon glyphicon-pencil"></span></html:link>
</baco:hasNotRole>
</baco:isTeacherOfCourseUnit>
</logic:notEqual>
</logic:equal>
</baco:isNotAdmin>
<baco:isAdmin>
<html:link styleClass="btn btn-small" action="/user/startLoadCourseUnitProgram?courseUnitId=${courseUnitView.id}"><span class="glyphicon glyphicon-pencil"></span></html:link>
</baco:isAdmin>
</td>
<td class="icons" style="text-align: center; vertical-align: middle">
<baco:hasRole role="${courseView.validationRole},courseValidatePrograms" >
<nested:checkbox styleClass="btn" property="evaluationOpenByAdmin"/>
</baco:hasRole>
</td>
<td class="icons">
<baco:isNotAdmin>
<baco:hasRole role="${courseView.validationRole},courseValidatePrograms,servicesPrograms">
<logic:equal value="true" name="courseUnitView" property="validEvaluation">
<a class="btn btn-small" href="<%=request.getContextPath()%>/repositoryStream/${courseUnitView.evaluationStreamId}"><span class="glyphicon glyphicon-check"></span></a>
</logic:equal>
<html:link styleClass="btn btn-small" action="/user/startLoadCourseUnitEvaluation.do?courseUnitId=${courseUnitView.id}"><span class="glyphicon glyphicon-pencil"></span></html:link>
</baco:hasRole>
<baco:hasNotRole role="${courseView.validationRole},courseValidatePrograms,servicesPrograms">
<baco:isTeacherOfCourseUnit courseUnitId="${courseUnitView.id}">
<logic:equal value="true" name="courseUnitView" property="validEvaluation">
<a class="btn btn-small" href="<%=request.getContextPath()%>/repositoryStream/${courseUnitView.evaluationStreamId}"><span class="glyphicon glyphicon-check"></span></a>
</logic:equal>
<html:link styleClass="btn btn-small" action="/user/startLoadCourseUnitEvaluation.do?courseUnitId=${courseUnitView.id}"><span class="glyphicon glyphicon-pencil"></span></html:link>
</baco:isTeacherOfCourseUnit>
</baco:hasNotRole>
</baco:isNotAdmin>
<baco:isAdmin>
<logic:equal value="true" name="courseUnitView" property="validEvaluation">
<a class="btn btn-small" href="<%=request.getContextPath()%>/repositoryStream/${courseUnitView.evaluationStreamId}"><span class="glyphicon glyphicon-check"></span></a>
</logic:equal>
<html:link styleClass="btn btn-small" action="/user/startLoadCourseUnitEvaluation.do?courseUnitId=${courseUnitView.id}"><span class="glyphicon glyphicon-pencil"></span></html:link>
</baco:isAdmin>
</td>
</tr>
</nested:iterate>
</tbody>
</table>
</div><!--panel body-->
</div><!--panel-->
</logic:notEmpty>
</logic:equal>
</div>
<logic:equal value="true" name="canChangeValidations">
<div class="panel-footer">
<input type="submit" class="btn btn-success" value="<bean:message key="confirm"/>">
</div>
</logic:equal>