PC SOFT

GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEVWEBDEV e WINDEV Mobile

Inicio → WEBDEV 2024 → probleme ajaxexecuteasynchrone
probleme ajaxexecuteasynchrone
Iniciado por Monsieur DOUCET, abr., 19 2019 10:52 PM - 1 resposta
Membro registado
16 mensagems
Publicado em abril, 19 2019 - 10:52 PM
Bonsoir,

Voila plusieurs jours que j'essaie de faire fonctionner un ajaxexecuteasynchrone mais en vain.
La procédure serveur se lance bien mais je n'ai pas le retour du code navigateur final.
J'ai essayé de m'inspirait d'info trouvées sur le web mais à priori j'ai du faire une erreur :p
Merci par avance


code navigateur clic du bouton ( avec ajax activé dans le bandeau code serveur du bouton) :

res est un entier
res =AJAXExécuteAsynchrone(ajaxActualiseChamps,maj_auto_proc,nav_maj_auto_proc)


code serveur : maj_auto_proc ( ajax activé)

Procedure maj_auto_proc()
Fichier_a_telecharger est une chaîne
name_light_or_full est une chaîne

//Ping
ping_ouverte est un entier
ping_texte est une chaîne

ping_fichier est une chaîne
ping_fichier ="/diagbox/web/tmp/ping.txt"

SI fFichierExiste(ping_fichier) =Vrai ALORS
fSupprime(ping_fichier)
FIN
PHPExecute(scripts_ping)
Multitâche(10)

SI fFichierExiste(ping_fichier) =Faux ALORS
error_logs_proc("Pas de fichier ping txt apres lancement script ping.sh","ouverture page maj","")
RENVOYER "2"
FIN

ping_ouverte =fOuvre(ping_fichier,foLectureEcriture)
SI ping_ouverte =-1 ALORS
fSupprime(ping_fichier)
error_logs_proc("Echec ouverture fichier ping.txt","ouverture page maj","")
RENVOYER "2"
FIN

ping_texte =fLitLigne(ping_ouverte)
SI ping_texte ="ok" ALORS
fFerme(ping_ouverte)
fSupprime(ping_fichier)

SINON
fFerme(ping_ouverte)
fSupprime(ping_fichier)
error_logs_proc("retour ko du script ping.sh","ouverture page maj","")
RENVOYER "3"
FIN

//Connexion bdd
SI maj_connexion_bdd() <>1 ALORS
RENVOYER "4"
FIN

SI HLitDernier(MISE_A_JOUR,incr) =Vrai ALORS
name_light_or_full ="diagboxx.update"

uuuuuu est une chaîne
uuuuuu =MISE_A_JOUR.incr

HExécuteRequête(requ_maj_full_or_light,hRequêteSansCorrection,uuuuuu,"full")
SI HLitPremier(requ_maj_full_or_light) ALORS

SI HTrouve(requ_maj_full_or_light) =Vrai ALORS
Fichier_a_telecharger =requ_maj_full_or_light.nom_fichier
SINON
HFermeConnexion(bdd_distante_cnx)
HFermeConnexion(bdd_distante_secours_cnx)
error_logs_proc("Aucune reponse trouvée dans la bdd","","")
RENVOYER "4"
FIN
SINON
HFermeConnexion(bdd_distante_cnx)
HFermeConnexion(bdd_distante_secours_cnx)
error_logs_proc("Aucune reponse trouvée dans la bdd","","")
RENVOYER "4"
FIN



HFermeConnexion(bdd_distante_cnx)
HFermeConnexion(bdd_distante_secours_cnx)
SINON
HFermeConnexion(bdd_distante_cnx)
HFermeConnexion(bdd_distante_secours_cnx)
error_logs_proc("Aucune reponse trouvée dans la bdd","","")
RENVOYER "4"
FIN
SELON maj_connexion_ftp()
CAS 1
//check si le dossier result est present
FTPDéconnecte(connexion_ftp_loadchoice)
result_final_fichier est une chaîne
result_final_fichier ="/diagbox/web/tmp/maj_resultat"

SI fFichierExiste(result_final_fichier) =Vrai ALORS
fSupprime(result_final_fichier)
FIN

//Création du php tempo
tempo_php est une chaîne
tempo_php =doss_tmp+"telecharger_maj.php"

SI fFichierExiste(tempo_php) =Vrai ALORS
fSupprime(tempo_php)
FIN

tempo_creation est un entier
tempo_ouvre est un entier
tempo_ecrit est un entier
tempo_texte est une chaîne

tempo_creation =fCrée(tempo_php)
SI tempo_creation =-1 ALORS
error_logs_proc("Echec creation php tempo","ouverture page maj","")
fSupprime(tempo_php)
RENVOYER "5"
FIN

