31/01/2024 - 16h
parent
84e8d24220
commit
2a11b604a2
|
@ -1,17 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="29/01/24 - 21h30">
|
||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="ss">
|
||||
<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$/Session_Formation.py" beforeDir="false" afterPath="$PROJECT_DIR$/Session_Formation.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/email_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/email_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/emargement.py" beforeDir="false" afterPath="$PROJECT_DIR$/emargement.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/module_editique.py" beforeDir="false" afterPath="$PROJECT_DIR$/module_editique.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/partners.py" beforeDir="false" afterPath="$PROJECT_DIR$/partners.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/prj_common.py" beforeDir="false" afterPath="$PROJECT_DIR$/prj_common.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/ressources_humaines.py" beforeDir="false" afterPath="$PROJECT_DIR$/ressources_humaines.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/ressources_materiels.py" beforeDir="false" afterPath="$PROJECT_DIR$/ressources_materiels.py" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
@ -81,13 +76,6 @@
|
|||
<option name="presentableId" value="Default" />
|
||||
<updated>1680804787304</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00157" summary="23/11/2023 - 21h30">
|
||||
<created>1700772203290</created>
|
||||
<option name="number" value="00157" />
|
||||
<option name="presentableId" value="LOCAL-00157" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1700772203291</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00158" summary="24/11/2023 - 18h30">
|
||||
<created>1700846519563</created>
|
||||
<option name="number" value="00158" />
|
||||
|
@ -424,7 +412,14 @@
|
|||
<option name="project" value="LOCAL" />
|
||||
<updated>1706560519176</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="206" />
|
||||
<task id="LOCAL-00206" summary="ss">
|
||||
<created>1706645717009</created>
|
||||
<option name="number" value="00206" />
|
||||
<option name="presentableId" value="LOCAL-00206" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1706645717009</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="207" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
|
@ -439,7 +434,6 @@
|
|||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="27/12/2023 - 13h" />
|
||||
<MESSAGE value="27/12/2023 - 23h" />
|
||||
<MESSAGE value="28/12/2023- 19h" />
|
||||
<MESSAGE value="29/12/2023- 12h" />
|
||||
|
@ -464,6 +458,7 @@
|
|||
<MESSAGE value="rrr" />
|
||||
<MESSAGE value="rrrf" />
|
||||
<MESSAGE value="29/01/24 - 21h30" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="29/01/24 - 21h30" />
|
||||
<MESSAGE value="ss" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="ss" />
|
||||
</component>
|
||||
</project>
|
2341
Log/log_file.log
2341
Log/log_file.log
File diff suppressed because one or more lines are too long
73
email_mgt.py
73
email_mgt.py
|
@ -14,6 +14,7 @@ import inspect
|
|||
import sys, os
|
||||
|
||||
from bson import ObjectId
|
||||
from pymongo import ReturnDocument
|
||||
from xhtml2pdf import pisa
|
||||
|
||||
import module_editique
|
||||
|
@ -1920,62 +1921,40 @@ def SendEmargementMail( diction):
|
|||
d'emargement, on log une action dans la collection ==> courrier_template_tracking_history
|
||||
"""
|
||||
local_status, local_retval = module_editique.Editic_Log_History_Action_From_courrier_template_type_document_ref_interne(
|
||||
my_partner, "EMARGEMENT_FORMATION",
|
||||
str(val_emarge['session_id']))
|
||||
my_partner, "EMARGEMENT_FORMATION", str(val_emarge['session_id']), "emargement", str(val_emarge['_id']) )
|
||||
|
||||
|
||||
"""
|
||||
31/01/2024 :
|
||||
A présent que la demande d'émargement est envoyée, on met à jour la collection 'emargement' pour
|
||||
dire que la demande a été envoyé, et quel jour
|
||||
"""
|
||||
now = str(datetime.datetime.now().strftime("%d/%m/%Y, %H:%M:%S"))
|
||||
updata_data = {}
|
||||
updata_data['date_update'] = now
|
||||
updata_data['update_by'] = str(my_partner['_id'])
|
||||
|
||||
updata_data['statut'] = "1"
|
||||
updata_data['date_envoi'] = now
|
||||
|
||||
|
||||
MYSY_GV.dbname['emargement'].find_one_and_update({'_id':ObjectId(str(val_emarge['_id'])), 'partner_owner_recid':str(my_partner['recid'])},
|
||||
{"$set": updata_data},
|
||||
return_document=ReturnDocument.AFTER
|
||||
)
|
||||
|
||||
|
||||
|
||||
print(" Email matinée envoyé " + str(my_emarge_id))
|
||||
|
||||
"""
|
||||
# envoie de l'emargement de l'apres midi
|
||||
myurl = "http://127.0.0.1:5001/myclass/api/UserEmargementValidation/" + str(val_emarge['_id']) + "/2"
|
||||
|
||||
if (MYSY_GV.MYSY_ENV == "PROD"):
|
||||
myurl = "https://apimysy.mysy-training.com/myclass/api/UserEmargementValidation/" + str(
|
||||
val_emarge['_id']) + "/2"
|
||||
elif (MYSY_GV.MYSY_ENV == "DEV"):
|
||||
myurl = "http://127.0.0.1:5001/myclass/api/UserEmargementValidation/" + str(val_emarge['_id']) + "/2"
|
||||
elif (MYSY_GV.MYSY_ENV == "REC"):
|
||||
myurl = "https://devapimysy.mysy-training.com/myclass/api/UserEmargementValidation/" + str(
|
||||
val_emarge['_id']) + "/2"
|
||||
|
||||
|
||||
body = {
|
||||
"params": {"nom": str(val_emarge['nom']),
|
||||
"prenom": str(val_emarge['prenom']),
|
||||
"email": str(val_emarge['email']),
|
||||
"class_title": str(local_class_title['title']),
|
||||
"date": str(val_emarge['date']),
|
||||
"session": "Après-midi",
|
||||
"code_session": str(local_session_data['code_session']),
|
||||
"mysyurl": str(myurl),
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
sourceHtml = template.render(params=body["params"])
|
||||
msg_2 = EmailMessage()
|
||||
msg_2.set_content(sourceHtml, subtype='html')
|
||||
msg_2['From'] = MYSY_GV.O365_SMTP_COUNT_From_User
|
||||
msg_2['Cc'] = 'contact@mysy-training.com'
|
||||
msg_2['Subject'] = "[MySy Training Technology] : Emargement Après-midi du "+str(val_emarge['date'])
|
||||
msg_2['To'] = str(val_emarge['email'])
|
||||
|
||||
#smtpserver.ehlo()
|
||||
#smtpserver.starttls()
|
||||
#smtpserver.login(MYSY_GV.O365_SMTP_COUNT_user, MYSY_GV.O365_SMTP_COUNT_password)
|
||||
val = smtpserver.send_message(msg_2)
|
||||
smtpserver.close()
|
||||
|
||||
print(" Email Apres midi envoyé " + str(my_emarge_id))
|
||||
"""
|
||||
|
||||
return True, "Email envoyé "
|
||||
return True, " La demande d'émargement a été correctement envoyée"
|
||||
|
||||
|
||||
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 d'envoyer l'email de notification "
|
||||
return False, " Impossible d'envoyer la demande d'émargement "
|
||||
|
||||
"""
|
||||
Creation manuelle d'une facture avec RIB
|
||||
|
|
|
@ -215,6 +215,12 @@ def CreateTableauEmargement(diction):
|
|||
Evolution de la fonction de création du tableau d'emargement.
|
||||
Dans cette evolution, on plutot recuperer les sequence déjà créesq
|
||||
|
||||
|
||||
31/01/2024 :
|
||||
le statut de l'émargement :
|
||||
0 ==> Initial
|
||||
1 ==> Envoyé
|
||||
2 ==> Validé
|
||||
"""
|
||||
def CreateTableauEmargement_From_Sequence(diction):
|
||||
try:
|
||||
|
@ -249,10 +255,12 @@ def CreateTableauEmargement_From_Sequence(diction):
|
|||
if ("token" in diction.keys()):
|
||||
if diction['token']:
|
||||
my_token = diction['token']
|
||||
# Verifier la validité du token
|
||||
retval = mycommon.check_partner_token_validity("", my_token)
|
||||
if retval is False:
|
||||
return "Err_Connexion", " La session de connexion n'est pas valide"
|
||||
|
||||
local_status, my_partner = mycommon.Check_Connexion_And_Return_Partner_Data(diction)
|
||||
if (local_status is not True):
|
||||
return local_status, my_partner
|
||||
|
||||
partner_recid = my_partner['recid']
|
||||
|
||||
|
||||
class_internal_url = ""
|
||||
|
@ -260,11 +268,6 @@ def CreateTableauEmargement_From_Sequence(diction):
|
|||
if diction['class_internal_url']:
|
||||
class_internal_url = diction['class_internal_url']
|
||||
|
||||
partner_recid = mycommon.get_parnter_recid_from_token(my_token)
|
||||
if (partner_recid is False):
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " - Impossible de créer la liste d'emargement ")
|
||||
return False, "Impossible de créer la liste d'emargement "
|
||||
|
||||
session_id = ""
|
||||
if ("session_id" in diction.keys()):
|
||||
if diction['session_id']:
|
||||
|
@ -373,6 +376,9 @@ def CreateTableauEmargement_From_Sequence(diction):
|
|||
new_my_local_data['matin'] = False
|
||||
new_my_local_data['apresmidi'] = False
|
||||
|
||||
new_my_local_data['statut'] = "0"
|
||||
new_my_local_data['date_envoi'] = ""
|
||||
|
||||
new_my_local_data['partner_owner_recid'] = str(str(partner_recid))
|
||||
|
||||
#print("### emargement insertion de : "+str(new_my_local_data))
|
||||
|
@ -457,6 +463,12 @@ def GetTableauEmargement(diction):
|
|||
for retval in MYSY_GV.dbname['emargement'].find({'session_id':str(session_id),
|
||||
'class_internal_url':str(class_internal_url)}).sort([("date",pymongo.ASCENDING), ("sequence_start",pymongo.ASCENDING), ("sequence_end",pymongo.ASCENDING),]):
|
||||
user = retval
|
||||
if( "statut" not in retval.keys() ):
|
||||
user['statut'] = ""
|
||||
|
||||
if ("date_envoi" not in retval.keys()):
|
||||
user['date_envoi'] = ""
|
||||
|
||||
user['id'] = str(val_tmp)
|
||||
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||
val_tmp = val_tmp + 1
|
||||
|
|
|
@ -338,6 +338,38 @@ def Get_Editable_Document_By_Partner_By_Collection(diction):
|
|||
val['local_related_collection_id'] = local_related_collection_id
|
||||
val['local_related_collection_name'] = local_related_collection_name
|
||||
|
||||
"""
|
||||
Recuperation des infos de la cible pour qui l'action a été faite.
|
||||
"""
|
||||
local_target_collection = ""
|
||||
local_target_collection_id = ""
|
||||
local_target_collection_name = ""
|
||||
|
||||
if( val and "target_collection" in val.keys() and val['target_collection'] and "target_collection_recid" in val.keys() and val['target_collection_recid']):
|
||||
|
||||
if( str(val['target_collection']) == "inscription"):
|
||||
local_target_collection = str(val['target_collection'])
|
||||
local_target_collection_id = str(val['target_collection_recid'])
|
||||
local_target_collection_data = MYSY_GV.dbname[str(val['target_collection'])].find_one({'_id':ObjectId(str(val['target_collection_recid'])),
|
||||
'partner_owner_recid':str(my_partner['recid'])})
|
||||
if( local_target_collection_data and "email" in local_target_collection_data.keys()):
|
||||
local_target_collection_name = local_target_collection_data['email']
|
||||
|
||||
elif (str(val['target_collection']) == "emargement"):
|
||||
local_target_collection = str(val['target_collection'])
|
||||
local_target_collection_id = str(val['target_collection_recid'])
|
||||
local_target_collection_data = MYSY_GV.dbname[str(val['target_collection'])].find_one(
|
||||
{'_id': ObjectId(str(val['target_collection_recid'])),
|
||||
'partner_owner_recid': str(my_partner['recid'])})
|
||||
if (local_target_collection_data and "email" in local_target_collection_data.keys()):
|
||||
local_target_collection_name = local_target_collection_data['email']
|
||||
|
||||
|
||||
val['local_target_collection'] = local_target_collection
|
||||
val['local_target_collection_id'] = local_target_collection_id
|
||||
val['local_target_collection_name'] = local_target_collection_name
|
||||
|
||||
|
||||
local_update_by_email = ""
|
||||
if( "update_by" in val.keys()):
|
||||
update_by_data = MYSY_GV.dbname['partnair_account'].find_one({'_id':ObjectId(val['update_by']),
|
||||
|
@ -712,6 +744,18 @@ def Editic_Log_History_Action(my_partner, courrier_template_data, related_collec
|
|||
history_data_to_log['valide'] = "1"
|
||||
history_data_to_log['locked'] = "0"
|
||||
|
||||
local_target_collection = ""
|
||||
if(target_collection ):
|
||||
local_target_collection = target_collection
|
||||
|
||||
local_target_collection_recid = ""
|
||||
if (target_collection_recid):
|
||||
local_target_collection_recid = target_collection_recid
|
||||
|
||||
history_data_to_log['target_collection'] = local_target_collection
|
||||
history_data_to_log['target_collection_recid'] = local_target_collection_recid
|
||||
|
||||
|
||||
|
||||
print( "#### history_data_to_log = ", history_data_to_log)
|
||||
MYSY_GV.dbname['courrier_template_tracking_history'].insert_one(history_data_to_log)
|
||||
|
@ -762,6 +806,17 @@ def Editic_Log_History_Action_From_courrier_template_type_document_ref_interne(m
|
|||
history_data_to_log['valide'] = "1"
|
||||
history_data_to_log['locked'] = "0"
|
||||
|
||||
local_target_collection = ""
|
||||
if (target_collection):
|
||||
local_target_collection = target_collection
|
||||
|
||||
local_target_collection_recid = ""
|
||||
if (target_collection_recid):
|
||||
local_target_collection_recid = target_collection_recid
|
||||
|
||||
history_data_to_log['target_collection'] = local_target_collection
|
||||
history_data_to_log['target_collection_recid'] = local_target_collection_recid
|
||||
|
||||
|
||||
print( "#### history_data_to_log = ", history_data_to_log)
|
||||
MYSY_GV.dbname['courrier_template_tracking_history'].insert_one(history_data_to_log)
|
||||
|
|
Loading…
Reference in New Issue