First Commit - Source Code from Reply
This commit is contained in:
@@ -0,0 +1,417 @@
|
||||
<%@page import = "mnp.crontab.objects.*, mnp.crontab.utility.ui.Res"%>
|
||||
<%@page import = "mnp.crontab.command.CrontabCostants" %>
|
||||
<%@page import = "mnp.crontab.command.CrontabSession" %>
|
||||
<%@page import = "mnp.crontab.command.TaskCommand" %>
|
||||
<%@page import = "mnp.crontab.objects.ui.TaskBean" %>
|
||||
<%@page import = "java.util.*" %>
|
||||
<jsp:useBean id="resultBean" scope="request" class="mnp.crontab.objects.ui.IntervalloAttivazione" />
|
||||
|
||||
<% if (session.isNew()) { session.invalidate(); %>
|
||||
<jsp:forward page="sessioneInattiva.html" />
|
||||
<%
|
||||
}
|
||||
|
||||
String cmdOperazione =(String) request.getAttribute(CrontabCostants.TIPO_OPERAZIONE);
|
||||
String elementOperazione =(String) request.getAttribute(CrontabCostants.CAMPO_ELEMENT_CHECKED);
|
||||
String ora =resultBean.getHourFrom();
|
||||
String minuti =resultBean.getMinutiFrom();
|
||||
String oraTo =resultBean.getHourTo();
|
||||
String minutiTo =resultBean.getMinutiTo();
|
||||
if (oraTo==null)
|
||||
{
|
||||
oraTo="";
|
||||
minutiTo="";
|
||||
}
|
||||
|
||||
if ((resultBean.getGiornoMese() != null) && (!resultBean.getGiornoMese().equals("0")))
|
||||
{
|
||||
if (resultBean.getGiornoMese().length()==1)
|
||||
resultBean.setGiornoMese("0"+resultBean.getGiornoMese());
|
||||
}
|
||||
|
||||
|
||||
String[] giorni = resultBean.getGiorniSettimana();
|
||||
%>
|
||||
|
||||
<HTML>
|
||||
<head>
|
||||
<TITLE>
|
||||
Mnp
|
||||
</TITLE>
|
||||
<script language = "Javascript">
|
||||
|
||||
function controllaFasciaOraria(action)
|
||||
{
|
||||
oraFrom=document.formCentrale.oraFrom
|
||||
oraTo=document.formCentrale.oraTo
|
||||
minutiFrom=document.formCentrale.minutiFrom
|
||||
minutiTo=document.formCentrale.minutiTo
|
||||
|
||||
if (oraTo.value !='')
|
||||
{
|
||||
|
||||
var ora1=parseInt(oraFrom.value,10);
|
||||
var ora2=parseInt(oraTo.value,10);
|
||||
|
||||
var minuto1=parseInt(minutiFrom.value,10);
|
||||
var minuto2=parseInt(minutiTo.value,10);
|
||||
|
||||
if (ora1 > ora2)
|
||||
{
|
||||
alert('Attenzione: Controllare Intervallo Orario!');
|
||||
oraTo.value=''
|
||||
minutiTo.value=''
|
||||
return
|
||||
}
|
||||
if (ora2 == ora1)
|
||||
{
|
||||
|
||||
if (minuto1 > minuto2)
|
||||
{
|
||||
alert('Attenzione: Controllare Intervallo Orario!');
|
||||
oraTo.value=''
|
||||
minutiTo.value=''
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
for (var i=0; i < 7; i++)
|
||||
{
|
||||
|
||||
if (document.formCentrale.giorniSettimana[i].checked)
|
||||
return checkAllFieldIntervallo(document.formCentrale,action)
|
||||
}
|
||||
if (document.formCentrale.giornoData.value == '')
|
||||
{
|
||||
alert('Errore.Inserire un giorno della Settimana o un giorno del Mese.')
|
||||
return;
|
||||
}
|
||||
checkAllFieldIntervallo(document.formCentrale,action)
|
||||
|
||||
}
|
||||
/*
|
||||
function resetAllFieldIntervallo(frm)
|
||||
{
|
||||
|
||||
// ncampi = numero di campi da resettare
|
||||
// ArrayCampi = array dei campi che devono essere resettati
|
||||
|
||||
var ncampi=8;
|
||||
var ArrayCampi = new Array(ncampi)
|
||||
|
||||
// Riempimento degli array
|
||||
|
||||
ArrayCampi[0] = frm.giorno
|
||||
ArrayCampi[1] = frm.giornoData
|
||||
ArrayCampi[2] = frm.oraFrom
|
||||
ArrayCampi[3] = frm.minutoFrom
|
||||
ArrayCampi[4] = frm.giornoStop
|
||||
ArrayCampi[5] = frm.giornoDataStop
|
||||
ArrayCampi[6] = frm.oraTo
|
||||
ArrayCampi[7] = frm.minutoTo
|
||||
|
||||
ResetAllField(ArrayCampi)
|
||||
frm.every.value='0'
|
||||
}
|
||||
|
||||
*/
|
||||
function checkAllFieldIntervallo(frm,action)
|
||||
{
|
||||
|
||||
// ncampi = numero di campi obbligatori da controllare
|
||||
// ArrayCampiObbligatori = array dei campi obbligatori che devono essere controllati
|
||||
// ArrayEtichetteCampiObbligatori = array di etichette dei campi obbligatori
|
||||
|
||||
|
||||
var ncampi=1;
|
||||
var ArrayCampiObbligatori = new Array(ncampi)
|
||||
var ArrayEtichetteCampiObbligatori = new Array(ncampi)
|
||||
|
||||
// Riempimento degli array
|
||||
/*
|
||||
if (frm.giorno.value=='')
|
||||
ArrayCampiObbligatori[0] = frm.giornoData
|
||||
else
|
||||
ArrayCampiObbligatori[0] = frm.giorno
|
||||
|
||||
|
||||
ArrayEtichetteCampiObbligatori[0]= 'Giorno di Partenza'
|
||||
*/
|
||||
ArrayCampiObbligatori[0] = frm.oraFrom
|
||||
ArrayEtichetteCampiObbligatori[0]= 'Ora di inizio attivazione'
|
||||
/*
|
||||
if (frm.giornoStop.value=='')
|
||||
ArrayCampiObbligatori[2] = frm.giornoDataStop
|
||||
else
|
||||
ArrayCampiObbligatori[2] = frm.giornoStop
|
||||
|
||||
ArrayEtichetteCampiObbligatori[2]= 'Giorno di Stop'
|
||||
ArrayCampiObbligatori[3] = frm.oraTo
|
||||
ArrayEtichetteCampiObbligatori[3]= 'Ora di fine attivazione'
|
||||
*/
|
||||
if (CheckCampiObbligatori(ArrayCampiObbligatori,ArrayEtichetteCampiObbligatori))
|
||||
{
|
||||
frm.JSP_FUNCTION.value=action;
|
||||
if (frm.every.value=='')
|
||||
frm.every.value='0'
|
||||
if (frm.deadline.value=='')
|
||||
frm.deadline.value='0'
|
||||
|
||||
frm.submit();
|
||||
}
|
||||
}
|
||||
|
||||
function CheckCampiObbligatori(ArrayCampiObbligatori,ArrayEtichetteCampiObbligatori)
|
||||
{
|
||||
for (var i=0; i < ArrayCampiObbligatori.length; i++)
|
||||
{
|
||||
if (ArrayCampiObbligatori[i].value == "")
|
||||
{
|
||||
alert('Errore.Inserire '+ArrayEtichetteCampiObbligatori[i])
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function ResetAllField(ArrayCampi)
|
||||
{
|
||||
for (var i=0; i < ArrayCampi.length; i++)
|
||||
{
|
||||
ArrayCampi[i].value = ""
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function settaGiorno()
|
||||
{
|
||||
for (var i=0; i < 7; i++)
|
||||
{
|
||||
document.formCentrale.giorniSettimana[i].checked=false;
|
||||
}
|
||||
}
|
||||
function settaMinutiTo()
|
||||
{
|
||||
document.formCentrale.minutiTo.value="00";
|
||||
}
|
||||
|
||||
function settaDataGiorno()
|
||||
{
|
||||
document.formCentrale.giornoData.value="";
|
||||
//document.formCentrale.giornoDataStop.value="";
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<form method="post" action="TaskCommand.do" name="formCentrale">
|
||||
<INPUT type="hidden" name="JSP_FUNCTION" value="">
|
||||
|
||||
|
||||
<LINK REL="stylesheet" TYPE="text/css" HREF="<%=Res.ApplContext%>/jsp/GUI/GUIStyle.css">
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<BODY>
|
||||
<!-- tabella che include il menu verticale -->
|
||||
<INPUT type="hidden" name="elementoChecked" value="<%= elementOperazione %>">
|
||||
<table width="524" height="533">
|
||||
<td width = "594" valign="top" height="529">
|
||||
<DIV align="center" >
|
||||
<table border="0" width="100%">
|
||||
<tr align = "center" valign = "top" width="45%" bgcolor="#D61414">
|
||||
<td align = "right" valign = "top" width="45%" bgcolor="#D61414">
|
||||
<b><i>
|
||||
<P class="Titolo"><font color="#FFFFFF">Intervalli di Attivazione</font></P></i></b>
|
||||
</td>
|
||||
</tr>
|
||||
<tr >
|
||||
<td align = "right" valign = "top" width="85%" colspan="2">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table width="483" border="0" height="60%" >
|
||||
<tr>
|
||||
<td colspan="2" height="21" width="475" align="right"><font color="#D61414"><i>campi obbligatori</i></font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="21" width="475" align="right" bgcolor="#FFFFCC" colspan="2">
|
||||
<p align="left"><font color="#D61414"><b>Giorno/i della
|
||||
Settimana</b></font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" height="21" width="475" >
|
||||
<TABLE nowrap width="473" >
|
||||
<TBODY>
|
||||
<TR width="100%">
|
||||
<TD height="17" nowrap align="center" width="15%">Lun</TD>
|
||||
<TD height="17" nowrap align="center" width="15%">Mar</TD>
|
||||
<TD height="17" nowrap align="center" width="15%">Mer</TD>
|
||||
<TD height="17" nowrap align="center" width="15%">Gio</TD>
|
||||
<TD height="17" nowrap align="center" width="15%">Ven</TD>
|
||||
<TD height="17" nowrap align="center" width="15%">Sab</TD>
|
||||
<TD height="17" nowrap align="center" width="15%">Dom</TD>
|
||||
|
||||
</TR>
|
||||
|
||||
<TR width="100%">
|
||||
<TD height="17" nowrap align="center" width="15%"><input type="checkbox" onclick="settaDataGiorno()" name="giorniSettimana" value="Lun" <% if (resultBean.getSelected(giorni,"Lun")) {%> checked <% }%>></TD>
|
||||
<TD height="17" nowrap align="center" width="15%"><input type="checkbox" onclick="settaDataGiorno()" name="giorniSettimana" value="Mar" <% if (resultBean.getSelected(giorni,"Mar")) {%> checked <% }%>></TD>
|
||||
<TD height="17" nowrap align="center" width="15%"><input type="checkbox" onclick="settaDataGiorno()" name="giorniSettimana" value="Mer" <% if (resultBean.getSelected(giorni,"Mer")) {%> checked <% }%>></TD>
|
||||
<TD height="17" nowrap align="center" width="15%"><input type="checkbox" onclick="settaDataGiorno()" name="giorniSettimana" value="Gio" <% if (resultBean.getSelected(giorni,"Gio")) {%> checked <% }%>></TD>
|
||||
<TD height="17" nowrap align="center" width="15%"><input type="checkbox" onclick="settaDataGiorno()" name="giorniSettimana" value="Ven" <% if (resultBean.getSelected(giorni,"Ven")) {%> checked <% }%>></TD>
|
||||
<TD height="17" nowrap align="center" width="15%"><input type="checkbox" onclick="settaDataGiorno()" name="giorniSettimana" value="Sab" <% if (resultBean.getSelected(giorni,"Sab")) {%> checked <% }%>></TD>
|
||||
<TD height="17" nowrap align="center" width="15%"><input type="checkbox" onclick="settaDataGiorno()" name="giorniSettimana" value="Dom" <% if (resultBean.getSelected(giorni,"Dom")) {%> checked <% }%>></TD>
|
||||
</TR>
|
||||
</TBODY>
|
||||
</TABLE>
|
||||
</td></tr>
|
||||
<tr>
|
||||
<td width="190" height="25"> </td>
|
||||
<td width="279" height="25">
|
||||
<p> <i><b>oppure </b></i></p>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="190" bgcolor="#FFFFCC" height="25"><b><font color="#D61414">Giorno del
|
||||
mese</font></b></td>
|
||||
<td width="279" height="25">
|
||||
|
||||
<select size="1" name="giornoData" onclick="settaGiorno()">
|
||||
<option value=""></option>
|
||||
<% for(int i=1; i<32;i++)
|
||||
{
|
||||
if (i<10)
|
||||
{ %>
|
||||
<OPTION value="0<%=i%>" <% if (("0"+String.valueOf(i)).equals(resultBean.getGiornoMese())) {%> selected <% }%>>0<%=i%></OPTION>
|
||||
<% }
|
||||
else { %>
|
||||
<OPTION value="<%=i%>" <% if (String.valueOf(i).equals(resultBean.getGiornoMese())) {%> selected <% }%> ><%=i%></OPTION>
|
||||
<% }
|
||||
} %>
|
||||
</select>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="190" height="25"></td>
|
||||
<td width="279" height="25">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="190" bgcolor="#FFFFCC" height="25"><b><font color="#D61414">Orario
|
||||
di Partenza <i><font size="2">(ora:minuti)</font></i></font></b></td>
|
||||
<td width="279" height="25">
|
||||
<p><SELECT name="oraFrom" >
|
||||
<% for(int i=0; i<24;i++)
|
||||
{
|
||||
if (i<10)
|
||||
{ %>
|
||||
<OPTION value="0<%=i%>" <% if (ora.equals("0"+String.valueOf(i))) {%> selected <% }%>>0<%=i%></OPTION>
|
||||
<% }
|
||||
else { %>
|
||||
<OPTION value="<%=i%>" <% if (ora.equals(String.valueOf(i))) {%> selected <% }%> ><%=i%></OPTION>
|
||||
<% }
|
||||
} %>
|
||||
</SELECT> :
|
||||
<SELECT name="minutiFrom">
|
||||
<% for(int i=0; i<60;i++)
|
||||
{
|
||||
if (i<10)
|
||||
{ %>
|
||||
<OPTION value="0<%=i%>" <% if (minuti.equals("0"+String.valueOf(i))) {%> selected <% }%> >0<%=i%></OPTION>
|
||||
<% }
|
||||
else { %>
|
||||
<OPTION value="<%=i%>" <% if (minuti.equals(String.valueOf(i))) {%> selected <% }%> ><%=i%></OPTION>
|
||||
<% }
|
||||
} %>
|
||||
</select>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="190" bgcolor="#FFFFCC" height="25"><b><font color="#000000">Orario
|
||||
Ultima Partenza <font size="2"><i>(ora:minuti)</i></font></font></b></td>
|
||||
<td width="279" height="25">
|
||||
<p>
|
||||
<SELECT name="oraTo" onChange="settaMinutiTo()">
|
||||
<option value=""></option>
|
||||
<% for(int i=0; i<24;i++)
|
||||
{
|
||||
if (i<10)
|
||||
{ %>
|
||||
<OPTION value="0<%=i%>" <% if (oraTo.equals("0"+String.valueOf(i))) {%> selected <% }%>>0<%=i%></OPTION>
|
||||
<% }
|
||||
else { %>
|
||||
<OPTION value="<%=i%>" <% if (oraTo.equals(String.valueOf(i))) {%> selected <% }%>><%=i%></OPTION>
|
||||
<% }
|
||||
} %>
|
||||
</SELECT> :
|
||||
<SELECT name="minutiTo">
|
||||
<option value=""></option>
|
||||
<% for(int i=0; i<60;i++)
|
||||
{
|
||||
if (i<10)
|
||||
{ %>
|
||||
<OPTION value="0<%=i%>" <% if (minutiTo.equals("0"+String.valueOf(i))) {%> selected <% }%>>0<%=i%></OPTION>
|
||||
<% }
|
||||
else { %>
|
||||
<OPTION value="<%=i%>" <% if (minutiTo.equals(String.valueOf(i))) {%> selected <% }%>><%=i%></OPTION>
|
||||
<% }
|
||||
} %>
|
||||
</SELECT></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="190" bgcolor="#FFFFCC" height="25"><b>Periodo
|
||||
<i><font size="2">(minuti)</font></i></b></td>
|
||||
<td width="279" height="25">
|
||||
<p><input type="text" name="every" size="2" value="<%= resultBean.getEveryPeriodo()%>" maxlength="3" ></p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="190" height="21" bgcolor="#FFFFCC"><font color="#000000"><b>DeadLine
|
||||
<i>(minuti) *</i></b></font></td>
|
||||
<td width="279" height="21">
|
||||
|
||||
<input type="text" name="deadline" size="2" value="<%= resultBean.getDeadline()%>" maxlength="3" >
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="469" height="21" colspan="2"><font color="#D61414"><i>*
|
||||
si intende il tempo che intercorre dall'ultima partenza allo
|
||||
stop dell'intervallo</i></font></td>
|
||||
</tr>
|
||||
|
||||
</table></div>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<DIV align="center">
|
||||
<TABLE nowrap width="70%">
|
||||
<TBODY>
|
||||
<TR width="180">
|
||||
<TD height="17" nowrap align="center" width="20%" class="hmenu"><A class="hmenu" href="javascript:controllaFasciaOraria(<%= cmdOperazione %>)"> Conferma</A></TD>
|
||||
<TD height="17" nowrap align="center" width="20%" class="hmenu"><A class="hmenu" href="javascript: history.back()"> Torna
|
||||
Indietro</A></TD>
|
||||
<TD height="17" nowrap align="center" width="20%" class="hmenu"><A class="hmenu" href="javascript: window.close()"> Chiudi </A></TD>
|
||||
</TR>
|
||||
</TBODY>
|
||||
</TABLE>
|
||||
</DIV>
|
||||
|
||||
<!-- tabella x menu -->
|
||||
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</form>
|
||||
Reference in New Issue
Block a user