14/01/23 - 16h

master
cherif 2023-01-14 16:26:35 +01:00
parent 6895afacae
commit fc86aba2c6
5 changed files with 4283 additions and 61 deletions

View File

@ -1,13 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="1122d9e2-679f-46d6-8c4f-97e9ae4041b5" name="Changes" comment="09/01/22 à 11h"> <list default="true" id="1122d9e2-679f-46d6-8c4f-97e9ae4041b5" name="Changes" comment="13/01/22 à 20h">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Inscription_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/Inscription_mgt.py" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Inscription_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/Inscription_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Log/log_file.log" beforeDir="false" afterPath="$PROJECT_DIR$/Log/log_file.log" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Log/log_file.log" beforeDir="false" afterPath="$PROJECT_DIR$/Log/log_file.log" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Session_Formation.py" beforeDir="false" afterPath="$PROJECT_DIR$/Session_Formation.py" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Template/MySy_confirmation_inscription_formation_tpl.html" beforeDir="false" afterPath="$PROJECT_DIR$/Template/MySy_confirmation_inscription_formation_tpl.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/class_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/class_mgt.py" afterDir="false" /> <change beforePath="$PROJECT_DIR$/email_inscription_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/email_inscription_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/prj_common.py" beforeDir="false" afterPath="$PROJECT_DIR$/prj_common.py" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -185,7 +184,14 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1673258247710</updated> <updated>1673258247710</updated>
</task> </task>
<option name="localTasksCounter" value="17" /> <task id="LOCAL-00017" summary="13/01/22 à 20h">
<created>1673637362528</created>
<option name="number" value="00017" />
<option name="presentableId" value="LOCAL-00017" />
<option name="project" value="LOCAL" />
<updated>1673637362528</updated>
</task>
<option name="localTasksCounter" value="18" />
<servers /> <servers />
</component> </component>
<component name="Vcs.Log.Tabs.Properties"> <component name="Vcs.Log.Tabs.Properties">
@ -216,7 +222,8 @@
<MESSAGE value="27/12/2022 - 11h00" /> <MESSAGE value="27/12/2022 - 11h00" />
<MESSAGE value="27/12/2022 - 16h00" /> <MESSAGE value="27/12/2022 - 16h00" />
<MESSAGE value="09/01/22 à 11h" /> <MESSAGE value="09/01/22 à 11h" />
<option name="LAST_COMMIT_MESSAGE" value="09/01/22 à 11h" /> <MESSAGE value="13/01/22 à 20h" />
<option name="LAST_COMMIT_MESSAGE" value="13/01/22 à 20h" />
</component> </component>
<component name="XDebuggerManager"> <component name="XDebuggerManager">
<breakpoint-manager> <breakpoint-manager>

View File

