/* Regdb Client - DMS - nov 1998 by Patrice FAVRE */ typeof winIns=ObjWin;; typeof TNomIns=ObjText;; typeof TEmailIns=ObjText;; typeof TMotsIns=ObjText;; typeof TPasswdIns=ObjText;; typeof FNomIns=ObjText;; typeof FEmailIns=ObjText;; typeof FMotsIns=ObjText;; typeof FPasswdIns=ObjText;; typeof ValNomIns=S;; typeof ValEmailIns=S;; typeof ValMotsIns=S;; typeof ValPasswdIns=S;; typeof BWlistIns=ObjButton;; typeof winUpd=ObjWin;; typeof TNomUpd=ObjText;; typeof TEmailUpd=ObjText;; typeof TMotsUpd=ObjText;; typeof TPasswdUpd=ObjText;; typeof TNewPasswdUpd=ObjText;; typeof FNomUpd=ObjText;; typeof FEmailUpd=ObjText;; typeof FMotsUpd=ObjText;; typeof FPasswdUpd=ObjText;; typeof FNewPasswdUpd=ObjText;; typeof ValNomUpd=S;; typeof ValEmailUpd=S;; typeof ValMotsUpd=S;; typeof ValPasswdUpd=S;; typeof ValNewPasswdUpd=S;; typeof BWlistUpd=ObjButton;; typeof winAdm=ObjWin;; typeof TNomAdm=ObjText;; typeof TEmailAdm=ObjText;; typeof TMotsAdm=ObjText;; typeof TPasswdAdm=ObjText;; typeof FNomAdm=ObjText;; typeof FEmailAdm=ObjText;; typeof FMotsAdm=ObjText;; typeof FPasswdAdm=ObjText;; typeof ValNomAdm=S;; typeof ValEmailAdm=S;; typeof ValMotsAdm=S;; typeof ValPasswdAdm=S;; typeof BWlistAdm=ObjButton;; typeof BEnregIns=ObjButton;; typeof BAnnulIns=ObjButton;; typeof BFetchUpd=ObjButton;; typeof BEnregUpd=ObjButton;; typeof BAnnulUpd=ObjButton;; typeof BSetAdm=ObjButton;; typeof BDelAdm=ObjButton;; typeof BFetchAdm=ObjButton;; typeof BAnnulAdm=ObjButton;; typeof saisieOK=I;; typeof LgLColName=I;; typeof LgLColEmail=I;; typeof LgLColPasswd=I;; typeof LgWColWord=I;; typeof Wlist=[ S r1 ];; typeof Policy=S;; typeof Maxlog=I;; struct Chk=[ Ochk:ObjCheck, Tchk:S ] mkChk;; typeof Chklist=[ Chk r1 ];; typeof BEnreg=ObjButton;; typeof BAnnul=ObjButton;; typeof win=ObjWin;; typeof winWlist=[ObjWin ObjWin];; typeof TMots=ObjText;; typeof Vh=I;; defcom CEnregUtil=EnregUtil S S S S;; defcom CModifUtil=ModifUtil S S S S S;; defcom CModifUtilP3=ModifUtilP3 S S S S S;; defcom CFetchUtilUpdP3=FetchUtilUpdP3 S S;; defcom CSetUtil=SetUtil S S S S;; defcom CFetchUtilAdm=FetchUtilAdm S;; defcom CFetchUtilUpd=FetchUtilUpd S S;; defcom CDelUtil=DelUtil S;; defcom CInitUpdate=InitUpdate S;; defcom CInitFetchUpd=InitFetchUpd S;; /*-----------------------*/ fun ConcLst(p,q)= if p==nil then q else (hd p)::(ConcLst tl p q);; /*-----------------------*/ fun _endZone(z)= if !strcmp z Z_FORM_INS then ( if winIns != nil then ( _DSwindow winIns; _DMSreleaseZone this z; set winIns=nil ) else nil; _DMSevent this EVT_INSERT_HIDDEN nil nil ) else if !strcmp z Z_FORM_UPD then ( if winUpd != nil then ( _DSwindow winUpd; _DMSreleaseZone this z; set winUpd=nil ) else nil; _DMSevent this EVT_UPDATE_HIDDEN nil nil ) else if !strcmp z Z_FORM_ADM then ( if winAdm != nil then ( _DSwindow winAdm; _DMSreleaseZone this z; set winAdm=nil ) else nil; _DMSevent this EVT_ADMIN_HIDDEN nil nil ) else nil; 0;; /*-----------------------*/ fun _destroyE(a,b)= _endZone b;; /*-----------------------*/ fun _destroyZ(a,b,c)= _endZone b;; /*-----------------------*/ fun _enregUtil(Nom, Email, Mots, Passwd)= _DMSsend this CEnregUtil [ Nom Email Mots signN Passwd Maxlog ];; /*-----------------------*/ fun _modifUtil(Nom, Email, Mots, Passwd, NewPasswd)= if Maxlog==nil then /* cas P2 */ _DMSsend this CModifUtil [ Nom Email Mots Passwd NewPasswd ] else /* cas P3 */ _DMSsend this CInitUpdate [ Nom ];; /*-----------------------*/ fun _setUtil(Nom, Email, Mots, Passwd)= _DMSsend this CSetUtil [ Nom Email Mots signN Passwd Maxlog ];; /*-----------------------*/ fun _fetchUtilUpd(Nom, Passwd)= if Maxlog==nil then /* cas P2 */ _DMSsend this CFetchUtilUpd [ Nom Passwd ] else /* cas P3 */ _DMSsend this CInitFetchUpd [ Nom ];; /*-----------------------*/ fun _fetchUtilAdm(Nom)= _DMSsend this CFetchUtilAdm [ Nom ];; /*-----------------------*/ fun _delUtil(Nom)= _DMSsend this CDelUtil [ Nom ];; /*-----------------------*/ fun _focus(B, T, a)= _SETtextFocus T;; /*-----------------------*/ fun _cleanAdm(a,b,c)= _SETtext TNomAdm ""; _SETtext TEmailAdm ""; _SETtext TMotsAdm ""; _SETtext TPasswdAdm ""; _focus nil TNomAdm nil;; /*-----------------------*/ fun _affErr(win, msg, T)= set saisieOK=0; _DLGrflmessage _DLGMessageBox _channel win TIT_ERREUR msg 0 @_focus T;; /*-----------------------*/ fun _resizeE(wn, Z, w, h)= if !strcmp Z Z_FORM_INS then ( _SIZEtext FNomIns 100 20 5 5; _SIZEtext FEmailIns 100 20 5 5+h/6; _SIZEtext FPasswdIns 100 20 5 5+2*h/6; _SIZEtext FMotsIns 100 20 5 5+3*h/6; _SIZEtext TNomIns w-115 20 110 5; _SIZEtext TEmailIns w-115 20 110 5+h/6; _SIZEtext TPasswdIns w-115 20 110 5+2*h/6; _SIZEtext TMotsIns w-115 20 110 5+3*h/6; _SIZEbutton BEnregIns 70 20 w/2-80 5+5*h/6; _SIZEbutton BAnnulIns 70 20 w/2+10 5+5*h/6; _SIZEbutton BWlistIns 50 20 110 30+3*h/6 ) else if !strcmp Z Z_FORM_UPD then ( _SIZEtext FNomUpd 100 20 5 5; _SIZEtext FEmailUpd 100 20 5 5+h/7; _SIZEtext FPasswdUpd 100 20 5 5+2*h/7; _SIZEtext FNewPasswdUpd 100 20 5 5+3*h/7; _SIZEtext FMotsUpd 100 20 5 5+4*h/7; _SIZEtext TNomUpd w-115 20 110 5; _SIZEtext TEmailUpd w-115 20 110 5+h/7; _SIZEtext TPasswdUpd w-115 20 110 5+2*h/7; _SIZEtext TNewPasswdUpd w-115 20 110 5+3*h/7; _SIZEtext TMotsUpd w-115 20 110 5+4*h/7; _SIZEbutton BFetchUpd 70 20 w/2-35 5+6*h/7-25; _SIZEbutton BEnregUpd 70 20 w/2-80 5+6*h/7; _SIZEbutton BAnnulUpd 70 20 w/2+10 5+6*h/7; _SIZEbutton BWlistUpd 50 20 110 30+4*h/7 ) else if !strcmp Z Z_FORM_ADM then ( _SIZEtext FNomAdm 100 20 5 5; _SIZEtext FEmailAdm 100 20 5 5+h/6; _SIZEtext FPasswdAdm 100 20 5 5+2*h/6; _SIZEtext FMotsAdm 100 20 5 5+3*h/6; _SIZEtext TNomAdm w-115 20 110 5; _SIZEtext TEmailAdm w-115 20 110 5+h/6; _SIZEtext TPasswdAdm w-115 20 110 5+2*h/6; _SIZEtext TMotsAdm w-115 20 110 5+3*h/6; _SIZEbutton BFetchAdm 70 20 w/2-110 5*h/6-20; _SIZEbutton BSetAdm 70 20 w/2-35 5*h/6-20; _SIZEbutton BDelAdm 70 20 w/2+40 5*h/6-20; _SIZEbutton BAnnulAdm 70 20 w/2-35 5+5*h/6; _SIZEbutton BWlistAdm 50 20 110 30+3*h/6 ) else nil;; /*-----------------------*/ fun _validIns(B, a)= set saisieOK=1; let strextr strlowercase _GETtext TMotsIns -> lst in ( TraitDblLig lst; let strbuild lst -> str in ( while (nth_char str (strlen str)-1) == 10 do set str=substr str 0 (strlen str)-1; _SETtext TMotsIns str )); set ValNomIns=_GETtext TNomIns ; set ValEmailIns=_GETtext TEmailIns; set ValMotsIns=_GETtext TMotsIns; set ValPasswdIns=_GETtext TPasswdIns; /* Contrôle champs obligatoires */ if (strlen ValNomIns) == 0 then _affErr winIns E_OBL_NOM TNomIns else if (strlen ValEmailIns) == 0 then _affErr winIns E_OBL_EMAIL TEmailIns else if (strlen ValMotsIns) == 0 then _affErr winIns E_OBL_MOTS TMotsIns else /* Contrôle longueur */ let TraitLgMot hd strextr _GETtext TMotsIns LgWColWord -> tst in if tst != nil then _affErr winIns strcatn "\""::tst::"\""::E_WLONG::(itoa LgWColWord)::nil TMotsIns else /* Contrôle syntaxe */ let strfind "@" ValEmailIns 0 -> PosCar in if PosCar == nil then _affErr winIns E_CAR_EMAIL TEmailIns else if PosCar == 0 then _affErr winIns E_CARDEB_EMAIL TEmailIns else if PosCar == (strlen ValEmailIns) - 1 then _affErr winIns E_CARFIN_EMAIL TEmailIns else if (strfind "@" ValEmailIns PosCar+1) != nil then _affErr winIns E_CARUNI_EMAIL TEmailIns else nil; if saisieOK then _enregUtil ValNomIns ValEmailIns ValMotsIns ValPasswdIns else nil;; /*-----------------------*/ fun _setAdm(B, a)= set saisieOK=1; let strextr strlowercase _GETtext TMotsAdm -> lst in ( TraitDblLig lst; let strbuild lst -> str in ( set str=substr str 0 (strlen str)-1; _SETtext TMotsAdm str )); set ValNomAdm=_GETtext TNomAdm ; set ValEmailAdm=_GETtext TEmailAdm; set ValMotsAdm=_GETtext TMotsAdm; set ValPasswdAdm=_GETtext TPasswdAdm; /* Contrôle champs obligatoires */ if (strlen ValNomAdm) == 0 then _affErr winAdm E_OBL_NOM TNomAdm else if (strlen ValEmailAdm) == 0 then _affErr winAdm E_OBL_EMAIL TEmailAdm else if (strlen ValMotsAdm) == 0 then _affErr winAdm E_OBL_MOTS TMotsAdm else /* Contrôle longueur */ let TraitLgMot hd strextr _GETtext TMotsAdm LgWColWord -> tst in if tst != nil then _affErr winAdm strcatn "\""::tst::"\""::E_WLONG::(itoa LgWColWord)::nil TMotsAdm else /* Contrôle syntaxe */ let strfind "@" ValEmailAdm 0 -> PosCar in if PosCar == nil then _affErr winAdm E_CAR_EMAIL TEmailAdm else if PosCar == 0 then _affErr winAdm E_CARDEB_EMAIL TEmailAdm else if PosCar == (strlen ValEmailAdm) - 1 then _affErr winAdm E_CARFIN_EMAIL TEmailAdm else if (strfind "@" ValEmailAdm PosCar+1) != nil then _affErr winAdm E_CARUNI_EMAIL TEmailAdm else nil; if saisieOK then _setUtil ValNomAdm ValEmailAdm ValMotsAdm ValPasswdAdm else nil;; /*-----------------------*/ fun _fetchAdm(B, a)= set saisieOK=1; set ValNomAdm=_GETtext TNomAdm ; /* Contrôle champs obligatoires */ if (strlen ValNomAdm) == 0 then _affErr winAdm E_OBL_NOM TNomAdm else nil; if saisieOK then _fetchUtilAdm ValNomAdm else nil;; /*-----------------------*/ fun _delAdm(B, a)= set saisieOK=1; set ValNomAdm=_GETtext TNomAdm ; /* Contrôle champs obligatoires */ if (strlen ValNomAdm) == 0 then _affErr winAdm E_OBL_NOM TNomAdm else nil; if saisieOK then _delUtil ValNomAdm else nil;; /*-----------------------*/ fun _fetchUpd(B, a)= set saisieOK=1; set ValNomUpd=_GETtext TNomUpd ; set ValPasswdUpd=_GETtext TPasswdUpd; /* Contrôle champs obligatoires */ if (strlen ValNomUpd) == 0 then _affErr winUpd E_OBL_NOM TNomUpd else if (strlen ValPasswdUpd) == 0 then _affErr winUpd E_OBL_PWD TPasswdUpd else nil; if saisieOK then _fetchUtilUpd ValNomUpd ValPasswdUpd else nil;; /*-----------------------*/ fun _validUpd(B, a)= set saisieOK=1; let strextr strlowercase _GETtext TMotsUpd -> lst in ( TraitDblLig lst; let strbuild lst -> str in ( while (nth_char str (strlen str)-1) == 10 do set str=substr str 0 (strlen str)-1; _SETtext TMotsUpd str )); set ValNomUpd=_GETtext TNomUpd ; set ValEmailUpd=_GETtext TEmailUpd; set ValMotsUpd=_GETtext TMotsUpd; set ValPasswdUpd=_GETtext TPasswdUpd; set ValNewPasswdUpd=_GETtext TNewPasswdUpd; /* Contrôle champs obligatoires */ if (strlen ValNomUpd) == 0 then _affErr winUpd E_OBL_NOM TNomUpd else if (strlen ValPasswdUpd) == 0 then _affErr winUpd E_OBL_PWD TPasswdUpd else /* Contrôle longueur */ let TraitLgMot hd strextr _GETtext TMotsUpd LgWColWord -> tst in if tst != nil then _affErr winUpd strcatn "\""::tst::"\""::E_WLONG::(itoa LgWColWord)::nil TMotsUpd else /* Contrôle syntaxe */ if strlen ValEmailUpd then let strfind "@" ValEmailUpd 0 -> PosCar in if PosCar == nil then _affErr winUpd E_CAR_EMAIL TEmailUpd else if PosCar == 0 then _affErr winUpd E_CARDEB_EMAIL TEmailUpd else if PosCar == (strlen ValEmailUpd) - 1 then _affErr winUpd E_CARFIN_EMAIL TEmailUpd else if (strfind "@" ValEmailUpd PosCar+1) != nil then _affErr winUpd E_CARUNI_EMAIL TEmailUpd else nil else nil; if saisieOK then _modifUtil ValNomUpd ValEmailUpd ValMotsUpd ValPasswdUpd ValNewPasswdUpd else nil;; /*-----------------------*/ fun Rsz3Mots(w,posy,clst)= if clst == nil then 0 else ( let hd clst -> elem in _POSITIONcheck elem.Ochk 5 posy w/3-10 20; if (tl clst) != nil then ( let hd tl clst -> elem in _POSITIONcheck elem.Ochk w/3-5 posy w/3-10 20; if (tl tl clst) != nil then let hd tl tl clst -> elem in _POSITIONcheck elem.Ochk 2*w/3-10 posy w/3-10 20 else nil ) else nil; Rsz3Mots w posy+25 tl tl tl clst );; /*-----------------------*/ fun _resizeWlist(wn, Z, w, h)= Rsz3Mots w 5 Chklist; let _GETbuttonPositionSize BEnreg -> [ _ By _ _ ] in _POSITIONbutton BEnreg w/2-80 By 70 20; let _GETbuttonPositionSize BAnnul -> [ _ By _ _ ] in _POSITIONbutton BAnnul w/2+10 By 70 20;; /*-----------------------*/ fun FindMot(mot,lstmots)= if lstmots==nil then 0 else if !strcmp mot hd lstmots then 1 else FindMot mot tl lstmots;; /*-----------------------*/ fun Aff3Mots(win,w,posy,lstmots,wlst)= if wlst == nil then 0 else ( let hd wlst -> mot in let _CRcheck _channel win 5 posy w/3-10 20 0 mot -> chk in ( set Chklist=ConcLst Chklist (mkChk [ chk mot ])::nil; _SETcheck chk FindMot mot lstmots ); if (tl wlst) != nil then ( let hd tl wlst -> mot in let _CRcheck _channel win w/3-5 posy w/3-10 20 0 mot -> chk in ( set Chklist=ConcLst Chklist (mkChk [ chk mot ])::nil; _SETcheck chk FindMot mot lstmots ); if (tl tl wlst) != nil then let hd tl tl wlst -> mot in let _CRcheck _channel win 2*w/3-10 posy w/3-10 20 0 mot -> chk in ( set Chklist=ConcLst Chklist (mkChk [ chk mot ])::nil; _SETcheck chk FindMot mot lstmots ) else nil ) else nil; Aff3Mots win w posy+25 lstmots tl tl tl wlst );; /*-----------------------*/ fun _destroyWlist(a,b)= _DSwindow b; set winWlist=nil;; /*-----------------------*/ fun TraitChk(lst)= if lst == nil then "" else let hd lst -> chk in if (_GETcheck chk.Ochk)==1 then strcatn (chk.Tchk)::(let TraitChk tl lst -> conc in if (strlen conc)==0 then nil else " "::conc::nil) else TraitChk tl lst;; /*-----------------------*/ fun FindChk(mot,lst)= if lst == nil then mot else let hd lst -> chk in if !strcmp mot chk.Tchk then if (_GETcheck chk.Ochk)==1 then ( _SETcheck chk.Ochk 0; mot ) else "" else FindChk mot tl lst;; /*-----------------------*/ fun TraitWlist(lst)= if lst == nil then "" else let hd lst -> mot in strcatn (FindChk mot Chklist)::(let TraitWlist tl lst -> conc in if (strlen conc)==0 then nil else " "::conc::nil);; /*-----------------------*/ fun _validWlist(a,b)= _SETtext b strcatn (TraitWlist hd strextr strlowercase _GETtext b):: (let TraitChk Chklist -> reste in if (strlen reste)==0 then nil else " "::reste::nil); _destroyWlist nil (let winWlist -> [ Par Chld ] in Par);; /*-----------------------*/ fun _AffWlist(a,b)= if winWlist != nil then nil else ( if !strcmp b Z_FORM_INS then ( set win=winIns; set TMots=TMotsIns ) else if !strcmp b Z_FORM_UPD then ( set win=winUpd; set TMots=TMotsUpd ) else if !strcmp b Z_FORM_ADM then ( set win=winAdm; set TMots=TMotsAdm ) else nil; let strlowercase _GETtext TMots -> mots in let 400 -> w in let 300 -> h in let w-30 -> Vw in let ((sizelist Wlist)/3+3)*25 -> Vh in ( set winWlist=_CRscrollWindow _channel win nil nil w h Vw Vh WN_VSCROLL|WN_MENU|WN_MINBOX|WN_SIZEBOX TIT_WLIST; /* debut patch */ /* let _CRwindow _channel win nil nil w h WN_MENU|WN_MINBOX|WN_SIZEBOX TIT_WLIST -> win in set winWlist=[win win];*/ /* fin patch */ set Chklist=nil; let winWlist -> [ winWPar winWChld ] in ( /* Affichage cases ŕ cocher */ Aff3Mots winWChld w 5 hd strextr mots Wlist; /* Bouton validation */ set BEnreg=_CRbutton _channel winWChld w/2-80 Vh-25 70 20 0 B_OK; _CBbutton BEnreg @_validWlist TMots; set BAnnul=_CRbutton _channel winWChld w/2+10 Vh-25 70 20 0 B_CANCEL; _CBbutton BAnnul @_destroyWlist winWPar; _CBwinDestroy winWPar @_destroyWlist winWPar; _CBwinSize winWPar @_resizeWlist nil )) );; /*-----------------------*/ fun Saisie()= if winIns == nil then ( let _DMSgetZone this Z_FORM_INS nil nil @_endZone -> [wn x y w h] in ( if wn==nil then ( set w=400; set h=300; set winIns=_CRwindow _channel DMSwin nil nil w h WN_MENU|WN_MINBOX|WN_SIZEBOX TIT_SAISIE ) else set winIns=_CRwindow _channel wn x y w h WN_CHILDINSIDE|WN_NOCAPTION|WN_NOBORDER ""; /* Champs */ set FNomIns=_CRtext _channel winIns 5 5 100 20 ET_ALIGN_RIGHT F_NOM; set FEmailIns=_CRtext _channel winIns 5 5+h/6 100 20 ET_ALIGN_RIGHT F_EMAIL; set FPasswdIns=_CRtext _channel winIns 5 5+2*h/6 100 20 ET_ALIGN_RIGHT F_PASSWD; set FMotsIns=_CRtext _channel winIns 5 5+3*h/6 100 20 ET_ALIGN_RIGHT F_MOTS; /* Zones de saisie */ set TNomIns=_CReditLine _channel winIns 110 5 w-115 20 ET_DOWN|ET_AHSCROLL ""; set TEmailIns=_CReditLine _channel winIns 110 5+h/6 w-115 20 ET_DOWN|ET_AHSCROLL ""; set TPasswdIns=_CReditLine _channel winIns 110 5+2*h/6 w-115 20 ET_DOWN|ET_AHSCROLL|ET_PASSWORD ""; set TMotsIns=_CReditLine _channel winIns 110 5+3*h/6 w-115 20 ET_DOWN|ET_AHSCROLL ""; set BWlistIns=_CRbutton _channel winIns 110 30+3*h/6 50 20 0 B_WLIST; _CBbutton BWlistIns @_AffWlist Z_FORM_INS; _SETtextSize TNomIns LgLColName; _SETtextSize TEmailIns LgLColEmail; _SETtextSize TMotsIns DFT_LGWLIST; _SETtextSize TPasswdIns LgLColPasswd; _focus nil TNomIns nil; /* Bouton validation */ set BEnregIns=_CRbutton _channel winIns w/2-80 5+5*h/6 70 20 0 B_OK; _CBbutton BEnregIns @_validIns nil; set BAnnulIns=_CRbutton _channel winIns w/2+10 5+5*h/6 70 20 0 B_CANCEL; _CBbutton BAnnulIns @_destroyE Z_FORM_INS; _CBwinDestroy winIns @_destroyE Z_FORM_INS; _CBwinSize winIns @_resizeE Z_FORM_INS; ) ) else nil; _DMSevent this EVT_INSERT_SHOWN nil nil;; /*-----------------------*/ fun Modif()= if winUpd == nil then ( let _DMSgetZone this Z_FORM_UPD nil nil @_endZone -> [wn x y w h] in ( if wn==nil then ( set w=400; set h=300; set winUpd=_CRwindow _channel DMSwin nil nil w h WN_MENU|WN_MINBOX|WN_SIZEBOX TIT_MODIF ) else set winUpd=_CRwindow _channel wn x y w h WN_CHILDINSIDE|WN_NOCAPTION|WN_NOBORDER ""; /* Champs */ set FNomUpd=_CRtext _channel winUpd 5 5 100 20 ET_ALIGN_RIGHT F_NOM; set FEmailUpd=_CRtext _channel winUpd 5 5+h/7 100 20 ET_ALIGN_RIGHT F_EMAIL; set FPasswdUpd=_CRtext _channel winUpd 5 5+2*h/7 100 20 ET_ALIGN_RIGHT F_PASSWD; set FNewPasswdUpd=_CRtext _channel winUpd 5 5+3*h/7 100 20 ET_ALIGN_RIGHT F_NEWPASSWD; set FMotsUpd=_CRtext _channel winUpd 5 5+4*h/7 100 20 ET_ALIGN_RIGHT F_MOTS; /* Zones de saisie */ set TNomUpd=_CReditLine _channel winUpd 110 5 w-115 20 ET_DOWN|ET_AHSCROLL ""; set TEmailUpd=_CReditLine _channel winUpd 110 5+h/7 w-115 20 ET_DOWN|ET_AHSCROLL ""; set TPasswdUpd=_CReditLine _channel winUpd 110 5+2*h/7 w-115 20 ET_DOWN|ET_AHSCROLL|ET_PASSWORD ""; set TNewPasswdUpd=_CReditLine _channel winUpd 110 5+3*h/7 w-115 20 ET_DOWN|ET_AHSCROLL|ET_PASSWORD ""; set TMotsUpd=_CReditLine _channel winUpd 110 5+4*h/7 w-115 20 ET_DOWN|ET_AHSCROLL ""; set BWlistUpd=_CRbutton _channel winUpd 110 30+4*h/7 50 20 0 B_WLIST; _CBbutton BWlistUpd @_AffWlist Z_FORM_UPD; _SETtextSize TNomUpd LgLColName; _SETtextSize TEmailUpd LgLColEmail; _SETtextSize TMotsUpd DFT_LGWLIST; _SETtextSize TPasswdUpd LgLColPasswd; _SETtextSize TNewPasswdUpd LgLColPasswd; _focus nil TNomUpd nil; /* Bouton validation */ set BFetchUpd=_CRbutton _channel winUpd w/2-35 5+6*h/7-25 70 20 0 B_FETCH; _CBbutton BFetchUpd @_fetchUpd nil; set BEnregUpd=_CRbutton _channel winUpd w/2-80 5+6*h/7 70 20 0 B_OK; _CBbutton BEnregUpd @_validUpd nil; set BAnnulUpd=_CRbutton _channel winUpd w/2+10 5+6*h/7 70 20 0 B_CANCEL; _CBbutton BAnnulUpd @_destroyE Z_FORM_UPD; _CBwinDestroy winUpd @_destroyE Z_FORM_UPD; _CBwinSize winUpd @_resizeE Z_FORM_UPD; ) ) else nil; _DMSevent this EVT_UPDATE_SHOWN nil nil;; /*-----------------------*/ fun __RetInsertOK(s)= if (atoi s) == 1 then let strbuild (KW_LOGIN::ValNomIns::nil)::(KW_PASSW::ValPasswdIns::nil)::nil -> cook in _storepack cook _getlongname "" NomFicCook ";" else nil; _DMSevent this EVT_INSERTED nil nil; _DLGrflmessage _DLGMessageBox _channel winIns TIT_INFO MSG_INS_OK 0 @_destroyZ Z_FORM_INS;; /*-----------------------*/ fun __RetUpdateOK(s)= if (atoi s) == 1 then let strbuild (KW_LOGIN::ValNomUpd::nil)::(KW_PASSW::(if (strlen ValNewPasswdUpd) then ValNewPasswdUpd else ValPasswdUpd)::nil)::nil -> cook in _storepack cook _getlongname "" NomFicCook ";" else nil; _DMSevent this EVT_UPDATED nil nil; _DLGrflmessage _DLGMessageBox _channel winUpd TIT_INFO MSG_UPD_OK 0 @_destroyZ Z_FORM_UPD;; /*-----------------------*/ fun __RetUpdateP3OK(s,n)= __RetUpdateOK s; if n>0 then _DLGrflmessage _DLGMessageBox _channel winAdm TIT_WARNING strcatn (itoa n)::" "::MSG_WARNING::nil 0 nil nil else nil;; /*-----------------------*/ fun __RetSetOK()= _DLGrflmessage _DLGMessageBox _channel winAdm TIT_INFO MSG_SET_OK 0 @_cleanAdm nil;; /*-----------------------*/ fun __RetDelOK()= _DLGrflmessage _DLGMessageBox _channel winAdm TIT_INFO MSG_DEL_OK 0 @_cleanAdm nil;; /*-----------------------*/ fun __RetFetchUpdOK(email, mots)= _SETtext TEmailUpd email; _SETtext TMotsUpd mots;; /*-----------------------*/ fun __RetFetchUpdP3OK(email, mots, n)= __RetFetchUpdOK email mots; if n>0 then _DLGrflmessage _DLGMessageBox _channel winAdm TIT_WARNING strcatn (itoa n)::" "::MSG_WARNING::nil 0 nil nil else nil;; /*-----------------------*/ fun __RetFetchAdmOK(email, mots)= _SETtext TEmailAdm email; _SETtext TMotsAdm mots;; /*-----------------------*/ fun __RetInsertKO()= _affErr winIns E_INS_KO TNomIns;; /*-----------------------*/ fun __RetUpdateKO()= _affErr winUpd E_UPD_KO TPasswdUpd;; /*-----------------------*/ fun __RetFetchUpdKO()= _affErr winUpd E_FTC_KO TNomUpd;; /*-----------------------*/ fun __RetFetchAdmKO()= _affErr winAdm E_FTC_KO TNomAdm;; /*-----------------------*/ fun __RetDelKO()= _affErr winAdm E_DEL_KO TNomAdm;; /*-----------------------*/ fun __RetInitUpdate(num)= if num==nil then __RetUpdateKO else ( _DMSsend this CModifUtilP3 [ ValNomUpd ValEmailUpd ValMotsUpd signN ValPasswdUpd atoi num signN ValNewPasswdUpd Maxlog ]; nil );; /*-----------------------*/ fun __RetInitFetchUpd(num)= if num==nil then __RetFetchUpdKO else ( _DMSsend this CFetchUtilUpdP3 [ ValNomUpd signN ValPasswdUpd atoi num ]; nil );; /*-----------------------*/ fun activate(from,action,param,rep)= if !strcmp action ACT_SHOW_INSERT then Saisie else if !strcmp action ACT_SHOW_UPDATE then Modif else if !strcmp action ACT_HIDE_INSERT then _endZone Z_FORM_INS else if !strcmp action ACT_HIDE_UPDATE then _endZone Z_FORM_UPD else nil;; /*-----------------------*/ fun IniDMI(param)= let strextr param -> l in ( set LgLColName=atoi getInfo l KW_LGLCOLNAME; set LgLColEmail=atoi getInfo l KW_LGLCOLEMAIL; set LgLColPasswd=atoi getInfo l KW_LGLCOLPASSWD; set LgWColWord=atoi getInfo l KW_LGWCOLWORD; set Wlist=hd strextr getInfo l KW_WLIST; set Maxlog=atoi getInfo l KW_MAXLOG ); _DMSregisterDMI this @activate nil; _DMSevent this EVT_STARTED nil nil;; /*-----------------------*/ fun __AffAdmin()= if winAdm == nil then ( let _DMSgetZone this Z_FORM_ADM nil nil @_endZone -> [wn x y w h] in ( if wn==nil then ( set w=400; set h=300; set winAdm=_CRwindow _channel DMSwin nil nil w h WN_MENU|WN_MINBOX|WN_SIZEBOX TIT_ADMIN ) else set winAdm=_CRwindow _channel wn x y w h WN_CHILDINSIDE|WN_NOCAPTION|WN_NOBORDER ""; /* Champs */ set FNomAdm=_CRtext _channel winAdm 5 5 100 20 ET_ALIGN_RIGHT F_NOM; set FEmailAdm=_CRtext _channel winAdm 5 5+h/6 100 20 ET_ALIGN_RIGHT F_EMAIL; set FPasswdAdm=_CRtext _channel winAdm 5 5+2*h/6 100 20 ET_ALIGN_RIGHT F_PASSWD; set FMotsAdm=_CRtext _channel winAdm 5 5+3*h/6 100 20 ET_ALIGN_RIGHT F_MOTS; /* Zones de saisie */ set TNomAdm=_CReditLine _channel winAdm 110 5 w-115 20 ET_DOWN|ET_AHSCROLL ""; set TEmailAdm=_CReditLine _channel winAdm 110 5+h/6 w-115 20 ET_DOWN|ET_AHSCROLL ""; set TPasswdAdm=_CReditLine _channel winAdm 110 5+2*h/6 w-115 20 ET_DOWN|ET_AHSCROLL|ET_PASSWORD ""; set TMotsAdm=_CReditLine _channel winAdm 110 5+3*h/6 w-115 20 ET_DOWN|ET_AHSCROLL ""; set BWlistAdm=_CRbutton _channel winAdm 110 30+3*h/6 50 20 0 B_WLIST; _CBbutton BWlistAdm @_AffWlist Z_FORM_ADM; _SETtextSize TNomAdm LgLColName; _SETtextSize TEmailAdm LgLColEmail; _SETtextSize TMotsAdm DFT_LGWLIST; _SETtextSize TPasswdAdm LgLColPasswd; _focus nil TNomAdm nil; /* Bouton validation */ set BFetchAdm=_CRbutton _channel winAdm w/2-110 5*h/6-20 70 20 0 B_FETCH; _CBbutton BFetchAdm @_fetchAdm nil; set BSetAdm=_CRbutton _channel winAdm w/2-35 5*h/6-20 70 20 0 B_SET; _CBbutton BSetAdm @_setAdm nil; set BDelAdm=_CRbutton _channel winAdm w/2+40 5*h/6-20 70 20 0 B_DEL; _CBbutton BDelAdm @_delAdm nil; set BAnnulAdm=_CRbutton _channel winAdm w/2-35 5+5*h/6 70 20 0 B_CANCEL; _CBbutton BAnnulAdm @_destroyE Z_FORM_ADM; _CBwinDestroy winAdm @_destroyE Z_FORM_ADM; _CBwinSize winAdm @_resizeE Z_FORM_ADM; ) ) else nil; _DMSevent this EVT_ADMIN_SHOWN nil nil;; /*-----------------------*/ fun __HideAdmin()= _endZone Z_FORM_ADM;;