forked from Wavyzz/dolibarr
FIX upload of files src_object_type
This commit is contained in:
@@ -881,7 +881,7 @@ class Documents extends DolibarrApi
|
||||
|
||||
$moreinfo = array('note_private' => 'File uploaded using API /documents from IP '.getUserRemoteIP());
|
||||
if (!empty($object) && is_object($object) && $object->id > 0) {
|
||||
$moreinfo['src_object_type'] = $modulepartorig;
|
||||
$moreinfo['src_object_type'] = $object->table_element;
|
||||
$moreinfo['src_object_id'] = $object->id;
|
||||
}
|
||||
|
||||
|
||||
@@ -1038,7 +1038,7 @@ function dol_move($srcfile, $destfile, $newmask = 0, $overwriteifexists = 1, $te
|
||||
$ecmfile->filename = $filename;
|
||||
$ecmfile->label = md5_file(dol_osencode($destfile)); // $destfile is a full path to file
|
||||
$ecmfile->fullpath_orig = $srcfile;
|
||||
$ecmfile->gen_or_uploaded = 'upload';
|
||||
$ecmfile->gen_or_uploaded = 'uploaded';
|
||||
if (!empty($moreinfo) && !empty($moreinfo['description'])) {
|
||||
$ecmfile->description = $moreinfo['description']; // indexed content
|
||||
} else {
|
||||
|
||||
@@ -26,7 +26,7 @@ CREATE TABLE llx_ecm_files
|
||||
entity integer DEFAULT 1 NOT NULL, -- multi company id
|
||||
filepath varchar(255) NOT NULL, -- relative to dolibarr document dir. Example module/def
|
||||
filename varchar(255) NOT NULL, -- file name only without any directory
|
||||
src_object_type varchar(64), -- Source object type ('proposal', 'invoice', ...)
|
||||
src_object_type varchar(64), -- Source object type ('proposal', 'invoice', ...) - object->table_element
|
||||
src_object_id integer, -- Source object id
|
||||
fullpath_orig varchar(750), -- full path of original filename, when file is uploaded from a local computer
|
||||
description text,
|
||||
|
||||
Reference in New Issue
Block a user