18/08/2024 - 16h55

master
cherif 2024-08-19 16:24:58 +02:00
parent 83b3123d81
commit fb9b09959c
5 changed files with 4822 additions and 20 deletions

View File

@ -1,14 +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="dddss"> <list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="17/08/2024 - 20h55">
<change afterPath="$PROJECT_DIR$/suivi_pedagogique.py" afterDir="false" />
<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$/domaine_formation_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/domaine_formation_mgt.py" afterDir="false" /> <change beforePath="$PROJECT_DIR$/agenda.py" beforeDir="false" afterPath="$PROJECT_DIR$/agenda.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/groupe_inscrit_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/groupe_inscrit_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/invoice_paiement_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/invoice_paiement_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/model_planning_sequence_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/model_planning_sequence_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/suivi_pedagogique_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/suivi_pedagogique_mgt.py" afterDir="false" /> <change beforePath="$PROJECT_DIR$/suivi_pedagogique_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/suivi_pedagogique_mgt.py" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
@ -79,13 +76,6 @@
<option name="presentableId" value="Default" /> <option name="presentableId" value="Default" />
<updated>1680804787304</updated> <updated>1680804787304</updated>
</task> </task>
<task id="LOCAL-00324" summary="05/06/2024 - 23h">
<created>1717621132734</created>
<option name="number" value="00324" />
<option name="presentableId" value="LOCAL-00324" />
<option name="project" value="LOCAL" />
<updated>1717621132735</updated>
</task>
<task id="LOCAL-00325" summary="06/06/2024 - 12h"> <task id="LOCAL-00325" summary="06/06/2024 - 12h">
<created>1717668732175</created> <created>1717668732175</created>
<option name="number" value="00325" /> <option name="number" value="00325" />
@ -422,7 +412,14 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1723804083490</updated> <updated>1723804083490</updated>
</task> </task>
<option name="localTasksCounter" value="373" /> <task id="LOCAL-00373" summary="17/08/2024 - 20h55">
<created>1723920962711</created>
<option name="number" value="00373" />
<option name="presentableId" value="LOCAL-00373" />
<option name="project" value="LOCAL" />
<updated>1723920962711</updated>
</task>
<option name="localTasksCounter" value="374" />
<servers /> <servers />
</component> </component>
<component name="Vcs.Log.Tabs.Properties"> <component name="Vcs.Log.Tabs.Properties">
@ -464,7 +461,6 @@
</option> </option>
</component> </component>
<component name="VcsManagerConfiguration"> <component name="VcsManagerConfiguration">
<MESSAGE value="14/07/2024 - 22h" />
<MESSAGE value="dqsdqs" /> <MESSAGE value="dqsdqs" />
<MESSAGE value="dqsdqss" /> <MESSAGE value="dqsdqss" />
<MESSAGE value="17/07/2024 - 11h30" /> <MESSAGE value="17/07/2024 - 11h30" />
@ -489,6 +485,7 @@
<MESSAGE value="dd" /> <MESSAGE value="dd" />
<MESSAGE value="ddd" /> <MESSAGE value="ddd" />
<MESSAGE value="dddss" /> <MESSAGE value="dddss" />
<option name="LAST_COMMIT_MESSAGE" value="dddss" /> <MESSAGE value="17/08/2024 - 20h55" />
<option name="LAST_COMMIT_MESSAGE" value="17/08/2024 - 20h55" />
</component> </component>
</project> </project>

View File

@ -352,7 +352,8 @@ def AddStagiairetoClass(diction):
11/07/2024 - si j'ai un client_client, mais pas de client facturé, alors on fait : client_facturé = client_client 11/07/2024 - si j'ai un client_client, mais pas de client facturé, alors on fait : client_facturé = client_client
""" """
if ("facture_client_rattachement_id" in mydata.keys() and len(str(mydata['facture_client_rattachement_id']).strip()) <= 1 and len(str(mydata['client_rattachement_id']).strip()) > 3): if ("facture_client_rattachement_id" in mydata.keys() and len(str(mydata['facture_client_rattachement_id']).strip()) <= 1 and "client_rattachement_id" in mydata.keys() and
len(str(mydata['client_rattachement_id']).strip()) > 3):
mydata['facture_client_rattachement_id'] = str(mydata['client_rattachement_id']) mydata['facture_client_rattachement_id'] = str(mydata['client_rattachement_id'])
""" """

