13/01/22 à 20h

master
cherif 2023-01-15 11:16:31 +01:00
parent fc86aba2c6
commit 2d13fb719a
8 changed files with 1532 additions and 21 deletions

View File

@ -5,8 +5,11 @@
<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$/Template/MySy_confirmation_inscription_formation_tpl.html" beforeDir="false" afterPath="$PROJECT_DIR$/Template/MySy_confirmation_inscription_formation_tpl.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/class_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/class_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/data_indexees.csv" beforeDir="false" afterPath="$PROJECT_DIR$/data_indexees.csv" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ela_output_test_file_pandas_2.txt" beforeDir="false" afterPath="$PROJECT_DIR$/ela_output_test_file_pandas_2.txt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/email_inscription_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/email_inscription_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/prj_common.py" beforeDir="false" afterPath="$PROJECT_DIR$/prj_common.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />

View File

@ -1211,18 +1211,11 @@ def PrintAttendeeDetail_perSession(diction):
{'internal_url': str(local_Insc_retval['class_internal_url'])})
my_local_title = ""
if ("class_title" in local_formation.keys()):
if local_formation['class_title']:
if ("title" in local_formation.keys()):
if local_formation['title']:
my_retrun_dict['class_title'] = local_formation['title']
my_local_title = local_formation['title']
"""
if( my_local_title == "" ):
mycommon.myprint(
str(inspect.stack()[0][
3]) + " Impossible d'imprimer la fiche detaillée : le title de session est absent ")
return False, " Impossible d'imprimer la fiche detaillée : le title de session est absent "
"""
@ -1247,6 +1240,16 @@ def PrintAttendeeDetail_perSession(diction):
return False, " Impossible d'imprimer la fiche detaillée : Aucun formateur designé pour la session"
if ("distantiel" in tmp_val.keys()):
if tmp_val['distantiel']:
my_retrun_dict['distantiel'] = tmp_val['distantiel']
if ("presentiel" in tmp_val.keys()):
if tmp_val['presentiel']:
my_retrun_dict['presentiel'] = tmp_val['presentiel']
my_retrun_dict['partner'] = local_formation['institut_formation']
my_retrun_dict['img_url'] = local_formation['img_url']
@ -1456,8 +1459,8 @@ def SendTrainingEvaluationEmail(diction):
my_retrun_dict['token_eval'] = local_Insc_retval['_id']
my_retrun_dict['session_id'] = local_Insc_retval['session_id']
my_retrun_dict['date_du'] = local_Insc_retval['date_du']
my_retrun_dict['date_au'] = local_Insc_retval['date_au']
my_retrun_dict['date_du'] = str(local_Insc_retval['date_du'])[1:10]
my_retrun_dict['date_au'] = str(local_Insc_retval['date_au'])[0:10]
my_retrun_dict['ville'] = local_Insc_retval['ville']
my_retrun_dict['code_postal'] = local_Insc_retval['code_postal']
my_retrun_dict['internal_url'] = local_Insc_retval['class_internal_url']
@ -1471,11 +1474,29 @@ def SendTrainingEvaluationEmail(diction):
my_retrun_dict['email'] = local_Insc_retval['email']
# Recuperation des infotrmations de la formation
print(" ## str(local_Insc_retval['class_internal_url']) = ",str(local_Insc_retval['class_internal_url']) )
print(" ### str(local_Insc_retval['class_internal_url']) = ",str(local_Insc_retval['class_internal_url']) )
local_formation = MYSY_GV.dbname['myclass'].find_one(
{'internal_url': str(local_Insc_retval['class_internal_url'])})
my_retrun_dict['title'] = local_formation['title']
# Recuperation des info de session
local_session_info = MYSY_GV.dbname['session_formation'].find_one({'formation_session_id': str(diction['session_id']),
'valide': '1'})
if( local_session_info is None):
mycommon.myprint(str(inspect.stack()[0][3]) + " Impossible de recuperer les données de la session de formation")
return False, " Impossible de recuperer les données de la session de formation"
if ("distantiel" in local_session_info.keys()):
if local_session_info['distantiel']:
my_retrun_dict['distantiel'] = local_session_info['teldistantielephone']
if ("presentiel" in local_session_info.keys()):
if local_session_info['presentiel']:
my_retrun_dict['presentiel'] = local_session_info['presentiel']
# Envoi de l'email de notification au formateur
local_status, local_message = email_session.Evaluation_training_confirmation_mail(my_retrun_dict)

File diff suppressed because it is too large Load Diff

