94 lines
2.6 KiB
JavaScript
94 lines
2.6 KiB
JavaScript
//<script language="Javascript">
|
|
|
|
var arSigneErreurLayers = new Array();
|
|
arSigneErreurLayers[0]='signeId';
|
|
arSigneErreurLayers[1]='signeMod';
|
|
arSigneErreurLayers[2]='signeNom';
|
|
arSigneErreurLayers[3]='erreur';
|
|
|
|
function resetFields()
|
|
{
|
|
var objRef;
|
|
objRef=MM_findObj('txt_refint');
|
|
objRef.value='';
|
|
objRef=MM_findObj('txt_mod');
|
|
objRef.value='';
|
|
objRef=MM_findObj('ident');
|
|
objRef.value='';
|
|
MM_showHideLayers('',arSigneErreurLayers);
|
|
return(false);
|
|
}
|
|
|
|
function validRequest(objLink,sMod,sFam,sSource)
|
|
{
|
|
var objIdent,objMod,sDiv;
|
|
|
|
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');
|
|
if (sMod=='') sMod=objMod.value; else objMod.value=sMod;
|
|
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 ((sMod.substring(0,1)=="8")||(sMod.substring(0,1)=="9"))
|
|
{
|
|
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);
|
|
}
|
|
}
|
|
|