parent
70a673f8cc
commit
6fd0e1ba69
|
|
@ -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="07/03/26 - 16h">
|
||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="08/03/26 - 20h">
|
||||
<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$/base_class_calcul_note.py" beforeDir="false" afterPath="$PROJECT_DIR$/base_class_calcul_note.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/jury_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/jury_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Session_Formation.py" beforeDir="false" afterPath="$PROJECT_DIR$/Session_Formation.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Session_Formation_Sequence.py" beforeDir="false" afterPath="$PROJECT_DIR$/Session_Formation_Sequence.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/class_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/class_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.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="546" />
|
||||
<option name="localTasksCounter" value="547" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
|
|
@ -494,7 +497,6 @@
|
|||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="15/12/25 - 13h" />
|
||||
<MESSAGE value="02/01/26 - 13h" />
|
||||
<MESSAGE value="02/01/26 - 21h" />
|
||||
<MESSAGE value="04/01/26 - 21h30" />
|
||||
|
|
@ -519,6 +521,7 @@
|
|||
<MESSAGE value="28/02/26 - 23h" />
|
||||
<MESSAGE value="01/03/26 - 13h30" />
|
||||
<MESSAGE value="07/03/26 - 16h" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="07/03/26 - 16h" />
|
||||
<MESSAGE value="08/03/26 - 20h" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="08/03/26 - 20h" />
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -20,6 +20,7 @@ import re
|
|||
from datetime import datetime, date
|
||||
|
||||
import apprenant_mgt
|
||||
import groupe_inscrit_mgt
|
||||
import module_editique
|
||||
import prj_common as mycommon
|
||||
import secrets
|
||||
|
|
@ -7675,6 +7676,8 @@ Fontion de validation / acceptation d'une inscription
|
|||
A la validation, on regarde si l'inscription a un 'client_rattachement_id' alors on considère qu'il
|
||||
s'agit d'une inscription pour un client, on met le champ 'entreprise' à '1', si non à '0'
|
||||
|
||||
03/10/2026 - S'il s'agit d'une promotion, alors apres l'acceptation de l'inscrit
|
||||
on va l'jouter au groupe "promo" associé
|
||||
"""
|
||||
def AcceptAttendeeInscription(diction):
|
||||
try:
|
||||
|
|
@ -8293,6 +8296,32 @@ def AcceptAttendeeInscription(diction):
|
|||
" - WARNING : Impossible de créer le compte d'accès à l'espace ENT pour " + str( ret_val2['email']) + " \n")
|
||||
is_warning_message = 1
|
||||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
10/03/2026 - s'il s'agit d'une promo, alors on inscrit la personne si on a un groupe "type_promo"
|
||||
"""
|
||||
if( "type_session" in local_session and local_session['type_session'] == "1"):
|
||||
groupe_promo = MYSY_GV.dbname['groupe_inscription'].find_one({'type_groupe_code':'PROMO_GRP',
|
||||
'session_id':str(local_session['_id']),
|
||||
'partner_owner_recid':str(my_partner['recid'])})
|
||||
|
||||
|
||||
|
||||
if( groupe_promo):
|
||||
local_diction = {}
|
||||
local_diction['token'] = diction['token']
|
||||
local_diction['_id'] = str(groupe_promo['_id'])
|
||||
local_diction['tab_inscriptions_ids'] = str(diction['inscription_id'])
|
||||
|
||||
add_to_groupe_status, add_to_groupe_retval = groupe_inscrit_mgt.Add_Update_Groupe_Inscrit_Membres(local_diction)
|
||||
if (add_to_groupe_status is False):
|
||||
mycommon.myprint(str(
|
||||
inspect.stack()[0][3]) + " WARNING : Impossible d'ajouter l'inscrit "+str(diction['inscription_id'])+" au groupe promo")
|
||||
|
||||
|
||||
|
||||
"""
|
||||
12/10/2024 - loguer les action dans l'historique général
|
||||
|
||||
|
|
@ -8371,6 +8400,8 @@ def AcceptAttendeeInscription(diction):
|
|||
|
||||
"""
|
||||
Cette fonction accepte une liste d'inscrit à une session de formation
|
||||
|
||||
|
||||
"""
|
||||
def Accept_List_AttendeeInscription(diction):
|
||||
try:
|
||||
|
|
|
|||
5290
Log/log_file.log
5290
Log/log_file.log
File diff suppressed because it is too large
Load Diff
|
|
@ -23,6 +23,7 @@ import Job_Cron_Common
|
|||
import Session_Formation_Sequence
|
||||
import attached_file_mgt
|
||||
import email_mgt
|
||||
import groupe_inscrit_mgt
|
||||
import module_editique
|
||||
import partner_client
|
||||
import prj_common as mycommon
|
||||
|
|
@ -143,7 +144,7 @@ def Add_Update_SessionFormation(diction):
|
|||
'locked':'0',
|
||||
'_id': {
|
||||
'$in': user_scope_class_id_ObjectId}
|
||||
}, {'_id':1, 'internal_url':1}
|
||||
}, {'_id':1, 'internal_url':1, 'external_code':1}
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -179,6 +180,7 @@ def Add_Update_SessionFormation(diction):
|
|||
"""
|
||||
class_internal_url = ""
|
||||
class_id = ""
|
||||
Class_data = None
|
||||
if ("class_internal_url" in diction.keys()):
|
||||
mydata['class_internal_url'] = diction['class_internal_url']
|
||||
|
||||
|
|
@ -652,7 +654,7 @@ def Add_Update_SessionFormation(diction):
|
|||
'locked':'0',
|
||||
'partner_owner_recid':str(my_partner['recid'])}
|
||||
|
||||
print(" #### qry_automatic_setup == ", qry_automatic_setup)
|
||||
#print(" #### qry_automatic_setup == ", qry_automatic_setup)
|
||||
|
||||
for base_document_automatic_setup_for_partner in MYSY_GV.dbname['base_document_automatic_setup'].find(qry_automatic_setup):
|
||||
new_local_data = base_document_automatic_setup_for_partner
|
||||
|
|
@ -713,6 +715,37 @@ def Add_Update_SessionFormation(diction):
|
|||
MYSY_GV.dbname['financial_caracteristic'].insert_one(financial_data)
|
||||
|
||||
|
||||
"""
|
||||
10/03/26 - Après la création de la promotion (si c'est une promotion), alors
|
||||
Ce groupe est créé automatiquement avec la création d'une promotion. Il est supprimé avec la supprimé d'une promotion
|
||||
"""
|
||||
if( "type_session" in diction.keys() and diction['type_session'] == "1"):
|
||||
# il faut créer le groupe de type promo qui va contenir tous les apprenant de la promo
|
||||
promo_code = ""
|
||||
promo_nom = ""
|
||||
if( is_class_data and "external_code" in is_class_data.keys()):
|
||||
promo_code = "Grp_Promo_"+str(is_class_data['external_code'])[0:10]
|
||||
promo_nom = "Grp Promo "+str(is_class_data['external_code'])[0:10]
|
||||
else:
|
||||
promo_code = "Grp_Promotion"
|
||||
promo_nom = "Grp Promotion"
|
||||
|
||||
group_diction = {}
|
||||
group_diction['token'] = diction['token']
|
||||
group_diction['code'] = promo_code
|
||||
group_diction['nom'] = promo_nom
|
||||
group_diction['type_groupe_code'] = "PROMO_GRP"
|
||||
group_diction['class_id'] = str(class_id)
|
||||
group_diction['session_id'] = str(local_inserted_id)
|
||||
group_diction['color'] = "#071c53"
|
||||
|
||||
local_status, local_retval = groupe_inscrit_mgt.Add_Groupe_Inscrit(group_diction)
|
||||
|
||||
if( local_status is False):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " WARNING : Impossible de créer le groupe promotion lié à la session_id '" + str(local_inserted_id) + "' ")
|
||||
|
||||
|
||||
|
||||
"""
|
||||
# Ajout de l'evenement dans l'historique
|
||||
|
|
@ -5422,6 +5455,7 @@ Ensuite supprimer les affectations d'enseignants et de materiels associée
|
|||
12/01/2024 :
|
||||
- Supprimer les sequences de cette session
|
||||
- Dealloué les agenda
|
||||
- supprimer les groupes apprenant associés
|
||||
"""
|
||||
def Delete_SessionFormation(diction):
|
||||
try:
|
||||
|
|
@ -5508,6 +5542,21 @@ def Delete_SessionFormation(diction):
|
|||
if( local_status is False):
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " WARNING : Impossible de supprimer la sequence_id "+str(sequence['_id']))
|
||||
|
||||
print(" delete 0 qry = ", {'session_id':str(diction['session_id']),
|
||||
'partner_owner_recid':str(my_partner['recid'])})
|
||||
|
||||
# Supprimer les groupe d'apprenant 'groupe_inscription_membre' et 'groupe_inscription'
|
||||
for groupe_inscrit in MYSY_GV.dbname['groupe_inscription'].find({'session_id':str(diction['session_id']),
|
||||
'partner_owner_recid':str(my_partner['recid'])}):
|
||||
|
||||
print(" delete 1 qry = ", {'groupe_inscription_id':str(groupe_inscrit['_id'])})
|
||||
print(" delete 2 qry = ", {'session_id': str(diction['session_id']),
|
||||
'partner_owner_recid': str(my_partner['recid'])})
|
||||
|
||||
delete_groupe_inscription_membre = MYSY_GV.dbname['groupe_inscription_membre'].delete_many({'groupe_inscription_id':str(groupe_inscrit['_id'])})
|
||||
delete_groupe_inscrit = MYSY_GV.dbname['groupe_inscription'].delete_many(
|
||||
{'session_id': str(diction['session_id']),
|
||||
'partner_owner_recid': str(my_partner['recid'])})
|
||||
|
||||
|
||||
# Suppression de la session
|
||||
|
|
@ -5559,6 +5608,7 @@ Cette fonction prends une liste '_id' de session et effectue la Suppression
|
|||
si les conditions sont remplie.
|
||||
|
||||
list_session_id = ['id1', 'id2', 'id3,]
|
||||
supprimer aussi les groupe d'apprenants associé
|
||||
"""
|
||||
def Delete_List_SessionFormation(diction):
|
||||
try:
|
||||
|
|
@ -5646,6 +5696,27 @@ def Delete_List_SessionFormation(diction):
|
|||
# Suppression des sessions
|
||||
cpt = 0
|
||||
for session_id in list_session_id:
|
||||
|
||||
local_delete_diction = {}
|
||||
local_delete_diction['token'] = str(diction['token'])
|
||||
local_delete_diction['session_id'] = str(session_id)
|
||||
|
||||
local_status, local_retval = Delete_SessionFormation(local_delete_diction)
|
||||
|
||||
|
||||
"""
|
||||
# Supprimer les groupe d'apprenant 'groupe_inscription_membre' et 'groupe_inscription'
|
||||
for groupe_inscrit in MYSY_GV.dbname['groupe_inscription'].find({'session_id': str(session_id),
|
||||
'partner_owner_recid': str(
|
||||
my_partner['recid'])}):
|
||||
delete_groupe_inscription_membre = MYSY_GV.dbname['groupe_inscription_membre'].delete_many(
|
||||
{'groupe_inscription_id': str(groupe_inscrit['_id'])})
|
||||
delete_groupe_inscrit = MYSY_GV.dbname['groupe_inscription'].delete_many(
|
||||
{'session_id': str(diction['session_id']),
|
||||
'partner_owner_recid': str(my_partner['recid'])})
|
||||
|
||||
|
||||
|
||||
deleted_session_qry = {'_id':ObjectId(str(session_id)), 'partner_owner_recid':str(partner_recid)}
|
||||
deleted_data = MYSY_GV.dbname['session_formation'].delete_many(deleted_session_qry)
|
||||
|
||||
|
|
@ -5654,13 +5725,12 @@ def Delete_List_SessionFormation(diction):
|
|||
'related_collection_id':str(session_id),
|
||||
'partner_owner_recid':str(my_partner['recid'])})
|
||||
|
||||
"""
|
||||
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + str(deleted_data.deleted_count)+" Document supprimé. La session_id " + str(
|
||||
session_id) + " a été correctement supprimée ")
|
||||
cpt = cpt + 1
|
||||
|
||||
if( cpt > 1 ):
|
||||
return True, "("+str(cpt)+") sessions ont été correctement supprimées"
|
||||
return True, "("+str(cpt)+") documents ont été correctement supprimées"
|
||||
else:
|
||||
return True, "Le document a été correctement supprimé"
|
||||
|
||||
|
|
@ -5668,7 +5738,7 @@ def Delete_List_SessionFormation(diction):
|
|||
except Exception as e:
|
||||
exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - ERRORRRR AT Line : " + str(exc_tb.tb_lineno))
|
||||
return False, "Impossible de supprimer la liste des sessions de formation"
|
||||
return False, "Impossible de supprimer la liste des formations"
|
||||
|
||||
|
||||
"""
|
||||
|
|
@ -5984,7 +6054,7 @@ def Duplicate_List_Session_Formation(diction):
|
|||
'locked': '0',
|
||||
'partner_owner_recid': str(my_partner['recid'])}
|
||||
|
||||
print(" #### qry_automatic_setup == ", qry_automatic_setup)
|
||||
#print(" #### qry_automatic_setup == ", qry_automatic_setup)
|
||||
|
||||
for base_document_automatic_setup_for_partner in MYSY_GV.dbname['base_document_automatic_setup'].find(
|
||||
qry_automatic_setup):
|
||||
|
|
@ -6016,7 +6086,43 @@ def Duplicate_List_Session_Formation(diction):
|
|||
|
||||
|
||||
|
||||
local_retval = MYSY_GV.dbname['session_formation'].insert_one(duplicated_session)
|
||||
local_retval_new_session_data = MYSY_GV.dbname['session_formation'].insert_one(duplicated_session)
|
||||
|
||||
"""
|
||||
10/03/26 - Après la création de la promotion (si c'est une promotion), alors
|
||||
Ce groupe est créé automatiquement avec la création d'une promotion. Il est supprimé avec la supprimé d'une promotion
|
||||
"""
|
||||
|
||||
is_class_data = MYSY_GV.dbname['myclass'].find_one({'_id':ObjectId(str(session_data['class_id'])),
|
||||
'partner_owner_recid':str(my_partner['recid'])}, {'_id':1, 'external_code':1})
|
||||
|
||||
if (is_class_data and "type_session" in session_data.keys() and session_data['type_session'] == "1"):
|
||||
# il faut créer le groupe de type promo qui va contenir tous les apprenant de la promo
|
||||
promo_code = ""
|
||||
promo_nom = ""
|
||||
if (is_class_data and "external_code" in is_class_data.keys()):
|
||||
promo_code = "Grp_Promo_" + str(is_class_data['external_code'])[0:10]
|
||||
promo_nom = "Grp Promo " + str(is_class_data['external_code'])[0:10]
|
||||
else:
|
||||
promo_code = "Grp_Promotion"
|
||||
promo_nom = "Grp Promotion"
|
||||
|
||||
group_diction = {}
|
||||
group_diction['token'] = diction['token']
|
||||
group_diction['code'] = promo_code
|
||||
group_diction['nom'] = promo_nom
|
||||
group_diction['type_groupe_code'] = "PROMO_GRP"
|
||||
group_diction['class_id'] = str(is_class_data['_id'])
|
||||
group_diction['session_id'] = str(local_retval_new_session_data.inserted_id)
|
||||
group_diction['color'] = "#EAFAF4"
|
||||
|
||||
local_status, local_retval_groupe = groupe_inscrit_mgt.Add_Groupe_Inscrit(group_diction)
|
||||
|
||||
if (local_status is False):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " WARNING : Impossible de créer le groupe de promotion lié à la session_id '" + str(
|
||||
local_retval_new_session_data.inserted_id) + "' ")
|
||||
|
||||
"""
|
||||
# Ajout de l'evenement dans l'historique
|
||||
|
|
@ -6025,7 +6131,7 @@ def Duplicate_List_Session_Formation(diction):
|
|||
history_event_dict = {}
|
||||
history_event_dict['token'] = diction['token']
|
||||
history_event_dict['related_collection'] = "session_formation"
|
||||
history_event_dict['related_collection_recid'] = str(local_retval.inserted_id)
|
||||
history_event_dict['related_collection_recid'] = str(local_retval_new_session_data.inserted_id)
|
||||
history_event_dict['action_date'] = str(now)
|
||||
history_event_dict['action_description'] = "Creation (Dupliqué depuis "+str(duplicated_session['code_session'])+" "
|
||||
local_status, local_retval = mycommon.Collection_Historique.Add_Historique_Event(history_event_dict)
|
||||
|
|
|
|||
|
|
@ -379,7 +379,7 @@ def Add_Session_Sequence_Return_New_Seq_Data(diction):
|
|||
"""
|
||||
field_list = ['token', 'session_id', 'sequence_title', 'sequence_start', 'sequence_end', 'agenda', 'objectif',
|
||||
'commentaire', 'check_chevauchement', 'grp_apprenant_id', 'ue_id', 'type', 'ue_planif_line_id',
|
||||
'mode_animation', 'volume_theorique']
|
||||
'mode_animation', 'volume_theorique', 'tab_grp_apprenant_ids']
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
|
|
@ -436,6 +436,39 @@ def Add_Session_Sequence_Return_New_Seq_Data(diction):
|
|||
str(inspect.stack()[0][3]) + " Le volume horaire est incorrecte ")
|
||||
return False, " Le volume horaire est incorrecte"
|
||||
|
||||
tab_grp_apprenant_ids = []
|
||||
tab_grp_apprenant_ids_Object = []
|
||||
if ("tab_grp_apprenant_ids" in diction.keys() and diction['tab_grp_apprenant_ids']):
|
||||
tab_grp_apprenant_ids_work = str(diction['tab_grp_apprenant_ids']).split(",")
|
||||
|
||||
for tmp in tab_grp_apprenant_ids_work:
|
||||
if (tmp):
|
||||
"""
|
||||
Verifier la validité du groupe d'apprenant
|
||||
"""
|
||||
is_valide_grp_apprenant_count = MYSY_GV.dbname['groupe_inscription'].count_documents({'_id':ObjectId(str(tmp)),
|
||||
'valide':'1',
|
||||
'locked':'0',
|
||||
'partner_owner_recid':str(my_partner['recid'])})
|
||||
|
||||
if( is_valide_grp_apprenant_count != 1 ):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " L'identifiant du groupe "+str(tmp)+" est invalide ")
|
||||
return False, " L'identifiant du groupe "+str(tmp)+" est invalide "
|
||||
|
||||
valide_grp_apprenant_data = MYSY_GV.dbname['groupe_inscription'].find_one(
|
||||
{'_id': ObjectId(str(tmp)),
|
||||
'valide': '1',
|
||||
'locked': '0',
|
||||
'partner_owner_recid': str(my_partner['recid'])}, {'_id':1, 'class_id':1, 'code':1 , 'nom':1, 'session_id':1,
|
||||
'type_groupe_code':1})
|
||||
|
||||
local_node = valide_grp_apprenant_data
|
||||
local_node['label'] = valide_grp_apprenant_data['code']
|
||||
|
||||
tab_grp_apprenant_ids.append(local_node)
|
||||
tab_grp_apprenant_ids_Object.append(ObjectId(tmp))
|
||||
|
||||
|
||||
# Verifier qu'il n'y a pas de chevauchement de date avec une autre sequence de la meme session.
|
||||
date_debut_seq = ""
|
||||
|
|
@ -643,6 +676,9 @@ def Add_Session_Sequence_Return_New_Seq_Data(diction):
|
|||
my_data['mode_animation'] = mode_animation
|
||||
|
||||
my_data['grp_apprenant_id'] = grp_apprenant_id
|
||||
|
||||
my_data['tab_grp_apprenant_ids'] = tab_grp_apprenant_ids
|
||||
|
||||
my_data['ue_id'] = ue_id
|
||||
my_data['unite_enseignement_planif_id'] = ue_planif_line_id
|
||||
|
||||
|
|
@ -653,6 +689,7 @@ def Add_Session_Sequence_Return_New_Seq_Data(diction):
|
|||
my_data['creation_date'] = str(datetime.now())
|
||||
my_data['creation_by'] = str(my_partner['_id'])
|
||||
|
||||
|
||||
local_retval = MYSY_GV.dbname['session_formation_sequence'].insert_one(my_data)
|
||||
|
||||
"""
|
||||
|
|
@ -1355,7 +1392,7 @@ def Update_Session_Sequence(diction):
|
|||
"""
|
||||
field_list = ['token', '_id', 'session_id', 'sequence_title', 'sequence_start', 'sequence_end', 'agenda', 'objectif',
|
||||
'commentaire', 'check_chevauchement', 'grp_apprenant_id', 'ue_id', 'type', 'ue_planif_line_id',
|
||||
'mode_animation', 'volume_theorique']
|
||||
'mode_animation', 'volume_theorique', 'tab_grp_apprenant_ids']
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
|
|
@ -1538,6 +1575,42 @@ def Update_Session_Sequence(diction):
|
|||
if ("objectif" in diction.keys()):
|
||||
update_data['objectif'] = str(diction['objectif'])
|
||||
|
||||
tab_grp_apprenant_ids = []
|
||||
tab_grp_apprenant_ids_Object = []
|
||||
if ("tab_grp_apprenant_ids" in diction.keys() and diction['tab_grp_apprenant_ids']):
|
||||
tab_grp_apprenant_ids_work = str(diction['tab_grp_apprenant_ids']).split(",")
|
||||
|
||||
for tmp in tab_grp_apprenant_ids_work:
|
||||
if (tmp):
|
||||
"""
|
||||
Verifier la validité du groupe d'apprenant
|
||||
"""
|
||||
is_valide_grp_apprenant_count = MYSY_GV.dbname['groupe_inscription'].count_documents(
|
||||
{'_id': ObjectId(str(tmp)),
|
||||
'valide': '1',
|
||||
'locked': '0',
|
||||
'partner_owner_recid': str(my_partner['recid'])})
|
||||
|
||||
if (is_valide_grp_apprenant_count != 1):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " L'identifiant du groupe " + str(tmp) + " est invalide ")
|
||||
return False, " L'identifiant du groupe " + str(tmp) + " est invalide "
|
||||
|
||||
valide_grp_apprenant_data = MYSY_GV.dbname['groupe_inscription'].find_one(
|
||||
{'_id': ObjectId(str(tmp)),
|
||||
'valide': '1',
|
||||
'locked': '0',
|
||||
'partner_owner_recid': str(my_partner['recid'])},
|
||||
{'_id': 1, 'class_id': 1, 'code': 1, 'nom': 1, 'session_id': 1,
|
||||
'type_groupe_code': 1})
|
||||
|
||||
local_node = valide_grp_apprenant_data
|
||||
local_node['label'] = valide_grp_apprenant_data['code']
|
||||
|
||||
tab_grp_apprenant_ids.append(local_node)
|
||||
tab_grp_apprenant_ids_Object.append(ObjectId(tmp))
|
||||
|
||||
update_data['tab_grp_apprenant_ids'] = tab_grp_apprenant_ids
|
||||
|
||||
if ("mode_animation" in diction.keys()):
|
||||
update_data['mode_animation'] = str(diction['mode_animation'])
|
||||
|
|
@ -3047,8 +3120,6 @@ def Delete_Note_Evaluation_Ressource_Poste(diction):
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
Recuperer la liste des affectations de ressource à une sequence
|
||||
"""
|
||||
|
|
@ -4417,3 +4488,135 @@ def Decale_Session_Sequence_X_days(diction):
|
|||
|
||||
|
||||
|
||||
"""
|
||||
Cette fonction permet de recuperer les sequences avec plusieurs filter.
|
||||
Filtre sur la session_id, le groupe d'apprenant et l'UE concerné
|
||||
"""
|
||||
def Get_Session_Sequence_List_With_Filter(diction):
|
||||
try:
|
||||
diction = mycommon.strip_dictionary(diction)
|
||||
|
||||
"""
|
||||
Verification des input acceptés
|
||||
"""
|
||||
field_list = ['token', 'session_id', 'grp_apprenant_id', 'unite_enseignement_planif_id']
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
if val not in field_list and val.startswith('my_') is False:
|
||||
mycommon.myprint(str(
|
||||
inspect.stack()[0][3]) + " Le champ '" + val + "' n'est pas autorisé ")
|
||||
return False, " Les informations fournies sont incorrectes",
|
||||
|
||||
"""
|
||||
Verification des champs obligatoires
|
||||
"""
|
||||
field_list_obligatoire = ['token', 'session_id']
|
||||
for val in field_list_obligatoire:
|
||||
if val not in diction:
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " - La valeur '" + val + "' n'est pas presente dans la liste des arguments ")
|
||||
return False, " Les informations fournies sont incorrectes",
|
||||
|
||||
"""
|
||||
Verification de l'identité et autorisation de l'entité qui
|
||||
appelle cette API
|
||||
"""
|
||||
token = ""
|
||||
if ("token" in diction.keys()):
|
||||
if diction['token']:
|
||||
token = diction['token']
|
||||
|
||||
local_status, my_partner = mycommon.Check_Connexion_And_Return_Partner_Data(diction)
|
||||
if (local_status is not True):
|
||||
return local_status, my_partner
|
||||
|
||||
|
||||
filt_grp_apprenant_id = {}
|
||||
if( "grp_apprenant_id" in diction.keys() and diction['grp_apprenant_id']):
|
||||
filt_grp_apprenant_id = {'tab_grp_apprenant_ids._id': str(diction['grp_apprenant_id'])}
|
||||
|
||||
filt_unite_enseignement_planif_id = {}
|
||||
if ("unite_enseignement_planif_id" in diction.keys() and diction['unite_enseignement_planif_id']):
|
||||
filt_unite_enseignement_planif_id = {'unite_enseignement_planif_id': str(diction['unite_enseignement_planif_id'])}
|
||||
|
||||
local_myquery = {"$and": [{'session_id':str(diction['session_id']),
|
||||
'partner_owner_recid':str(my_partner['recid']), 'valide':'1', 'locked':'0'},
|
||||
filt_grp_apprenant_id, filt_unite_enseignement_planif_id
|
||||
]}
|
||||
|
||||
|
||||
RetObject = []
|
||||
val_tmp = 0
|
||||
nb_sequence = 0
|
||||
for New_retVal in MYSY_GV.dbname['session_formation_sequence'].find(local_myquery):
|
||||
|
||||
user = New_retVal
|
||||
user['id'] = str(val_tmp)
|
||||
val_tmp = val_tmp + 1
|
||||
nb_sequence = nb_sequence + 1
|
||||
|
||||
if ("type" not in user.keys()):
|
||||
user['type'] = ""
|
||||
|
||||
|
||||
if ("volume_theorique" not in user.keys()):
|
||||
user['volume_theorique'] = ""
|
||||
|
||||
|
||||
if( "grp_apprenant_id" not in user.keys() ):
|
||||
user['grp_apprenant_id'] = ""
|
||||
|
||||
grp_apprenant_color = ""
|
||||
grp_apprenant_code = ""
|
||||
"""
|
||||
Recuperer la couleur du groupe
|
||||
"""
|
||||
if( "grp_apprenant_id" in user.keys() and user['grp_apprenant_id']):
|
||||
groupe_data = MYSY_GV.dbname['groupe_inscription'].find_one({'_id':ObjectId(str(user['grp_apprenant_id'])),
|
||||
'valide':'1',
|
||||
'locked':'0',
|
||||
'partner_owner_recid':str(my_partner['recid'])},
|
||||
{'code':1, 'color':1})
|
||||
|
||||
if( groupe_data and "color" in groupe_data.keys() and groupe_data['color']):
|
||||
grp_apprenant_color = groupe_data['color']
|
||||
|
||||
if (groupe_data and "code" in groupe_data.keys() and groupe_data['code']):
|
||||
grp_apprenant_code = groupe_data['code']
|
||||
|
||||
user['grp_apprenant_color'] = grp_apprenant_color
|
||||
user['grp_apprenant_code'] = grp_apprenant_code
|
||||
|
||||
if ("mode_animation" not in user.keys()):
|
||||
user['mode_animation'] = "0"
|
||||
|
||||
ue_titre = ""
|
||||
ue_code = ""
|
||||
if ("ue_id" not in user.keys()):
|
||||
user['ue_id'] = ""
|
||||
elif ( "ue_id" in user.keys() and user['ue_id']):
|
||||
eu_id_data = MYSY_GV.dbname['unite_enseignement'].find_one({'_id':ObjectId(str(user['ue_id'])),
|
||||
'partner_owner_recid':str(my_partner['recid'])})
|
||||
|
||||
if(eu_id_data and "titre" in eu_id_data.keys() ):
|
||||
ue_titre = eu_id_data['titre']
|
||||
|
||||
if (eu_id_data and "code" in eu_id_data.keys()):
|
||||
ue_code = eu_id_data['code']
|
||||
|
||||
user['ue_code'] = ue_code
|
||||
user['ue_titre'] = ue_titre
|
||||
|
||||
|
||||
if ("unite_enseignement_planif_id" not in user.keys()):
|
||||
user['unite_enseignement_planif_id'] = ""
|
||||
|
||||
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||
|
||||
return True, RetObject, nb_sequence
|
||||
|
||||
except Exception as e:
|
||||
exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - Line : " + str(exc_tb.tb_lineno))
|
||||
return False, " Impossible de récupérer la liste des séquences de la session "
|
||||
|
|
|
|||
41
class_mgt.py
41
class_mgt.py
|
|
@ -61,7 +61,7 @@ def add_class(diction):
|
|||
'class_level', 'methode_pedagogique', 'condition_handicape', 'suivi_eval', 'class_id',
|
||||
'version', 'categorie', 'recyclage_delai', 'recyclage_periodicite', 'recyclage_alert',
|
||||
'contenu_attestation', 'note_finale_calculation_rule_id', 'referentiel_padagogique_id',
|
||||
'published_catalog_prive', 'is_ftion_initiale']
|
||||
'published_catalog_prive', 'is_ftion_initiale', 'inscription_direct']
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
|
|
@ -589,6 +589,15 @@ def add_class(diction):
|
|||
version = diction['version']
|
||||
mydata['version'] = version
|
||||
|
||||
|
||||
inscription_direct = ""
|
||||
if ("inscription_direct" in diction.keys()):
|
||||
if diction['inscription_direct']:
|
||||
inscription_direct = diction['inscription_direct']
|
||||
mydata['inscription_direct'] = inscription_direct
|
||||
|
||||
|
||||
|
||||
categorie = ""
|
||||
if ("categorie" in diction.keys()):
|
||||
if diction['categorie']:
|
||||
|
|
@ -847,7 +856,7 @@ def update_class(diction):
|
|||
'condition_handicape', 'suivi_eval', 'class_id', 'version', 'categorie', 'recyclage_delai',
|
||||
'recyclage_periodicite', 'recyclage_alert', 'contenu_attestation',
|
||||
'note_finale_calculation_rule_id', 'referentiel_padagogique_id', 'published_catalog_prive',
|
||||
'is_ftion_initiale']
|
||||
'is_ftion_initiale', 'inscription_direct']
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
|
|
@ -1114,6 +1123,9 @@ def update_class(diction):
|
|||
if ("pourqui" in diction.keys()):
|
||||
mydata['pourqui'] = diction['pourqui']
|
||||
|
||||
if ("inscription_direct" in diction.keys()):
|
||||
mydata['inscription_direct'] = diction['inscription_direct']
|
||||
|
||||
if ("support" in diction.keys()):
|
||||
mydata['support'] = str(diction['support']).lower().strip()
|
||||
|
||||
|
|
@ -2801,6 +2813,9 @@ def get_class(diction):
|
|||
if ("note_finale_calculation_rule_id" not in user.keys()):
|
||||
user['note_finale_calculation_rule_id'] = ""
|
||||
|
||||
if ("inscription_direct" not in user.keys()):
|
||||
user['inscription_direct'] = ""
|
||||
|
||||
"""
|
||||
15/09/2024 :
|
||||
Si la formation a des unité d'enseignements rattaché,
|
||||
|
|
@ -3260,6 +3275,10 @@ def get_class_without_marketplace_check(diction):
|
|||
if ("note_finale_calculation_rule_id" not in user.keys()):
|
||||
user['note_finale_calculation_rule_id'] = ""
|
||||
|
||||
|
||||
if ("inscription_direct" not in user.keys()):
|
||||
user['inscription_direct'] = ""
|
||||
|
||||
"""
|
||||
15/09/2024 :
|
||||
Si la formation a des unité d'enseignements rattaché,
|
||||
|
|
@ -3728,6 +3747,9 @@ def get_class_for_partner_catalog(diction):
|
|||
if ("note_finale_calculation_rule_id" not in user.keys()):
|
||||
user['note_finale_calculation_rule_id'] = ""
|
||||
|
||||
if ("inscription_direct" not in user.keys()):
|
||||
user['inscription_direct'] = ""
|
||||
|
||||
RetObject.append(JSONEncoder().encode(user))
|
||||
|
||||
return True, RetObject
|
||||
|
|
@ -3845,6 +3867,9 @@ def get_class_coup_de_coeur(diction):
|
|||
if ("note_finale_calculation_rule_id" not in user.keys()):
|
||||
user['note_finale_calculation_rule_id'] = ""
|
||||
|
||||
if ("inscription_direct" not in user.keys()):
|
||||
user['inscription_direct'] = ""
|
||||
|
||||
RetObject.append(JSONEncoder().encode(user))
|
||||
|
||||
return True, RetObject
|
||||
|
|
@ -5055,6 +5080,9 @@ def get_partner_class_external_code(diction):
|
|||
if ("note_finale_calculation_rule_id" not in user.keys()):
|
||||
user['note_finale_calculation_rule_id'] = ""
|
||||
|
||||
if ("inscription_direct" not in user.keys()):
|
||||
user['inscription_direct'] = ""
|
||||
|
||||
user['id'] = str(val_tmp)
|
||||
|
||||
'''
|
||||
|
|
@ -6355,6 +6383,9 @@ def get_class_by_metier(diction):
|
|||
if ("note_finale_calculation_rule_id" not in user.keys()):
|
||||
user['note_finale_calculation_rule_id'] = ""
|
||||
|
||||
if ("inscription_direct" not in user.keys()):
|
||||
user['inscription_direct'] = ""
|
||||
|
||||
RetObject.append(JSONEncoder().encode(user))
|
||||
# print(" 22222 ")
|
||||
retVal_for_stat = retVal
|
||||
|
|
@ -7164,6 +7195,9 @@ def get_Class_From_Internal_Url(diction):
|
|||
if ("note_finale_calculation_rule_id" not in user.keys()):
|
||||
user['note_finale_calculation_rule_id'] = ""
|
||||
|
||||
if ("inscription_direct" not in user.keys()):
|
||||
user['inscription_direct'] = ""
|
||||
|
||||
|
||||
val_tmp = val_tmp + 1
|
||||
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||
|
|
@ -7245,6 +7279,9 @@ def get_Class_From_Url(diction):
|
|||
if ("note_finale_calculation_rule_id" not in user.keys()):
|
||||
user['note_finale_calculation_rule_id'] = ""
|
||||
|
||||
if ("inscription_direct" not in user.keys()):
|
||||
user['inscription_direct'] = ""
|
||||
|
||||
|
||||
user['id'] = str(val_tmp)
|
||||
val_tmp = val_tmp + 1
|
||||
|
|
|
|||
15
main.py
15
main.py
|
|
@ -11152,6 +11152,21 @@ def Decale_Session_Sequence_X_days():
|
|||
|
||||
|
||||
|
||||
"""
|
||||
API pour de recuperer les sequences avec plusieurs filter.
|
||||
Filtre sur la session_id, le groupe d'apprenant et l'UE concerné
|
||||
"""
|
||||
@app.route('/myclass/api/Get_Session_Sequence_List_With_Filter/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Get_Session_Sequence_List_With_Filter():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Get_Session_Sequence_List_With_Filter payload = ",payload)
|
||||
status, retval, nb_sequence = Session_Formation_Sequence.Get_Session_Sequence_List_With_Filter(payload)
|
||||
return jsonify(status=status, message=retval, nb_sequence=nb_sequence)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
|
|
|
|||
Loading…
Reference in New Issue