var urlString=window.location.pathname.slice(0, window.location.pathname.lastIndexOf('.nsf/'))+".nsf"; //////////////////////////////////////////////LTrim/////////////////////////////////////////// // Author: Luca Valterio // Elimina gli spazi a sinistra di Str function LTrim(Str) { while (Str.charAt(0) == " ") Str = Str.substr(1); return Str; } ////////////////////////////////////////////RTrim/////////////////////////////////////////////// // Author: Luca Valterio // Elimina gli spazi a destra di Str function RTrim(Str) { while (Str.charAt(Str.length-1) == " ") Str = Str.substr(0,Str.length-1); return Str; } /////////////////////////////////////////////Trim/////////////////////////////////////////////// // Author: Luca Valterio // Elimina gli spazi a destra e sinistra di Str function Trim(Str) { Str = LTrim(Str); Str = RTrim(Str); return Str; } ///////////////////////////////////////////isValid//////////////////////////////////////////////// // Author Bersan Paolo // Restituisce true se la stringa Str passata contiene solo de valori // accettabili definiti nell'array aCheck[] // Es: aCheck=new Array("0","1","2","3","4","5","6","7","8","9") function isValid( Str , aCheck ) { var Error = true; for (var i = 0; i < Str.length; i++) { for (var j = 0; j < aCheck.length; j++) { if (Str.charAt(i) == aCheck[j]) { Error = false; } } if (Error) { return false; } Error = true; } return true; } //############################################################## //############################################################## //####################### BERPAO ############################## function annulla() { var start = location.toString().lastIndexOf('.nsf/') + 5; //Recupero parte della location che va da dopo nsf/ fino alla fine var partialLoc = location.toString().substring( start ); //Cerco in questa stringa la presenza della / var posSlash = partialLoc.indexOf( '/' ) //Se la slash non esiste vuol dire che il documento è nuovo, altrimenti è già stato salvato if ( posSlash == -1) { history.go(-1); } else { var target = partialLoc.substring( 0 , posSlash ); switch ( target ) { case "TB001": location=urlString+"/TB001?OpenView&Start=1&Count=10"; break; case "TB002": location=urlString+"/TB002?OpenView&Start=1&Count=10"; break; default: location=urlString+"/"+target+"?OpenView&Start=1&Count=10"; break; } } } //Funzione per nascondere una colonna function changeCol(oTable , h , s) { var cRows = oTable.rows; for (var i = 0 ; i < cRows.length ; i++) { for (var k = 0; k < h.length ; k++) { cRows[i].cells[ h[k]-1 ].style.display="none"; } for (var j = 0; j < s.length ; j++) { cRows[i].cells[ s[j]-1 ].style.display="block"; } } } //############################################################################### //Funzione che gestisce la visualizzazione di un tooltip personalizzato var objDragItem = null; var bDragMode = false; function hideMsg() { bDragMode = false; if (objDragItem != null ) { objDragItem.removeNode(true); } objDragItem = null; } function showMsg( tipo ) { //var messaggio = setResultMessage( tipo , separatore , obblig ); var messaggio = tipo; //bDragMode = true; objDragItem = document.createElement("DIV"); document.body.insertBefore( objDragItem ) //Formattazione objDragItem.style.borderStyle = "solid"; objDragItem.style.borderWidth = "1px"; objDragItem.style.width = "150px"; objDragItem.style.backgroundColor = "#F7FBDD"; objDragItem.style.fontFamily = "Arial"; objDragItem.style.fontSize = "8pt"; objDragItem.style.fontWeight = "normal"; objDragItem.style.color = "#0000BB"; //Fine Formattazione objDragItem.innerHTML = messaggio; objDragItem.style.position = "absolute"; //objDragItem.style.zIndex = "10"; //objDragItem.style.display = "none"; //Hardcoded value for height difference var midWObj = objDragItem.style.posWidth / 2; var midHObj = 5; // Save mouse's position in the document var intTop = event.clientY + document.body.scrollTop; var intLeft = event.clientX + document.body.scrollLeft; var cx=0; var cy=0; // Set position //objDragItem.style.pixelTop = intTop - cx - midHObj - 25; //objDragItem.style.pixelLeft = intLeft - cy - midWObj + (objDragItem.offsetWidth * 0.5); objDragItem.style.pixelTop = intTop; objDragItem.style.pixelLeft = intLeft -180; event.cancelBubble = true; event.returnValue = false; } function manageMove() { if(!bDragMode || !objDragItem) return; //Hardcoded value for height difference var midWObj = objDragItem.style.posWidth / 2; var midHObj = 5; // Save mouse's position in the document var intTop = event.clientY + document.body.scrollTop; var intLeft = event.clientX + document.body.scrollLeft; var cx=0; var cy=0; //alert( objDragItem.tagName ); /* var elCurrent = objDragItem.offsetParent; //alert(elCurrent) while (elCurrent.offsetParent != null) { cx += elCurrent.offsetTop; cy += elCurrent.offsetLeft; elCurrent = elCurrent.offsetParent; } */ // Set position objDragItem.style.pixelTop = intTop - cx - midHObj - 25; objDragItem.style.pixelLeft = intLeft - cy - midWObj + (objDragItem.offsetWidth * 0.5); //alert(elCurrent) if ( objDragItem.style.display == "none" ) { objDragItem.style.display = "block"; //alert(objDragItem.outerHTML) } event.cancelBubble = true; event.returnValue = false; } //############################################################################### //Restituisce True se il parametro la data passata ("data") è compresa nel periodo definito da "dataIniz" e "dataFine" //Il parametro formatao indica il formao in cui fare il controllo ( "GG/MM/AAAA" o "MM/GG/AAAA" ) function isBetween( dataIniz , dataFine , data , formato) { var tempDataIniz = dataIniz.split( "/" ); var tempDataFine = dataFine.split( "/" ); var tempData = data.split( "/" ); if (formato.toUpperCase() == "GG/MM/AAAA") { var newDataIniz = new Date( Number( tempDataIniz[2] ) , Number( tempDataIniz[1] ) - 1 , Number( tempDataIniz[0] ) ); var newDataFine = new Date( Number( tempDataFine[2] ) , Number( tempDataFine[1] ) - 1 , Number( tempDataFine[0] ) ); var newData = new Date( Number( tempData[2] ) , Number( tempData[1] ) - 1 , Number( tempData[0] ) ); } else { var newDataIniz = new Date( Number( tempDataIniz[2] ) , Number( tempDataIniz[0] ) - 1 , Number( tempDataIniz[1] ) ); var newDataFine = new Date( Number( tempDataFine[2] ) , Number( tempDataFine[0] ) - 1 , Number( tempDataFine[1] ) ); var newData = new Date( Number( tempData[2] ) , Number( tempData[0] ) - 1 , Number( tempData[1] ) ); } if ( ( newData >= newDataIniz ) && ( newData <= newDataFine ) ) { return true; } else { return false; } } //FUNZIONE USATA DALLA AGENTE AG02 PER RECUPERARE I VALORI E PORTARLI NELL' OPENER function getValues( sTableId , sRowId ) { //var selIndex = top.frames[0].document.forms[0].SEARCH_SOC.options.selectedIndex; //var valoreSoc = top.frames[0].document.forms[0].SEARCH_SOC.options[selIndex].text ; //var valori = valoreSoc.split( " - " ); var codSoc = "" ; var descSoc = ""; var codCli = ""; var ragSocCli = ""; var oTable = document.getElementById( sTableId ); var numRiga = Number( sRowId ) ; var oRow = oTable.rows[numRiga]; ragSocCli = oRow.cells[0].innerText; codCli = oRow.cells[1].innerText; codSoc = oRow.cells[2].innerText; top.opener.document.forms[0].RE_CODCLI.value = codCli ; top.opener.document.forms[0].RE_DESCLI.value = ragSocCli ; top.opener.document.forms[0].RE_CODSOC.value = codSoc; top.close(); } function getValGest( sTableId , sRowId ) { var ragSocAg = ""; var oTable = document.getElementById( sTableId ); var numRiga = Number( sRowId ) ; var oRow = oTable.rows[numRiga]; ragSocAg = oRow.cells[0].innerText; top.opener.document.forms[0].RE_GESTSOLUZIONE.value = ragSocAg ; top.opener.document.forms[0].RE_GESTRECLAMO.value = ragSocAg ; top.close(); } //Blocca la pressione del tasto INVIO function interceptKeypress( codiceTasto ) { if ( codiceTasto == 13 ) { event.returnValue = false; } }