parent
333bcf9d98
commit
0cf528a144
|
@ -4,31 +4,17 @@
|
|||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="06/07/2025 - 12h">
|
||||
<change afterPath="$PROJECT_DIR$/email_queu/email_queu_mgt.py" afterDir="false" />
|
||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="12/07/2025 - 12h">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Contact.py" beforeDir="false" afterPath="$PROJECT_DIR$/Contact.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/E_Sign_Document.py" beforeDir="false" afterPath="$PROJECT_DIR$/E_Sign_Document.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/GlobalVariable.py" beforeDir="false" afterPath="$PROJECT_DIR$/GlobalVariable.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Inscription_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/Inscription_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Job_Cron.py" beforeDir="false" afterPath="$PROJECT_DIR$/Job_Cron.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Job_Cron_Common.py" beforeDir="false" afterPath="$PROJECT_DIR$/Job_Cron_Common.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$/apprenant_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/apprenant_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/attached_file_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/attached_file_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/base_partner_catalog_config.py" beforeDir="false" afterPath="$PROJECT_DIR$/base_partner_catalog_config.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/crm_opportunite.py" beforeDir="false" afterPath="$PROJECT_DIR$/crm_opportunite.py" 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$/emargement.py" beforeDir="false" afterPath="$PROJECT_DIR$/emargement.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/lms_chamilo/mysy_lms.py" beforeDir="false" afterPath="$PROJECT_DIR$/lms_chamilo/mysy_lms.py" 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" />
|
||||
<change beforePath="$PROJECT_DIR$/note_evaluation_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/note_evaluation_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/partner_client.py" beforeDir="false" afterPath="$PROJECT_DIR$/partner_client.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/partner_order.py" beforeDir="false" afterPath="$PROJECT_DIR$/partner_order.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$/partner_invoice.py" beforeDir="false" afterPath="$PROJECT_DIR$/partner_invoice.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/survey_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/survey_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/tools_cherif/tools_cherif.py" beforeDir="false" afterPath="$PROJECT_DIR$/tools_cherif/tools_cherif.py" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
@ -471,7 +457,7 @@
|
|||
<option name="project" value="LOCAL" />
|
||||
<updated>1747251650255</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="489" />
|
||||
<option name="localTasksCounter" value="490" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
|
@ -513,7 +499,6 @@
|
|||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="13/05/2025 - 17h" />
|
||||
<MESSAGE value="13/05/2025 - 20h" />
|
||||
<MESSAGE value="14/05/2025 - 20h" />
|
||||
<MESSAGE value="Init - 29/05/2025" />
|
||||
|
@ -538,7 +523,8 @@
|
|||
<MESSAGE value="ssss" />
|
||||
<MESSAGE value="03/07/2025 - 19h30" />
|
||||
<MESSAGE value="06/07/2025 - 12h" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="06/07/2025 - 12h" />
|
||||
<MESSAGE value="12/07/2025 - 12h" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="12/07/2025 - 12h" />
|
||||
</component>
|
||||
<component name="XDebuggerManager">
|
||||
<breakpoint-manager>
|
||||
|
|
|
@ -4038,7 +4038,7 @@ def Controle_AddStagiairetoClass_mass_for_many_session(saved_file=None, Folder=N
|
|||
client_rattachement_nom = str(df['client_rattachement_nom'].values[n]).strip()
|
||||
if (client_rattachement_email and client_rattachement_nom):
|
||||
local_client_retval_qry = {'email':str(client_rattachement_email), 'nom':str(client_rattachement_nom),
|
||||
'valide':'1', 'locked':'0', 'partner_recid' :str(partner_recid)}
|
||||
'valide':'1', 'locked':'0', 'partner_owner_recid' :str(partner_recid)}
|
||||
|
||||
print(" ### local_client_retval_qry = ", local_client_retval_qry)
|
||||
local_client_retval_count = MYSY_GV.dbname['partner_client'].count_documents(local_client_retval_qry)
|
||||
|
@ -12597,7 +12597,7 @@ def Get_Statgaire_List_Partner_with_filter_FOR_ONLY_INSCRIPTION_NO_TOKEN(diction
|
|||
Lists_partner_client_id = []
|
||||
if ("client_nom" in diction.keys()):
|
||||
sub_filt_client_nom = {'nom': {'$regex': str(diction['client_nom']), "$options": "i"},
|
||||
'partner_recid': str(partner_recid), 'valide': '1', 'locked': '0'}
|
||||
'partner_owner_recid': str(partner_recid), 'valide': '1', 'locked': '0'}
|
||||
# Recuperation des '_id' des clients dont le nom match en regexp
|
||||
# print(" ### sub_filt_client_nom = ", sub_filt_client_nom)
|
||||
for List_Client_Data in MYSY_GV.dbname['partner_client'].find(sub_filt_client_nom, {'_id': 1}):
|
||||
|
|
9401
Log/log_file.log
9401
Log/log_file.log
File diff suppressed because one or more lines are too long
|
@ -565,6 +565,90 @@ def Get_Stored_Downloaded_File_From_Id(diction):
|
|||
return False, False
|
||||
|
||||
|
||||
"""
|
||||
Fonction de recuperation des pièces jointes d'objet en utilisant le '_id' SANS TOKEN
|
||||
"""
|
||||
|
||||
def Get_Stored_Downloaded_File_From_Id_WITHOUT_TOKEN(diction):
|
||||
try:
|
||||
full_file_path = ""
|
||||
|
||||
diction = mycommon.strip_dictionary(diction)
|
||||
"""
|
||||
Verification des input acceptés
|
||||
"""
|
||||
|
||||
|
||||
field_list = [ '_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",
|
||||
|
||||
"""
|
||||
Verification des champs obligatoires
|
||||
"""
|
||||
field_list_obligatoire = [ '_id']
|
||||
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",
|
||||
|
||||
|
||||
"""
|
||||
Verifier la validité de l'identifiant
|
||||
"""
|
||||
is_valide_download_files = MYSY_GV.dbname["download_files"].count_documents({'_id':ObjectId(str(diction['_id'])),
|
||||
'valide':'1',})
|
||||
if(is_valide_download_files != 1 ):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " L'identifiant du fichier est invalide ")
|
||||
return False, " L'identifiant du fichier est invalide ",
|
||||
|
||||
|
||||
is_valide_download_files_data = MYSY_GV.dbname["download_files"].find_one(
|
||||
{'_id': ObjectId(str(diction['_id'])),
|
||||
'valide': '1',
|
||||
})
|
||||
|
||||
|
||||
|
||||
file_name = ""
|
||||
if( "file_name" in is_valide_download_files_data.keys() ):
|
||||
file_name = is_valide_download_files_data['full_path']
|
||||
|
||||
if( not file_name ):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " - Fichier invalide = "+ str(file_name))
|
||||
|
||||
return False, " Fichier invalide "
|
||||
|
||||
full_path = str(file_name)
|
||||
|
||||
|
||||
|
||||
if os.path.exists(full_path):
|
||||
print(" ### full_path = ", full_path)
|
||||
return True, send_file(full_path, as_attachment=True)
|
||||
|
||||
else:
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " Fichier invalide (2)= "+str(full_path))
|
||||
|
||||
return False, " Fichier invalide (2) "
|
||||
|
||||
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, False
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
|
@ -1241,3 +1325,175 @@ def Get_List_object_owner_collection_Stored_Files_With_Filter(diction):
|
|||
mycommon.myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - ERRORRRR AT Line : " + str(exc_tb.tb_lineno))
|
||||
return False, " Impossible récupérer la liste des documents "
|
||||
|
||||
|
||||
"""
|
||||
Cette fonction permet de recuperer une liste de documents
|
||||
avec plusieurs filtre
|
||||
"""
|
||||
|
||||
|
||||
def Get_List_object_owner_collection_Stored_Files_With_Filter_No_Token(diction):
|
||||
try:
|
||||
|
||||
diction = mycommon.strip_dictionary(diction)
|
||||
|
||||
"""
|
||||
Verification des input acceptés
|
||||
"""
|
||||
field_list = [ 'filter_object_owner_collection', 'filter_object_owner_id',
|
||||
'filter_file_business_object', 'date_create_start_date', 'date_create_end_date',
|
||||
'filter_type_document',
|
||||
'filter_nom_client', 'filter_formation_external_code', 'filter_session_code',
|
||||
'filter_class_external_code']
|
||||
|
||||
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",
|
||||
|
||||
'''
|
||||
Une fois qu'on a controlé que toutes les clés mise dans l'API sont correcte. etape precedente,
|
||||
On controle que les champs obligatoires sont presents dans la liste
|
||||
'''
|
||||
field_list_obligatoire = ['filter_object_owner_collection', 'filter_object_owner_id', ]
|
||||
|
||||
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, "Tous les champs obligatoires ne sont pas fournis"
|
||||
|
||||
|
||||
# Ici le nom du document
|
||||
filt_file_business_object = {}
|
||||
if ("filter_file_business_object" in diction.keys() and diction['filter_file_business_object']):
|
||||
filt_file_business_object = {
|
||||
'file_business_object': {'$regex': str(diction['filter_file_business_object']), "$options": 'i'}}
|
||||
|
||||
filt_object_owner_collection = {}
|
||||
if ("filter_object_owner_collection" in diction.keys() and diction['filter_object_owner_collection']):
|
||||
filt_object_owner_collection = {'object_owner_collection': str(diction['filter_object_owner_collection'])}
|
||||
|
||||
filt_filter_object_owner_id = {}
|
||||
if ("filter_object_owner_id" in diction.keys() and diction['filter_object_owner_id']):
|
||||
filt_filter_object_owner_id = {'object_owner_id': str(diction['filter_object_owner_id'])}
|
||||
|
||||
filt_type_document = {}
|
||||
if ("filter_type_document" in diction.keys() and diction['filter_type_document']):
|
||||
|
||||
if (str(diction['filter_type_document']).strip().lower() == "alltypedocument"):
|
||||
# Il faut faire une recherche sur touts les types de document, ca reviens à laisser le filtre vide, a ne rien filtrer
|
||||
filt_type_document = {}
|
||||
|
||||
elif (str(diction['filter_type_document']).strip().lower() == "autre" or str(
|
||||
diction['filter_type_document']).strip().lower() == ""):
|
||||
# Si la valeur du type de document est 'autre' ou vide, alors filtre sur tous les document avec la valeur 'type_document' = ''
|
||||
filt_type_document = {'type_document': ''}
|
||||
else:
|
||||
filt_type_document = {
|
||||
'type_document': {'$regex': "^" + str(diction['filter_type_document']) + "$", "$options": 'i'}}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
my_query = {'$and': [filt_object_owner_collection, filt_filter_object_owner_id,
|
||||
filt_type_document, filt_file_business_object,
|
||||
]}
|
||||
|
||||
new_query = ([
|
||||
{'$match': my_query
|
||||
},
|
||||
{
|
||||
'$sort': {'_id': -1, 'mysy_download_files_date_creation': -1}
|
||||
},
|
||||
|
||||
])
|
||||
|
||||
print(" ##### new_query download_files = " + str(new_query))
|
||||
|
||||
RetObject = []
|
||||
nb_val = 0
|
||||
for retval in MYSY_GV.dbname['download_files'].aggregate(new_query):
|
||||
ret_file = {}
|
||||
|
||||
ret_file['id'] = str(nb_val)
|
||||
ret_file['_id'] = str(retval['_id'])
|
||||
|
||||
ret_file['file_business_object'] = retval['file_business_object']
|
||||
|
||||
if ("creation_date" in retval.keys()):
|
||||
ret_file['creation_date'] = retval['creation_date']
|
||||
else:
|
||||
ret_file['creation_date'] = "9999-99-99"
|
||||
|
||||
if ("file_business_object" in retval.keys()):
|
||||
ret_file['file_business_object'] = retval['file_business_object']
|
||||
|
||||
if ("object_owner_collection" in retval.keys()):
|
||||
ret_file['object_owner_collection'] = retval['object_owner_collection']
|
||||
|
||||
if ("object_owner_id" in retval.keys()):
|
||||
ret_file['object_owner_id'] = retval['object_owner_id']
|
||||
|
||||
if ("file_name" in retval.keys()):
|
||||
ret_file['file_name'] = retval['file_name']
|
||||
|
||||
if ("status" in retval.keys()):
|
||||
ret_file['status'] = retval['status']
|
||||
|
||||
if ("document_display_order" in retval.keys()):
|
||||
ret_file['document_display_order'] = retval['document_display_order']
|
||||
|
||||
if ("full_path" in retval.keys()):
|
||||
ret_file['full_path'] = retval['full_path']
|
||||
|
||||
if ("file_cononical_name" in retval.keys()):
|
||||
ret_file['file_cononical_name'] = retval['file_cononical_name']
|
||||
else:
|
||||
ret_file['file_cononical_name'] = "Anonyme"
|
||||
|
||||
if ("type_document" in retval.keys()):
|
||||
ret_file['type_document'] = retval['type_document']
|
||||
else:
|
||||
ret_file['type_document'] = "Autre"
|
||||
|
||||
if ("file_extention" in retval.keys()):
|
||||
ret_file['file_extention'] = retval['file_extention']
|
||||
else:
|
||||
ret_file['file_extention'] = "file_extention"
|
||||
|
||||
"""
|
||||
Recuperation du nom du client
|
||||
"""
|
||||
client_raison_sociale = ""
|
||||
client_nom = ""
|
||||
|
||||
if ("object_owner_id" in retval.keys() and retval["object_owner_id"]):
|
||||
partner_client_data = MYSY_GV.dbname['partner_client'].find_one(
|
||||
{'_id': ObjectId(str(retval["object_owner_id"]))}, {'raison_sociale': 1, 'nom': 1})
|
||||
|
||||
if (partner_client_data and "raison_sociale" in partner_client_data.keys()):
|
||||
client_raison_sociale = partner_client_data['raison_sociale']
|
||||
|
||||
if (partner_client_data and "nom" in partner_client_data.keys()):
|
||||
client_nom = partner_client_data['nom']
|
||||
|
||||
ret_file['client_raison_sociale'] = client_raison_sociale
|
||||
ret_file['client_nom'] = client_nom
|
||||
|
||||
RetObject.append(mycommon.JSONEncoder().encode(ret_file))
|
||||
nb_val = nb_val + 1
|
||||
|
||||
# print(" ### Get_List_object_owner_collection_Stored_Files = ", RetObject)
|
||||
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) + " - ERRORRRR AT Line : " + str(exc_tb.tb_lineno))
|
||||
return False, " Impossible récupérer la liste des documents "
|
||||
|
||||
|
|
|
@ -4365,7 +4365,7 @@ def Get_Partner_All_Class_Few_Fields(diction):
|
|||
RetObject.append(JSONEncoder().encode(user))
|
||||
val_tmp = val_tmp + 1
|
||||
|
||||
# print(" #### return find_partner_class_like = : ", str(RetObject))
|
||||
print(" #### Get_Partner_All_Class_Few_Fields - return find_partner_class_like = : ", str(RetObject))
|
||||
return True, RetObject
|
||||
|
||||
|
||||
|
|
53
main.py
53
main.py
|
@ -123,6 +123,10 @@ app.config['CORS_HEADERS'] = 'Content-Type'
|
|||
app.config['UPLOAD_FOLDER'] = MYSY_GV.upload_folder
|
||||
app.env = "Production"
|
||||
app.debug = "Production"
|
||||
app.config['MAX_CONTENT_LENGTH'] = 50 * 1024 * 1024
|
||||
app.config['MAX_FORM_MEMORY_SIZE'] = None
|
||||
app.config['MAX_FORM_PARTS'] =None
|
||||
|
||||
|
||||
@app.before_request
|
||||
def before_request():
|
||||
|
@ -7235,6 +7239,8 @@ def Get_object_owner_collection_Stored_Files():
|
|||
return jsonify(status=status, message=retval)
|
||||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API de recuperation de la liste des fichiers stock"s dans la collection 'download_files'
|
||||
avec plusieurs filtres
|
||||
|
@ -7250,6 +7256,23 @@ def Get_List_object_owner_collection_Stored_Files_With_Filter():
|
|||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API de recuperation de la liste des fichiers stock"s dans la collection 'download_files'
|
||||
avec plusieurs filtres SANS TOKEN
|
||||
"""
|
||||
@app.route('/myclass/api/Get_List_object_owner_collection_Stored_Files_With_Filter_No_Token/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Get_List_object_owner_collection_Stored_Files_With_Filter_No_Token():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Get_List_object_owner_collection_Stored_Files_With_Filter_No_Token : payload = ",payload)
|
||||
status, retval = attached_file_mgt.Get_List_object_owner_collection_Stored_Files_With_Filter_No_Token(payload)
|
||||
return jsonify(status=status, message=retval)
|
||||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API de suppression d'un fichier stocké
|
||||
"""
|
||||
|
@ -7330,6 +7353,31 @@ def Get_Stored_Downloaded_File_From_Id(token, doc_id):
|
|||
|
||||
|
||||
|
||||
"""
|
||||
API de recuperartion des fichier telechargés par une user en utilisant le '_id' SANS TOKEN
|
||||
"""
|
||||
|
||||
@app.route('/myclass/api/Get_Stored_Downloaded_File_From_Id_WITHOUT_TOKEN/<doc_id>',methods=['POST', 'GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Get_Stored_Downloaded_File_From_Id_WITHOUT_TOKEN( doc_id):
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = {}
|
||||
payload['_id'] = str(doc_id)
|
||||
|
||||
payload = mycommon.strip_dictionary(payload)
|
||||
|
||||
print(" ### Get_Stored_Downloaded_File_From_Id_WITHOUT_TOKEN : payload = ",payload)
|
||||
status, retval = attached_file_mgt.Get_Stored_Downloaded_File_From_Id_WITHOUT_TOKEN(payload)
|
||||
if (status is False):
|
||||
return ""
|
||||
|
||||
return retval
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API d'ajout d'un champ personnalisé
|
||||
"""
|
||||
|
@ -11914,7 +11962,6 @@ def Get_List_Theme_Catalog_Pub():
|
|||
return jsonify(status=status, message=retval)
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API pour mettre à jour la configuration du catalogue public du
|
||||
partenaire
|
||||
|
@ -11923,7 +11970,7 @@ partenaire
|
|||
@crossdomain(origin='*')
|
||||
def Add_Update_Partner_Catalog_Pub_Config():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
payload = request.form.to_dict()
|
||||
print(" ### Add_Update_Partner_Catalog_Pub_Config payload (trop long) = ")
|
||||
status, retval = base_partner_catalog_config.Add_Update_Partner_Catalog_Pub_Config(payload)
|
||||
return jsonify(status=status, message=retval)
|
||||
|
@ -13514,6 +13561,8 @@ def Get_List_Message_To_Mail_Queue():
|
|||
|
||||
if __name__ == '__main__':
|
||||
print(" debut api")
|
||||
|
||||
print(" sdqsdqs app.coapp.config['MAX_CONTENT_LENGTH'] = ", app.config['MAX_CONTENT_LENGTH'])
|
||||
context = SSL.Context(SSL.SSLv23_METHOD)
|
||||
if (MYSY_GV.MYSY_ENV == "PROD"):
|
||||
mycommon.myprint(" ++++ ENVIRONNEMENT PRODUCTION ++++ ")
|
||||
|
|
|
@ -653,11 +653,28 @@ def Get_List_Evaluation_Planification_No_Filter(diction):
|
|||
val_tmp = 0
|
||||
|
||||
for retval in MYSY_GV.dbname['note_evaluation'].find(data_cle).sort([("_id", pymongo.DESCENDING), ]):
|
||||
user = retval
|
||||
user['id'] = str(val_tmp)
|
||||
val_tmp = val_tmp + 1
|
||||
# Verifier si la formation , la session sont valide
|
||||
is_class_id_count = 0
|
||||
is_session_id_count = 0
|
||||
|
||||
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||
if( "class_id" in retval.keys() ):
|
||||
is_class_id_count = MYSY_GV.dbname['myclass'].count_documents({'_id':ObjectId(str(retval['class_id'])),
|
||||
'valide':'1',
|
||||
'partner_owner_recid':str(my_partner['recid']),
|
||||
'archive':{'$ne':'1'}})
|
||||
|
||||
if ("session_id" in retval.keys()):
|
||||
is_session_id_count = MYSY_GV.dbname['session_formation'].count_documents({'_id': ObjectId(str(retval['session_id'])),
|
||||
'valide': '1',
|
||||
'partner_owner_recid': str(
|
||||
my_partner['recid']),
|
||||
'archive': {'$ne': '1'}})
|
||||
if( is_class_id_count > 0 and is_session_id_count > 0 ):
|
||||
user = retval
|
||||
user['id'] = str(val_tmp)
|
||||
val_tmp = val_tmp + 1
|
||||
|
||||
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||
|
||||
return True, RetObject
|
||||
|
||||
|
|
|
@ -2617,7 +2617,7 @@ def Delete_Given_Partner_Client(diction):
|
|||
MYSY_GV.dbname['contact'].delete_one(
|
||||
{'related_collection':'partner_client',
|
||||
'related_collection_recid':str(diction['_id']),
|
||||
'partner_owner_recid': str(my_partner['recid'])}
|
||||
'partner_recid': str(my_partner['recid'])}
|
||||
)
|
||||
|
||||
|
||||
|
@ -3056,6 +3056,13 @@ def Get_Partner_Client_Communication_Contact(diction):
|
|||
|
||||
|
||||
# Verifier la validité du client
|
||||
|
||||
print(" ### qru 010101 = ",{"_id":ObjectId(str(diction['_id'])),
|
||||
'valide': '1',
|
||||
'locked':'0',
|
||||
'partner_owner_recid':str(my_partner['recid'])}
|
||||
)
|
||||
|
||||
is_client_exist_valide = MYSY_GV.dbname['partner_client'].count_documents({"_id":ObjectId(str(diction['_id'])),
|
||||
'valide': '1',
|
||||
'locked':'0',
|
||||
|
@ -3071,7 +3078,7 @@ def Get_Partner_Client_Communication_Contact(diction):
|
|||
new_diction = {}
|
||||
new_diction['related_collection'] = "partner_client"
|
||||
new_diction['related_collection_recid'] = diction['_id']
|
||||
new_diction['partner_owner_recid'] = my_partner['recid']
|
||||
new_diction['partner_recid'] = my_partner['recid']
|
||||
new_diction['valide'] = "1"
|
||||
new_diction['locked'] = "0"
|
||||
new_diction['include_com'] = "1"
|
||||
|
@ -3145,7 +3152,7 @@ def Get_Partner_Client_Communication_Contact_NO_TOKEN(diction):
|
|||
new_diction = {}
|
||||
new_diction['related_collection'] = "partner_client"
|
||||
new_diction['related_collection_recid'] = diction['_id']
|
||||
new_diction['partner_owner_recid'] = str(diction['partner_owner_recid'])
|
||||
new_diction['partner_recid'] = str(diction['partner_owner_recid'])
|
||||
new_diction['valide'] = "1"
|
||||
new_diction['locked'] = "0"
|
||||
new_diction['include_com'] = "1"
|
||||
|
|
|
@ -141,7 +141,7 @@ def Invoice_Partner_Order(diction):
|
|||
|
||||
# Verification de la validité du client
|
||||
is_client_valide = MYSY_GV.dbname['partner_client'].count_documents({'_id':ObjectId(str(order_to_invoice_data['order_header_client_id'])),
|
||||
'valide':'1', 'locked':'0', 'partner_recid':str(my_partner['recid'])})
|
||||
'valide':'1', 'locked':'0', 'partner_owner_recid':str(my_partner['recid'])})
|
||||
|
||||
if( is_client_valide != 1):
|
||||
mycommon.myprint(
|
||||
|
@ -533,7 +533,7 @@ def Get_Given_Partner_Invoice(diction):
|
|||
if ('order_header_client_id' in retval.keys()):
|
||||
Client_data = MYSY_GV.dbname['partner_client'].find_one(
|
||||
{'_id': ObjectId(str(retval['order_header_client_id'])), 'valide': '1', 'locked': '0',
|
||||
'partner_recid': str(my_partner['recid'])})
|
||||
'partner_owner_recid': str(my_partner['recid'])})
|
||||
|
||||
if (Client_data and 'nom' in Client_data.keys()):
|
||||
user['order_header_client_nom'] = str(Client_data['nom'])
|
||||
|
@ -1317,7 +1317,7 @@ def Get_List_Partner_Invoice_no_filter(diction):
|
|||
# Si le champ 'order_header_client_id' alors on va chercher le nom du client
|
||||
if( 'order_header_client_id' in New_retVal.keys()):
|
||||
Client_data = MYSY_GV.dbname['partner_client'].find_one({'_id':ObjectId(str(New_retVal['order_header_client_id'])), 'valide':'1', 'locked':'0',
|
||||
'partner_recid':str(my_partner['recid'])})
|
||||
'partner_owner_recid':str(my_partner['recid'])})
|
||||
|
||||
if( Client_data and 'nom' in Client_data.keys() ):
|
||||
user['order_header_client_nom'] = str(Client_data['nom'])
|
||||
|
@ -1430,7 +1430,7 @@ def Get_List_Partner_Invoice_with_filter(diction):
|
|||
sub_filt_client_nom = {}
|
||||
Lists_partner_client_id = []
|
||||
if ("client_nom" in diction.keys()):
|
||||
sub_filt_client_nom = {'nom': {'$regex': str(diction['client_nom']), "$options": "i"}, 'partner_recid':str(my_partner['recid']), 'valide':'1', 'locked':'0'}
|
||||
sub_filt_client_nom = {'nom': {'$regex': str(diction['client_nom']), "$options": "i"}, 'partner_owner_recid':str(my_partner['recid']), 'valide':'1', 'locked':'0'}
|
||||
# Recuperation des '_id' des clients dont le nom match en regexp
|
||||
#print(" ### sub_filt_client_nom = ", sub_filt_client_nom)
|
||||
for List_Client_Data in MYSY_GV.dbname['partner_client'].find(sub_filt_client_nom, {'_id':1}):
|
||||
|
@ -1556,7 +1556,7 @@ def Get_List_Partner_Invoice_with_filter(diction):
|
|||
if ('order_header_client_id' in New_retVal.keys()):
|
||||
Client_data = MYSY_GV.dbname['partner_client'].find_one(
|
||||
{'_id': ObjectId(str(New_retVal['order_header_client_id'])), 'valide': '1', 'locked': '0',
|
||||
'partner_recid': str(my_partner['recid'])})
|
||||
'partner_owner_recid': str(my_partner['recid'])})
|
||||
|
||||
if (Client_data and 'nom' in Client_data.keys()):
|
||||
user['order_header_client_nom'] = str(Client_data['nom'])
|
||||
|
@ -2107,7 +2107,7 @@ def GerneratePDF_Partner_Invoice(diction):
|
|||
if ("order_header_client_id" in Order_header_data.keys()):
|
||||
Order_header_client_data = MYSY_GV.dbname['partner_client'].find_one(
|
||||
{'_id': ObjectId(str(Order_header_data['order_header_client_id'])),
|
||||
'partner_recid': str(my_partner['recid']), 'valide': '1', 'locked': '0'})
|
||||
'partner_owner_recid': str(my_partner['recid']), 'valide': '1', 'locked': '0'})
|
||||
|
||||
if (Order_header_client_data is None):
|
||||
mycommon.myprint(str(inspect.stack()[0][
|
||||
|
@ -2548,7 +2548,7 @@ def Send_Partner_Invoice_By_Email(tab_files, Folder, diction):
|
|||
# Recuperation des données du client
|
||||
if( "order_header_client_id" in Order_header_data.keys() ):
|
||||
Order_header_client_data = MYSY_GV.dbname['partner_client'].find_one({'_id':ObjectId(str(Order_header_data['order_header_client_id'])),
|
||||
'partner_recid':str(my_partner['recid']), 'valide':'1', 'locked':'0'})
|
||||
'partner_owner_recid':str(my_partner['recid']), 'valide':'1', 'locked':'0'})
|
||||
|
||||
if( Order_header_client_data is None):
|
||||
mycommon.myprint(str(inspect.stack()[0][
|
||||
|
|
|
@ -1591,7 +1591,7 @@ def Send_Survey_TabIds(diction):
|
|||
le principe est de prendre le module du partenaire. si pas de modele du partenaire on
|
||||
prend le modele par default
|
||||
"""
|
||||
|
||||
print(" ### courrier_template courrier_ref_interne = ", courrier_ref_interne)
|
||||
courrier_template_model = MYSY_GV.dbname['courrier_template'].count_documents(
|
||||
{'ref_interne': str(courrier_ref_interne),
|
||||
'valide': '1',
|
||||
|
|
Loading…
Reference in New Issue