@ -377,20 +377,47 @@ def UpdateStagiairetoClass(diction):
local_date_du = "" local_date_du = ""
if ("date_debut" in local_tmp_session.keys() and local_tmp_session['date_debut']): if ("date_debut" in local_tmp_session.keys() and local_tmp_session['date_debut']):
local_date_du = local_tmp_session['date_debut'] local_date_du = str(local_tmp_session['date_debut'])[0:10]
email_data['date_du'] = local_date_du email_data['date_du'] = local_date_du
local_date_au = "" local_date_au = ""
if ("date_fin" in local_tmp_session.keys() and local_tmp_session['date_fin']): if ("date_fin" in local_tmp_session.keys() and local_tmp_session['date_fin']):
local_date_au = local_tmp_session['date_fin'] local_date_au = str(local_tmp_session['date_fin'])[0:10]
email_data['date_au'] = local_date_au email_data['date_au'] = local_date_au
adresse = "" local_adresse = ""
if ("adresse" in local_tmp_session.keys() and local_tmp_session['adresse']): if ("adresse" in local_tmp_session.keys() and local_tmp_session['adresse']):
local_adresse = local_tmp_session['adresse'] local_adresse = local_tmp_session['adresse']
email_data['adresse'] = local_adresse email_data['adresse'] = local_adresse
local_cp= ""
if ("code_postal" in local_tmp_session.keys() and local_tmp_session['code_postal']):
local_cp = local_tmp_session['code_postal']
email_data['code_postal'] = local_cp
local_ville = ""
if ("ville" in local_tmp_session.keys() and local_tmp_session['ville']):
local_ville = local_tmp_session['ville']
email_data['ville'] = local_ville
local_distance = ""
if ("distantiel" in local_tmp_session.keys() and local_tmp_session['distantiel']):
local_distance = local_tmp_session['distantiel']
email_data['adresse'] = local_distance
local_presence = ""
if ("presentiel" in local_tmp_session.keys() and local_tmp_session['presentiel']):
local_presence = local_tmp_session['presentiel']
email_data['presentiel'] = local_presence
local_formateur = ""
if ("formateur" in local_tmp_session.keys() and local_tmp_session['formateur']):
local_formateur = local_tmp_session['formateur']
email_data['formateur'] = local_formateur
if ( diction['status'] == "1" ): if ( diction['status'] == "1" ):
# Il s'agit d'envoyer le message de confirmation d'une inscription # Il s'agit d'envoyer le message de confirmation d'une inscription
local_status, local_message = email_session.incription_training_confirmation_mail(email_data) local_status, local_message = email_session.incription_training_confirmation_mail(email_data)
@ -625,14 +652,8 @@ def SendPre_InscriptionEmail(diction):
data_mail['nom'] = local_session[0]['nom'] data_mail['nom'] = local_session[0]['nom']
data_mail['prenom'] = local_session[0]['prenom'] data_mail['prenom'] = local_session[0]['prenom']
data_mail['email'] = local_session[0]['email'] data_mail['email'] = local_session[0]['email']
data_mail['date_du'] = local_session[0]['date_du']
data_mail['date_au'] = local_session[0]['date_au']
if ("adresse" in local_session[0].keys()):
if local_session[0]['adresse']:
data_mail['adresse'] = local_session[0]['adresse']
if ("employeur" in local_session[0].keys()): if ("employeur" in local_session[0].keys()):
if local_session[0]['employeur']: if local_session[0]['employeur']:
data_mail['employeur'] = local_session[0]['employeur'] data_mail['employeur'] = local_session[0]['employeur']
@ -642,6 +663,45 @@ def SendPre_InscriptionEmail(diction):
data_mail['telephone'] = local_session[0]['telephone'] data_mail['telephone'] = local_session[0]['telephone']
#3 - Recuperations des info de la session (a distance, formateur, etc)
local_info_session = MYSY_GV.dbname['session_formation'].find({'formation_session_id': str(diction['session_id']),
'valide':'1'})
if( local_info_session is None):
mycommon.myprint(
str(inspect.stack()[0][3]) + " - impossible d'envoyer le mail de presinscription. la session "+str(diction['session_id'])+" est introuvable ")
return False, " impossible d'envoyer le mail de presinscription. la session "+str(diction['session_id'])+" est introuvable "
if ("code_postal" in local_info_session[0].keys()):
if local_session[0]['code_postal']:
data_mail['code_postal'] = local_info_session[0]['code_postal']
if ("date_debut" in local_info_session[0].keys()):
if local_session[0]['date_debut']:
data_mail['date_du'] = str(local_info_session[0]['date_debut'])[0:10]
if ("date_fin" in local_info_session[0].keys()):
if local_session[0]['date_fin']:
data_mail['date_au'] = str(local_info_session[0]['date_fin'])[0:10]
if ("formateur" in local_info_session[0].keys()):
if local_session[0]['formateur']:
data_mail['formateur'] = local_info_session[0]['formateur']
if ("distantiel" in local_info_session[0].keys()):
if local_session[0]['distantiel']:
data_mail['distantiel'] = local_info_session[0]['distantiel']
if ("presentiel" in local_info_session[0].keys()):
if local_session[0]['presentiel']:
data_mail['presentiel'] = local_info_session[0]['presentiel']
if ("ville" in local_info_session[0].keys()):
if local_session[0]['ville']:
data_mail['ville'] = local_info_session[0]['ville']
# Envoi de l'email de confirmation au demandeur de la formation # Envoi de l'email de confirmation au demandeur de la formation
local_status, local_message = email_session.Pre_incription_training_confirmation_mail(data_mail) local_status, local_message = email_session.Pre_incription_training_confirmation_mail(data_mail)
@ -685,7 +745,7 @@ def DownloadParticipantsList(diction):
partner_recid = mycommon.get_parnter_recid_from_token(mytoken) partner_recid = mycommon.get_parnter_recid_from_token(mytoken)
if (partner_recid is False): if (partner_recid is False):
mycommon.myprint(str(inspect.stack()[0][3]) + " - Impossible de recuperer la liste des stagiaires, ") mycommon.myprint(str(inspect.stack()[0][3]) + " - Impossible de recuperer la liste des stagiaires, ")
return False, "Impossible de recuperer la liste des stagiaires, Les informations d'identification sont incorrectes " return False, " Impossible de generer la liste des participants. les informations sont incompletes"
session_id = "" session_id = ""
@ -700,7 +760,7 @@ def DownloadParticipantsList(diction):
if (local_session is None): if (local_session is None):
mycommon.myprint(str(inspect.stack()[0][3]) + " - Cette de formation n'a pas d'informations detaillées ") mycommon.myprint(str(inspect.stack()[0][3]) + " - Cette de formation n'a pas d'informations detaillées ")
return False, " Cette de formation n'a pas d'informations detaillées " return False, " Cette session de formation n'a pas d'informations detaillées "
# Recuperation des données de la formation # Recuperation des données de la formation
local_formation = MYSY_GV.dbname['myclass'].find_one({'internal_url':str(local_session['class_internal_url'])}) local_formation = MYSY_GV.dbname['myclass'].find_one({'internal_url':str(local_session['class_internal_url'])})
@ -719,10 +779,57 @@ def DownloadParticipantsList(diction):
for retval in coll_session.find(myquery, { 'session_id':0}): for retval in coll_session.find(myquery, { 'session_id':0}):
local_data = {} local_data = {}
local_data['titre_formation'] = local_formation['title'] local_data['titre'] = local_formation['title']
local_data['debut_session'] = local_session ['date_debut'] local_data['debut_session'] = local_session ['date_debut']
local_data['fin_session'] = local_session['date_fin'] local_data['fin_session'] = local_session['date_fin']
local_formateur = ""
if ("formateur" in local_session.keys()):
if local_session['formateur']:
local_formateur = local_session['formateur']
local_data['formateur'] = local_formateur
presentiel = ""
if ("presentiel" in local_session.keys()):
if local_session['presentiel']:
presentiel = local_session['presentiel']
local_data['presentiel'] = presentiel
distantiel = ""
if ("distantiel" in local_session.keys()):
if local_session['distantiel']:
distantiel = local_session['distantiel']
local_data['distantiel'] = distantiel
adresse = ""
if ("adresse" in local_session.keys()):
if local_session['adresse']:
adresse = local_session['adresse']
local_data['adresse'] = adresse
ville = ""
if ("ville" in local_session.keys()):
if local_session['ville']:
ville = local_session['ville']
local_data['ville'] = ville
code_postal = ""
if ("code_postal" in local_session.keys()):
if local_session['code_postal']:
code_postal = local_session['code_postal']
local_data['code_postal'] = code_postal
prix_session = ""
if ("prix_session" in local_session.keys()):
if local_session['prix_session']:
prix_session = local_session['prix_session']
local_data['prix_session'] = prix_session
nb_participant = ""
if ("nb_participant" in local_session.keys()):
if local_session['nb_participant']:
nb_participant = local_session['nb_participant']
local_data['nb_participants'] = nb_participant
@ -730,31 +837,8 @@ def DownloadParticipantsList(diction):
local_data['nom'] = retval['nom'] local_data['nom'] = retval['nom']
local_data['email'] = retval['email'] local_data['email'] = retval['email']
local_data['telephone'] = retval['telephone'] local_data['telephone'] = retval['telephone']
local_data['date inscription'] = str(retval['_id'].generation_time.strftime("%m/%d/%Y, %H:%M")) local_data['date_inscription'] = str(retval['_id'].generation_time.strftime("%m/%d/%Y, %H:%M"))
adresse = ""
if ("adresse" in retval.keys()):
if (retval['adresse']):
adresse = retval['adresse']
local_data['adresse'] = adresse
formateur = ""
if ("formateur" in local_session.keys()):
if (local_session['formateur']):
formateur = local_session['formateur']
local_data['formateur'] = formateur
code_postal = ""
if ("code_postal" in retval.keys()):
if (retval['code_postal']):
code_postal = retval['code_postal']
local_data['code_postal'] = code_postal
ville = ""
if ("ville" in retval.keys()):
if (retval['ville']):
ville = retval['ville']
local_data['ville'] = ville
employeur = "" employeur = ""
if ("employeur" in retval.keys()): if ("employeur" in retval.keys()):
@ -796,6 +880,71 @@ def DownloadParticipantsList(diction):
RetObject.append(local_data) RetObject.append(local_data)
"""
/!\ : Quand il n'y a pas encore de stagaire, alors le grid : RetObject : est vide car la boucle precedent est vide
Donc on retourne juste les infos de la session
"""
print(" ### len(RetObject) = ", len(RetObject) , " RetObject = ", RetObject )
if(len(RetObject) <= 0 ):
local_data = {}
local_data['titre_formation'] = local_formation['title']
local_data['debut_session'] = local_session['date_debut']
local_data['fin_session'] = local_session['date_fin']
local_formateur = ""
if ("formateur" in local_session.keys()):
if local_session['formateur']:
local_formateur = local_session['formateur']
local_data['formateur'] = local_formateur
presentiel = ""
if ("presentiel" in local_session.keys()):
if local_session['presentiel']:
local_formateur = local_session['presentiel']
local_data['presentiel'] = presentiel
distantiel = ""
if ("distantiel" in local_session.keys()):
if local_session['distantiel']:
distantiel = local_session['distantiel']
local_data['distantiel'] = distantiel
adresse = ""
if ("adresse" in local_session.keys()):
if local_session['adresse']:
adresse = local_session['adresse']
local_data['adresse'] = adresse
ville = ""
if ("ville" in local_session.keys()):
if local_session['ville']:
ville = local_session['ville']
local_data['ville'] = ville
code_postal = ""
if ("code_postal" in local_session.keys()):
if local_session['code_postal']:
code_postal = local_session['code_postal']
local_data['code_postal'] = code_postal
prix_session = ""
if ("prix_session" in local_session.keys()):
if local_session['prix_session']:
prix_session = local_session['prix_session']
local_data['prix_session'] = prix_session
nb_participant = ""
if ("nb_participant" in local_session.keys()):
if local_session['nb_participant']:
nb_participant = local_session['nb_participant']
local_data['nb_participants'] = nb_participant
local_data['nb_inscrit'] = "0"
RetObject.append(local_data)
# Expand the cursor and construct the DataFrame # Expand the cursor and construct the DataFrame
df = pd.DataFrame(list(RetObject)) df = pd.DataFrame(list(RetObject))
@ -1608,29 +1757,27 @@ def GetListEvaluation_Session(diction):
user['prenom'] = local_Insc_retval['prenom'] user['prenom'] = local_Insc_retval['prenom']
if ("eval_date" in diction.keys()):
if diction['eval_date']:
if ("eval_date" in local_Insc_retval.keys()):
if local_Insc_retval['eval_date']:
user['eval_date'] = local_Insc_retval['eval_date'] user['eval_date'] = local_Insc_retval['eval_date']
if ("eval_date" in diction.keys()): if ("eval_eval" in local_Insc_retval.keys()):
if diction['eval_date']: if local_Insc_retval['eval_eval']:
user['eval_date'] = local_Insc_retval['eval_date']
if ("eval_eval" in diction.keys()):
if diction['eval_eval']:
user['eval_eval'] = local_Insc_retval['eval_eval'] user['eval_eval'] = local_Insc_retval['eval_eval']
else: else:
user['eval_eval'] = "Aucune Evalution" user['eval_eval'] = "---"
if ("eval_note" in diction.keys()): if ("eval_note" in local_Insc_retval.keys()):
if diction['eval_note']: if local_Insc_retval['eval_note']:
user['eval_note'] = local_Insc_retval['eval_note'] user['eval_note'] = local_Insc_retval['eval_note']
else: else:
user['eval_note'] = "Aucune Note" user['eval_note'] = "---"
if ("eval_pedagogie" in diction.keys()): if ("eval_pedagogie" in local_Insc_retval.keys()):
if diction['eval_pedagogie']: if local_Insc_retval['eval_pedagogie']:
user['eval_pedagogie'] = local_Insc_retval['eval_pedagogie'] user['eval_pedagogie'] = local_Insc_retval['eval_pedagogie']

