Subversion Repositories bacoAlunos

Rev

Rev 1133 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<%@ page import="jomm.dao.impl.AbstractDao" %>
<%@ page import="pt.estgp.estgweb.domain.JobServiceTaskScheduler" %>
<%@ page import="pt.estgp.estgweb.domain.dao.DaoFactory" %>
<%@ page import="java.util.List" %>
<%@ page import="pt.estgp.estgweb.utils.DatesUtils" %>
<%@ page import="com.sun.mail.handlers.image_gif" %>
<%@ 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" %>
<%@ taglib prefix="hmlt" uri="http://jakarta.apache.org/struts/tags-html" %>
<jsp:useBean id="UserSession" type="pt.estgp.estgweb.domain.UserSession" scope="request"/>
<jsp:useBean id="SchedulleTasksForm" type="pt.estgp.estgweb.web.form.configuration.SchedulleTasksForm" scope="request"/>
<jomm:messages/>
<html:errors/>


<script>
    $(document).ready(function()
        {
            <logic:equal value="true" name="SchedulleTasksForm" property="jobScheduller.weekly">
                $("#weekdaySelection").show();
                $("#monthdaySelection").hide();
            </logic:equal>
            <logic:equal value="true" name="SchedulleTasksForm" property="jobScheduller.monthly">
                $("#weekdaySelection").hide();
                $("#monthdaySelection").show();
            </logic:equal>
            <logic:equal value="true" name="SchedulleTasksForm" property="jobScheduller.daily">
                $("#weekdaySelection").hide();
                $("#monthdaySelection").hide();
            </logic:equal>
            <logic:equal value="false" name="SchedulleTasksForm" property="jobScheduller.daily">
                <logic:equal value="false" name="SchedulleTasksForm" property="jobScheduller.monthly">
                    <logic:equal value="false" name="SchedulleTasksForm" property="jobScheduller.weekly">
                        $("#weekdaySelection").hide();
                        $("#monthdaySelection").hide();
                    </logic:equal>
                </logic:equal>
            </logic:equal>

            changeParameters();

        }
    );
    function changeForms(calendarization)
    {
        if(calendarization == "DAILY")
        {
            $("#weekdaySelection").hide();
            $("#monthdaySelection").hide();
        }
        else if(calendarization == "MONTLY")
        {
            $("#weekdaySelection").hide();
            $("#monthdaySelection").show();
        }
        else if(calendarization == "WEEKLY")
        {
            $("#weekdaySelection").show();
            $("#monthdaySelection").hide();
        }
    }

    function changeParameters()
    {
        $("#jobImportYearKeyPart").hide();
        $("#jobSemestreKeyPart").hide();
        $("#jobSendIonlineKeyPart").hide();
        $("#jobSendEmailKeyPart").hide();
        $("#jobCloneOnlyNewsKeyPart").hide();
        $("#jobGenerateAllPdfsKeyPart").hide();
        $("#jobValidateKeyPart").hide();

        type = $("#targetService").val();
        if(type == "pt.estgp.estgweb.services.sigesimports.ImportCourseService")
        {
            $("#jobImportYearKeyPart").show();
        }
        else if(type == "pt.estgp.estgweb.services.sigesimports.ImportGradesService")
        {
            $("#jobImportYearKeyPart").show();
        }
        else if(type == "pt.estgp.estgweb.services.sigesimports.ImportTeachersService")
        {
            $("#jobImportYearKeyPart").show();
        }
        else if(type == "pt.estgp.estgweb.services.sigesimports.ImportStudentsService")
        {
            $("#jobImportYearKeyPart").show();
        }
        else if(type == "pt.estgp.estgweb.services.sigesimports.ImportSumariesJson")
        {
            $("#jobImportYearKeyPart").show();
            $("#jobSemestreKeyPart").show();
            $("#jobSendIonlineKeyPart").show();
            $("#jobSendEmailKeyPart").show();
        }
        else if(type == "pt.estgp.estgweb.services.sigesimports.SincronizeLastYearCourseUnitProgramsService")
        {
            $("#jobImportYearKeyPart").show();
            $("#jobSemestreKeyPart").show();
            $("#jobCloneOnlyNewsKeyPart").show();
            $("#jobGenerateAllPdfsKeyPart").show();
            $("#jobValidateKeyPart").show();
        }
        else
        {
            $("#jobImportYearKeyPart").show();
        }


    }



