Merge branch 'seeddms-5.1.x' into seeddms-6.0.x

This commit is contained in:
Uwe Steinmann 2017-12-12 22:12:17 +01:00
commit 6b7eb1cf3e
2 changed files with 3 additions and 2 deletions

View File

@ -6154,7 +6154,7 @@ class SeedDMS_Core_DocumentFile { /* {{{ */
* @return boolean true on success
*/
function setDate($date) { /* {{{ */
$db = $this->_dms->getDB();
$db = $this->_document->_dms->getDB();
if(!$date)
$date = time();

View File

@ -850,7 +850,7 @@ function insert_document($document) { /* {{{ */
$filename = tempnam('/tmp', 'FOO');
file_put_contents($filename, $filecontents);
}
$newDocument->addDocumentFile(
$newfile = $newDocument->addDocumentFile(
$file['attributes']['name'],
$file['attributes']['comment'],
$owner,
@ -861,6 +861,7 @@ function insert_document($document) { /* {{{ */
$file['attributes']['version'],
$file['attributes']['public']
);
$newfile->setDate(dateToTimestamp($file['attributes']['date']));
unlink($filename);
}
}