From da972bbc2b5d482f57e11a3778ae6a72bbb6d3bb Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 12 Dec 2017 09:48:05 +0100 Subject: [PATCH 1/2] fix SeedDMS_Core_DocumentFile::setDate() --- SeedDMS_Core/Core/inc.ClassDocument.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SeedDMS_Core/Core/inc.ClassDocument.php b/SeedDMS_Core/Core/inc.ClassDocument.php index 82d503557..76e53d5fe 100644 --- a/SeedDMS_Core/Core/inc.ClassDocument.php +++ b/SeedDMS_Core/Core/inc.ClassDocument.php @@ -4802,7 +4802,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(); From 074aee914d0645b3c39e1b1b49c9bccaeb89b4fc Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 12 Dec 2017 09:48:32 +0100 Subject: [PATCH 2/2] set date of attachment --- utils/xmlimport.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/xmlimport.php b/utils/xmlimport.php index 703782300..08299948a 100644 --- a/utils/xmlimport.php +++ b/utils/xmlimport.php @@ -764,7 +764,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, @@ -775,6 +775,7 @@ function insert_document($document) { /* {{{ */ $file['attributes']['version'], $file['attributes']['public'] ); + $newfile->setDate(dateToTimestamp($file['attributes']['date'])); unlink($filename); } }