07/10/2024 - 20h30

master
cherif 2024-10-11 14:19:13 +02:00
parent 81f1556547
commit 482fed6536
4 changed files with 5755 additions and 32 deletions

View File

@ -1,11 +1,11 @@
<?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="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="05/10/2024 - 18h30"> <list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="07/10/2024 - 20h30">
<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$/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$/base_partner_catalog_config.py" beforeDir="false" afterPath="$PROJECT_DIR$/base_partner_catalog_config.py" afterDir="false" /> <change beforePath="$PROJECT_DIR$/lms_chamilo/mysy_lms.py" beforeDir="false" afterPath="$PROJECT_DIR$/lms_chamilo/mysy_lms.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" />
@ -75,13 +75,6 @@
<option name="presentableId" value="Default" /> <option name="presentableId" value="Default" />
<updated>1680804787304</updated> <updated>1680804787304</updated>
</task> </task>
<task id="LOCAL-00356" summary="21/07/2024 - 12h">
<created>1721557111552</created>
<option name="number" value="00356" />
<option name="presentableId" value="LOCAL-00356" />
<option name="project" value="LOCAL" />
<updated>1721557111553</updated>
</task>
<task id="LOCAL-00357" summary="23/07/2024 - 12h"> <task id="LOCAL-00357" summary="23/07/2024 - 12h">
<created>1721725653358</created> <created>1721725653358</created>
<option name="number" value="00357" /> <option name="number" value="00357" />
@ -418,7 +411,14 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1728145402808</updated> <updated>1728145402808</updated>
</task> </task>
<option name="localTasksCounter" value="405" /> <task id="LOCAL-00405" summary="07/10/2024 - 20h30">
<created>1728325045729</created>
<option name="number" value="00405" />
<option name="presentableId" value="LOCAL-00405" />
<option name="project" value="LOCAL" />
<updated>1728325045730</updated>
</task>
<option name="localTasksCounter" value="406" />
<servers /> <servers />
</component> </component>
<component name="Vcs.Log.Tabs.Properties"> <component name="Vcs.Log.Tabs.Properties">
@ -460,7 +460,6 @@
</option> </option>
</component> </component>
<component name="VcsManagerConfiguration"> <component name="VcsManagerConfiguration">
<MESSAGE value="ddd" />
<MESSAGE value="dddqsd" /> <MESSAGE value="dddqsd" />
<MESSAGE value="dddqsdd" /> <MESSAGE value="dddqsdd" />
<MESSAGE value="dddqsdddd" /> <MESSAGE value="dddqsdddd" />
@ -485,6 +484,7 @@
<MESSAGE value="sdfsdsdsd" /> <MESSAGE value="sdfsdsdsd" />
<MESSAGE value="05/10/2024 - 12h" /> <MESSAGE value="05/10/2024 - 12h" />
<MESSAGE value="05/10/2024 - 18h30" /> <MESSAGE value="05/10/2024 - 18h30" />
<option name="LAST_COMMIT_MESSAGE" value="05/10/2024 - 18h30" /> <MESSAGE value="07/10/2024 - 20h30" />
<option name="LAST_COMMIT_MESSAGE" value="07/10/2024 - 20h30" />
</component> </component>
</project> </project>

View File

