139 lines
4.1 KiB
JavaScript
139 lines
4.1 KiB
JavaScript
//<script language="Javascript">
|
|
|
|
var arFamilyList=new Array();
|
|
|
|
var arSigneErreurLayers = new Array();
|
|
arSigneErreurLayers[0]='cId';
|
|
arSigneErreurLayers[1]='c1';
|
|
arSigneErreurLayers[2]='c2';
|
|
arSigneErreurLayers[3]='c3';
|
|
arSigneErreurLayers[4]='c4';
|
|
arSigneErreurLayers[5]='c5';
|
|
arSigneErreurLayers[6]='c6';
|
|
arSigneErreurLayers[7]='c7';
|
|
arSigneErreurLayers[8]='c8';
|
|
arSigneErreurLayers[9]='c9';
|
|
arSigneErreurLayers[10]='c10';
|
|
arSigneErreurLayers[11]='signeNom';
|
|
arSigneErreurLayers[12]='erreur';
|
|
|
|
|
|
function resetFields()
|
|
{
|
|
var objRef;
|
|
objRef=MM_findObj('ident');
|
|
objRef.value='';
|
|
objRef=MM_findObj('txt_refint');
|
|
objRef.value='';
|
|
for (i=1;i<=10;i++) {
|
|
var objRef = MM_findObj('module'+i);
|
|
objRef.value='';
|
|
}
|
|
MM_showHideLayers('',arSigneErreurLayers);
|
|
//return(false);
|
|
}
|
|
|
|
function validRequest(objLink,sMod,sFam,sSource) {
|
|
var i,sUrl, sId, bFlag, oInput;
|
|
if (sMod==null) { // ce test équivaut à avoir cliquer sur le bouton valider
|
|
oInput=MM_findObj('ident');
|
|
if (bCheck(oInput.value)) {
|
|
sUrl= 'MultiModulesRequest.asp?Id=' + oInput.value;
|
|
oInput=MM_findObj('txt_refint');
|
|
if (oInput.value!=null && oInput.value!='') sUrl += '&RefClient=' + oInput.value;
|
|
for (i=1;i<=cstMaxMod;i++) {
|
|
oInput=MM_findObj('module' + i);
|
|
if (oInput.value!=null && oInput.value!='') {
|
|
sUrl += '&Mod=' + (oInput.value).toUpperCase() + '&Famille='
|
|
if (arFamilyList[i]==null) {
|
|
sUrl += '9';
|
|
}
|
|
else {
|
|
sUrl += arFamilyList[i];
|
|
}
|
|
}
|
|
}
|
|
objLink.href=sUrl;
|
|
}
|
|
}
|
|
else { // sinon, c'est que l'on a cliqué sur un menu
|
|
oInput = MM_findObj(sSource);
|
|
if (oInput.src.indexOf('_in.gif')==-1) {
|
|
bFlag=false;
|
|
for (i=1;i<=cstMaxMod && !(bFlag);i++) {
|
|
oInput = MM_findObj('module'+i);
|
|
if (oInput.value==null || oInput.value=='') bFlag=true;
|
|
}
|
|
if (bFlag) {
|
|
oInput.value=sMod;
|
|
arFamilyList[i-1]=sFam;
|
|
}
|
|
else {
|
|
window.alert ('Vous ne pouvez renseigner que 10 modules maximum');
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
function bCheck(sIdent) {
|
|
var bFlag,iCheckId,objIdent,iIndex;
|
|
var sDiv='<div class="clErreur">' ;
|
|
|
|
if(sIdent==""||sIdent=='null')
|
|
{
|
|
MM_setTextOfLayer('erreur','',sDiv + aErreur['U053'] + "</div>");
|
|
MM_showHideLayers('',arSigneErreurLayers,'erreur','cId');
|
|
return(false);
|
|
}
|
|
iCheckId=iCheckIdentifiant(sIdent);
|
|
if (iCheckId==cstNothing)
|
|
{
|
|
MM_setTextOfLayer('erreur','',sDiv + aErreur['U01'] + "</div>");
|
|
MM_showHideLayers('',arSigneErreurLayers,'erreur','cId');
|
|
return (false);
|
|
}
|
|
bFlag=false;
|
|
for(i=1;i<=cstMaxMod;i++)
|
|
{
|
|
objModule=MM_findObj('module' + i);
|
|
if ((objModule.value!='')&&(objModule.value!='null'))
|
|
{
|
|
bFlag=true ;
|
|
iIndex=sUserProfile.indexOf("|" + (objModule.value).toUpperCase() + "|") ;
|
|
if (objModule.value=='81' || objModule.value=='82' || objModule.value=='83' || objModule.value=='84' || objModule.value=='85' || objModule.value=='88' || objModule.value=='91' || objModule.value=='92' || objModule.value=='93' || objModule.value=='94' || objModule.value=='95' || objModule.value=='98' || objModule.value.toUpperCase()=='LS')
|
|
{
|
|
MM_setTextOfLayer('erreur','',sDiv + aErreur['U00A'] + "</div>");
|
|
MM_showHideLayers('',arSigneErreurLayers,'erreur','c' + i);
|
|
return(false);
|
|
}
|
|
if (objModule.value=='07')
|
|
{
|
|
MM_setTextOfLayer('erreur','',sDiv + aErreur['U00B'] + "</div>");
|
|
MM_showHideLayers('',arSigneErreurLayers,'erreur','c' + i);
|
|
return(false);
|
|
}
|
|
if (iIndex==-1)
|
|
{
|
|
MM_setTextOfLayer('erreur','',sDiv + aErreur['U02'] + "</div>");
|
|
MM_showHideLayers('',arSigneErreurLayers,'erreur','c' + i);
|
|
return(false);
|
|
}
|
|
if (iCheckId==cstBDFKey && cstValidModuleList4BDFKeys.indexOf("|" + (objModule.value).toUpperCase() + "|")==-1)
|
|
{
|
|
MM_setTextOfLayer('erreur','',sDiv + aErreur['IST06'] + "</div>");
|
|
MM_showHideLayers('',arSigneErreurLayers,'erreur','c' + i);
|
|
return (false);
|
|
}
|
|
}
|
|
}
|
|
if (bFlag==false)
|
|
{
|
|
MM_setTextOfLayer('erreur','',sDiv + aErreur['U054'] + "</div>");
|
|
MM_showHideLayers('',arSigneErreurLayers,'erreur','c1');
|
|
return(false);
|
|
}
|
|
return(true);
|
|
}
|
|
|