19/07/26 - 21h

Signed-off-by: Cherif <cbalde@mysy-training.com>
master_Elyos_FI
Cherif 2026-07-19 21:26:31 +02:00
parent e8287891f8
commit 0a0e4e1f2d
7 changed files with 3068 additions and 37 deletions

View File

@ -4,11 +4,14 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="14/07/2026 - 20h">
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="16/07/2026 - 20h">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/GlobalVariable.py" beforeDir="false" afterPath="$PROJECT_DIR$/GlobalVariable.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$/Session_Formation.py" beforeDir="false" afterPath="$PROJECT_DIR$/Session_Formation.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/session_admission_fi.py" beforeDir="false" afterPath="$PROJECT_DIR$/session_admission_fi.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/prj_common.py" beforeDir="false" afterPath="$PROJECT_DIR$/prj_common.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/wrapper.py" beforeDir="false" afterPath="$PROJECT_DIR$/wrapper.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -452,7 +455,7 @@
<option name="project" value="LOCAL" />
<updated>1747251650255</updated>
</task>
<option name="localTasksCounter" value="608" />
<option name="localTasksCounter" value="609" />
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
@ -494,7 +497,6 @@
</option>
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="19/05/2026 - 20h30" />
<MESSAGE value="20/05/2026 - 12h30" />
<MESSAGE value="20/05/2026 - 20h30" />
<MESSAGE value="22/05/2026 - 20h" />
@ -519,6 +521,7 @@
<MESSAGE value="05/07/26 - 20h" />
<MESSAGE value="09/07/26 - 20h" />
<MESSAGE value="14/07/2026 - 20h" />
<option name="LAST_COMMIT_MESSAGE" value="14/07/2026 - 20h" />
<MESSAGE value="16/07/2026 - 20h" />
<option name="LAST_COMMIT_MESSAGE" value="16/07/2026 - 20h" />
</component>
</project>

View File

@ -1274,6 +1274,20 @@ Gestion de stage : Status
"""
STAGE_STATUS = ['', '0', '1', '2', '3', '4', '-1']
"""
Gestion des sessions de formation / promotion : Status
'0' => Inactif
'1' => Actif
'2' => Clôturé
'-1' => Annulé ou
'' => Vide
"""
SESSION_STATUS = ['', '0', '1', '2', '-1']
"""
Dans le cadre de l'evaluation des stages,
On prevoir une evaluation par le tuteur de stage et

File diff suppressed because it is too large Load Diff

View File

