Subversion Repositories bacoAlunos

Compare Revisions

Ignore whitespace Rev 1327 → Rev 1328

/branches/v3/impl/conf/app.properties
811,11 → 811,13
questionario.p26=O acompanhamento do orientador interno ou do supervisor da Prática foi adequado.
questionario.p27=O local onde se realizou o Estágio ou o Projeto foi adequado
 
pt.estgp.estgweb.services.questionarios.PedagogicoAlunosProcessor.forward=afetacoes.pedagogico.alunos
pt.estgp.estgweb.domain.IAnswersProcessor.1=pt.estgp.estgweb.services.questionarios.PedagogicoAlunosProcessor
pt.estgp.estgweb.services.questionarios.PedagogicoAlunosProcessor.jsp=/admin/questionarios/pedagogicoEstudante/questionarioAdminPanel.jsp
pt.estgp.estgweb.services.questionarios.PedagogicoAlunosProcessor.title=Processador de Respostas para Questionários de Avaliação Pedagógica para Estudantes
 
#pt.estgp.estgweb.domain.IAnswersProcessor.2=pt.estgp.estgweb.services.questionarios.PedagogicoDocentesProcessor
pt.estgp.estgweb.services.questionarios.PedagogicoDocentesProcessor.jsp=/admin/questionarios/pedagogicoDocente/questionarioAdminPanel.jsp
pt.estgp.estgweb.services.questionarios.PedagogicoDocentesProcessor.title=Processador de Respostas para Questionários de Avaliação Pedagógica para Docentes
pt.estgp.estgweb.domain.IAnswersProcessor.1=pt.estgp.estgweb.services.questionarios.PedagogicoAlunosProcessor
#pt.estgp.estgweb.domain.IAnswersProcessor.2=pt.estgp.estgweb.services.questionarios.PedagogicoDocentesProcessor
 