</script>


<div class="container-fluid">
    <div class="panel panel-default">
        <div class="panel-heading">
            <bean:message key="configuration.task"/>
        </div>
        <div class="panel-body">

            <html:form action="/user/configurationTasks" >
                <input type="hidden" name="dispatch" value="save"/>
                <html:hidden property="jobScheduller.id"/>
                <div class="form-group">
                    <label for="targetService">Tarefa:</label>
                    <html:select onchange="changeParameters()" property="jobScheduller.targetService" styleClass="form-control" styleId="targetService">
                        <html:option value="pt.estgp.estgweb.services.sigesimports.ImportCourseService">Importação de Cursos</html:option>
                        <html:option value="pt.estgp.estgweb.services.sigesimports.ImportGradesService">Importação de Notas</html:option>
                        <html:option value="pt.estgp.estgweb.services.sigesimports.ImportTeachersService">Importação de Docentes</html:option>
                        <html:option value="pt.estgp.estgweb.services.sigesimports.ImportStudentsService">Importação de Estudantes</html:option>
                        <html:option value="pt.estgp.estgweb.services.sigesimports.ImportSumariesJson">Importação de Sumários</html:option>
                        <html:option value="pt.estgp.estgweb.services.sigesimports.SincronizeLastYearCourseUnitProgramsService">Clonagem de Fichas Curriculares</html:option>
                    </html:select>
                </div>
                <div class="form-group">
                    <label for="description">Descrição:</label>
                    <html:textarea styleClass="form-control" styleId="description" property="jobScheduller.description"/>
                </div>
                <div class="form-group">
                    <label for="description">Calendarização:</label>
                    <html:select styleClass="form-control" property="jobScheduller.calendarization" onchange="changeForms(this.value)">
                        <html:option value="DAILY">Diário</html:option>
                        <html:option value="WEEKLY">Semanal</html:option>
                        <html:option value="MONTLY">Mensal</html:option>
                    </html:select>
                </div>
                <div class="form-group" id="weekdaySelection">
                    <label for="weekday">Dia da Semana:</label>
                    <html:select styleClass="form-control" styleId="weekday" property="jobScheduller.weekday">
                        <%
                            for(int i=1;i<=7;i++)
                            {
                                request.setAttribute("i",i);
                        %>
                        <html:option value="${i}"><bean:message key="weekday.${i}"/></html:option>
                        <%
                            }
                        %>
                    </html:select>
                </div>
                <div class="form-group" id="monthdaySelection">
                    <label for="monthday">Dia do Mês:</label>
                    <html:select styleClass="form-control" styleId="monthday" property="jobScheduller.monthday">
                        <%
                            for(int i=1;i<31;i++)
                            {
                                request.setAttribute("i",i);
                        %>
                        <html:option value="${i}">${i}</html:option>
                        <%
                            }
                        %>
                    </html:select>
                </div>
                <div class="form-group">
                    <div class="row">
                        <div class="col-sm-4">
                            <label for="hour">Hora:</label>
                            <html:select styleClass="form-control" styleId="hour" property="jobScheduller.hour">
                                <%
                                for(int i=0;i<24;i++)
                                {
                                    request.setAttribute("i",i);
                                %>
                                    <html:option value="${i}">${i}</html:option>
                                <%
                                }
                                %>
                            </html:select>
                        </div>
                        <div class="col-sm-4">
                            <label for="minute">Minuto:</label>
                            <html:select styleClass="form-control" styleId="minute" property="jobScheduller.minute">
                                <%
                                    for(int i=0;i<60;i++)
                                    {
                                        request.setAttribute("i",i);
                                %>
                                <html:option value="${i}">${i}</html:option>
                                <%
                                    }
                                %>
                            </html:select>
                        </div>
                        <div class="col-sm-4">
                            <label for="second">Segundo:</label>
                            <html:select styleClass="form-control" styleId="second" property="jobScheduller.second">
                                <%
                                    for(int i=0;i<60;i++)
                                    {
                                        request.setAttribute("i",i);
                                %>
                                <html:option value="${i}">${i}</html:option>
                                <%
                                    }
                                %>
                            </html:select>
                        </div>
                    </div>
                </div>
               <!--
                ;


                private String jobGenerateAllPdfsKey;
                private String jobValidateKey;-->
                <div class="form-group" id="jobImportYearKeyPart">
                    <label for="jobImportYearKey">Ano:</label>
                    <%
                        List<String> years = DatesUtils.getImportYears(10);
                    %>
                    <html:select styleClass="form-control" styleId="jobImportYearKey" property="jobImportYearKey">
                        <%
                            for(String year:years)
                            {
                                request.setAttribute("year",year);
                        %>
                        <html:option value="${year}">${year}</html:option>
                        <%
                            }
                        %>
                    </html:select>
                </div>

                <div class="form-group" id="jobSemestreKeyPart">
                    <label for="jobSemestreKey">Semestre:</label>
                    <html:select styleClass="form-control" styleId="jobSemestreKey" property="jobSemestreKey">
                        <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 class="form-group" id="jobSendIonlineKeyPart">
                    <label for="jobSendIonlineKey">Enviar para a pasta do DTP:</label>
                    <html:select styleClass="form-control" styleId="jobSendIonlineKey" property="jobSendIonlineKey">
                        <html:option value="true">Sim</html:option>
                        <html:option value="false">Não</html:option>
                    </html:select>
                </div>

                <div class="form-group" id="jobSendEmailKeyPart">
                    <label for="jobSendEmailKey">Enviar email de notificação:</label>
                    <html:select styleClass="form-control" styleId="jobSendEmailKey" property="jobSendEmailKey">
                        <html:option value="true">Sim</html:option>
                        <html:option value="false">Não</html:option>
                    </html:select>
                </div>

                <div class="form-group" id="jobCloneOnlyNewsKeyPart">
                    <label for="jobCloneOnlyNewsKey">Clonar apenas quando não existe ficha (Se escolher não irá clonar também fichas inválidas):</label>
                    <html:select styleClass="form-control" styleId="jobCloneOnlyNewsKey" property="jobCloneOnlyNewsKey">
                        <html:option value="true">Sim</html:option>
                        <html:option value="false">Não</html:option>
                    </html:select>
                </div>

                <div class="form-group" id="jobGenerateAllPdfsKeyPart">
                    <label for="jobGenerateAllPdfsKey">Gerar PDF's mesmo que não clone as fichas:</label>
                    <html:select styleClass="form-control" styleId="jobGenerateAllPdfsKey" property="jobGenerateAllPdfsKey">
                        <html:option value="true">Sim</html:option>
                        <html:option value="false">Não</html:option>
                    </html:select>
                </div>

                <div class="form-group" id="jobValidateKeyPart">
                    <label for="jobValidateKey">Validar Fichas ao Clonar:</label>
                    <html:select styleClass="form-control" styleId="jobValidateKey" property="jobValidateKey">
                        <html:option value="true">Sim</html:option>
                        <html:option value="false">Não</html:option>
                    </html:select>
                </div>
                <button type="submit" class="btn btn-default"><bean:message key="confirm"/></button>
            </html:form>


        </div>
    </div>
</div>

Generated by GNU Enscript 1.6.5.2.