diff --git a/htdocs/api/class/api_documents.class.php b/htdocs/api/class/api_documents.class.php index f4232c31d7e..915768e0ea6 100644 --- a/htdocs/api/class/api_documents.class.php +++ b/htdocs/api/class/api_documents.class.php @@ -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; } diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 06f7babfb6e..925e9683fd4 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -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 { diff --git a/htdocs/install/mysql/tables/llx_ecm_files.sql b/htdocs/install/mysql/tables/llx_ecm_files.sql index 14952d45594..68a620c3e81 100644 --- a/htdocs/install/mysql/tables/llx_ecm_files.sql +++ b/htdocs/install/mysql/tables/llx_ecm_files.sql @@ -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,