96 lines
2.7 KiB
JavaScript
96 lines
2.7 KiB
JavaScript
//<script language="Javascript">
|
|
|
|
var arSigneErreurLayers = new Array();
|
|
arSigneErreurLayers[0]='signeId';
|
|
arSigneErreurLayers[1]='signeMod';
|
|
arSigneErreurLayers[2]='signeNom';
|
|
arSigneErreurLayers[3]='erreur';
|
|
|
|
|
|
function resetFieldsAlerte()
|
|
{
|
|
var objRef,i;
|
|
objRef=MM_findObj('txt_mod');
|
|
// le 1er checked sélectionne le 1er bouton et déselectionne les autres;
|
|
// le 2eme checked déselectionne aussi le 1er bouton
|
|
objRef[0].checked=true;
|
|
objRef[0].checked=false;
|
|
objRef=MM_findObj('ident');
|
|
objRef.value='';
|
|
objRef=MM_findObj('txt_refint');
|
|
objRef.value='';
|
|
MM_showHideLayers('',arSigneErreurLayers);
|
|
//return(false);
|
|
}
|
|
|
|
function validRequest(objLink,sMod,sFam,sSource)
|
|
{
|
|
var objIdent,objMod,sDiv,i;
|
|
|
|
objIdent = MM_findObj(sSource);
|
|
if (objIdent.src.indexOf('_in.gif')==-1)
|
|
{
|
|
objIdent = MM_findObj('ident');
|
|
|
|
MM_showHideLayers('',arSigneErreurLayers);
|
|
|
|
sDiv='<div class="clErreur">' ;
|
|
if(objIdent.value=="")
|
|
{
|
|
MM_setTextOfLayer('erreur','',sDiv + aErreur['U053'] + "</div>")
|
|
MM_showHideLayers('',arSigneErreurLayers,'erreur','signeId');
|
|
return(false) ;
|
|
}
|
|
objMod = MM_findObj('txt_mod');
|
|
i=-1;
|
|
while (sMod=='' & ++i<objMod.length) if (objMod[i].checked) sMod=objMod[i].value;
|
|
if(sMod=='')
|
|
{
|
|
MM_setTextOfLayer('erreur','',sDiv + aErreur['U054'] + "</div>")
|
|
MM_showHideLayers('',arSigneErreurLayers,'erreur','signeMod');
|
|
return(false) ;
|
|
}
|
|
else
|
|
{
|
|
iIndex=sUserProfile.indexOf("|" + sMod.toUpperCase()+ "|") ;
|
|
if (iIndex==-1)
|
|
{
|
|
MM_setTextOfLayer('erreur','',sDiv + aErreur['U02'] + "</div>")
|
|
MM_showHideLayers('',arSigneErreurLayers,'erreur','signeMod');
|
|
return(false) ;
|
|
}
|
|
}
|
|
|
|
if (iCheckIdentifiant(objIdent.value)==cstNothing)
|
|
{
|
|
MM_setTextOfLayer('erreur','',sDiv + aErreur['U01'] + "</div>")
|
|
MM_showHideLayers('',arSigneErreurLayers,'erreur','signeId');
|
|
return(false) ;
|
|
}
|
|
|
|
if (iCheckIdentifiant(objIdent.value)==cstBDFKey)
|
|
{
|
|
iIndex=cstValidModuleList4BDFKeys.indexOf("|" + sMod.toUpperCase() + "|") ;
|
|
if (iIndex==-1)
|
|
{
|
|
MM_setTextOfLayer('erreur','',sDiv + aErreur['IST06'] + "</div>")
|
|
MM_showHideLayers('',arSigneErreurLayers,'erreur','signeMod');
|
|
return(false) ;
|
|
}
|
|
if (objIdent.value.length<13)
|
|
{
|
|
var sSuffixe = objIdent.value.slice(objIdent.value.length-2,objIdent.value.length)
|
|
if (isNaN(sSuffixe))
|
|
{
|
|
MM_setTextOfLayer('erreur','',sDiv + aErreur['U011'] + "</div>")
|
|
MM_showHideLayers('',arSigneErreurLayers,'erreur','signeId');
|
|
return(false) ;
|
|
}
|
|
}
|
|
}
|
|
var objRef=MM_findObj('txt_refint');
|
|
requestBDFInfos(sMod,objRef.value,sFam, objIdent.value, false,false,objLink);
|
|
}
|
|
}
|
|
|