parent
661e2c097f
commit
6fbcf1d670
|
|
@ -4,10 +4,15 @@
|
|||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="17/04/2026 -19h">
|
||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="18/04/2026 -19h">
|
||||
<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$/ressources_humaines.py" beforeDir="false" afterPath="$PROJECT_DIR$/ressources_humaines.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/stage_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/stage_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/survey_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/survey_mgt.py" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
|
@ -451,7 +456,7 @@
|
|||
<option name="project" value="LOCAL" />
|
||||
<updated>1747251650255</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="561" />
|
||||
<option name="localTasksCounter" value="562" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
|
|
@ -493,7 +498,6 @@
|
|||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="21/02/26 - 20h" />
|
||||
<MESSAGE value="22/02/26 - 20h" />
|
||||
<MESSAGE value="24/02/26 - 19h30" />
|
||||
<MESSAGE value="25/02/26 - 19h30" />
|
||||
|
|
@ -518,6 +522,7 @@
|
|||
<MESSAGE value="07/04/2026 - 14h" />
|
||||
<MESSAGE value="10/04/2026 - 18h" />
|
||||
<MESSAGE value="17/04/2026 -19h" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="17/04/2026 -19h" />
|
||||
<MESSAGE value="18/04/2026 -19h" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="18/04/2026 -19h" />
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -912,9 +912,11 @@ Les types de formulaire
|
|||
- hot_eval = Formulaire pour evaluation à chaud
|
||||
- cold_eval = Formulaire pour evaluation à froid
|
||||
- human_eval = Formulaire pour evaluation d'une ressource humaine
|
||||
- stage_eval = Formulaire pour evaluation d'un stage
|
||||
- autre_eval = Formulaire pour d'autres evaluation non prevu plus haut
|
||||
"""
|
||||
FORM_TYPE = ['pos', 'hot_eval', 'cold_eval', 'human_eval', 'autre_eval', 'client_eval']
|
||||
FORM_TYPE = ['pos', 'hot_eval', 'cold_eval', 'human_eval', 'autre_eval', 'client_eval',
|
||||
'stage_eval']
|
||||
|
||||
|
||||
"""
|
||||
|
|
@ -1200,3 +1202,13 @@ Ftion Initiale : Fréquence de facturation d'un inscrit
|
|||
INSCRIT_FREQUENCE_FACTURE = ["", "1", "2", "3", ]
|
||||
|
||||
|
||||
"""
|
||||
Gestion de stage : Status
|
||||
'0' => Init
|
||||
'1' => Convention envoyée par Email ou edité par PDF
|
||||
'2' => Convention signée
|
||||
'3' => Stage terminé
|
||||
'4' => Stage Cloturé (ici aucune modification n'est possible)
|
||||
'-1' => Annulé
|
||||
"""
|
||||
STAGE_STATUS = ['', '0', '1', '2', '3', '4', '-1']
|
||||
2470
Log/log_file.log
2470
Log/log_file.log
File diff suppressed because one or more lines are too long
|
|
@ -8541,7 +8541,8 @@ def Prepare_and_Send_Convocation_From_Session_By_PDF(diction):
|
|||
|
||||
|
||||
"""
|
||||
La meme que la précedente mais juste pour une liste d'inscrit"""
|
||||
La meme que la précedente mais juste pour une liste d'inscrit
|
||||
"""
|
||||
def Prepare_and_Send_Convocation_From_Session_For_Selected_Inscrit_By_PDF(diction):
|
||||
try:
|
||||
field_list_obligatoire = ['token', 'session_id', 'courrier_template_id', 'tab_ids']
|
||||
|
|
|
|||
77
main.py
77
main.py
|
|
@ -10567,6 +10567,18 @@ def Add_Specific_Survey_Tab_For_All_Session_Client():
|
|||
|
||||
|
||||
|
||||
"""
|
||||
API pour ajouter une évaluation d'un stage en entreprise.
|
||||
Ici la demande d'évaluation est envoyée au tuteur de stage
|
||||
"""
|
||||
@app.route('/myclass/api/Add_Specific_Survey_Tab_For_Stage_Evaluation/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Add_Specific_Survey_Tab_For_Stage_Evaluation():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Add_Specific_Survey_Tab_For_Stage_Evaluation payload = ",payload)
|
||||
status, retval, survey_internal_code = survey_mgt.Add_Specific_Survey_Tab_For_Stage_Evaluation(payload)
|
||||
return jsonify(status=status, message=retval, survey_internal_code=survey_internal_code)
|
||||
|
||||
|
||||
|
||||
|
|
@ -17364,6 +17376,71 @@ def Get_Given_Stage_data():
|
|||
return jsonify(status=status, message=retval)
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API pour recuperer les modèles de convention de stage
|
||||
"""
|
||||
@app.route('/myclass/api/Get_List_Modele_Stage_Convention_With_Filter/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Get_List_Modele_Stage_Convention_With_Filter():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Get_List_Modele_Stage_Convention_With_Filter payload = ",payload)
|
||||
status, retval = stage_mgt.Get_List_Modele_Stage_Convention_With_Filter(payload)
|
||||
return jsonify(status=status, message=retval)
|
||||
|
||||
|
||||
"""
|
||||
API pour editier la convention de stage en PDF
|
||||
"""
|
||||
@app.route('/myclass/api/Prepare_and_Send_Stage_Convention_For_Selected_Inscrit_By_PDF/<token>/<session_id>/<courrier_template_id>/<tab_inscription_ids>/<stage_id>', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Prepare_and_Send_Stage_Convention_For_Selected_Inscrit_By_PDF(token, session_id, courrier_template_id, tab_inscription_ids, stage_id):
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
payload = {}
|
||||
payload['token'] = str(token)
|
||||
payload['session_id'] = str(session_id)
|
||||
payload['courrier_template_id'] = str(courrier_template_id)
|
||||
payload['tab_inscription_ids'] = str(tab_inscription_ids)
|
||||
payload['stage_id'] = str(stage_id)
|
||||
|
||||
print(" ### Prepare_and_Send_Stage_Convention_For_Selected_Inscrit_By_PDF : payload = ",str(payload))
|
||||
|
||||
localStatus, response= stage_mgt.Prepare_and_Send_Stage_Convention_For_Selected_Inscrit_By_PDF(payload)
|
||||
if(localStatus ):
|
||||
return response
|
||||
else:
|
||||
return False
|
||||
|
||||
|
||||
"""
|
||||
API qui permet d'envoyer la convention de stage par email
|
||||
"""
|
||||
"""
|
||||
API : pour préparer et envoyer les convention en partant d'une session MAIS
|
||||
Avec un liste d'inscrits
|
||||
"""
|
||||
@app.route('/myclass/api/Prepare_and_Send_Stage_Convention_For_Selected_Inscrit_By_Email/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Prepare_and_Send_Stage_Convention_For_Selected_Inscrit_By_Email():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Prepare_and_Send_Stage_Convention_For_Selected_Inscrit_By_Email : payload = ",str(payload))
|
||||
|
||||
file = []
|
||||
tab_files = []
|
||||
if request.method == 'POST':
|
||||
# Create variable for uploaded file
|
||||
tab_files = []
|
||||
for tmp in request.files.getlist("File"):
|
||||
tab_files.append(tmp)
|
||||
|
||||
status, retval = stage_mgt.Prepare_and_Send_Stage_Convention_For_Selected_Inscrit_By_Email(tab_files, MYSY_GV.TEMPORARY_DIRECTORY_V2, payload)
|
||||
return jsonify(status=status, message=retval)
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
print(" debut api")
|
||||
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ def Add_Partner_Admin_Ressource_Humaine_No_Toke(diction):
|
|||
str(inspect.stack()[0][
|
||||
3]) + " - L'adresse email "+str(email)+" n'est pas valide")
|
||||
|
||||
return False, " - - L'adresse email "+str(email)+" n'est pas valide "
|
||||
return False, " - L'adresse email "+str(email)+" n'est pas valide "
|
||||
|
||||
comment = ""
|
||||
if ("comment" in diction.keys()):
|
||||
|
|
|
|||
1304
stage_mgt.py
1304
stage_mgt.py
File diff suppressed because it is too large
Load Diff
279
survey_mgt.py
279
survey_mgt.py
|
|
@ -673,6 +673,10 @@ def Survey_Send_Notification_Sur_Seuil_Alert(diction):
|
|||
elif (diction['survey_type'] == "human_eval"):
|
||||
survey_type = "Questionnaire d'évaluation personnel"
|
||||
|
||||
|
||||
elif (diction['survey_type'] == "stage_eval"):
|
||||
survey_type = "Questionnaire d'évaluation en entreprise"
|
||||
|
||||
convention_dictionnary_data['survey_type'] = survey_type
|
||||
convention_dictionnary_data['partner_owner_recid'] = str(diction['partner_owner_recid'])
|
||||
|
||||
|
|
@ -1871,6 +1875,160 @@ def Add_Specific_Survey_Tab_For_All_Session_Client(diction):
|
|||
return False, " Impossible de créer le formulaire ", False
|
||||
|
||||
|
||||
"""
|
||||
Ajout d'une évaluation d'un stage en entreprise.
|
||||
Ici la demande d'évaluation est envoyée au tuteur de stage
|
||||
"""
|
||||
def Add_Specific_Survey_Tab_For_Stage_Evaluation(diction):
|
||||
try:
|
||||
diction = mycommon.strip_dictionary(diction)
|
||||
|
||||
"""
|
||||
Verification des input acceptés
|
||||
"""
|
||||
field_list = ['session_id', 'token', 'formulaire_id', 'survey_type', 'sending_date', 'related_collection',
|
||||
'related_collection_id', 'stage_id', 'inscription_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", False
|
||||
|
||||
field_list_obligatoire = ['session_id', 'token', 'formulaire_id', 'survey_type', 'sending_date']
|
||||
|
||||
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", False
|
||||
|
||||
my_token = ""
|
||||
if ("token" in diction.keys()):
|
||||
if diction['token']:
|
||||
my_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, False
|
||||
|
||||
local_safe_survey_internal_code = mycommon.create_user_recid()
|
||||
|
||||
|
||||
if( diction['survey_type'] != 'stage_eval'):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " Le type d'évaluation '" + str(diction['survey_type']) + "' ne correspond pas à une évalution d'un stage ")
|
||||
return False, " Le type d'évaluation '" + str(diction['survey_type']) + "' ne correspond pas à une évalution d'un stage ", False
|
||||
|
||||
|
||||
stage_id_valide = MYSY_GV.dbname['inscription_stage'].count_documents({'_id':ObjectId(str(diction['stage_id'])),
|
||||
'partner_owner_recid':str(my_partner['recid']),
|
||||
'valide':'1',
|
||||
'locked':'0'})
|
||||
|
||||
if( stage_id_valide != 1):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " L'identifiant du stage est invalide ")
|
||||
return False, " L'identifiant du stage est invalide ", False
|
||||
|
||||
tuteur_entreprise_data = None
|
||||
stage_data = MYSY_GV.dbname['inscription_stage'].find_one(
|
||||
{'_id': ObjectId(str(diction['stage_id'])),
|
||||
'partner_owner_recid': str(my_partner['recid']),
|
||||
'valide': '1',
|
||||
'locked': '0'})
|
||||
|
||||
if ("partner_client_tuteur_id" in stage_data.keys() and stage_data['partner_client_tuteur_id']):
|
||||
tuteur_entreprise_data = MYSY_GV.dbname['contact'].find_one(
|
||||
{'_id': ObjectId(stage_data['partner_client_tuteur_id']),
|
||||
'partner_recid': str(my_partner['recid']),
|
||||
})
|
||||
|
||||
if (not tuteur_entreprise_data or 'email' not in tuteur_entreprise_data.keys() or mycommon.isEmailValide(tuteur_entreprise_data['email']) is False ):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " - Le tuteur en entreprise est invalide")
|
||||
|
||||
return False, " Le tuteur en entreprise est invalide "
|
||||
|
||||
"""
|
||||
Verifier que la session est valide
|
||||
"""
|
||||
is_valide_session = MYSY_GV.dbname['session_formation'].count_documents(
|
||||
{'_id': ObjectId(str(diction['session_id'])),
|
||||
'valide': '1',
|
||||
'partner_owner_recid': str(my_partner['recid'])})
|
||||
|
||||
if (is_valide_session <= 0):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " L'identifiant de la session est invalide ")
|
||||
return False, " L'identifiant de la session est invalide ", False
|
||||
|
||||
|
||||
"""
|
||||
Verifier la validité du formulaire
|
||||
"""
|
||||
is_valide_form = MYSY_GV.dbname['formulaire'].count_documents({'_id': ObjectId(str(diction['formulaire_id'])),
|
||||
'valide': '1',
|
||||
'locked': '0',
|
||||
'partner_owner_recid': str(my_partner['recid'])})
|
||||
|
||||
if (is_valide_form <= 0):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " L'identifiant du formulaire est invalide ")
|
||||
return False, " L'identifiant du formulaire est invalide ", False
|
||||
|
||||
"""
|
||||
1 - suppression des data existe et
|
||||
2 - la creation de l'enquete
|
||||
"""
|
||||
|
||||
|
||||
MYSY_GV.dbname['survey'].delete_many({'partner_owner_recid':str(my_partner['recid']),
|
||||
'session_id':str(diction['session_id']),
|
||||
'survey_type':str(diction['survey_type']),
|
||||
'inscription_id':str(diction['inscription_id'])})
|
||||
|
||||
|
||||
server_diction = {}
|
||||
server_diction['token'] = diction['token']
|
||||
server_diction['session_id'] = diction['session_id']
|
||||
server_diction['contact_id'] = str(stage_data['partner_client_tuteur_id'])
|
||||
server_diction['formulaire_id'] = diction['formulaire_id']
|
||||
server_diction['survey_type'] = diction['survey_type']
|
||||
server_diction['sending_date'] = diction['sending_date']
|
||||
server_diction['inscrit_id'] = diction['inscription_id']
|
||||
server_diction['stage_id'] = diction['stage_id']
|
||||
|
||||
if ("related_collection" in diction.keys() and diction['related_collection']
|
||||
and "related_collection_id" in diction.keys() and diction['related_collection_id']):
|
||||
server_diction['related_collection'] = diction['related_collection']
|
||||
server_diction['related_collection_id'] = diction['related_collection_id']
|
||||
|
||||
|
||||
server_diction['survey_internal_code'] = local_safe_survey_internal_code
|
||||
# server_diction['survey_type'] = 'specific_survey'
|
||||
|
||||
print(" ### server_diction = ", server_diction)
|
||||
local_status, local_retval = Create_One_Survey_To_Inscrit(server_diction)
|
||||
if (local_status is False):
|
||||
return local_status, local_retval
|
||||
|
||||
return True, " La demande d'évaluation en entreprise a été créée ", local_safe_survey_internal_code
|
||||
|
||||
|
||||
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 créer la demande d'évaluation en entreprise ", False
|
||||
|
||||
|
||||
"""
|
||||
Cette fonction recupere la liste des evaluations spécifique d'un sessions
|
||||
Juste les internal_code
|
||||
|
|
@ -2285,8 +2443,6 @@ def Init_Survey_Tab_For_All_Except_Inscription(diction):
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
Cette fonction envoi un formulaire pour inscrit
|
||||
"""
|
||||
|
|
@ -2299,7 +2455,7 @@ def Create_One_Survey_To_Inscrit(diction):
|
|||
Verification des input acceptés
|
||||
"""
|
||||
field_list = ['session_id', 'token', 'inscrit_id', 'formulaire_id', 'survey_type', 'sending_date', 'related_collection',
|
||||
'related_collection_id', 'class_id', 'survey_internal_code', 'client_id']
|
||||
'related_collection_id', 'class_id', 'survey_internal_code', 'client_id', 'contact_id', 'stage_id']
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
|
|
@ -2377,7 +2533,7 @@ def Create_One_Survey_To_Inscrit(diction):
|
|||
"""
|
||||
Recuperer les données de l'inscrit ou du client
|
||||
"""
|
||||
if( "inscrit_id" in diction.keys() and diction['inscrit_id']):
|
||||
if( "inscrit_id" in diction.keys() and diction['inscrit_id'] and "contact_id" not in diction.keys()):
|
||||
my_inscrit_data = MYSY_GV.dbname['inscription'].find_one({'_id': ObjectId(str(diction['inscrit_id'])),
|
||||
'valide': '1',
|
||||
'locked': '0',
|
||||
|
|
@ -2503,6 +2659,76 @@ def Create_One_Survey_To_Inscrit(diction):
|
|||
mycommon.myprint(" Impossible de créer l'enquete (2) ")
|
||||
return False, " Impossible de créer l'enquete (2) "
|
||||
|
||||
elif ("contact_id" in diction.keys() and diction['contact_id'] and "inscrit_id" in diction.keys()):
|
||||
contact_data = MYSY_GV.dbname['contact'].find_one({'_id': ObjectId(str(diction['contact_id'])),
|
||||
'valide': '1',
|
||||
'partner_recid': str(
|
||||
my_partner['recid'])})
|
||||
|
||||
if (contact_data is None):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " L'identifiant du contact est invalide ")
|
||||
return False, " L'identifiant du contact est invalide "
|
||||
|
||||
related_collection = ""
|
||||
related_collection_id = ""
|
||||
if ("related_collection" in diction.keys() and "related_collection_id" in diction.keys()):
|
||||
related_collection = diction['related_collection']
|
||||
related_collection_id = diction['related_collection_id']
|
||||
|
||||
new_survey_data = {}
|
||||
new_survey_data['email'] = contact_data['email']
|
||||
new_survey_data['nom'] = contact_data['nom']
|
||||
new_survey_data['prenom'] = contact_data['prenom']
|
||||
new_survey_data['civilite'] = contact_data['civilite']
|
||||
new_survey_data['fonction'] = contact_data['fonction']
|
||||
new_survey_data['contact_id'] = str(contact_data['_id'])
|
||||
new_survey_data['formulaire_id'] = str(diction['formulaire_id'])
|
||||
new_survey_data['inscription_id'] = str(diction['inscrit_id'])
|
||||
new_survey_data['partner_owner_recid'] = str(my_partner['recid'])
|
||||
new_survey_data['session_id'] = str(diction['session_id'])
|
||||
new_survey_data['class_id'] = str(my_class_data['_id'])
|
||||
new_survey_data['survey_type'] = str(diction['survey_type'])
|
||||
|
||||
if( 'stage_id' in diction.keys()):
|
||||
new_survey_data['stage_id'] = str(diction['stage_id'])
|
||||
|
||||
if ("survey_internal_code" in diction.keys()):
|
||||
new_survey_data['survey_internal_code'] = str(diction['survey_internal_code'])
|
||||
else:
|
||||
new_survey_data['survey_internal_code'] = ""
|
||||
|
||||
new_survey_data['related_collection'] = str(related_collection)
|
||||
new_survey_data['related_collection_id'] = str(related_collection_id)
|
||||
|
||||
new_survey_data['date_envoi'] = ""
|
||||
new_survey_data['automatique_sending_request_date'] = str(diction['sending_date'])
|
||||
new_survey_data['automatique_traitement'] = "1"
|
||||
new_survey_data['automatique_traitement_done'] = "0"
|
||||
|
||||
new_survey_data['locked'] = "0"
|
||||
new_survey_data['valide'] = "1"
|
||||
|
||||
new_survey_data['mode_envoi'] = ""
|
||||
|
||||
new_survey_data['statut'] = "0"
|
||||
new_survey_data['type'] = "1"
|
||||
new_survey_data['creation_date'] = str(datetime.now())
|
||||
new_survey_data['update_by'] = str(my_partner['_id'])
|
||||
new_survey_data['creation_by'] = str(my_partner['_id'])
|
||||
|
||||
new_survey_data['date_dernier_relance_auto'] = str(datetime.now().strftime("%d/%m/%Y"))
|
||||
|
||||
inserted_id = MYSY_GV.dbname['survey'].insert_one(new_survey_data).inserted_id
|
||||
|
||||
if (not inserted_id):
|
||||
mycommon.myprint(" Impossible de créer l'enquete (2) ")
|
||||
return False, " Impossible de créer l'enquete (2) "
|
||||
|
||||
|
||||
|
||||
|
||||
return True, " L'enquete a été créée"
|
||||
|
||||
except Exception as e:
|
||||
|
|
@ -2828,6 +3054,9 @@ def Send_Survey_TabIds(diction):
|
|||
elif ("survey_type" in local_survey_retval.keys() and local_survey_retval['survey_type'] == "autre_eval"):
|
||||
courrier_ref_interne = "EVAL_AUTRE"
|
||||
|
||||
elif ("survey_type" in local_survey_retval.keys() and local_survey_retval['survey_type'] == "stage_eval"):
|
||||
courrier_ref_interne = "EVAL_AUTRE"
|
||||
|
||||
elif ("survey_type" in local_survey_retval.keys() and local_survey_retval['survey_type'] == "specific_survey"):
|
||||
if ("client_id" in local_survey_retval.keys() and local_survey_retval['client_id']):
|
||||
courrier_ref_interne = "SPECIFIC_SURVEY_CLIENT"
|
||||
|
|
@ -3091,6 +3320,9 @@ def Send_Survey_TabIds(diction):
|
|||
elif ("survey_type" in local_survey_retval.keys() and local_survey_retval['survey_type'] == "autre_eval"):
|
||||
courrier_ref_interne = "EVAL_AUTRE"
|
||||
|
||||
elif ("survey_type" in local_survey_retval.keys() and local_survey_retval['survey_type'] == "stage_eval"):
|
||||
courrier_ref_interne = "EVAL_AUTRE"
|
||||
|
||||
elif ("survey_type" in local_survey_retval.keys() and local_survey_retval[ 'survey_type'] == "specific_survey"):
|
||||
courrier_ref_interne = "SPECIFIC_SURVEY"
|
||||
|
||||
|
|
@ -3314,6 +3546,9 @@ def Automatic_Send_Survey_TabIds(diction):
|
|||
elif ("survey_type" in local_survey_retval.keys() and local_survey_retval['survey_type'] == "autre_eval"):
|
||||
courrier_ref_interne = "EVAL_AUTRE"
|
||||
|
||||
elif ("survey_type" in local_survey_retval.keys() and local_survey_retval['survey_type'] == "stage_eval"):
|
||||
courrier_ref_interne = "EVAL_AUTRE"
|
||||
|
||||
elif ("survey_type" in local_survey_retval.keys() and local_survey_retval['survey_type'] == "specific_survey"):
|
||||
courrier_ref_interne = "SPECIFIC_SURVEY"
|
||||
|
||||
|
|
@ -3542,6 +3777,9 @@ def Automatic_Send_Survey_TabIds(diction):
|
|||
elif ("survey_type" in local_survey_retval.keys() and local_survey_retval['survey_type'] == "autre_eval"):
|
||||
courrier_ref_interne = "EVAL_AUTRE"
|
||||
|
||||
elif ("survey_type" in local_survey_retval.keys() and local_survey_retval['survey_type'] == "stage_eval"):
|
||||
courrier_ref_interne = "EVAL_AUTRE"
|
||||
|
||||
elif ("survey_type" in local_survey_retval.keys() and local_survey_retval['survey_type'] == "specific_survey"):
|
||||
courrier_ref_interne = "SPECIFIC_SURVEY"
|
||||
|
||||
|
|
@ -3609,7 +3847,7 @@ def Get_List_Survey_with_filter(diction):
|
|||
Verification des input acceptés
|
||||
"""
|
||||
field_list = ['token', 'session_id', 'formulaire_type', 'related_collection',
|
||||
'related_collection_id', 'survey_internal_code' ]
|
||||
'related_collection_id', 'survey_internal_code', 'stage_id' ]
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
|
|
@ -3647,6 +3885,10 @@ def Get_List_Survey_with_filter(diction):
|
|||
if ("session_id" in diction.keys()):
|
||||
filt_session_id = {'session_id': str(diction['session_id'])}
|
||||
|
||||
filt_stage_id = {}
|
||||
if ("stage_id" in diction.keys()):
|
||||
filt_stage_id = {'stage_id': str(diction['stage_id'])}
|
||||
|
||||
filt_related_collection = {}
|
||||
if ("related_collection" in diction.keys()):
|
||||
filt_related_collection = {'related_collection': str(diction['related_collection'])}
|
||||
|
|
@ -3669,7 +3911,7 @@ def Get_List_Survey_with_filter(diction):
|
|||
|
||||
qry = {"partner_owner_recid": str(my_partner['recid']), 'valide': '1', 'locked': '0'}
|
||||
query_with_filter = {'$and': [qry, filt_session_id, filt_related_collection, filt_related_collection_id,
|
||||
filt_survey_internal_code, filt_survey_type]}
|
||||
filt_survey_internal_code, filt_survey_type, filt_stage_id]}
|
||||
|
||||
if ("formulaire_type" in diction.keys() and diction['formulaire_type']):
|
||||
pipe_qry = ([
|
||||
|
|
@ -4696,6 +4938,8 @@ def Export_To_Excel_Survey_with_filter_Tab_Survey_Id(diction):
|
|||
if (formateur_data and 'email' in formateur_data.keys()):
|
||||
formateur_email = formateur_data['email']
|
||||
|
||||
|
||||
|
||||
param_survey_data['evaluation_formateur'] = evaluation_formateur
|
||||
|
||||
param_survey_data['formateur_evalue_nom'] = formateur_nom
|
||||
|
|
@ -5886,8 +6130,6 @@ def Get_Survey_Url_From_SessionId_Email_No_Token(diction):
|
|||
"""
|
||||
|
||||
|
||||
|
||||
|
||||
is_session_valide = MYSY_GV.dbname['session_formation'].count_documents({'_id':ObjectId(str(diction['session_id'])),
|
||||
'valide':'1'})
|
||||
|
||||
|
|
@ -5929,12 +6171,23 @@ def Get_Survey_Url_From_SessionId_Email_No_Token(diction):
|
|||
if (survey_data):
|
||||
survey_url = MYSY_GV.CLIENT_URL_BASE + "Survey/qrcode/" + str(survey_data['_id'])
|
||||
|
||||
else:
|
||||
print(" ## QRYYY OODOD = ", {"session_id": diction['session_id'],
|
||||
'email': diction['email'],
|
||||
'valide': '1',
|
||||
elif (diction['survey_type'] == "stage_eval"):
|
||||
|
||||
survey_data = MYSY_GV.dbname['survey'].find_one({'email': str(diction['email']),
|
||||
'session_id': str(diction['session_id']),
|
||||
'partner_owner_recid': str(
|
||||
session_data['partner_owner_recid']),
|
||||
'valide': '1',
|
||||
'locked': '0',
|
||||
'qr_code_safe_token': str(diction['qr_code_safe_token']),
|
||||
'statut': '1', })
|
||||
|
||||
if (survey_data):
|
||||
survey_url = MYSY_GV.CLIENT_URL_BASE + "Survey/qrcode/" + str(survey_data['_id'])
|
||||
|
||||
|
||||
else:
|
||||
|
||||
'status': {'$in': ['0', '1']}})
|
||||
is_inscription_valide = MYSY_GV.dbname['inscription'].count_documents({"session_id": diction['session_id'],
|
||||
'email': diction['email'],
|
||||
'valide': '1',
|
||||
|
|
|
|||
Loading…
Reference in New Issue