File diff suppressed because it is too large Load Diff

View File

@ -54,7 +54,7 @@ def Add_Update_Agenda_Event(diction):
Verification des input acceptés Verification des input acceptés
""" """
field_list = ['token', '_id', 'related_collection', 'event_title', 'event_start', 'event_end', 'related_collection_recid', 'comment', field_list = ['token', '_id', 'related_collection', 'event_title', 'event_start', 'event_end', 'related_collection_recid', 'comment',
'event_type', 'justified'] 'event_type', 'justified', 'linked_collection', 'linked_collection_recid']
incom_keys = diction.keys() incom_keys = diction.keys()
for val in incom_keys: for val in incom_keys:
@ -93,10 +93,16 @@ def Add_Update_Agenda_Event(diction):
str(inspect.stack()[0][3]) + " - L'objet metier "+str(diction['related_collection'] )+" n'accepte pas de planning") str(inspect.stack()[0][3]) + " - L'objet metier "+str(diction['related_collection'] )+" n'accepte pas de planning")
return False, " L'objet metier "+str(diction['related_collection'] )+" n'accepte pas de planning " return False, " L'objet metier "+str(diction['related_collection'] )+" n'accepte pas de planning "
partner_owner_recid = "partner_owner_recid"
if( str(diction['related_collection']) in ['ressource_humaine', 'ressource_materielle']):
partner_owner_recid = "partner_recid"
# Verifier que 'related_collection_recid' existe et est valide dans la collection 'related_collection' # Verifier que 'related_collection_recid' existe et est valide dans la collection 'related_collection'
is_existe_valide_related_collection_recid = MYSY_GV.dbname[str(diction['related_collection'])].count_documents({'_id':ObjectId(str(diction['related_collection_recid'])), is_existe_valide_related_collection_recid = MYSY_GV.dbname[str(diction['related_collection'])].count_documents({'_id':ObjectId(str(diction['related_collection_recid'])),
'partner_recid':str(my_partner['recid']), partner_owner_recid:str(my_partner['recid']),
'valide':'1', 'valide':'1',
'locked':'0'}) 'locked':'0'})
@ -124,6 +130,17 @@ def Add_Update_Agenda_Event(diction):
mydata['event_title'] = str(diction['event_title']) mydata['event_title'] = str(diction['event_title'])
mydata['event_start'] = str(diction['event_start']) mydata['event_start'] = str(diction['event_start'])
mydata['event_end'] = str(diction['event_end']) mydata['event_end'] = str(diction['event_end'])
if( "linked_collection" in diction.keys() ):
mydata['linked_collection'] = str(diction['linked_collection'])
else:
mydata['linked_collection'] = ""
if ("linked_collection_recid" in diction.keys()):
mydata['linked_collection_recid'] = str(diction['linked_collection_recid'])
else:
mydata['linked_collection_recid'] = ""
comment = "" comment = ""
if( "comment" in diction.keys()): if( "comment" in diction.keys()):

View File

