Signed-off-by: Cherif <cbalde@mysy-training.com>
master_Elyos_FI
Cherif 2025-10-22 13:43:49 +02:00
parent 0688b2f2d2
commit 2848bf6656
4 changed files with 4110 additions and 7 deletions

View File

@ -4,10 +4,11 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="20/10/2025 - 14hsd">
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="21/10/2025 - 22h">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" 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$/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" />
@ -450,7 +451,7 @@
<option name="project" value="LOCAL" />
<updated>1747251650255</updated>
</task>
<option name="localTasksCounter" value="503" />
<option name="localTasksCounter" value="505" />
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
@ -492,7 +493,6 @@
</option>
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="06/06/2025 - 20h" />
<MESSAGE value="07/06/2025 - 21h30" />
<MESSAGE value="08/06/2025 - 16h30" />
<MESSAGE value="09/06/2025 - 21h30" />
@ -517,6 +517,7 @@
<MESSAGE value="19/10/2025 - 14h" />
<MESSAGE value="20/10/2025 - 14h" />
<MESSAGE value="20/10/2025 - 14hsd" />
<option name="LAST_COMMIT_MESSAGE" value="20/10/2025 - 14hsd" />
<MESSAGE value="21/10/2025 - 22h" />
<option name="LAST_COMMIT_MESSAGE" value="21/10/2025 - 22h" />
</component>
</project>

File diff suppressed because it is too large Load Diff

View File

@ -8198,7 +8198,7 @@ def Update_Class_Default_Document(diction):
'CONVENTION_STAGIAIRE_INDIVIDUELLE_MAIL', 'CONVENTION_STAGIAIRE_INDIVIDUELLE_PDF',
'ATTESTATION_FORMATION', 'CONVOCATION_STAGIAIRE_MAIL',
'CONVOCATION_STAGIAIRE_PDF', 'QUESTION_POSITIONNEMENT',
'EVAL_FORMATION']
'EVAL_FORMATION_HOT', 'EVAL_FORMATION_COLD', 'EVAL_FORMATION_FORMATEUR']
incom_keys = diction.keys()
for val in incom_keys:
@ -8271,7 +8271,7 @@ def Update_Class_Default_Document(diction):
"""
verifier que tous les formulaire envoyés sont valides - formulaire
"""
local_keys = ['QUESTION_POSITIONNEMENT', 'EVAL_FORMATION']
local_keys = ['QUESTION_POSITIONNEMENT', 'EVAL_FORMATION_HOT', 'EVAL_FORMATION_COLD']
for tmp in local_keys:
if (tmp in diction.keys() and diction[str(tmp)]):
@ -8293,7 +8293,7 @@ def Update_Class_Default_Document(diction):
'CONVENTION_STAGIAIRE_INDIVIDUELLE_MAIL', 'CONVENTION_STAGIAIRE_INDIVIDUELLE_PDF',
'ATTESTATION_FORMATION', 'CONVOCATION_STAGIAIRE_MAIL',
'CONVOCATION_STAGIAIRE_PDF', 'QUESTION_POSITIONNEMENT',
'EVAL_FORMATION']
'EVAL_FORMATION_HOT', 'EVAL_FORMATION_COLD', 'EVAL_FORMATION_FORMATEUR']
updated_type_doc = []
# Suppression de l'existant pour cette formation
@ -8421,3 +8421,71 @@ def Get_Given_Class_List_Default_Documents(diction):
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 documents par défaut"
"""
Recuperation du document par defaut d'un type de document
"""
def Get_Given_Class_List_Default_Documents_For_Given_Type_Doc(diction):
try:
diction = mycommon.strip_dictionary(diction)
"""
Verification des input acceptés
"""
field_list = ['token', 'class_id', 'document_type']
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'existe pas")
return False, " Les informations fournies sont incorrectes",
"""
Verification des champs obligatoires
"""
field_list_obligatoire = ['token', 'class_id', 'document_type']
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
"""
Clés de mise à jour
"""
data_cle = {}
data_cle['partner_owner_recid'] = str(my_partner['recid'])
data_cle['class_id'] = str(diction['class_id'])
data_cle['valide'] = "1"
data_cle['locked'] = "0"
#print(" ### Get_Partner_List_Partner_Client data_cle = ", data_cle)
RetObject = []
val_tmp = 0
for retval in MYSY_GV.dbname['myclass_default_document'].find(data_cle, {str(diction['document_type']):1}):
if( str(diction['document_type']) in retval.keys() ):
user = retval
user['id'] = str(val_tmp)
val_tmp = val_tmp + 1
RetObject.append(mycommon.JSONEncoder().encode(user))
return True, RetObject
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 documents par défaut"

13
main.py
View File

@ -14473,6 +14473,19 @@ def Get_Given_Class_List_Default_Documents():
return jsonify(status=status, message=retval)
"""
API pour Recuper du document par defaut d'un type de document
"""
@app.route('/myclass/api/Get_Given_Class_List_Default_Documents_For_Given_Type_Doc/', methods=['POST','GET'])
@crossdomain(origin='*')
def Get_Given_Class_List_Default_Documents_For_Given_Type_Doc():
# On recupere le corps (payload) de la requete
payload = mycommon.strip_dictionary (request.form.to_dict())
print(" ### Get_Given_Class_List_Default_Documents_For_Given_Type_Doc payload = ",payload)
status, retval = cm.Get_Given_Class_List_Default_Documents_For_Given_Type_Doc(payload)
return jsonify(status=status, message=retval)