@ -406,6 +406,10 @@ def Add_Update_SessionFormation(diction):
if ("session_status" in diction.keys()):
mydata['session_status'] = str(mycommon.tryInt(str(diction['session_status'])))
if( str(mydata['session_status']) not in MYSY_GV.SESSION_STATUS):
mycommon.myprint(str(
inspect.stack()[0][3]) + " Le statut est invalide. Les valeurs autorisées sont "+str(MYSY_GV.SESSION_STATUS))
return False, " Le statut est invalide. Les valeurs autorisées sont "+str(MYSY_GV.SESSION_STATUS)
else:
mydata['session_status'] = ""
@ -1224,7 +1228,7 @@ def GetSessionFormation(diction):
user['site_formation_id'] = site_formation_id
user['site_formation_code'] = site_formation_code
if( "session_status" not in user.keys() or user['session_status'] not in [ '-1', '1']):
if( "session_status" not in user.keys() or user['session_status'] not in MYSY_GV.SESSION_STATUS):
user['session_status'] = "1"
"""
@ -2087,7 +2091,7 @@ def GetAllValideSessionPartner_List_Without_Scope_Action(diction):
else:
val['mode_animation'] = "0"
if ("session_status" not in val.keys() or val['session_status'] not in ['-1', '1']):
if ("session_status" not in val.keys() or val['session_status'] not in MYSY_GV.SESSION_STATUS):
val['session_status'] = "1"
RetObject.append(mycommon.JSONEncoder().encode(val))
@ -2315,6 +2319,9 @@ def GetAllValideSessionPartner_List(diction):
else:
val['session_status'] = "0"
if( val['session_status'] not in MYSY_GV.SESSION_STATUS):
val['session_status'] = "0"
val['date_debut'] = retVal['date_debut'][0:10]
val['date_fin'] = retVal['date_fin'][0:10]
val['date_debut_inscription'] = retVal['date_debut_inscription'][0:10]
@ -2546,7 +2553,7 @@ def GetAllValideSessionPartner_List(diction):
val['is_session_alert'] = ""
val['session_alert_message'] = ""
if ("session_status" not in val.keys() or val['session_status'] not in ['-1', '1']):
if ("session_status" not in val.keys() or val['session_status'] not in MYSY_GV.SESSION_STATUS):
val['session_status'] = "1"
RetObject.append(mycommon.JSONEncoder().encode(val))
@ -3009,7 +3016,7 @@ def GetAllValideSessionPartner_List_filter_like(diction):
val['taux_remplissage'] = str(taux_remplissage)
if ("session_status" not in val.keys() or val['session_status'] not in ['-1', '1']):
if ("session_status" not in val.keys() or val['session_status'] not in MYSY_GV.SESSION_STATUS):
val['session_status'] = "1"
if( retVal["type_session"] == "0"):
@ -3427,7 +3434,7 @@ def GetAllValideSessionPartner_List_no_filter(diction):
2)
val['taux_remplissage'] = str(taux_remplissage)
if ("session_status" not in val.keys() or val['session_status'] not in ['-1', '1']):
if ("session_status" not in val.keys() or val['session_status'] not in MYSY_GV.SESSION_STATUS):
val['session_status'] = "1"
if( retVal["type_session"] == "0"):
@ -3494,7 +3501,7 @@ def GetAllValideSessionPartner_List_no_filter(diction):
val['is_session_alert'] = ""
val['session_alert_message'] = ""
if ("session_status" not in val.keys() or val['session_status'] not in ['-1', '1']):
if ("session_status" not in val.keys() or val['session_status'] not in MYSY_GV.SESSION_STATUS):
val['session_status'] = "1"
RetObject.append(mycommon.JSONEncoder().encode(val))

View File

@ -13382,7 +13382,6 @@ def Prepare_and_Send_Email_From_Front():
for tmp in request.files.getlist("File"):
tab_files.append(tmp)
print(" ### payloadpayloadpayload = ", payload)
status, retval = emails.Prepare_and_Send_Email_From_Front(tab_files, MYSY_GV.TEMPORARY_DIRECTORY_V2, payload)
return jsonify(status=status, message=retval)

View File

@ -8402,7 +8402,7 @@ def Ent_Student_Store_files(diction):
"""
Verification des input acceptés
"""
field_list = ['token', 'tab_file_name', 'tab_inscrit_ids', 'tab_ue_ids']
field_list = ['token', 'tab_file_name', 'tab_inscrit_ids', 'tab_ue_ids', 'publish_ent']
incom_keys = diction.keys()
for val in incom_keys:
@ -8492,6 +8492,11 @@ def Ent_Student_Store_files(diction):
new_file['related_collection_session'] = tab_session_id
new_file['related_collection_class'] = tab_class_id
if( "publish_ent" in diction.keys() and diction['publish_ent'] in ['0', '1']):
new_file['publish_ent'] = str(diction['publish_ent'])
else:
new_file['publish_ent'] = "0"
if( "tab_ue_ids" in diction.keys() ):
new_file['related_collection_ue'] = diction['tab_ue_ids']
@ -8549,10 +8554,12 @@ def Push_Document_To_ENT_For_Inscrit(tab_files, Folder, diction):
return local_status, my_partner
list_inscription_id = str(diction['list_inscription_id']).split(",")
tab_related_collection_id = []
list_inscription_id_Objectid = []
for tmp in list_inscription_id:
if (tmp):
list_inscription_id_Objectid.append((ObjectId(str(tmp))))
tab_related_collection_id.append(str(tmp))
# print(" #### list_inscription_id = ", list_inscription_id)
@ -8571,6 +8578,7 @@ def Push_Document_To_ENT_For_Inscrit(tab_files, Folder, diction):
if( session_data and 'code_session' in session_data.keys()):
code_session_formation = session_data['code_session']
tab_ue_ids = []
if ("tab_ue_ids" in diction.keys()):
if diction['tab_ue_ids']:
@ -8614,7 +8622,7 @@ def Push_Document_To_ENT_For_Inscrit(tab_files, Folder, diction):
Verifier la validité des emails de destinataire.
Si et SEULEMENT SI "related_collection" != "no_contact"
"""
tab_related_collection_id = []
tab_email_dest = ""
if ("list_email_dest" in diction.keys()):
if diction['list_email_dest']:
@ -8702,6 +8710,7 @@ def Push_Document_To_ENT_For_Inscrit(tab_files, Folder, diction):
local_diction['tab_file_name'] = tab_saved_file_full_path
local_diction['tab_inscrit_ids'] = list_inscription_id
local_diction['tab_ue_ids'] = tab_ue_ids
local_diction['publish_ent'] = "1"
local_status, local_retval = Ent_Student_Store_files(local_diction)
if (local_status is False):
@ -8772,14 +8781,20 @@ def Push_Document_To_ENT_For_Inscrit(tab_files, Folder, diction):
if (my_company_data_for_sms and "nom" in my_company_data_for_sms.keys() and my_company_data_for_sms['nom']):
nom_etablissement_for_sms = my_company_data_for_sms['nom']
print(" 000000000 tab_related_collection_id = ", tab_related_collection_id)
for user_id in tab_related_collection_id:
user_related_collection_data = MYSY_GV.dbname[str(related_collection)].find_one(
print(" 111111111111111 user_id = ", user_id, " ### QRY = ", {"_id": ObjectId(str(user_id)),
'valide': '1',
'session_id': str(diction['session_id']),
'partner_owner_recid': str(my_partner['recid'])
})
user_related_collection_data = MYSY_GV.dbname['inscription'].find_one(
{"_id": ObjectId(str(user_id)),
'valide': '1',
'session_id': str(diction['session_id']),
local_partner_owner_recid: str(my_partner['recid'])
'partner_owner_recid': str(my_partner['recid'])
}, {'_id': 1, 'email': 1, 'nom': 1, 'prenom': 1, 'telephone':1})
nom = ""
@ -8799,8 +8814,7 @@ def Push_Document_To_ENT_For_Inscrit(tab_files, Folder, diction):
if ("telephone" in user_related_collection_data.keys()):
tel_for_sms = user_related_collection_data['telephone']
print(" 22222222222 ")
node = {}
convention_dictionnary_data['nom'] = nom
convention_dictionnary_data['prenom'] = prenom
@ -8827,8 +8841,7 @@ def Push_Document_To_ENT_For_Inscrit(tab_files, Folder, diction):
3]) + " Le modèle de courrier 'ENT_PUSH_DOCUMENT_NOTIF' n'est pas correctement configuré - contenu_doc")
return False, " Le modèle de courrier 'ENT_PUSH_DOCUMENT_NOTIF' n'est pas correctement configuré - contenu_doc"
print(" 3333333333333333 ")
# Traitement du sujet du mail
sujet_mail_Template = jinja2.Template(str(courrier_data_retval['sujet']))
sujetHtml = sujet_mail_Template.render(params=body["params"])
@ -8841,7 +8854,7 @@ def Push_Document_To_ENT_For_Inscrit(tab_files, Folder, diction):
# Creation de l'email à enoyer
msg = MIMEMultipart("alternative")
#print(" ## partner_own_smtp_valuepartner_own_smtp_value = ", partner_own_smtp_value)
print(" ## partner_own_smtp_valuepartner_own_smtp_value = ", partner_own_smtp_value)
if (str(partner_own_smtp_value) == "1"):
msg.attach(html_mime)
@ -8888,6 +8901,7 @@ def Push_Document_To_ENT_For_Inscrit(tab_files, Folder, diction):
"""
10/07/2026 - envoyer les sms de notification
"""
partner_sms_base_config = MYSY_GV.dbname['base_partner_setup'].find_one(
{'config_name': 'send_sms', 'partner_owner_recid': str(my_partner['recid']),
'valide': '1', 'locked': '0'})
@ -8895,19 +8909,19 @@ def Push_Document_To_ENT_For_Inscrit(tab_files, Folder, diction):
if (partner_sms_base_config and 'config_value' in partner_sms_base_config.keys() and
partner_sms_base_config['config_value'] == "1" and tel_for_sms):
diction_sms = {}
diction_sms['phone_number'] = str(tel_for_sms)
diction_sms['message'] = "Bonjour, vous avez reçu un e-mail de la part de létablissement de formation "+str(nom_etablissement_for_sms).upper()+". Pensez à vérifier votre dossier « Courriers indésirables »."
diction_sms['message'] = "Bonjour, vous avez reçu un nouveau document de la part de létablissement de formation "+str(nom_etablissement_for_sms).upper()+". Pensez à vérifier votre dossier « Courriers indésirables »."
status_send_sms, retval_send_sms = EySy_OVH_Send_Sms(diction_sms)
if (status_send_sms is False):
myprint(
" WARNING : Impossible d'envoyer le sms de notification d'ouverture du compte pour : " + str(
diction['rh_id']))
" WARNING : Impossible d'envoyer le sms de notification d'un nouveau document ")
else:
print(" Un sms de notficationa a été envoyé à "+ str(tel_for_sms))
print(" dd NB_email envoyé = ", cpt_email_envoye)
print(" dd NB_email envoyé = ", cpt_email_envoye)
smtpserver.close()
return True, " Les documents ont été publiés"

