add of seteventmessages

This commit is contained in:
hystepik 2023-03-22 16:24:46 +01:00
parent bb2aa2701a
commit cf88987c52
3 changed files with 15 additions and 3 deletions

View File

@ -3383,9 +3383,12 @@ function dragAndDropFileUpload($htmlname)
data:fd,
success:function(){
console.log("Uploaded.",arguments);
window.location.href = "'.$_SERVER["PHP_SELF"].'?id='.dol_escape_json($object->id).'";
window.location.href = "'.$_SERVER["PHP_SELF"].'?id='.dol_escape_json($object->id).'&seteventmessages=uploadFileDragDropSuccess:mesgs";
},
error:function(){
console.log("Error Uploading.",arguments)
window.location.href = "'.$_SERVER["PHP_SELF"].'?id='.dol_escape_json($object->id).'&seteventmessages=uploadFileDragDropError:errors";
},
error:function(){ console.log("Error Uploading.",arguments) },
})
});
});

View File

@ -1228,3 +1228,5 @@ PublicVirtualCardUrl=Virtual business card page URL
PublicVirtualCard=Virtual business card
TreeView=Tree view
DropFileToAddItToObject=Drop a file to add it to this object
uploadFileDragDropSuccess=The file(s) have been uploaded successfully
uploadFileDragDropError=There was an error while the file(s) upload

View File

@ -1388,7 +1388,14 @@ if (!defined('NOREQUIREMENU')) {
$menumanager->loadMenu();
}
if (!empty(GETPOST('seteventmessages', 'alpha'))) {
$message = GETPOST('seteventmessages', 'alpha');
$messages = explode(',', $message);
foreach ($messages as $key => $msg) {
$tmp = explode(':', $msg);
setEventMessages($tmp[0], null, !empty($tmp[1]) ? $tmp[1] : 'mesgs');
}
}
// Functions