tempo_ouvre =fOuvre(tempo_php,foLectureEcriture)
SI tempo_ouvre =-1 ALORS
error_logs_proc("Echec ouverture php tempo","ouverture page maj","")
fSupprime(tempo_php)
RENVOYER "5"
FIN

tempo_texte ="<?php"+RC+"exec(""/diagbox/web/scripts/update/telecharger_maj.sh"+" "+...
maj_ftp_id+" "+maj_ftp_mdp+" "+maj_ftp_ip+" "+maj_ftp_port+" "+Fichier_a_telecharger+" "+name_light_or_full+""""+");"+RC+"?>"

tempo_ecrit =fEcrit(tempo_ouvre,tempo_texte)
SI tempo_ecrit =-1 ALORS
error_logs_proc("Echec ecriture php tempo","ouverture page maj","")
fSupprime(tempo_php)
RENVOYER "5"
FIN

fFerme(tempo_ouvre)

tempo_version_scripts est une chaîne
tempo_version_scripts ="/tmp/maj_php_tempo_chmod.php"
PHPExecute(tempo_version_scripts)
Multitâche(10)

SI fFichierExiste(result_final_fichier) =Vrai ALORS
error_logs_proc("Echec chmod 777 php tempo","ouverture page maj","")
fSupprime(tempo_php)
RENVOYER "5"
FIN

fSupprime(dosss+tempo_version_scripts)

tempooo est une chaîne
tempooo ="/tmp/telecharger_maj.php"

PHPExecute(tempooo)
Multitâche(10)

SI fFichierExiste(result_final_fichier) =Faux ALORS
FTPDéconnecte(connexion_ftp_loadchoice)
error_logs_proc("Echec lancement script sh maj telechargement","ouverture page maj","")
fSupprime(tempo_php)
RENVOYER "5"
FIN

final_ouvre est un entier
final_lit est une chaîne

final_ouvre =fOuvre(result_final_fichier)
SI final_ouvre =-1 ALORS
error_logs_proc("Echec ouverture fichier result final","ouverture page maj","")
fSupprime(tempo_php)
RENVOYER "5"
FIN

final_lit =fLitLigne(final_ouvre)
SI final_lit ="ok" ALORS
fSupprime(result_final_fichier)
FTPDéconnecte(connexion_ftp_loadchoice)
fSupprime(tempo_php)
RENVOYER "1"
SINON
//fSupprime(result_final_fichier)
FTPDéconnecte(connexion_ftp_loadchoice)
error_logs_proc("Echec telechargement maj","ouverture page maj","")
fSupprime(tempo_php)
RENVOYER "5"

FIN




AUTRE CAS
FTPDéconnecte(connexion_ftp_loadchoice)
error_logs_proc("Echec connexion serveur(s) ftp","ouverture page maj","")
RENVOYER "5"
FIN


code navigateur retour : nav_maj_auto_proc

Procedure nav_maj_auto_proc(psresult,res)
SELON psresult
CAS "1"
ToastAffiche("Téléchargement mise à jour réussie",toastCourt,cvBas,chCentre)
PopupFerme(popup_maj_attente)
PopupAffiche(popup_maj_finish,popupCentre)
CAS "2"
PopupFerme(popup_maj_attente)
popup_aid.Banned_36950..Visible =Vrai
popup_aid.Help_icon..Visible =Faux
popup_aid.ZoneTexte1 ="Erreur système"
PopupAffiche(popup_aid,popupCentre)
CAS "3"
PopupFerme(popup_maj_attente)
popup_aid.Banned_36950..Visible =Vrai
popup_aid.Help_icon..Visible =Faux
popup_aid.ZoneTexte1 ="Pas de connexion internet"
PopupAffiche(popup_aid,popupCentre)
CAS "4"
PopupFerme(popup_maj_attente)
popup_aid.Banned_36950..Visible =Vrai
popup_aid.Help_icon..Visible =Faux
popup_aid.ZoneTexte1 ="Erreur systeme"
PopupAffiche(popup_aid,popupCentre)
CAS "5"
PopupFerme(popup_maj_attente)
popup_aid.Banned_36950..Visible =Vrai
popup_aid.Help_icon..Visible =Faux
popup_aid.ZoneTexte1 ="Echec téléchargement mise à jour"
PopupAffiche(popup_aid,popupCentre)
AUTRE CAS
Info("test")
FIN
Membro registado
1.623 mensagems
Popularité : +100 (114 votes)
Publicado em abril, 23 2019 - 11:12 AM
Salut,

Tu veux dire que si tu insert un info("OK") en premiere ligne de ta procédure nav nav_maj_auto_proc il ne s'afficherait pas ?
Peux tu faire le test ?

As tu vérifié (par des logs par exemples) quelle valeur renvoi maj_auto_proc ?