#days until a certificate expire
certificates.expire.in.days=15
/branches/v3/impl/src/java/pt/estgp/estgweb/services/jobs/JobDeamon.java
25,7 → 25,7
{
try
{
logger.info("Jo bRunner: Waiking up");
logger.info("JobRunner: Waiking up");
AbstractDao.getCurrentSession().beginTransaction();
 
logger.info("JobRunner: Checking scheduler");
56,11 → 56,19
j.setExecuted(true);
DaoFactory.getJobDaoImpl().saveOrUpdate(j);
AbstractDao.getCurrentSession().flush();
try{
AbstractDao.getCurrentSession().getTransaction().commit();
}
catch(HibernateException e)
{
AbstractDao.getCurrentSession().getTransaction().rollback();
logger.error("Need to Rolling back " + e.toString(),e);
}
AbstractDao.getCurrentSession().beginTransaction();
AbstractDao.getCurrentSession().evict(j);
}
catch(Throwable e)
{
 
j.setExecuted(true);
DaoFactory.getJobDaoImpl().saveOrUpdate(j);
AbstractDao.getCurrentSession().flush();
147,6 → 155,8
 
public static JobServiceTaskImpl createServiceJob(Class targetService, User owner, Set<JobServiceTaskParameter> paramsJob, String description)
{
if(description==null || description.trim().length()==0)
description = targetService.getSimpleName();
logger.info("Schedulling one job " + targetService + " to run");
JobServiceTaskImpl jobServiceTask = DomainObjectFactory.createJobServiceTaskImpl();
jobServiceTask.setStartDate(new Date());
/branches/v3/impl/src/java/pt/estgp/estgweb/services/questionarios/pedagogico/UpdateCoursesAndUnitsJobService.java
1,7 → 1,10
package pt.estgp.estgweb.services.questionarios.pedagogico;
 
import org.apache.log4j.Logger;
import org.json.JSONArray;
import org.json.JSONException;
import pt.estgp.estgweb.domain.*;
import pt.estgp.estgweb.domain.dao.DaoFactory;
import pt.estgp.estgweb.services.jobs.JobDeamon;
import pt.estgp.estgweb.services.jobs.ServiceJob;
import pt.estgp.estgweb.services.logresults.ILogMessages;
12,12 → 15,39
import java.util.HashSet;
import java.util.Set;
 
 
/**
* Created by jorgemachado on 22/03/16.
*/
public class UpdateCoursesAndUnitsJobService extends ServiceJob implements IService
{
 
public static final Logger logger = Logger.getLogger(UpdateCoursesAndUnitsJobService.class);
 
public String[] deserializeCoursesList(QuestionarioImpl questionario)
{
JobServiceTaskImpl job = questionario.getCourseSelectionTaskId() > 0 ?
(JobServiceTaskImpl) DaoFactory.getJobServiceTaskDaoImpl().load(questionario.getCourseSelectionTaskId()) :
null;
if(job == null)
return new String[0];
 
String courses = job.getParameter(ServiceJob.JOB_questionario_courseList_KEY).getObject();
 
try {
 
JSONArray jsonArray = new JSONArray(courses);
String[] coursesList = new String[jsonArray.length()];
for(int i=0;i <jsonArray.length();i++)
{
coursesList[i] = ""+ jsonArray.get(i);
}
return coursesList;
} catch (JSONException e) {
logger.error(e,e);
}
return new String[0];
}
//todo falta validar as clearances
//todo falta meter a tarefa no Questionario
public QuestionarioImpl runJobSelectCourses(long questionarioId,String[] coursesList,UserSession session,QuestionarioImpl questionarioCleared) throws NotAuthorizedException {
56,6 → 86,20
@Override
protected ILogMessages runJobServiceTask() throws Throwable {
System.out.println("RUNNING DEMO");
long total = 60000;
long start = System.currentTimeMillis();
//Thread.sleep(20000);
while(true)
{
Thread.sleep(5000);
long elapsed = System.currentTimeMillis() - start;
setProgress((int) (((float)elapsed)/((float)total)*100.0f));
commitPartially();
if(System.currentTimeMillis() - start > total)
break;
}
setProgress(100);
 
return new DefaultLogMessages();
}
}
/branches/v3/impl/src/java/pt/estgp/estgweb/services/questionarios/PedagogicoAlunosProcessor.java
1,6 → 1,8
package pt.estgp.estgweb.services.questionarios;
 
import pt.estgp.estgweb.domain.IAnswersProcessor;
import pt.estgp.estgweb.domain.QuestionarioImpl;
import pt.estgp.estgweb.services.questionarios.pedagogico.UpdateCoursesAndUnitsJobService;
import pt.estgp.estgweb.utils.ConfigProperties;
 
/**
10,7 → 12,7
{
 
static String title = ConfigProperties.getProperty("pt.estgp.estgweb.services.questionarios.PedagogicoAlunosProcessor.title");
static String forward = ConfigProperties.getProperty("pt.estgp.estgweb.services.questionarios.PedagogicoAlunosProcessor.forward");
static String jsp = ConfigProperties.getProperty("pt.estgp.estgweb.services.questionarios.PedagogicoAlunosProcessor.jsp");
 
@Override
public String getHistoryDriveConstraint() {
25,6 → 27,12
@Override
public String getAfetacoesManagementForward()
{
return forward;
return jsp;
}
 
@Override
public void initQuestionarioAfetacoesVariables(QuestionarioImpl questionario)
{
questionario.setAfetacoesVarCoursesSelectionForJob(new UpdateCoursesAndUnitsJobService().deserializeCoursesList(questionario));
}
}
/branches/v3/impl/src/java/pt/estgp/estgweb/services/questionarios/QuestionariosService.java
89,15 → 89,16
questionarioCleared.getDescription();//to load proxy just in case
if(questionarioCleared.getQuestionarioHistoryDrive() != null)
questionarioCleared.getQuestionarioHistoryDrive().getCodeName();
IAnswersProcessor processor = questionarioCleared.getiAnswersProcessorClass();
processor.initQuestionarioAfetacoesVariables(questionarioCleared);
return questionarioCleared;
}
 
private void loadInit(List<QuestionarioImpl> questionarioCleared)
{
for(QuestionarioImpl q: questionarioCleared)
{
q.getDescription();//to load proxy just in case
if(q.getQuestionarioHistoryDrive() != null)
q.getQuestionarioHistoryDrive().getCodeName();
loadInit(q);
}
}
 
/branches/v3/impl/src/java/pt/estgp/estgweb/domain/IAnswersProcessor.java
8,4 → 8,6
public String getHistoryDriveConstraint();
public String getTitle();
public String getAfetacoesManagementForward();
 
public void initQuestionarioAfetacoesVariables(QuestionarioImpl questionario);
}
/branches/v3/impl/src/java/pt/estgp/estgweb/domain/JobServiceTaskImpl.java
97,4 → 97,14
return "";
return pt.estgp.estgweb.web.utils.DatesUtils.getStringFromDateWithMinutesAndSeconds(getServiceStartDate());
}
 
public JobServiceTaskParameter getParameter(String name)
{
if(getServiceTaskParameters() != null)
for(JobServiceTaskParameter param: getServiceTaskParameters())
if(param.getName().equals(name))
return param;
return null;
}
 
}
/branches/v3/impl/src/java/pt/estgp/estgweb/domain/QuestionarioImpl.java
151,6 → 151,11
public String getAfetacoesManagementForward() {
return null;
}
 
@Override
public void initQuestionarioAfetacoesVariables(QuestionarioImpl questionario) {
 
}
};
}
 
288,4 → 293,24
return null;
}
}
 
 
 
 
String[] afetacoesVarCoursesSelectionForJob;
 
/**
* Variaveis especificas do modulo do pedagogico
* ver o PedagogicoAlunosProcessor que implementa o IAnswersProcessor
* que as inicia
*
* @return lista de cursos ids no BACO selecionados na tarefa
*/
public String[] getAfetacoesVarCoursesSelectionForJob() {
return afetacoesVarCoursesSelectionForJob;
}
 
public void setAfetacoesVarCoursesSelectionForJob(String[] afetacoesVarCoursesSelectionForJob) {
this.afetacoesVarCoursesSelectionForJob = afetacoesVarCoursesSelectionForJob;
}
}
/branches/v3/impl/src/java/pt/estgp/estgweb/web/controllers/questionarios/QuestionarioCourseSelectionController.java
46,8 → 46,7
frm.setQuestionario(q);
 
addMessage(request,"questionarios.courses.start");
 
return mapping.findForward("admin");
return mapping.findForward("coursesSelection");
}
 
 
/branches/v3/impl/src/web/admin/questionarios/questionarioStateASSIGNATION_DETAILS.jsp
11,101 → 11,14
<%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %>
<jsp:useBean id="Questionario" type="pt.estgp.estgweb.domain.QuestionarioImpl" scope="request"/>
 
<jsp:include page="${Questionario.iAnswersProcessorClass.afetacoesManagementForward}"/>
 
<logic:empty name="Questionario" property="year">
<script>
$(document).ready(
function(){
$("#yearSemestreForm").show();
}
);
</script>
</logic:empty>
<logic:notEmpty name="Questionario" property="year">
<div class="col-md-3 col-sm-3" id="yearSemestreInfo">
<div class="list-group">
<div class="list-group-item">
<bean:message key="survey.list.form.year"/>: ${Questionario.year}
</div>
<div class="list-group-item">
Semestre: ${Questionario.semestre}
</div>
</div>
<baco:clearOperation name="Questionario" op="QUESTIONARIO_SET_ANO_SEMESTRE">
<button class="btn btn-default" type="button" onclick="$('#yearSemestreForm').show();$('#yearSemestreInfo').hide()">Modificar</button>
</baco:clearOperation>
</div>
</logic:notEmpty>
 
<baco:clearOperation name="Questionario" op="QUESTIONARIO_SET_ANO_SEMESTRE">
<div class="col-md-6" style="display: none" id="yearSemestreForm">
<div class="panel panel-default">
<div class="panel-body">
 
<html:form styleClass="form-horizontal" action="/admin/questionariosPaeYearSemestre">
<%
QuestionarioForm qFr = (QuestionarioForm) request.getAttribute("QuestionarioForm");
if(qFr.getQuestionario().getId() <= 0)
qFr.setQuestionario(Questionario);
%>
<input type="hidden" name="dispatch" value="setYearSemestre"/>
<html:hidden property="questionario.id"/>
<div class="form-group">
<label class="control-label col-sm-2" for="year"><bean:message key="survey.list.form.year"/></label>
<div class="col-sm-10">
<%
List<String> years = DatesUtils.getImportYears(10);
%>
<html:select styleClass="form-control" styleId="year" property="questionario.year">
<html:option value="">Escolha Ano</html:option>
<%
for(String year:years)
{
request.setAttribute("year",year);
%>
<html:option value="${year}">${year}</html:option>
<%
}
%>
</html:select>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="semestre">Semestre:</label>
<div class="col-sm-10">
<html:select styleClass="form-control" styleId="semestre" property="questionario.semestre">
<html:option value="">Escolha semestre</html:option>
<html:option value="A">Anual</html:option>
<html:option value="S1">Semestre 1</html:option>
<html:option value="S2">Semestre 2</html:option>
<html:option value="T1">Trimestre 1</html:option>
<html:option value="T2">Trimestre 2</html:option>
<html:option value="T3">Trimestre 3</html:option>
<html:option value="T4">Trimestre 4</html:option>
</html:select>
</div>
</div>
<button class="btn btn-default" type="button" onclick="this.form.action = this.form.action + '#NOWTASK';this.form.submit();"><bean:message key="confirm"/></button>
</html:form>
</div>
</div>
</div>
</baco:clearOperation>
 
<logic:notEmpty name="Questionario" property="year">
<logic:notEmpty name="Questionario" property="semestre">
<div class="col-md-3 col-sm-3">
<html:link styleClass="btn btn-warning" action="/admin/questionarioPedagogicoStartChooseCourses?questionarioId=${Questionario.id}">
Iniciar selecção de Cursos
</html:link>
</div>
</logic:notEmpty>
</logic:notEmpty>
 
 
 
 
 
 
 
 
/branches/v3/impl/src/web/admin/questionarios/pedagogicoEstudante/pedagogicoEstudanteCoursesSelection.jsp
8,6 → 8,9
<%@ page import="java.util.List" %>
<%@ page import="pt.estgp.estgweb.web.form.configuration.SchedulleTasksForm" %>
<%@ page import="pt.estgp.estgweb.domain.*" %>
<%@ page import="pt.estgp.estgweb.services.jobs.ServiceJob" %>
<%@ page import="pt.estgp.estgweb.services.questionarios.pedagogico.UpdateCoursesAndUnitsJobService" %>
<%@ page import="pt.estgp.estgweb.web.form.questionarios.QuestionarioForm" %>
<%@ 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-nested.tld" prefix="nested" %>
23,24 → 26,63
Object[] args = {questionarioId};
QuestionarioImpl questionario = (QuestionarioImpl) sm.execute(RequestUtils.getRequester(request, response),"loadQuestionarioAdmin",args,names);
 
 
request.setAttribute("Questionario", questionario);
 
 
 
AbstractDao.getCurrentSession().beginTransaction();
JobServiceTaskImpl job = questionario.getCourseSelectionTaskId() > 0 ?
(JobServiceTaskImpl) DaoFactory.getJobServiceTaskDaoImpl().load(questionario.getCourseSelectionTaskId()) :
null;
request.setAttribute("Job", job);
 
List<String> institutionCodes = ConfigProperties.getListValues("questionario.instituition.");
 
%>
 
 
 
<link href="https://gitcdn.github.io/bootstrap-toggle/2.2.2/css/bootstrap-toggle.min.css" rel="stylesheet">
<script src="https://gitcdn.github.io/bootstrap-toggle/2.2.2/js/bootstrap-toggle.min.js"></script>
<html:form action="/admin/questionariosPaeSelectCourses">
<jsp:useBean id="QuestionarioForm" type="pt.estgp.estgweb.web.form.questionarios.QuestionarioForm" scope="request"/>
<%
//Variavel iniciada no serviço de load por chamada do IAnswerProcessor respectivo para inicializar
//as variaveis especificas
QuestionarioForm.setCoursesSelectedIds(questionario.getAfetacoesVarCoursesSelectionForJob());
%>
<div class="container-fluid">
<script>
$(document).ready(
function()
{
<baco:clearOperation name="Questionario" op="QUESTIONARIO_SCHEDULLE_SELECT_COURSES">
$(".courseCheck").attr("data-toogle","toggle")
 
$('.courseCheck').bootstrapToggle({
on: 'Sim',
off: 'Não'
});
$('.checkAll').bootstrapToggle({
on: 'Sim',
off: 'Não'
});
</baco:clearOperation>
<baco:notClearOperation name="Questionario" op="QUESTIONARIO_SCHEDULLE_SELECT_COURSES">
$('.courseCheck').bootstrapToggle('disable');
$('.checkAll').bootstrapToggle('disable');
</baco:notClearOperation>
 
}
 
);
 
function selectAll(code,source)
{
$('#institution' + code).find('.courseCheck').each(
function()
{
this.checked = $(source).prop('checked');
$(this).bootstrapToggle('on');
});
}
</script>
53,187 → 95,203
<html:errors/>
<jomm:messages/>
 
<ul class="nav nav-tabs">
<%
for(String institutionCode: institutionCodes)
{
String institutionName = ConfigProperties.getProperty("institution.code." + institutionCode);
%>
<li id="institutionsSeparators<%=institutionCode%>"><a href="javascript:showInstitutionCode('<%=institutionCode%>')"><%=institutionName%></a></li>
<%
}
%>
<li id="institutionsSeparatorsGerarFinal"><a href="javascript:showInstitutionCode('GerarFinal')"><strong><u>Confirmar</u></strong></a></li>
</ul>
<script>
$(document).ready(
function(){
showInstitutionCode('<%=institutionCodes.get(0)%>');
}
);
<div class="baco-please-wait">
 
</div>
<div class="baco-please-wait-target">
 
function showInstitutionCode(institutionCode)
{
<ul class="nav nav-tabs">
<li id="institutionsSeparatorsGerarFinal"><a href="javascript:showInstitutionCode('GerarFinal')"><strong><u>Operações</u></strong></a></li>
<%
for(String institutionCode: institutionCodes)
{
%>
if(institutionCode == '<%=institutionCode%>')
for(String institutionCode: institutionCodes)
{
$("#institution<%=institutionCode%>").show();
$("#institutionsSeparators<%=institutionCode%>").addClass("active");
}
else
{
$("#institution<%=institutionCode%>").hide();
$("#institutionsSeparators<%=institutionCode%>").removeClass("active");
}
<%
}
String institutionName = ConfigProperties.getProperty("institution.code." + institutionCode);
%>
if(institutionCode == 'GerarFinal')
{
$("#institutionGerarFinal").show();
$("#institutionsSeparatorsGerarFinal").addClass("active");
}
else
{
$("#institutionGerarFinal").hide();
$("#institutionsSeparatorsGerarFinal").removeClass("active");
}
}
</script>
 
<%
for(String institutionCode: institutionCodes)
{
String institutionName = ConfigProperties.getProperty("institution.code." + institutionCode);
List<Course> courses = DaoFactory.getCourseDaoImpl().findCoursesWithUnitsIn(questionario.getYear(),institutionCode,questionario.getSemestre());
%>
<div class="panel panel-default" id="institution<%=institutionCode%>">
<div class="panel-heading">
Cursos da <%=institutionName%>
</div>
<div class="panel-body">
<table class="tablesorterfiltered">
<thead>
<tr>
<th>Codigo</th>
<th>Tipo de Curso</th>
<th>Curso</th>
<th>Papel Comissão Curso</th>
<th>Unidades</th>
<th>Turmas</th>
<th class="filter-false" data-sorter="false">
<input type="checkbox" onchange="selectAll('<%=institutionCode%>',this)">
</th>
</tr>
</thead>
<tbody>
<li id="institutionsSeparators<%=institutionCode%>"><a href="javascript:showInstitutionCode('<%=institutionCode%>')"><%=institutionName%></a></li>
<%
for(Course course: courses)
{
int unitsSize=DaoFactory.getCourseDaoImpl().countCoursesUnits(questionario.getYear(), course.getId());
int turmasSize = DaoFactory.getCourseDaoImpl().countCoursesUnitsTurmas(questionario.getYear(), course.getId());
CourseView cv = new CourseView(course);
request.setAttribute("CourseView",cv);
%>
<tr>
<td>${CourseView.code}</td>
<td><bean:message key="course.${CourseView.degreeCleanCode}"/></td>
<td>${CourseView.name}</td>
<td>
<logic:notEmpty name="CourseView" property="validationRole">
<bean:message key="user.role.${CourseView.validationRole}"/>
</logic:notEmpty>
<logic:empty name="CourseView" property="validationRole">
Papel não atribuido (Corrigir Situação)
</logic:empty>
</td>
<td>
<a href="#" data-href="<%=request.getContextPath()%>/admin/questionarios/pedagogicoEstudante/listCourseUnits.jsp?importYear=${CourseView.importYear}&courseId=${CourseView.id}" data-title="Unidades do Curso de ${CourseView.name} (${CourseView.code})" data-toggle="modal" data-target="#modalAjaxRequest">
<%=unitsSize%>
</a>
</td>
<td>
<a href="#" data-href="<%=request.getContextPath()%>/admin/questionarios/pedagogicoEstudante/listCourseUnitsTurmas.jsp?importYear=${CourseView.importYear}&courseId=${CourseView.id}" data-title="Turmas do Curso de ${CourseView.name} (${CourseView.code})" data-toggle="modal" data-target="#modalAjaxRequest">
<%=turmasSize%>
</a>
</td>
<td>
<html:multibox property="coursesSelectedIds" value="${CourseView.id}" styleClass="courseCheck"/>
</td>
</tr>
<%
}
%>
</tbody>
</table>
</div>
</div>
<%
}
%>
 
</ul>
<script>
$(document).ready(
function(){
showInstitutionCode('GerarFinal');
}
);
 
<div class="panel panel-default" id="institutionGerarFinal">
<div class="panel-heading">
Atribuição de Cursos e Unidades ao Questionário
</div>
<div class="panel-body">
<baco:clearOperation name="Questionario" op="QUESTIONARIO_SCHEDULLE_SELECT_COURSES">
<div class="alert alert-warning">Esta operação vai associar todos os cursos seleccionados e respectivas unidades curriculares
ao questionário ${Questionario.id} criado para o periodo ${Questionario.semestre} de ${Questionario.year}</div>
<div class="alert alert-info alert-small">Esta operação poderá ser revertida ou então repetida para atualizar os cursos alvo do questionário</div>
<div class="alert alert-info alert-small">Esta operação poderá demorar alguns instantes</div>
<html:hidden property="questionario.id" value="${Questionario.id}"/>
<input type="hidden" name="questionarioId" value="${Questionario.id}"/>
<input type="hidden" name="dispatch" value="selectCourses"/>
<button class="btn btn-warning btn-lg" type="button" onclick="this.form.submit()">Associar Cursos e Unidades Curriculares</button>
 
</baco:clearOperation>
<baco:notClearOperation name="Questionario" op="QUESTIONARIO_SCHEDULLE_SELECT_COURSES">
 
<baco:notClearOperation name="Questionario" op="QUESTIONARIO_SCHEDULLE_SEE_SELECT_COURSES">
<div class="alert alert-warning">Não têm autorização para ver esta secção</div>
</baco:notClearOperation>
 
</baco:notClearOperation>
<baco:clearOperation name="Questionario" op="QUESTIONARIO_SCHEDULLE_SEE_SELECT_COURSES">
<div class="alert alert-warning">O sistema agendou a atribuição de cursos e unidades ao questionário ${Questionario.id} criado para o periodo ${Questionario.semestre} de ${Questionario.year}. Veja o progresso em baixo, caso não termine no final de 30 minutos esta tarefa ficará de novo disponivel</div>
function showInstitutionCode(institutionCode)
{
<%
if(questionario.getCourseSelectionTaskId() > 0)
for(String institutionCode: institutionCodes)
{
%>
if(institutionCode == '<%=institutionCode%>')
{
JobServiceTask job = DaoFactory.getJobServiceTaskDaoImpl().load(questionario.getCourseSelectionTaskId());
SchedulleTasksForm schedulleTasksForm = new SchedulleTasksForm();
schedulleTasksForm.setJobServiceTask((JobServiceTaskImpl) job);
schedulleTasksForm.setId(job.getId());
request.setAttribute("SchedulleTasksForm",schedulleTasksForm);
%>
<div>
<jsp:include page="/admin/configuration/taskLog.jsp"/>
</div>
$("#institution<%=institutionCode%>").show();
$("#institutionsSeparators<%=institutionCode%>").addClass("active");
}
else
{
$("#institution<%=institutionCode%>").hide();
$("#institutionsSeparators<%=institutionCode%>").removeClass("active");
}
<%
}
%>
if(institutionCode == 'GerarFinal')
{
$("#institutionGerarFinal").show();
$("#institutionsSeparatorsGerarFinal").addClass("active");
}
else
{
$("#institutionGerarFinal").hide();
$("#institutionsSeparatorsGerarFinal").removeClass("active");
}
}
</script>
 
<%
for(String institutionCode: institutionCodes)
{
String institutionName = ConfigProperties.getProperty("institution.code." + institutionCode);
List<Course> courses = DaoFactory.getCourseDaoImpl().findCoursesWithUnitsIn(questionario.getYear(),institutionCode,questionario.getSemestre());
%>
<div class="panel panel-default" id="institution<%=institutionCode%>" style="display: none">
<div class="panel-heading">
Cursos da <%=institutionName%>
</div>
<div class="panel-body">
<table class="tablesorterfiltered">
<thead>
<tr>
<th>Codigo</th>
<th>Tipo de Curso</th>
<th>Curso</th>
<th>Papel Comissão Curso</th>
<th>Unidades</th>
<th>Turmas</th>
<th class="filter-false" data-sorter="false">
<input class="checkAll" type="checkbox" onchange="selectAll('<%=institutionCode%>',this)">
</th>
</tr>
</thead>
<tbody>
<%
for(Course course: courses)
{
int unitsSize=DaoFactory.getCourseDaoImpl().countCoursesUnits(questionario.getYear(), course.getId());
int turmasSize = DaoFactory.getCourseDaoImpl().countCoursesUnitsTurmas(questionario.getYear(), course.getId());
CourseView cv = new CourseView(course);
request.setAttribute("CourseView",cv);
%>
<div class="alert alert-danger">O sistema não conseguiu encontrar a tarefa de atribuição nas tarefas agendadas, por favor verifique em todos os logs de tarefas <html:link action="/user/configurationJobTasks">Aqui</html:link> </div>
<tr>
<td>${CourseView.code}</td>
<td><bean:message key="course.${CourseView.degreeCleanCode}"/></td>
<td>${CourseView.name}</td>
<td>
<logic:notEmpty name="CourseView" property="validationRole">
<bean:message key="user.role.${CourseView.validationRole}"/>
</logic:notEmpty>
<logic:empty name="CourseView" property="validationRole">
Papel não atribuido (Corrigir Situação)
</logic:empty>
</td>
<td>
<a href="#" data-href="<%=request.getContextPath()%>/admin/questionarios/pedagogicoEstudante/listCourseUnits.jsp?importYear=${CourseView.importYear}&courseId=${CourseView.id}" data-title="Unidades do Curso de ${CourseView.name} (${CourseView.code})" data-toggle="modal" data-target="#modalAjaxRequest">
<%=unitsSize%>
</a>
</td>
<td>
<a href="#" data-href="<%=request.getContextPath()%>/admin/questionarios/pedagogicoEstudante/listCourseUnitsTurmas.jsp?importYear=${CourseView.importYear}&courseId=${CourseView.id}" data-title="Turmas do Curso de ${CourseView.name} (${CourseView.code})" data-toggle="modal" data-target="#modalAjaxRequest">
<%=turmasSize%>
</a>
</td>
<td>
<html:multibox property="coursesSelectedIds" value="${CourseView.id}" styleClass="courseCheck"/>
</td>
</tr>
<%
}
%>
<div>
</tbody>
</table>
</div>
</div>
<%
}
%>
 
 
<div class="panel panel-primary" id="institutionGerarFinal">
<div class="panel-heading">
Atribuição de Cursos e Unidades ao Questionário
</div>
<div class="panel-body">
 
 
<div class="col-sm-6">
<baco:clearOperation name="Questionario" op="QUESTIONARIO_SCHEDULLE_SELECT_COURSES">
<div class="alert alert-warning">Esta operação vai associar todos os cursos seleccionados e respectivas unidades curriculares
ao questionário ${Questionario.id} criado para o periodo ${Questionario.semestre} de ${Questionario.year}</div>
<div class="alert alert-info alert-small">Esta operação poderá ser revertida ou então repetida para atualizar os cursos alvo do questionário</div>
<div class="alert alert-info alert-small">Esta operação poderá demorar alguns instantes</div>
<html:hidden property="questionario.id" value="${Questionario.id}"/>
<input type="hidden" name="questionarioId" value="${Questionario.id}"/>
<input type="hidden" name="dispatch" value="selectCourses"/>
</baco:clearOperation>
 
 
 
<baco:clearOperation name="Questionario" op="QUESTIONARIO_SCHEDULLE_SELECT_COURSES">
<button class="btn btn-warning" type="button" onclick="this.form.submit()">Associar Cursos e Unidades Curriculares</button>
</baco:clearOperation>
<baco:notClearOperation name="Questionario" op="QUESTIONARIO_SCHEDULLE_SELECT_COURSES">
<baco:clearOperation name="Questionario" op="QUESTIONARIO_SCHEDULLE_SEE_SELECT_COURSES">
<div class="alert alert-warning">O sistema agendou a atribuição de cursos e unidades ao questionário ${Questionario.id} criado para o periodo ${Questionario.semestre} de ${Questionario.year}. Veja o progresso em baixo, caso não termine no final de 30 minutos esta tarefa ficará de novo disponivel</div>
</baco:clearOperation>
<baco:notClearOperation name="Questionario" op="QUESTIONARIO_SCHEDULLE_SEE_SELECT_COURSES">
<div class="alert alert-warning">Não têm autorização para ver esta secção</div>
</baco:notClearOperation>
 
</baco:notClearOperation>
</div>
<div class="col-sm-6">
<baco:clearOperation name="Questionario" op="QUESTIONARIO_SCHEDULLE_SEE_SELECT_COURSES">
<%
if(job != null)
{
SchedulleTasksForm schedulleTasksForm = new SchedulleTasksForm();
schedulleTasksForm.setJobServiceTask(job);
schedulleTasksForm.setId(job.getId());
request.setAttribute("SchedulleTasksForm",schedulleTasksForm);
%>
<div class="task-log task-log-xs" data-href="<%=request.getContextPath()%>/admin/questionarioPedagogicoStartChooseCourses.do?questionarioId=${Questionario.id}">
<jsp:include page="/admin/configuration/taskLog.jsp"/>
</div>
<%
}
else
{
%>
<div class="alert alert-danger">O sistema não conseguiu encontrar a tarefa de atribuição nas tarefas agendadas, por favor verifique em todos os logs de tarefas <html:link action="/user/configurationJobTasks">Aqui</html:link> </div>
<%
}
%>
</baco:clearOperation>
</div>
 
</baco:clearOperation>
</div>
 
</div>
</div>
 
</div>
<div class="col-sm-12">
<html:link action="/admin/adminQuestionario?questionario.id=${Questionario.id}#NOWTASK" styleClass="btn btn-danger">Voltar à administração</html:link>
</div>
</div>
</div>
</div>
</div>
<%
/branches/v3/impl/src/web/admin/questionarios/pedagogicoEstudante/questionarioAdminPanel.jsp
New file
0,0 → 1,115
<%@ page import="pt.estgp.estgweb.utils.DatesUtils" %>
<%@ page import="java.util.List" %>
<%@ page import="pt.estgp.estgweb.web.form.questionarios.QuestionarioForm" %>
<%@ 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-nested.tld" prefix="nested" %>
<%@ 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-tiles.tld" prefix="tiles" %>
<%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %>
<%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %>
<jsp:useBean id="Questionario" type="pt.estgp.estgweb.domain.QuestionarioImpl" scope="request"/>
 
<logic:empty name="Questionario" property="year">
<script>
$(document).ready(
function(){
$("#yearSemestreForm").show();
}
);
</script>
</logic:empty>
<logic:notEmpty name="Questionario" property="year">
<div class="col-md-3 col-sm-3" id="yearSemestreInfo">
<div class="list-group">
<div class="list-group-item">
<bean:message key="survey.list.form.year"/>: ${Questionario.year}
</div>
<div class="list-group-item">
Semestre: ${Questionario.semestre}
</div>
</div>
<baco:clearOperation name="Questionario" op="QUESTIONARIO_SET_ANO_SEMESTRE">
<button class="btn btn-default" type="button" onclick="$('#yearSemestreForm').show();$('#yearSemestreInfo').hide()">Modificar</button>
</baco:clearOperation>
</div>
</logic:notEmpty>
 
<baco:clearOperation name="Questionario" op="QUESTIONARIO_SET_ANO_SEMESTRE">
<div class="col-md-6" style="display: none" id="yearSemestreForm">
<div class="panel panel-default">
<div class="panel-body">
 
<html:form styleClass="form-horizontal" action="/admin/questionariosPaeYearSemestre">
<%
QuestionarioForm qFr = (QuestionarioForm) request.getAttribute("QuestionarioForm");
if(qFr.getQuestionario().getId() <= 0)
qFr.setQuestionario(Questionario);
%>
<input type="hidden" name="dispatch" value="setYearSemestre"/>
<html:hidden property="questionario.id"/>
<div class="form-group">
<label class="control-label col-sm-2" for="year"><bean:message key="survey.list.form.year"/></label>
<div class="col-sm-10">
<%
List<String> years = DatesUtils.getImportYears(10);
%>
<html:select styleClass="form-control" styleId="year" property="questionario.year">
<html:option value="">Escolha Ano</html:option>
<%
for(String year:years)
{
request.setAttribute("year",year);
%>
<html:option value="${year}">${year}</html:option>
<%
}
%>
</html:select>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="semestre">Semestre:</label>
<div class="col-sm-10">
<html:select styleClass="form-control" styleId="semestre" property="questionario.semestre">
<html:option value="">Escolha semestre</html:option>
<html:option value="A">Anual</html:option>
<html:option value="S1">Semestre 1</html:option>
<html:option value="S2">Semestre 2</html:option>
<html:option value="T1">Trimestre 1</html:option>
<html:option value="T2">Trimestre 2</html:option>
<html:option value="T3">Trimestre 3</html:option>
<html:option value="T4">Trimestre 4</html:option>
</html:select>
</div>
</div>
<button class="btn btn-default" type="button" onclick="this.form.action = this.form.action + '#NOWTASK';this.form.submit();"><bean:message key="confirm"/></button>
</html:form>
</div>
</div>
</div>
</baco:clearOperation>
 
<logic:notEmpty name="Questionario" property="year">
<logic:notEmpty name="Questionario" property="semestre">
<div class="col-md-3 col-sm-3">
<html:link styleClass="btn btn-warning" action="/admin/questionarioPedagogicoStartChooseCourses?questionarioId=${Questionario.id}">
Iniciar selecção de Cursos
</html:link>
</div>
<div class="col-md-3 col-sm-3">
<html:link styleClass="btn btn-warning" action="/admin/questionarioPedagogicoStartChooseCourses?questionarioId=${Questionario.id}">
Iniciar selecção de Questionários
</html:link>
</div>
<logic:equal value="CURSOS_ATRIBUIDOS" name="Questionario" property="substate">
<div class="col-md-3 col-sm-3">
<html:link styleClass="btn btn-warning" action="/admin/questionarioPedagogicoStartChooseCourses?questionarioId=${Questionario.id}">
Iniciar Atribuição de Respostas
</html:link>
</div>
</logic:equal>
</logic:notEmpty>
</logic:notEmpty>
 
/branches/v3/impl/src/web/admin/configuration/taskLog.jsp
1,6 → 1,7
<%@ page import="jomm.utils.MessageResources" %>
<%@ page import="pt.estgp.estgweb.domain.JobServiceTaskImpl" %>
<%@ page import="pt.estgp.estgweb.utils.ConfigProperties" %>
<%@ page import="jomm.utils.BytesUtils" %>
<%@ 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" %>
14,10 → 15,77
<jomm:messages/>
<html:errors/>
 
<%
String logid = "log" + BytesUtils.generateHexKey();
%>
 
<%--
TaskLog styles
normal or nothing in attribute
task-log-xs (only progress bar and log link download url)
task-log-sm (only progress bar,screen log small and log download url)
task-log-md (table info, progress bar, screen log small and log download url)
task-log-lg (panel title, table info, progress bar, screen log small and log download url)
---%>
 
 
<style>
.task-log.task-log-xs *.task-log-panel > .panel-heading,
.task-log.task-log-sm *.task-log-panel > .panel-heading,
.task-log.task-log-md *.task-log-panel > .panel-heading
{
display: none !important;
}
.task-log.task-log-xs *.task-log-table,
.task-log.task-log-sm *.task-log-table
{
display: none !important;
}
.task-log.task-log-sm *.task-log-screens
{
height: 50px !important;
font-size: 0.8em !important;
}
.task-log.task-log-sm *.task-log-screens-toogle,
.task-log.task-log-md *.task-log-screens-toogle,
.task-log.task-log-lg *.task-log-screens-toogle
{
display: none !important;
}
 
.task-log.task-log-sm *.task-log-screens .screen,
.task-log.task-log-xs *.task-log-screens .screen
{
height: 150px !important;
width: 100%;
font-size: 0.7em !important;
}
.task-log.task-log-sm *.task-log-screens .header h2, .task-log-sm .task-log-screens .header a,
.task-log.task-log-xs *.task-log-screens .header h2, .task-log-xs .task-log-screens .header a{
font-size: 0.7em !important;
}
</style>
<script>
$(document).ready(function(){
 
 
 
$(".task-log.task-log-sm *.task-log-screens").addClass("in");
$(".task-log.task-log-md *.task-log-screens").addClass("in");
$(".task-log.task-log-lg *.task-log-screens").addClass("in");
/*
$(".task-log-xs .task-log-panel .panel .panel-heading").remove();
$(".task-log-sm .task-log-panel .panel .panel-heading").remove();
$(".task-log-md .task-log-panel .panel .panel-heading").remove();
$(".task-log-xs .task-log-table").remove();
$(".task-log-sm .task-log-table").remove();
$(".task-log-xs .task-log-screens").remove();
*/
});
</script>
<script>
 
var startStatus = "";
function updateStatus()
{
$.getJSON( "<%=request.getContextPath()%>/admin/schedullerTasksJson?service=loadLog&id=${SchedulleTasksForm.jobServiceTask.id}", function( data ) {
44,6 → 112,14
 
if(data.status == "STARTED" || data.status == "PENDING")
setTimeout("updateStatus()",2000);
 
if(startStatus == "")
startStatus = data.status;
 
if(data.progress >= 100 && startStatus != data.status)
{
window.location.href = $("#<%=logid%>").closest('.task-log').data("href");
}
});
 
}
58,13 → 134,13
%>
 
 
<div class="container-fluid">
<div class="panel panel-default">
 
<div class="panel panel-default task-log-panel" >
<div class="panel-heading">
<bean:message key="configuration.taskLog"/>
</div>
<div class="panel-body">
<table class="tablesorter tablesortersimple">
<table class="tablesorter tablesortersimple task-log-table">
<thead>
<tr>
<th><bean:message key="configuration.task"/></th>
119,14 → 195,20
</tbody>
 
</table>
<div class="progress">
<div class="progress task-log-progress">
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="0"
aria-valuemin="0" aria-valuemax="100" style="width:0%">
70%
</div>
</div>
<div id="screens"></div>
<a href="<%=request.getContextPath()%>/logServiceStream/${SchedulleTasksForm.jobServiceTask.logFilePath}">Download Log Completo</a>
 
<div class="task-log-screens-toogle">
<button type="button" class="btn btn-default" data-toggle="collapse" data-target="#<%=logid%>">Mostrar Log</button>
</div>
<div id="<%=logid%>" class="task-log-screens collapse">
<div id="screens"></div>
<a href="<%=request.getContextPath()%>/logServiceStream/${SchedulleTasksForm.jobServiceTask.logFilePath}">Download Log Completo</a>
</div>
</div>
</div>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/logtailer/logtail.js"></script>
138,6 → 220,9
padding: 0.5em;
font-family: sans-serif;
}
.header h2{
font-size: 1em;
}
 
.header .buttons {
float: right;
187,4 → 272,4
 
 
 
</div>
 
/branches/v3/impl/src/web/layout/themes/scripts-default.jsp
4,6 → 4,8
<meta name="viewport" content="width=device-width, initial-scale=1">
 
 
 
 
<%
String bacoTheme = (String) request.getAttribute("pt_estgp_estgweb_theme");
if(bacoTheme == null)
62,6 → 64,37
 
 
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquerytables/jquery-2.1.4.min.js"></script>
 
<!--READY FIRST EVENT-->
<script>
$(document).ready(
function()
{
$(".baco-please-wait-target").hide();
$(".baco-please-wait").html(
"<div class=\"panel panel-info\">" +
"<div class=\"panel-body\">" +
"<p>Por favor aguarde um momento, o sistema está a carregar <img src=\"<%=request.getContextPath()%>/imgs/wait.gif\"/></p>" +
"</div>" +
"</div>");
setTimeout("removeBacoWait()", 2000);
 
}
);
function removeBacoWait()
{
$(".baco-please-wait").fadeOut(300, function(){ $(this).remove();});
$(".baco-please-wait-target").fadeIn(300, function(){ $(this).show();});
}
</script>
<style>
.baco-please-wait-target
{
display: none;
}
</style>
<!--READY FIRST EVENT-->
 
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquerytables/jquery.tablesorter.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquerytables/jquery.tablesorter.widgets.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquerytables/bootstrap/js/bootstrap.js"></script>
116,6 → 149,9
 
 
 
 
 
 
$(document).ready(
function(){
$("#network").hide();
628,6 → 664,7
}
 
</script>
 
<%--O nosso estilo fica aqui para se sobrepor--%>
<link type="text/css" rel="stylesheet" href="<%=request.getContextPath()%>/css/style.css"/>
<link type="text/css" rel="stylesheet" href="<%=request.getContextPath()%>/css/<%=bacoTheme%>/style.css"/>
/branches/v3/impl/src/web/layout/footer.jsp
1,3 → 1,5
<%@ page contentType="text/html; charset=UTF-8" language="java"%>
<jsp:include page="/layout/setTheme.jsp"/>
<jsp:include page="/layout/themes/${pt_estgp_estgweb_theme}/footer.jsp"/>
<jsp:include page="/layout/themes/${pt_estgp_estgweb_theme}/footer.jsp"/>