@ -79,7 +79,7 @@ def AddStagiairetoClass(diction):
'tuteur1_cp', 'tuteur1_ville', 'tuteur1_pays', 'tuteur1_include_com', 'tuteur1_cp', 'tuteur1_ville', 'tuteur1_pays', 'tuteur1_include_com',
'tuteur2_nom', 'tuteur2_prenom', 'tuteur2_email', 'tuteur2_telephone', 'tuteur2_adresse', 'tuteur2_nom', 'tuteur2_prenom', 'tuteur2_email', 'tuteur2_telephone', 'tuteur2_adresse',
'tuteur2_cp', 'tuteur2_ville', 'tuteur2_pays', 'tuteur2_include_com','date_naissance', 'tuteur2_cp', 'tuteur2_ville', 'tuteur2_pays', 'tuteur2_include_com','date_naissance',
'financeur_rattachement_id', 'tuteur1_civilite', 'tuteur1_civilite', 'quotation_id', 'financeur_rattachement_id', 'tuteur1_civilite', 'tuteur2_civilite', 'quotation_id',
'facture_client_rattachement_id' 'facture_client_rattachement_id'
] ]
@ -457,7 +457,9 @@ def AddStagiairetoClass(diction):
mydata['date_update'] = datetime.now().strftime("%d/%m/%Y %H:%M:%S") mydata['date_update'] = datetime.now().strftime("%d/%m/%Y %H:%M:%S")
mydata['date_creation'] = datetime.now().strftime("%d/%m/%Y %H:%M:%S")
mydata['update_by'] = str(connected_user_id) mydata['update_by'] = str(connected_user_id)
mydata['created_by'] = str(connected_user_id)
mydata['valide'] = "1" mydata['valide'] = "1"
mydata['locked'] = "0" mydata['locked'] = "0"
@ -538,7 +540,7 @@ def AddStagiairetoClass(diction):
""" """
Un email ne pouvant s'inscrire qu'a une seule session_id; on fait un usert Un email ne pouvant s'inscrire qu'a une seule session_id; on fait un upsert
""" """
#print(" #### mydata before inscr = ", mydata) #print(" #### mydata before inscr = ", mydata)
ret_val = MYSY_GV.dbname['inscription'].find_one_and_update( ret_val = MYSY_GV.dbname['inscription'].find_one_and_update(
@ -571,7 +573,7 @@ def AddStagiairetoClass(diction):
local_diction['inscription_id'] = str(inserted_id) local_diction['inscription_id'] = str(inserted_id)
local_diction['class_id'] = str(is_myclass_valide_data['_id']) local_diction['class_id'] = str(is_myclass_valide_data['_id'])
print(" ### Init_AcceptAttendeeInscription_For_Initial_Formation local_diction = ",local_diction ) print(" ### Init_AcceptAttendeeInscription_For_Initial_Formation 11 local_diction = ",local_diction )
local_inscription_liste_ue_status, local_inscription_liste_ue_retval = Init_AcceptAttendeeInscription_For_Initial_Formation( local_inscription_liste_ue_status, local_inscription_liste_ue_retval = Init_AcceptAttendeeInscription_For_Initial_Formation(
local_diction) local_diction)
@ -601,8 +603,8 @@ def AddStagiairetoClass(diction):
pour le moment, dans ce cas figure, vu que les email ne sont pas bon car il s'agit d'un resa, alors on ne declenche pour le moment, dans ce cas figure, vu que les email ne sont pas bon car il s'agit d'un resa, alors on ne declenche
pas d'envoie d'email pas d'envoie d'email
""" """
if( new_status != "2" and quotation_id == ""): if( new_status == "0" and quotation_id == ""):
# Le stagaire a bien ete inseré, on declenche l'envoi des emaisl # Le stagaire a bien ete inseré, on declenche l'envoi des emails
## Envoie de l'email de preinscription ## Envoie de l'email de preinscription
mail_data = {} mail_data = {}
@ -630,9 +632,8 @@ def AddStagiairetoClass(diction):
""" """
29/12/2023 : La creation s'est bien passée, si c'est une inscription definitive du premier cout, 29/12/2023 : La creation s'est bien passée, si c'est une inscription definitive du premier cout,
c'est a dire que str(new_status) = 1 => Inscription (validée) alors fait la creation ou une mise à jour c'est a dire que str(new_status) = 1 => Inscription (validée) alors on fait la creation ou une mise à jour
du dossier apprenant en meme tps du dossier apprenant en meme tps
""" """
if (new_status == "1"): if (new_status == "1"):
local_apprenant_id = "" local_apprenant_id = ""
@ -650,9 +651,11 @@ def AddStagiairetoClass(diction):
'valide': '1', 'valide': '1',
'locked': '0'}, {'_id': 1}) 'locked': '0'}, {'_id': 1})
new_apprenant_diction = diction new_apprenant_diction = diction
champ_to_delete = ['class_internal_url', 'session_id', 'inscription_validation_date', 'apprenant_id', champ_to_delete = ['class_internal_url', 'session_id', 'inscription_validation_date', 'apprenant_id',
'status', 'modefinancement', 'type_apprenant'] 'status', 'modefinancement', 'type_apprenant', 'financeur_rattachement_id',
'quotation_id', 'facture_client_rattachement_id']
for val in champ_to_delete: for val in champ_to_delete:
if (val in new_apprenant_diction.keys()): if (val in new_apprenant_diction.keys()):
@ -661,6 +664,8 @@ def AddStagiairetoClass(diction):
new_apprenant_diction['_id'] = str(is_apprenant_existe['_id']) new_apprenant_diction['_id'] = str(is_apprenant_existe['_id'])
local_apprenant_id = str(is_apprenant_existe['_id']) local_apprenant_id = str(is_apprenant_existe['_id'])
local_status, local_retval = apprenant_mgt.Update_Apprenant(new_apprenant_diction) local_status, local_retval = apprenant_mgt.Update_Apprenant(new_apprenant_diction)
if (local_status is False): if (local_status is False):
return local_status, local_retval return local_status, local_retval
@ -668,11 +673,14 @@ def AddStagiairetoClass(diction):
else: else:
new_apprenant_diction = diction new_apprenant_diction = diction
champ_to_delete = [ 'class_internal_url', 'session_id', 'inscription_validation_date', 'apprenant_id', 'status', 'modefinancement', 'type_apprenant'] champ_to_delete = [ 'class_internal_url', 'session_id', 'inscription_validation_date', 'apprenant_id', 'status',
'modefinancement', 'type_apprenant', 'financeur_rattachement_id',
'quotation_id', 'facture_client_rattachement_id']
for val in champ_to_delete: for val in champ_to_delete:
if( val in new_apprenant_diction.keys()): if( val in new_apprenant_diction.keys()):
del new_apprenant_diction[str(val)] del new_apprenant_diction[str(val)]
local_status, local_retval = apprenant_mgt.Add_Apprenant(new_apprenant_diction) local_status, local_retval = apprenant_mgt.Add_Apprenant(new_apprenant_diction)
if (local_status is False): if (local_status is False):
return local_status, local_retval return local_status, local_retval
@ -692,9 +700,10 @@ def AddStagiairetoClass(diction):
local_apprenant_id = str(apprenant_data['_id']) local_apprenant_id = str(apprenant_data['_id'])
"""
Apres la creation du dossier on met à jour l'inscription en rajoutant l'apprenant_id
""" """
Apres la creation du dossier on met à jour l'inscription en rajoutant l'apprenant_id
"""
ret_val2 = MYSY_GV.dbname['inscription'].find_one_and_update( ret_val2 = MYSY_GV.dbname['inscription'].find_one_and_update(
{'_id': ObjectId(str(inserted_id)), 'email': str(diction['email']), {'_id': ObjectId(str(inserted_id)), 'email': str(diction['email']),
'partner_owner_recid': str(my_partner['recid'])}, 'partner_owner_recid': str(my_partner['recid'])},
@ -702,10 +711,28 @@ def AddStagiairetoClass(diction):
'update_by': str(my_partner['_id'])}}, 'update_by': str(my_partner['_id'])}},
return_document=ReturnDocument.AFTER, return_document=ReturnDocument.AFTER,
upsert=False, upsert=False,
) )
"""
Update du 08/10/2024 :
Vu que c'est une inscription validée du premier cout, alors on va lancer les opération de validation
"""
local_diction = {}
local_diction['token'] = str(mytoken)
local_diction['email'] = str(diction['email'])
local_diction['inscription_id'] = str(inserted_id)
print(" ### -- local_diction = ", local_diction)
local_status, local_retval = AcceptAttendeeInscription(local_diction)
if (local_status is False):
return local_status, local_retval
""" """
# Ajout de l'evenement dans l'historique # Ajout de l'evenement dans l'historique
""" """
@ -1054,7 +1081,7 @@ def UpdateStagiairetoClass(diction):
""" """
update de 20/08/23 : update de 20/08/23 :
Vu qu'on autorise maintenant le changement de session, alors pour parer à une eventellement changement de sessio Vu qu'on autorise maintenant le changement de session, alors pour parer à une eventuellement changement de sessio
pour une affectation a une session appartenant à une autre formation, pour une affectation a une session appartenant à une autre formation,
on va ecraser le 'class_internal_url' de la collection 'inscription' avec celui de la collection 'session_formation' on va ecraser le 'class_internal_url' de la collection 'inscription' avec celui de la collection 'session_formation'
@ -6575,6 +6602,7 @@ def AcceptAttendeeInscription(diction):
else: else:
# Il faut créer un dossier apprenant # Il faut créer un dossier apprenant
print(" 11 ")
local_status, local_retval = apprenant_mgt.Add_Apprenant(new_apprenant_diction) local_status, local_retval = apprenant_mgt.Add_Apprenant(new_apprenant_diction)
if( local_status is False): if( local_status is False):
return local_status, local_retval return local_status, local_retval