View File

@ -21,15 +21,22 @@ import pandas as pd
from unidecode import unidecode
import GlobalVariable as MYSY_GV
from datetime import datetime, date
class JSONEncoder(json.JSONEncoder):
def default(self, o):
if isinstance(o, ObjectId):
return str(o)
print(self)
print(o)
return json.JSONEncoder.default(self, o)
def default(self, obj):
if isinstance(obj, ObjectId):
return str(obj)
if isinstance(obj, datetime):
return obj.isoformat()
if isinstance(obj, date):
return obj.isoformat()
return super().default(obj)
@ -856,6 +863,7 @@ def get_all_class_Given_partner_owner_recid_No_Login_With_Valide_Session(diction
"$match": {
"archive": {"$ne": "1"},
"valide": "1",
"session_status": "1",
"partner_owner_recid": str(x['partner_owner_recid']),
"class_id": str(x['_id'])
}
@ -922,7 +930,10 @@ def get_all_class_Given_partner_owner_recid_No_Login_With_Valide_Session(diction
"nb_participant": 1,
"mode_animation": 1,
"date_debut_inscription": 1,
"date_fin_inscription": 1
"date_fin_inscription": 1,
"date_debut_inscription_date":1,
"date_fin_inscription_date":1,
"today_date":1
}
},
{
@ -938,6 +949,10 @@ def get_all_class_Given_partner_owner_recid_No_Login_With_Valide_Session(diction
user = {}
for local_session in MYSY_GV.dbname['session_formation'].aggregate(pipeline_session_valide):
print(" ### local_session = ", local_session)
"""
24/10/2025 - Pour verifie si le prix est HT ou TTC du PRORITAIRE DE LA FORMATION
on va aller chercher la valeur de TVA dans la collecion :'base_partner_setup'
@ -1031,7 +1046,7 @@ def get_all_class_Given_partner_owner_recid_No_Login_With_Valide_Session(diction
'related_collection_recid':str(x['_id']),
"related_collection":"myclass"}
print("### QRY img = ", class_img_qry)
#print("### QRY img = ", class_img_qry)
image_ch_data = MYSY_GV.dbname['image_ch'].find_one(class_img_qry)
@ -1069,8 +1084,18 @@ def get_all_class_Given_partner_owner_recid_No_Login_With_Valide_Session(diction
user['tab_session'] = tab_session
## Recuperation des sequence
session_sequence = []
for val in MYSY_GV.dbname['session_formation_sequence'].find({'session_id':str(local_session['_id']), 'valide':'1',
'partner_owner_recid':str(str(x['partner_owner_recid']))}):
session_sequence.append(val)
#print(" V2222 user = ", user)
if( session_sequence):
user['session_sequence'] = session_sequence
else:
user['session_sequence'] = []
print(" V2222 user = ", user)
insertObject.append(JSONEncoder().encode(user))
# print(" 1111111 ")