20/11/2023 - 21h00

master
cherif 2023-11-20 21:47:48 +01:00
parent d1a5042e1b
commit 5c476e29d9
4 changed files with 1506 additions and 5 deletions

View File

@ -2,13 +2,10 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="18/11/2023 - 17h00">
<change afterPath="$PROJECT_DIR$/Session_Formation_Sequence.py" afterDir="false" />
<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$/Session_Formation_Sequence.py" beforeDir="false" afterPath="$PROJECT_DIR$/Session_Formation_Sequence.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/agenda.py" beforeDir="false" afterPath="$PROJECT_DIR$/agenda.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/partner_document_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/partner_document_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" />

File diff suppressed because it is too large Load Diff

View File

@ -605,6 +605,19 @@ def Add_Sequence_Affectation_Ressource_Poste(diction):
mycommon.myprint(str(inspect.stack()[0][3]) + " - Sequence incohérente. il a plusieurs sequences avec le meme id ")
return False, " Sequence incohérente. il a plusieurs sequences avec le meme id "
sequence_session_existe_data = MYSY_GV.dbname['session_formation_sequence'].find_one(
{'_id': ObjectId(str(sequence_session_id)), 'partner_owner_recid': str(partner_recid),
'valide': '1', 'locked': '0'})
qry_la = {'_id': ObjectId(str(sequence_session_existe_data['session_id'])), 'partner_owner_recid': str(partner_recid),
'valide': '1'}
session_data = MYSY_GV.dbname['session_formation'].find_one(
{'_id': ObjectId(str(sequence_session_existe_data['session_id'])), 'partner_owner_recid': str(partner_recid),
'valide': '1'})
comment = ""
if ("comment" in diction.keys()):
@ -661,7 +674,10 @@ def Add_Sequence_Affectation_Ressource_Poste(diction):
my_data['poste'] = str(poste)
my_data['related_target_collection_id'] = str(related_target_collection_id)
my_data['related_target_collection'] = str(related_target_collection)
my_data['comment'] = str(diction['comment'])
if( "comment" in diction.keys() ):
my_data['comment'] = str(diction['comment'])
else:
my_data['comment'] = ""
my_data['sequence_session_id'] = str(diction['sequence_session_id'])
@ -675,6 +691,37 @@ def Add_Sequence_Affectation_Ressource_Poste(diction):
return False," Impossible d'affecter la ressource à la sequence (2)"
"""
A présent que la sequence est créée, creation de l'event dans l'agenda de la ressource
"""
my_class_data = MYSY_GV.dbname['myclass'].find_one({'internal_url':str(session_data['class_internal_url']),
'partner_owner_recid':str(session_data['partner_owner_recid']),
'valide':'1'})
class_title = ""
if( my_class_data and "title" in my_class_data.keys()):
class_title = my_class_data['title']
data_agenda = {}
data_agenda['related_collection'] = str(related_target_collection)
data_agenda['related_collection_recid'] = str(related_target_collection_id)
data_agenda['partner_owner_recid'] = str(partner_recid)
data_agenda['event_title'] = str(class_title)
data_agenda['comment'] = str(session_data['code_session'])
data_agenda['event_start'] = datetime.strptime(str(sequence_session_existe_data['sequence_start']), '%d/%m/%Y %H:%M').isoformat()
data_agenda['event_end'] = datetime.strptime(str(sequence_session_existe_data['sequence_end']), '%d/%m/%Y %H:%M').isoformat()
data_agenda['valide'] = "1"
data_agenda['locked'] = "0"
data_agenda['event_type'] = "planning"
data_agenda['sequence_session_id'] = str(sequence_session_existe_data['_id'])
print(" #### data_agenda to add = ", data_agenda)
MYSY_GV.dbname['agenda'].insert_one(data_agenda)
return True, " La sequence a bien été affectée au poste"
except Exception as e:

View File

@ -341,6 +341,12 @@ def get_Agenda_Event_List(diction):
RetObject = []
val_tmp = 1
qry = {'related_collection':str(diction['related_collection']), 'related_collection_recid':str(diction['related_collection_recid']),
'partner_owner_recid':str(my_partner['recid']), 'valide':'1', 'locked':'0'}
for New_retVal in MYSY_GV.dbname['agenda'].find({'related_collection':str(diction['related_collection']), 'related_collection_recid':str(diction['related_collection_recid']),
'partner_owner_recid':str(my_partner['recid']), 'valide':'1', 'locked':'0'}):