File diff suppressed because it is too large Load Diff

View File

@ -1894,6 +1894,17 @@ def Create_MySy_LMS_Apprenant(diction):
database=MYSY_GV.MYSY_LMS_BDD database=MYSY_GV.MYSY_LMS_BDD
) )
cur = conn.cursor() cur = conn.cursor()
"""
print(" ### connexion database mariatdb cur = ", cur)
print(" ### MYSY_GV.MYSY_MARIADB_USER = ", MYSY_GV.MYSY_MARIADB_USER)
print(" ### MYSY_GV.MYSY_MARIADB_USER_PASS = ", MYSY_GV.MYSY_MARIADB_USER_PASS)
print(" ### MYSY_GV.MYSY_MARIADB_HOST = ", MYSY_GV.MYSY_MARIADB_HOST)
print(" ### MYSY_GV.MYSY_MARIADB_PORT = ", MYSY_GV.MYSY_MARIADB_PORT)
print(" ### MYSY_GV.MYSY_LMS_BDD = ", MYSY_GV.MYSY_LMS_BDD)
"""
""" """
# retrieving information # retrieving information
cur.execute("SELECT username, email_canonical FROM user WHERE id=?", (2,)) cur.execute("SELECT username, email_canonical FROM user WHERE id=?", (2,))
@ -1923,15 +1934,15 @@ def Create_MySy_LMS_Apprenant(diction):
hashed_pwd) + "', " \ hashed_pwd) + "', " \
"enabled='1', " \ "enabled='1', " \
"expired='0', " \ "expired='0', " \
"locked = '0', expiration_date = "+str(session_end_date_str)+", " \ "locked = '0', expiration_date = '"+str(session_end_date_str)+"', " \
"auth_source = 'platform'," \ "auth_source = 'platform'," \
"roles = 'a:0:{}', " \ "roles = 'a:0:{}', " \
"language = 'french'," \ "language = 'french'," \
"username_canonical = '" + username + "', " \ "username_canonical = '" + username + "', " \
" email_canonical = '" + email + "', " \ " email_canonical = '" + email + "', " \
"email = '" + email + "'," \ "email = '" + email + "'," \
" official_code = '" + official_code + "', " \ " official_code = '" + official_code + "', " \
"active = '1' WHERE username='" + str( "active = '1' WHERE username='" + str(
email) + "' ;" email) + "' ;"
else: else:
# Le compte n'existe pas, il faut le créer # Le compte n'existe pas, il faut le créer
@ -1947,8 +1958,8 @@ def Create_MySy_LMS_Apprenant(diction):
" registration_date = '"+registration_date+"'," \ " registration_date = '"+registration_date+"'," \
" credentials_expired='0', " \ " credentials_expired='0', " \
"enabled='1', " \ "enabled='1', " \
"expired='0', expiration_date = "+str(session_end_date_str)+", " \ "expired='0', expiration_date = '"+str(session_end_date_str)+"', " \
"created_at='" + str( registration_date) + "'," \ "created_at='" + str( registration_date) + "'," \
" updated_at='" + str( registration_date) + "', " \ " updated_at='" + str( registration_date) + "', " \
" status = '5', " \ " status = '5', " \
"password = '"+str(hashed_pwd)+"', " \ "password = '"+str(hashed_pwd)+"', " \