259 lines
6.2 KiB
Plaintext
259 lines
6.2 KiB
Plaintext
<script language = "Javascript">
|
||
|
||
//----------------------------------------//
|
||
// Questo file contiene gli script //
|
||
// javascript per validare le pagine dei //
|
||
// report jsp lato client. //
|
||
// @Autore : Francesca Coppola //
|
||
// @Data : 13/02/2003 //
|
||
//----------------------------------------//
|
||
|
||
|
||
function checkCategoriaReport(valore)
|
||
{
|
||
var sCategoria = valore;
|
||
|
||
|
||
if(sCategoria == "")
|
||
{
|
||
alert("ATTENZIONE : SELEZIONARE UNA CATEGORIA");
|
||
|
||
}
|
||
else
|
||
{
|
||
var app = '/VisualizzaListaReportCrontab.do';
|
||
//document.forms[0].action = app;
|
||
document.forms[0].method = 'POST';
|
||
document.forms[0].submit();
|
||
}
|
||
}
|
||
|
||
function checkTipoProcesso(sContext,valore)
|
||
{
|
||
var sTipoProcesso = valore;
|
||
|
||
|
||
if(sTipoProcesso == "")
|
||
{
|
||
alert("ATTENZIONE : SELEZIONARE UN TIPO PROCESSO");
|
||
|
||
}
|
||
else
|
||
{
|
||
var pathCreato = sContext +'/ScegliReport.do';
|
||
document.forms[0].action = pathCreato;
|
||
document.forms[0].method = 'POST';
|
||
document.forms[0].submit();
|
||
}
|
||
}
|
||
|
||
|
||
function checkNomeReport(sContext,nomereport, processo)
|
||
{
|
||
|
||
|
||
if((processo != "")&& (nomereport==""))
|
||
{
|
||
alert("ATTENZIONE : SELEZIONARE IL NOME DI UN REPORT");
|
||
|
||
}
|
||
else
|
||
{
|
||
var pathCreato = sContext +'/ScegliReport.do';
|
||
document.forms[0].action = pathCreato;
|
||
document.forms[0].submit();
|
||
}
|
||
}
|
||
|
||
|
||
|
||
function checkCampiReport(frmEseguiReport) {
|
||
|
||
var ret= true;
|
||
var data_inizio = null;
|
||
var data_fine = null;
|
||
var nome_report = null;
|
||
var file_in = null;
|
||
var data = null;
|
||
|
||
|
||
data_inizio = document.frmEseguiReport.txtdata_IN.value;
|
||
data_fine = document.frmEseguiReport.txtdata_FI.value;
|
||
processo = document.frmEseguiReport.cmbTipoProcesso.value;
|
||
nome_report = document.frmEseguiReport.cmbNomiReport.value;
|
||
data = document.frmEseguiReport.txt_YYYY.value;
|
||
file_in =document.frmEseguiReport.file.value;
|
||
|
||
|
||
if (processo == "")
|
||
{
|
||
alert("Selezionare un tipo di processo");
|
||
ret = false;
|
||
}
|
||
if(nome_report == "")
|
||
{
|
||
alert("Selezionare un report");
|
||
ret = false;
|
||
}
|
||
|
||
if((data_inizio == "") && (data_fine == "") && (data == "")&&(file_in ==""))
|
||
{
|
||
alert("Inserire uno dei parametri per il lancio del report");
|
||
ret = false;
|
||
}
|
||
else
|
||
{
|
||
if ((data_inizio != "")&& (data_fine == ""))
|
||
{
|
||
alert("Inserire una data di fine per il lancio del report");
|
||
ret = false;
|
||
}
|
||
else
|
||
{
|
||
if ((data_inizio.substring(6,10)) > (data_fine.substring(6,10)))
|
||
{
|
||
alert("Data inizio Maggiore di Data fine");
|
||
document.frmEseguiReport.txtdata_IN.value = "";
|
||
document.frmEseguiReport.txtdata_FI.value = "";
|
||
document.frmEseguiReport.txtdata_IN.focus();
|
||
ret= false;
|
||
}
|
||
else
|
||
{
|
||
if ((data_inizio.substring(3,5))> (data_fine.substring(3,5)))
|
||
{
|
||
alert("Data inizio Maggiore di Data fine");
|
||
document.frmEseguiReport.txtdata_IN.value = "";
|
||
document.frmEseguiReport.txtdata_FI.value = "";
|
||
document.frmEseguiReport.txtdata_IN.focus();
|
||
ret= false;
|
||
}
|
||
else
|
||
{
|
||
if ((data_inizio.substring(3,5))== (data_fine.substring(3,5)) && (data_inizio.substring(0,2))> (data_fine.substring(0,2)))
|
||
{
|
||
alert("Data inizio Maggiore di Data fine");
|
||
document.frmEseguiReport.txtdata_IN.value = "";
|
||
document.frmEseguiReport.txtdata_FI.value = "";
|
||
document.frmEseguiReport.txtdata_IN.focus();
|
||
ret= false;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
if(ret){
|
||
ret = checkDataMaggioreOggi(data_inizio,data_fine);
|
||
if(!ret){
|
||
alert("Le date di inizio e di fine devono essere minori o uguali\n alla data odierna");
|
||
document.frmEseguiReport.txtdata_IN.value = "";
|
||
document.frmEseguiReport.txtdata_FI.value = "";
|
||
document.frmEseguiReport.txtdata_IN.focus();
|
||
}
|
||
}
|
||
return ret;
|
||
}
|
||
|
||
|
||
|
||
function checkDataMaggioreOggi(dataInizio,dataFine){
|
||
var retI = false;
|
||
var retF = false;
|
||
var oggi = new Date();
|
||
var oggiDD = oggi.getDate();
|
||
var oggiMM = (oggi.getMonth()+1);
|
||
var oggiYYYY = oggi.getYear();
|
||
|
||
//alert("oggiDD :"+oggiDD+"\n"+
|
||
// "oggiMM :"+oggiMM+"\n"+
|
||
// "oggiYYYY :"+oggiYYYY+"\n"+
|
||
// "DIYYYY :"+dataInizio.substring(6,10)+"\n"+
|
||
// "DIMM :"+dataInizio.substring(3,5)+"\n"+
|
||
// "DIDD :"+dataInizio.substring(0,2)+"\n");
|
||
|
||
|
||
if(dataInizio.substring(6,10) == oggiYYYY){
|
||
// OK vado avanti ANNI OK
|
||
if(dataInizio.substring(3,5) == oggiMM){
|
||
if(dataInizio.substring(0,2) <= oggiDD){ //se <20> lo stesso mese:
|
||
retI = true;
|
||
}
|
||
}else if(dataInizio.substring(3,5) < oggiMM){
|
||
retI = true;
|
||
}
|
||
}else if(dataInizio.substring(6,10) < oggiYYYY){
|
||
retI = true;
|
||
}
|
||
//////////////////////////////////////////////////////////
|
||
if(dataFine.substring(6,10) == oggiYYYY){
|
||
// OK vado avanti ANNI OK
|
||
if(dataFine.substring(3,5) == oggiMM){
|
||
if(dataFine.substring(0,2) <= oggiDD){ //se <20> lo stesso mese:
|
||
retF = true;
|
||
}
|
||
}else if(dataFine.substring(3,5) < oggiMM){
|
||
retF = true;
|
||
}
|
||
}else if(dataFine.substring(6,10) < oggiYYYY){
|
||
retF = true;
|
||
}
|
||
|
||
|
||
|
||
return retI && retF;
|
||
}
|
||
|
||
function lanciaDownload(sContext,valore)
|
||
{
|
||
var sTipoRTeport = valore;
|
||
|
||
|
||
|
||
var pathCreato = sContext +'/GUI/SceltaReportMancateAzioni.do?tipoOperazione=download';
|
||
alert("path:" + pathCreato);
|
||
document.forms[0].action = pathCreato;
|
||
document.forms[0].tipoOperazione.value="download";
|
||
document.forms[0].method = 'POST';
|
||
document.forms[0].submit();
|
||
|
||
}
|
||
function lanciaDownload(sContext)
|
||
{
|
||
//var sTipoRTeport = valore;
|
||
|
||
var pathCreato = sContext +'/GUI/SceltaReportMancateAzioni.do?tipoOperazione=download';
|
||
document.forms[0].action = pathCreato;
|
||
document.forms[0].tipoOperazione.value="download";
|
||
document.forms[0].method = 'POST';
|
||
document.forms[0].submit();
|
||
|
||
}
|
||
function clsMessErrore()
|
||
{
|
||
document.getElementById("messaggio").style.display = 'none';
|
||
}
|
||
|
||
|
||
//input: document.form.oggetto.value
|
||
function checkFile(objValue){
|
||
|
||
if(objValue == ""){
|
||
alert("ATTENZIONE : SELEZIONARE UN FILE");
|
||
return false;
|
||
}
|
||
}//fx
|
||
function logout(url_logout) {
|
||
//window.location=self.location;
|
||
var conferma = confirm('Sei sicuro di voler uscire dalla pagina?');
|
||
if (conferma) {
|
||
//window.opener = self;
|
||
//window.open('','_self','');
|
||
window.location.href = url_logout;
|
||
//window.close();
|
||
} else {
|
||
return false;
|
||
}
|
||
} //fx
|
||
</script>
|