parent
2a5327fc88
commit
691ce28984
|
@ -6,10 +6,9 @@
|
|||
<component name="ChangeListManager">
|
||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="02/06/2025 - 20h">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Session_Formation.py" beforeDir="false" afterPath="$PROJECT_DIR$/Session_Formation.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/class_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/class_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/formulaire_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/formulaire_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/apprenant_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/apprenant_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/note_evaluation_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/note_evaluation_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/prj_common.py" beforeDir="false" afterPath="$PROJECT_DIR$/prj_common.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/survey_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/survey_mgt.py" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
|
@ -55,6 +54,7 @@
|
|||
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"git-widget-placeholder": "master__Elyos__FI",
|
||||
"ignore.virus.scanning.warn.message": "true",
|
||||
"last_opened_file_path": "C:/Users/Cherif/Documents/myclass.com/Siteweb/Elyos_Ftion_Continue/Ela_back/Back_Office",
|
||||
"settings.editor.selected.configurable": "project.propVCSSupport.CommitDialog"
|
||||
}
|
||||
|
|
|
@ -53,7 +53,11 @@ def Add_Apprenant(diction):
|
|||
'tuteur1_cp', 'tuteur1_ville', 'tuteur1_pays', 'tuteur1_include_com',
|
||||
'tuteur2_nom', 'tuteur2_prenom', 'tuteur2_email', 'tuteur2_telephone', 'tuteur2_adresse',
|
||||
'tuteur2_cp', 'tuteur2_ville', 'tuteur2_pays', 'tuteur2_include_com', 'civilite', 'date_naissance',
|
||||
'tuteur1_civilite', 'tuteur2_civilite'
|
||||
'tuteur1_civilite', 'tuteur2_civilite',
|
||||
'is_handicap', 'is_droit_image', 'is_rgpd', 'nationalite', 'situation_famille', 'naissance_lieu',
|
||||
'naissance_departement',
|
||||
'naissance_pays', 'num_secu', 'identite_type', 'piece_identite_num', 'type_mobilite',
|
||||
'telephone_bis',
|
||||
]
|
||||
|
||||
incom_keys = diction.keys()
|
||||
|
@ -126,7 +130,6 @@ def Add_Apprenant(diction):
|
|||
|
||||
|
||||
|
||||
|
||||
# Verifier l'adresse email du tuteur 1
|
||||
if ("tuteur1_email" in diction.keys() and diction['tuteur1_email']):
|
||||
if (mycommon.isEmailValide(str(diction['tuteur1_email'])) is False):
|
||||
|
@ -168,6 +171,23 @@ def Add_Apprenant(diction):
|
|||
return False, " Il existe déjà un apprenant avec la même adresse email. ",
|
||||
|
||||
|
||||
if( "is_handicap" in diction.keys() and str(diction['is_handicap']) not in ['0', '1']):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Le champ 'is_handicap' est invalide ")
|
||||
return False, " Le champ 'is_handicap' est invalide "
|
||||
|
||||
if ("is_droit_image" in diction.keys() and str(diction['is_droit_image']) not in ['0', '1']):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Le champ 'is_droit_image' est invalide ")
|
||||
return False, " Le champ 'is_droit_image' est invalide "
|
||||
|
||||
if ("is_rgpd" in diction.keys() and str(diction['is_rgpd']) not in ['0', '1']):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Le champ 'is_rgpd' est invalide ")
|
||||
return False, " Le champ 'is_rgpd' est invalide "
|
||||
|
||||
|
||||
|
||||
new_data = diction
|
||||
local_token = new_data['token']
|
||||
|
||||
|
@ -187,6 +207,9 @@ def Add_Apprenant(diction):
|
|||
|
||||
new_data['date_creation'] = str(todays_date)
|
||||
|
||||
if ("date_naissance" not in new_data.keys() or str(new_data['user']) == ""):
|
||||
new_data['date_naissance'] = "01/01/1900"
|
||||
|
||||
del new_data['token']
|
||||
inserted_id = MYSY_GV.dbname['apprenant'].insert_one(new_data).inserted_id
|
||||
if (not inserted_id):
|
||||
|
@ -233,6 +256,9 @@ def Update_Apprenant(diction):
|
|||
'tuteur2_nom', 'tuteur2_prenom', 'tuteur2_email', 'tuteur2_telephone', 'tuteur2_adresse',
|
||||
'tuteur2_cp', 'tuteur2_ville', 'tuteur2_pays', 'tuteur2_include_com', 'civilite', 'date_naissance',
|
||||
'tuteur1_civilite', 'tuteur2_civilite',
|
||||
'is_handicap', 'is_droit_image', 'is_rgpd', 'nationalite', 'situation_famille', 'naissance_lieu', 'naissance_departement',
|
||||
'naissance_pays','num_secu', 'identite_type', 'piece_identite_num', 'type_mobilite', 'telephone_bis',
|
||||
|
||||
]
|
||||
|
||||
incom_keys = diction.keys()
|
||||
|
@ -325,6 +351,22 @@ def Update_Apprenant(diction):
|
|||
str(inspect.stack()[0][3]) + " L'identifiant du client n'est pas valide")
|
||||
return False, " L'identifiant du client n'est pas valide ",
|
||||
|
||||
if ("is_handicap" in diction.keys() and str(diction['is_handicap']) not in ['0', '1']):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Le champ 'is_handicap' est invalide ")
|
||||
return False, " Le champ 'is_handicap' est invalide "
|
||||
|
||||
if ("is_droit_image" in diction.keys() and str(diction['is_droit_image']) not in ['0', '1']):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Le champ 'is_droit_image' est invalide ")
|
||||
return False, " Le champ 'is_droit_image' est invalide "
|
||||
|
||||
if ("is_rgpd" in diction.keys() and str(diction['is_rgpd']) not in ['0', '1']):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Le champ 'is_rgpd' est invalide ")
|
||||
return False, " Le champ 'is_rgpd' est invalide "
|
||||
|
||||
|
||||
apprenant_id = str(diction['_id'])
|
||||
stored_token = str(diction['token'])
|
||||
new_data = diction
|
||||
|
@ -454,6 +496,19 @@ def Get_Given_Apprenant_Data(diction):
|
|||
'locked':'0'})
|
||||
user['client_nom'] = client_data['nom']
|
||||
|
||||
age = "?"
|
||||
if( "date_naissance" in user.keys() ):
|
||||
local_status = mycommon.CheckisDate(str(user['date_naissance']))
|
||||
if( local_status ):
|
||||
today = datetime.today()
|
||||
dob = datetime.strptime(str(user['date_naissance']), '%d/%m/%Y')
|
||||
age = today.year - dob.year - ((today.month, today.day) < (dob.month, dob.day))
|
||||
|
||||
user['age'] = str(age)
|
||||
|
||||
if( "date_naissance" not in user.keys() or str(user['date_naissance']) == ""):
|
||||
user['date_naissance'] = "01/01/1900"
|
||||
|
||||
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||
|
||||
return True, RetObject
|
||||
|
@ -760,6 +815,8 @@ def Get_List_Partner_Apprenant(diction):
|
|||
else:
|
||||
user['civilite'] = ""
|
||||
|
||||
if ("date_naissance" not in user.keys() or str(user['date_naissance']) == ""):
|
||||
user['date_naissance'] = "01/01/1900"
|
||||
|
||||
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||
|
||||
|
@ -832,6 +889,9 @@ def Get_Apprenant_List_Partner_with_filter(diction):
|
|||
val['id'] = str(cpt)
|
||||
cpt = cpt + 1
|
||||
|
||||
if ("date_naissance" not in val.keys() or str(val['user']) == ""):
|
||||
val['date_naissance'] = "01/01/1900"
|
||||
|
||||
RetObject.append(mycommon.JSONEncoder().encode(val))
|
||||
|
||||
|
||||
|
|
|
@ -3033,41 +3033,42 @@ def Get_List_Apprenant_Notes_With_Filter(diction):
|
|||
user['inscription_id'] = str(retval['inscription_id'])
|
||||
user['note'] = str(retval['note'])
|
||||
|
||||
user['note_evaluation_id'] = str(retval['note_evaluation_collection'][0]['_id'])
|
||||
user['note_evaluation_code'] = str(retval['note_evaluation_collection'][0]['code'])
|
||||
if( len(retval['note_evaluation_collection']) > 0 ):
|
||||
user['note_evaluation_id'] = str(retval['note_evaluation_collection'][0]['_id'])
|
||||
user['note_evaluation_code'] = str(retval['note_evaluation_collection'][0]['code'])
|
||||
|
||||
user['note_evaluation_titre'] = str(retval['note_evaluation_collection'][0]['titre'])
|
||||
user['session_id'] = str(retval['note_evaluation_collection'][0]['session_id'])
|
||||
user['class_eu_id'] = str(retval['note_evaluation_collection'][0]['class_eu_id'])
|
||||
user['note_evaluation_titre'] = str(retval['note_evaluation_collection'][0]['titre'])
|
||||
user['session_id'] = str(retval['note_evaluation_collection'][0]['session_id'])
|
||||
user['class_eu_id'] = str(retval['note_evaluation_collection'][0]['class_eu_id'])
|
||||
|
||||
class_ue_code = ""
|
||||
class_ue_titre = ""
|
||||
ue_data = MYSY_GV.dbname['unite_enseignement'].find_one({'_id': ObjectId(str(user['class_eu_id'])),
|
||||
class_ue_code = ""
|
||||
class_ue_titre = ""
|
||||
ue_data = MYSY_GV.dbname['unite_enseignement'].find_one({'_id': ObjectId(str(user['class_eu_id'])),
|
||||
'valide': '1',
|
||||
'locked': '0',
|
||||
'partner_owner_recid': str(
|
||||
my_partner['recid'])})
|
||||
if ("code" in ue_data.keys()):
|
||||
class_ue_code = str(ue_data['code'])
|
||||
if ("titre" in ue_data.keys()):
|
||||
class_ue_titre = str(ue_data['titre'])
|
||||
if ("code" in ue_data.keys()):
|
||||
class_ue_code = str(ue_data['code'])
|
||||
if ("titre" in ue_data.keys()):
|
||||
class_ue_titre = str(ue_data['titre'])
|
||||
|
||||
user['class_ue_code'] = class_ue_code
|
||||
user['class_ue_titre'] = class_ue_titre
|
||||
user['class_ue_code'] = class_ue_code
|
||||
user['class_ue_titre'] = class_ue_titre
|
||||
|
||||
user['type_eval_id'] = str(retval['note_evaluation_collection'][0]['type_eval_id'])
|
||||
type_eval_data = MYSY_GV.dbname['type_eval_id'].find_one({'_id': ObjectId(str(user['type_eval_id'])),
|
||||
'valide': '1',
|
||||
'locked': '0',
|
||||
'partner_owner_recid': str(
|
||||
my_partner['recid'])})
|
||||
if (type_eval_data and 'code' in type_eval_data.keys()):
|
||||
user['type_eval_code'] = type_eval_data['code']
|
||||
else:
|
||||
user['type_eval_code'] = ""
|
||||
user['type_eval_id'] = str(retval['note_evaluation_collection'][0]['type_eval_id'])
|
||||
type_eval_data = MYSY_GV.dbname['type_eval_id'].find_one({'_id': ObjectId(str(user['type_eval_id'])),
|
||||
'valide': '1',
|
||||
'locked': '0',
|
||||
'partner_owner_recid': str(
|
||||
my_partner['recid'])})
|
||||
if (type_eval_data and 'code' in type_eval_data.keys()):
|
||||
user['type_eval_code'] = type_eval_data['code']
|
||||
else:
|
||||
user['type_eval_code'] = ""
|
||||
|
||||
user['eval_date_heure_debut'] = str(retval['note_evaluation_collection'][0]['eval_date_heure_debut'])
|
||||
user['eval_date_heure_fin'] = str(retval['note_evaluation_collection'][0]['eval_date_heure_fin'])
|
||||
user['eval_date_heure_debut'] = str(retval['note_evaluation_collection'][0]['eval_date_heure_debut'])
|
||||
user['eval_date_heure_fin'] = str(retval['note_evaluation_collection'][0]['eval_date_heure_fin'])
|
||||
|
||||
user['nom'] = nom_apprenant
|
||||
user['prenom'] = prenom_apprenant
|
||||
|
|
|
@ -4763,7 +4763,8 @@ def Get_Dictionnary_data_For_Template(diction):
|
|||
'distantiel', 'presentiel', 'session_ondemande', 'nb_participant',
|
||||
'prix_session', 'titre', 'location_type', 'is_bpf', 'formateur_id', 'adresse',
|
||||
'code_postal', 'ville', 'pays', 'date_debut_inscription', 'date_fin_inscription',
|
||||
'formateur_nom_prenom', 'session_formation_titre', 'session_formation_objectif', 'session_formation_description']
|
||||
'formateur_nom_prenom', 'session_formation_titre', 'session_formation_objectif',
|
||||
'session_formation_description']
|
||||
list_session_data = []
|
||||
tab_session_id = diction['list_session_id']
|
||||
|
||||
|
|
|
@ -355,7 +355,9 @@ def Record_Survey_Data_No_Token(diction):
|
|||
local_diction['session_id'] = str(survey_data['session_id'])
|
||||
local_diction['survey_type'] = str(survey_data['_id'])
|
||||
local_diction['formulaire_id'] = str(survey_data['formulaire_id'])
|
||||
local_diction['inscription_id'] = str(survey_data['inscription_id'])
|
||||
local_diction['partner_owner_recid'] = str(survey_data['partner_owner_recid'])
|
||||
local_diction['survey_type'] = str(survey_data['survey_type'])
|
||||
|
||||
retval_status, retval = Survey_Send_Notification_Sur_Seuil_Alert(local_diction)
|
||||
|
||||
|
@ -374,7 +376,8 @@ un seuil d'alert est atteint dans un questionnaire
|
|||
"""
|
||||
def Survey_Send_Notification_Sur_Seuil_Alert(diction):
|
||||
try:
|
||||
field_list_obligatoire = ['global_response', 'class_id', 'session_id', 'survey_type', 'formulaire_id', 'partner_owner_recid']
|
||||
field_list_obligatoire = ['global_response', 'class_id', 'session_id', 'survey_type', 'formulaire_id',
|
||||
'partner_owner_recid', 'inscription_id']
|
||||
|
||||
for val in field_list_obligatoire:
|
||||
if val not in diction:
|
||||
|
@ -418,7 +421,7 @@ def Survey_Send_Notification_Sur_Seuil_Alert(diction):
|
|||
convention_dictionnary_data = {}
|
||||
new_diction = {}
|
||||
new_diction['token'] = str(my_partner['token'])
|
||||
new_diction['list_stagiaire_id'] = []
|
||||
new_diction['list_stagiaire_id'] = [ObjectId(str(diction['inscription_id']))]
|
||||
new_diction['list_session_id'] = [ObjectId(str(diction['session_id']))]
|
||||
new_diction['list_class_id'] = [ObjectId(str(diction['class_id']))]
|
||||
new_diction['list_client_id'] = []
|
||||
|
@ -429,8 +432,26 @@ def Survey_Send_Notification_Sur_Seuil_Alert(diction):
|
|||
if (local_status is False):
|
||||
return local_status, local_retval
|
||||
|
||||
|
||||
|
||||
convention_dictionnary_data = local_retval
|
||||
|
||||
print(" ### convention_dictionnary_data =", convention_dictionnary_data)
|
||||
|
||||
"""
|
||||
Recuperation des données du formateur qui est mis sur la session de formation
|
||||
"""
|
||||
formateur_data = {}
|
||||
if( session_data and "formateur_id" in session_data.keys() ):
|
||||
formateur_data_tmp = MYSY_GV.dbname["ressource_humaine"].find_one({'_id': ObjectId(str(session_data['formateur_id'])),
|
||||
'partner_recid':str(diction['partner_owner_recid']),
|
||||
'valide':'1'}, {'_id':1, 'nom':1, 'prenom':1, 'email':1})
|
||||
|
||||
if( formateur_data_tmp):
|
||||
formateur_data = formateur_data_tmp
|
||||
|
||||
convention_dictionnary_data['formateur_data'] = formateur_data
|
||||
|
||||
survey_type = ""
|
||||
if( diction['survey_type'] == "pos"):
|
||||
survey_type = "Questionnaire de positionnement"
|
||||
|
@ -452,8 +473,6 @@ def Survey_Send_Notification_Sur_Seuil_Alert(diction):
|
|||
for val in diction['global_response']:
|
||||
|
||||
if("is_alert" in val.keys() and val['is_alert'] == "1" ):
|
||||
print(" ## on fait un controle")
|
||||
|
||||
if( val['type'] == "bool" ):
|
||||
seuil = val['alert_seuil']
|
||||
valeur = ""
|
||||
|
@ -463,7 +482,6 @@ def Survey_Send_Notification_Sur_Seuil_Alert(diction):
|
|||
valeur = "0"
|
||||
|
||||
if( seuil == valeur):
|
||||
print(" ### DECLENCHEMENT MESSAGE D'ALERT")
|
||||
convention_dictionnary_data['user_question_reponse'] = val
|
||||
notif_status, notif_retval = Send_Survey_Alert_Notif(convention_dictionnary_data)
|
||||
|
||||
|
@ -472,7 +490,6 @@ def Survey_Send_Notification_Sur_Seuil_Alert(diction):
|
|||
valeur = mycommon.tryFloat(val['response'])
|
||||
|
||||
if( valeur <= seuil):
|
||||
print(" ### DECLENCHEMENT MESSAGE D'ALERT")
|
||||
convention_dictionnary_data['user_question_reponse'] = val
|
||||
notif_status, notif_retval = Send_Survey_Alert_Notif(convention_dictionnary_data)
|
||||
|
||||
|
@ -552,7 +569,21 @@ def Send_Survey_Alert_Notif(diction):
|
|||
sourceHtml_corps_mail = contenu_corp_mail_Template.render(params=body["params"])
|
||||
html_mime = MIMEText(sourceHtml_corps_mail, 'html')
|
||||
|
||||
email_to = ['cbalde@mysy-training.com']
|
||||
email_to = []
|
||||
|
||||
if( "formateur_data" in diction.keys() and 'email' in diction['formateur_data'].keys() ):
|
||||
email_to.append(str(diction['formateur_data']['email']))
|
||||
|
||||
if ("company_data" in diction.keys() and 'societe_email' in diction['company_data'].keys()):
|
||||
email_to.append(str(diction['company_data']['societe_email']))
|
||||
|
||||
if(len(email_to) <= 0 ):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " Aucune adresse email de destinataire ")
|
||||
return False, " Aucune adresse email de destinataire "
|
||||
|
||||
|
||||
# Creation de l'email à enoyer
|
||||
msg = MIMEMultipart("alternative")
|
||||
if (str(partner_own_smtp_value) == "1"):
|
||||
|
|
Loading…
Reference in New Issue