View File

@ -2534,8 +2534,9 @@ def add_class_mass(file=None, Folder=None, diction=None):
mydata['external_code'] = str(df['external_code'].values[n]).strip()
mydata['title'] = str(df['titre'].values[n]).strip()
mydata['domaine'] = str(df['domaine'].values[n]).strip()
mydata['description'] = str(df['description'].values[n]).strip()
tmp_desc = str(df['description'].values[n]).strip()
tmp_desc = mycommon.format_MySy_Text_Tag(tmp_desc)
mydata['description'] = tmp_desc
formateur = ""
if ("formateur" in df.keys()):
@ -2570,6 +2571,8 @@ def add_class_mass(file=None, Folder=None, diction=None):
if ("plus_produit" in df.keys()):
if (str(df['plus_produit'].values[n])):
plus_produit = str(df['plus_produit'].values[n]).strip()
plus_produit = mycommon.format_MySy_Text_Tag(plus_produit)
mydata['plus_produit'] = plus_produit
mots_cle = ""
@ -2635,6 +2638,8 @@ def add_class_mass(file=None, Folder=None, diction=None):
if ("objectif" in df.keys()):
if (str(df['objectif'].values[n])):
objectif = str(df['objectif'].values[n]).strip()
objectif = mycommon.format_MySy_Text_Tag(objectif)
mydata['objectif'] = objectif
note = ""
@ -2647,18 +2652,24 @@ def add_class_mass(file=None, Folder=None, diction=None):
if ("programme" in df.keys()):
if (str(df['programme'].values[n])):
programme = str(df['programme'].values[n]).strip()
programme = mycommon.format_MySy_Text_Tag(programme)
mydata['programme'] = programme
prerequis = ""
if ("prerequis" in df.keys()):
if (str(df['prerequis'].values[n])):
prerequis = str(df['prerequis'].values[n]).strip()
prerequis = mycommon.format_MySy_Text_Tag(prerequis)
mydata['prerequis'] = prerequis
pourqui = ""
if ("pourqui" in df.keys()):
if (str(df['pourqui'].values[n])):
pourqui = str(df['pourqui'].values[n]).strip()
pourqui = mycommon.format_MySy_Text_Tag(pourqui)
mydata['pourqui'] = pourqui
support = ""

View File

@ -1,4 +1,3 @@
,index,mots,occurence,moyenne,id_formation,source_field
0,0,parole,1,0.33,CODE_10006,title
1,1,prise,1,0.33,CODE_10006,title
2,2,public,1,0.33,CODE_10006,title
0,0,handicap,1,0.5,TEST_10008_1,title
1,1,sensibiliser,1,0.5,TEST_10008_1,title

1 index mots occurence moyenne id_formation source_field
2 0 0 parole handicap 1 0.33 0.5 CODE_10006 TEST_10008_1 title
3 1 1 prise sensibiliser 1 0.33 0.5 CODE_10006 TEST_10008_1 title
2 2 public 1 0.33 CODE_10006 title

View File

@ -1,3 +1,3 @@
Empty DataFrame
Columns: [mots, occurence, moyenne, id_formation, source_field]
Index: []
mots occurence moyenne id_formation source_field
0 handicap 1 0.5 TEST_10008_1 title
1 sensibiliser 1 0.5 TEST_10008_1 title

View File

@ -478,6 +478,8 @@ def Evaluation_training_confirmation_mail(diction):
"date_fin": str(diction['date_au']),
"adresse": str(diction['adresse']),
"title": str(diction['title']),
"presentiel": str(diction['presentiel']),
"distantiel": str(diction['distantiel']),
"email": str(diction['email']),
"mysyurl": str(my_url)} }

View File

@ -2642,3 +2642,22 @@ def cleanhtml(raw_html):
CLEANR = re.compile('<.*?>')
cleantext = re.sub(CLEANR, '', raw_html).replace("&nbsp;", "")
return cleantext
"""
Cette fonction un texte et ajuste des tag, pour faciliter l'import et formatage des formations
<s> => souligner </s>
<g> => Gras <g>
<t> => tablulation
<l> => saut de ligne
"""
def format_MySy_Text_Tag(sentence):
sentence = sentence.replace("<l>", "<br/>")
sentence = sentence.replace("<e>", "<\t>")
sentence = sentence.replace("<g>", "<b>")
sentence = sentence.replace("</g>", "</b>")
sentence = sentence.replace("<s>", "<u>")
sentence = sentence.replace("</s>", "</u>")
return sentence