@ -44,6 +44,7 @@ from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText from email.mime.text import MIMEText
from email.mime.base import MIMEBase from email.mime.base import MIMEBase
from email import encoders from email import encoders
import agenda as agenda
""" """
Ajout d'un suivi pédagogique Ajout d'un suivi pédagogique
@ -118,6 +119,11 @@ def Add_Suivi_Pedagogique(diction):
str(inspect.stack()[0][3]) + " La formation est invalide ") str(inspect.stack()[0][3]) + " La formation est invalide ")
return False, " La formation est invalide " return False, " La formation est invalide "
local_eu_data = MYSY_GV.dbname['unite_enseignement'].find_one({'_id': ObjectId(str(diction['class_eu_id'])),
'partner_owner_recid': my_partner['recid'],
'valide': '1',
'locked': '0'})
""" """
Verifier que le l'apprenant est valide Verifier que le l'apprenant est valide
""" """
@ -132,6 +138,11 @@ def Add_Suivi_Pedagogique(diction):
str(inspect.stack()[0][3]) + " L'identifiant de l'apprenant est invalide ") str(inspect.stack()[0][3]) + " L'identifiant de l'apprenant est invalide ")
return False, " L'identifiant de l'apprenant est invalide " return False, " L'identifiant de l'apprenant est invalide "
is_valide_apprenant_data = MYSY_GV.dbname['apprenant'].find_one(
{'_id': ObjectId(str(diction['apprenant_id'])),
'partner_owner_recid': my_partner['recid'],
'valide': '1',
'locked': '0'})
""" """
Verifier que le responsable est valide Verifier que le responsable est valide
@ -148,6 +159,13 @@ def Add_Suivi_Pedagogique(diction):
str(inspect.stack()[0][3]) + " L'identifiant du responsable de l'évaluation est invalide ") str(inspect.stack()[0][3]) + " L'identifiant du responsable de l'évaluation est invalide ")
return False, " L'identifiant du responsable de l'évaluation est invalide " return False, " L'identifiant du responsable de l'évaluation est invalide "
is_valide_responsable_data = MYSY_GV.dbname['ressource_humaine'].find_one(
{'_id': ObjectId(str(diction['responsable_id'])),
'partner_recid': my_partner[
'recid'],
'valide': '1',
'locked': '0'})
""" """
Si session_id, verifier la validité de la session Si session_id, verifier la validité de la session
@ -196,6 +214,7 @@ def Add_Suivi_Pedagogique(diction):
new_data = diction new_data = diction
my_token = str(diction['token'])
del diction['token'] del diction['token']
# Initialisation des champs non envoyés à vide # Initialisation des champs non envoyés à vide
@ -217,6 +236,64 @@ def Add_Suivi_Pedagogique(diction):
return False, " Impossible de créer le suivi pédagogique (2) " return False, " Impossible de créer le suivi pédagogique (2) "
"""
Ajouter le suivi pédagogique dans l'agenda de
l'apprenant et du responsable
"""
new_event = {}
new_event['token'] = str(my_token)
new_event['related_collection'] = "apprenant"
new_event['event_title'] = "Suivi Pédagogique"
new_event['event_start'] = datetime.strptime(str(date_heure_debut).strip(), '%d/%m/%Y %H:%M').strftime("%Y-%m-%dT%H:%M")
new_event['event_end'] = datetime.strptime(str(date_heure_fin).strip(), '%d/%m/%Y %H:%M').strftime("%Y-%m-%dT%H:%M")
new_event['related_collection_recid'] = str(diction['apprenant_id'])
new_event['event_type'] = "autre"
comment = " Responsable : "+str(is_valide_responsable_data['civilite']) +" "+str(is_valide_responsable_data['prenom'])+" "+str(is_valide_responsable_data['nom'])+" "
comment = comment+ "\n Apprenant : " + str(is_valide_apprenant_data['civilite']) + " " + str( is_valide_apprenant_data['prenom']) + " " + str(is_valide_apprenant_data['nom']) + " \n "
comment = comment +"\n Unite Enseignement : " + str(local_eu_data['titre'])
new_event['comment'] = comment
new_event['_id'] = ""
new_event['linked_collection'] = "suivi_pedagogique"
new_event['linked_collection_recid'] = str(inserted_id)
add_agenda_status, add_agenda_retval = agenda.Add_Update_Agenda_Event(new_event)
if( add_agenda_status is False ):
mycommon.myprint(
" WARNING : Impossible d'ajouter la suivi pédagogique dans l'agenda de l'apprenant ")
new_event = {}
new_event['token'] = str(my_token)
new_event['related_collection'] = "ressource_humaine"
new_event['event_title'] = "Suivi Pédagogique"
new_event['event_start'] = datetime.strptime(str(date_heure_debut).strip(), '%d/%m/%Y %H:%M').strftime("%Y-%m-%dT%H:%M")
new_event['event_end'] = datetime.strptime(str(date_heure_fin).strip(), '%d/%m/%Y %H:%M').strftime("%Y-%m-%dT%H:%M")
new_event['related_collection_recid'] = str(diction['responsable_id'])
new_event['event_type'] = "autre"
comment = " Responsable : " + str(is_valide_responsable_data['civilite']) + " " + str(
is_valide_responsable_data['prenom']) + " " + str(is_valide_responsable_data['nom']) + " "
comment = comment + "\n Apprenant : " + str(is_valide_apprenant_data['civilite']) + " " + str( is_valide_apprenant_data['prenom']) + " " + str(is_valide_apprenant_data['nom']) + " \n "
comment = comment + "\n Unite Enseignement : " + str(local_eu_data['titre'])
new_event['comment'] = comment
new_event['_id'] = ""
new_event['linked_collection'] = "suivi_pedagogique"
new_event['linked_collection_recid'] = str(inserted_id)
add_agenda_status, add_agenda_retval = agenda.Add_Update_Agenda_Event(new_event)
if (add_agenda_status is False):
mycommon.myprint(
" WARNING : Impossible d'ajouter la suivi pédagogique dans l'agenda du responsable ")
return True, " Le suivi pédagoqique a été correctement ajouté" return True, " Le suivi pédagoqique a été correctement ajouté"
except Exception as e: except Exception as e:
@ -277,7 +354,7 @@ def Update_Suivi_Pedagogique(diction):
""" """
is_valide_suivi_peda_count = MYSY_GV.dbname['suivi_pedagogique'].count_documents({'_id':ObjectId(str(diction['_id'])), is_valide_suivi_peda_count = MYSY_GV.dbname['suivi_pedagogique'].count_documents({'_id':ObjectId(str(diction['_id'])),
'valide':'1', 'valide':'1',
'lockad':'0', 'locked':'0',
'partner_owner_recid':str(my_partner['recid'])}) 'partner_owner_recid':str(my_partner['recid'])})
if( is_valide_suivi_peda_count != 1 ): if( is_valide_suivi_peda_count != 1 ):
@ -313,6 +390,11 @@ def Update_Suivi_Pedagogique(diction):
str(inspect.stack()[0][3]) + " La formation est invalide ") str(inspect.stack()[0][3]) + " La formation est invalide ")
return False, " La formation est invalide " return False, " La formation est invalide "
local_eu_data = MYSY_GV.dbname['unite_enseignement'].find_one({'_id': ObjectId(str(diction['class_eu_id'])),
'partner_owner_recid': my_partner['recid'],
'valide': '1',
'locked': '0'})
""" """
Verifier que le l'apprenant est valide Verifier que le l'apprenant est valide
""" """
@ -327,6 +409,11 @@ def Update_Suivi_Pedagogique(diction):
str(inspect.stack()[0][3]) + " L'identifiant de l'apprenant est invalide ") str(inspect.stack()[0][3]) + " L'identifiant de l'apprenant est invalide ")
return False, " L'identifiant de l'apprenant est invalide " return False, " L'identifiant de l'apprenant est invalide "
is_valide_apprenant_data = MYSY_GV.dbname['apprenant'].find_one(
{'_id': ObjectId(str(diction['apprenant_id'])),
'partner_owner_recid': my_partner['recid'],
'valide': '1',
'locked': '0'})
""" """
Verifier que le responsable est valide Verifier que le responsable est valide
@ -343,6 +430,13 @@ def Update_Suivi_Pedagogique(diction):
str(inspect.stack()[0][3]) + " L'identifiant du responsable de l'évaluation est invalide ") str(inspect.stack()[0][3]) + " L'identifiant du responsable de l'évaluation est invalide ")
return False, " L'identifiant du responsable de l'évaluation est invalide " return False, " L'identifiant du responsable de l'évaluation est invalide "
is_valide_responsable_data = MYSY_GV.dbname['ressource_humaine'].find_one(
{'_id': ObjectId(str(diction['responsable_id'])),
'partner_recid': my_partner[
'recid'],
'valide': '1',
'locked': '0'})
""" """
Si session_id, verifier la validité de la session Si session_id, verifier la validité de la session
@ -391,6 +485,8 @@ def Update_Suivi_Pedagogique(diction):
local_suivi_peda_id = diction['_id'] local_suivi_peda_id = diction['_id']
my_token = diction['token']
new_data = diction new_data = diction
del diction['token'] del diction['token']
del diction['_id'] del diction['_id']
@ -422,6 +518,93 @@ def Update_Suivi_Pedagogique(diction):
" Impossible de mettre à jour le suivi pédagogique (2) ") " Impossible de mettre à jour le suivi pédagogique (2) ")
return False, " Impossible de mettre à jour le suivi pédagogique (2) " return False, " Impossible de mettre à jour le suivi pédagogique (2) "
"""
Ajouter le suivi pédagogique dans l'agenda de
l'apprenant et du responsable
"""
event_to_update = MYSY_GV.dbname['agenda'].find_one({
'partner_owner_recid':str(my_partner['recid']),
'valide':'1',
'locked':'0',
'related_collection':'apprenant',
'linked_collection':'suivi_pedagogique',
'linked_collection_recid':str(local_suivi_peda_id)})
print({
'partner_owner_recid':str(my_partner['recid']),
'valide':'1',
'locked':'0',
'related_collection':'apprenant',
'linked_collection':'suivi_pedagogique',
'linked_collection_recid':str(local_suivi_peda_id)})
if( event_to_update ):
new_event = {}
new_event['token'] = str(my_token)
new_event['related_collection'] = "apprenant"
new_event['event_title'] = "Suivi Pédagogique"
new_event['event_start'] = datetime.strptime(str(date_heure_debut).strip(), '%d/%m/%Y %H:%M').strftime(
"%Y-%m-%dT%H:%M")
new_event['event_end'] = datetime.strptime(str(date_heure_fin).strip(), '%d/%m/%Y %H:%M').strftime(
"%Y-%m-%dT%H:%M")
new_event['related_collection_recid'] = str(diction['apprenant_id'])
new_event['event_type'] = "autre"
comment = " Responsable : " + str(is_valide_responsable_data['civilite']) + " " + str(
is_valide_responsable_data['prenom']) + " " + str(is_valide_responsable_data['nom']) + " "
comment = comment + "\n Apprenant : " + str(is_valide_apprenant_data['civilite']) + " " + str(
is_valide_apprenant_data['prenom']) + " " + str(is_valide_apprenant_data['nom']) + " \n "
comment = comment + "\n Unite Enseignement : " + str(local_eu_data['titre'])
new_event['comment'] = comment
new_event['_id'] = str(event_to_update['_id'])
new_event['linked_collection'] = "suivi_pedagogique"
new_event['linked_collection_recid'] = str(local_suivi_peda_id)
add_agenda_status, add_agenda_retval = agenda.Add_Update_Agenda_Event(new_event)
if (add_agenda_status is False):
mycommon.myprint(
" WARNING : Impossible d'ajouter la suivi pédagogique dans l'agenda de l'apprenant ")
event_to_update = MYSY_GV.dbname['agenda'].find_one({
'partner_owner_recid': str(my_partner['recid']),
'valide': '1',
'locked': '0',
'related_collection': 'ressource_humaine',
'linked_collection': 'suivi_pedagogique',
'linked_collection_recid': str(local_suivi_peda_id)})
if (event_to_update):
new_event = {}
new_event['token'] = str(my_token)
new_event['related_collection'] = "ressource_humaine"
new_event['event_title'] = "Suivi Pédagogique"
new_event['event_start'] = datetime.strptime(str(date_heure_debut).strip(), '%d/%m/%Y %H:%M').strftime(
"%Y-%m-%dT%H:%M")
new_event['event_end'] = datetime.strptime(str(date_heure_fin).strip(), '%d/%m/%Y %H:%M').strftime(
"%Y-%m-%dT%H:%M")
new_event['related_collection_recid'] = str(diction['responsable_id'])
new_event['event_type'] = "autre"
comment = " Responsable : " + str(is_valide_responsable_data['civilite']) + " " + str(
is_valide_responsable_data['prenom']) + " " + str(is_valide_responsable_data['nom']) + " "
comment = comment + "\n Apprenant : " + str(is_valide_apprenant_data['civilite']) + " " + str(
is_valide_apprenant_data['prenom']) + " " + str(is_valide_apprenant_data['nom']) + " \n "
comment = comment + "\n Unite Enseignement : " + str(local_eu_data['titre'])
new_event['comment'] = comment
new_event['_id'] = str(event_to_update['_id'])
new_event['linked_collection'] = "suivi_pedagogique"
new_event['linked_collection_recid'] = str(local_suivi_peda_id)
add_agenda_status, add_agenda_retval = agenda.Add_Update_Agenda_Event(new_event)
if (add_agenda_status is False):
mycommon.myprint(
" WARNING : Impossible d'ajouter la suivi pédagogique dans l'agenda du responsable ")