File diff suppressed because it is too large Load Diff

View File

@ -108,14 +108,13 @@
</tbody> </tbody>
</table> </table>
{% if params.adresse == "enligne" %} {% if params.distantiel == "1" %}
<p style="text-align:justify">­ <p style="text-align:justify">­
Il s'agit d'une formation en ligne. Il s'agit d'une formation en ligne.
</p> </p>
{% else %} {% else %}
<p style="text-align:justify">­ <p style="text-align:justify">­
Cette formation organisée se tiendra au {{ Cette formation organisée se tiendra au {{ params.adresse }}, {{ params.ville }}, {{ params.code_postal }}.
params.adresse }}.
</p> </p>
{% endif %} {% endif %}

View File

@ -105,6 +105,14 @@ def incription_training_confirmation_mail(diction):
"date_fin": str(diction['date_au']), "date_fin": str(diction['date_au']),
"adresse": str(adresse_session), "adresse": str(adresse_session),
"title": str(diction['title']), "title": str(diction['title']),
"code_postal": str(diction['code_postal']),
"ville": str(diction['ville']),
"distantiel": str(diction['distantiel']),
"presentiel": str(diction['presentiel']),
"formateur": str(diction['formateur']),
"email": str(diction['email'])}, "email": str(diction['email'])},
} }
@ -248,7 +256,7 @@ def Pre_incription_training_confirmation_mail(diction):
""" """
Verification de la liste des champs obligatoires Verification de la liste des champs obligatoires
""" """
field_list_obligatoire = ['nom', 'prenom', 'email', 'date_du', 'date_au', 'adresse', 'title'] field_list_obligatoire = ['nom', 'prenom', 'email', 'date_du', 'date_au', 'adresse', 'title', 'distantiel', 'presentiel']
for val in field_list_obligatoire: for val in field_list_obligatoire:
if val not in diction: if val not in diction:
mycommon.myprint( mycommon.myprint(
@ -289,7 +297,12 @@ def Pre_incription_training_confirmation_mail(diction):
"date_du": str(diction['date_du']), "date_du": str(diction['date_du']),
"date_fin": str(diction['date_au']), "date_fin": str(diction['date_au']),
"adresse": str(diction['adresse']), "adresse": str(diction['adresse']),
"distantiel": str(diction['distantiel']),
"presentiel": str(diction['presentiel']),
"title": str(diction['title']), "title": str(diction['title']),
"code_postal": str(diction['code_postal']),
"ville": str(diction['ville']),
"email": str(diction['email'])}, "email": str(diction['email'])},
} }
@ -370,9 +383,13 @@ def Notification_partner_Pre_incription_mail(diction):
"date_du": str(diction['date_du']), "date_du": str(diction['date_du']),
"date_fin": str(diction['date_au']), "date_fin": str(diction['date_au']),
"adresse": str(diction['adresse']), "adresse": str(diction['adresse']),
"title": str(diction['title']),
"employeur": str(diction['employeur']), "employeur": str(diction['employeur']),
"telephone": str(diction['telephone']), "telephone": str(diction['telephone']),
"distantiel": str(diction['distantiel']),
"presentiel": str(diction['presentiel']),
"title": str(diction['title']),
"code_postal": str(diction['code_postal']),
"ville": str(diction['ville']),
"email": str(diction['email'])}, "email": str(diction['email'])},
} }