diff --git a/CHANGELOG b/CHANGELOG
index 30f89ad5f..8cae3b36f 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -135,6 +135,7 @@
- clean up code for managing extensions
- fix renaming of folders via webdav
- fix list of expired documents on MyDocuments page
+- pass showtree to ViewDocument (Closes: #462)
--------------------------------------------------------------------------------
Changes in version 5.1.13
diff --git a/SeedDMS_Preview/Preview/Base.php b/SeedDMS_Preview/Preview/Base.php
index f8723ee29..c8401bb48 100644
--- a/SeedDMS_Preview/Preview/Base.php
+++ b/SeedDMS_Preview/Preview/Base.php
@@ -50,6 +50,12 @@ class SeedDMS_Preview_Base {
*/
protected $xsendfile;
+ /**
+ * @var string $lastpreviewfile will be set to the file name of the last preview
+ * @access protected
+ */
+ protected $lastpreviewfile;
+
function __construct($previewDir, $timeout=5, $xsendfile=true) { /* {{{ */
if(!is_dir($previewDir)) {
if (!SeedDMS_Core_File::makeDir($previewDir)) {
@@ -158,14 +164,14 @@ class SeedDMS_Preview_Base {
return array_key_exists($mimetype, $this->converters) && $this->converters[$mimetype];
} /* }}} */
-/**
- * Send a file from disk to the browser
- *
- * This function uses either readfile() or the xѕendfile apache module if
- * it is installed.
- *
- * @param string $filename
- */
+ /**
+ * Send a file from disk to the browser
+ *
+ * This function uses either readfile() or the xѕendfile apache module if
+ * it is installed.
+ *
+ * @param string $filename
+ */
protected function sendFile($filename) { /* {{{ */
if($this->xsendfile && function_exists('apache_get_modules') && in_array('mod_xsendfile',apache_get_modules())) {
header("X-Sendfile: ".$filename);
@@ -177,5 +183,14 @@ class SeedDMS_Preview_Base {
readfile($filename);
}
} /* }}} */
+
+ /**
+ * Return path of last created preview file
+ *
+ * @return string
+ */
+ public function getPreviewFile() { /* {{{ */
+ return $this->lastpreviewfile;
+ } /* }}} */
}
diff --git a/SeedDMS_Preview/Preview/PdfPreviewer.php b/SeedDMS_Preview/Preview/PdfPreviewer.php
index daae6a4ed..d4cc0b477 100644
--- a/SeedDMS_Preview/Preview/PdfPreviewer.php
+++ b/SeedDMS_Preview/Preview/PdfPreviewer.php
@@ -96,6 +96,7 @@ class SeedDMS_Preview_PdfPreviewer extends SeedDMS_Preview_Base {
return false;
if(!$target)
$target = $this->previewDir.$dir.md5($infile);
+ $this->lastpreviewfile = $target.'.png';
if($target != '' && (!file_exists($target.'.pdf') || filectime($target.'.pdf') < filectime($infile))) {
$cmd = '';
$mimeparts = explode('/', $mimetype, 2);
@@ -110,6 +111,7 @@ class SeedDMS_Preview_PdfPreviewer extends SeedDMS_Preview_Base {
try {
self::execWithTimeout($cmd, $this->timeout);
} catch(Exception $e) {
+ $this->lastpreviewfile = '';
return false;
}
}
diff --git a/SeedDMS_Preview/Preview/Previewer.php b/SeedDMS_Preview/Preview/Previewer.php
index 9e2fe2a34..ba69b75a4 100644
--- a/SeedDMS_Preview/Preview/Previewer.php
+++ b/SeedDMS_Preview/Preview/Previewer.php
@@ -105,6 +105,7 @@ class SeedDMS_Preview_Previewer extends SeedDMS_Preview_Base {
return false;
if(!$target)
$target = $this->previewDir.$dir.md5($infile).'-'.$width;
+ $this->lastpreviewfile = $target.'.png';
if($target != '' && (!file_exists($target.'.png') || filectime($target.'.png') < filectime($infile))) {
$cmd = '';
$mimeparts = explode('/', $mimetype, 2);
@@ -120,6 +121,7 @@ class SeedDMS_Preview_Previewer extends SeedDMS_Preview_Base {
try {
self::execWithTimeout($cmd, $this->timeout);
} catch(Exception $e) {
+ $this->lastpreviewfile = '';
return false;
}
}
diff --git a/SeedDMS_Preview/package.xml b/SeedDMS_Preview/package.xml
index 9ecce9466..aa4a3992f 100644
--- a/SeedDMS_Preview/package.xml
+++ b/SeedDMS_Preview/package.xml
@@ -11,11 +11,11 @@
uwe@steinmann.cx
yes
- 2019-02-11
+ 2020-01-21
- 1.2.10
- 1.2.10
+ 1.3.0
+ 1.3.0
stable
@@ -23,10 +23,7 @@
GPL License
-make sure list of converters is always an array
-usage of mod_sendfile can be configured
-new parameter for enabling/disabling xsendfile
-fix creation of pdf preview if document content class is not SeedDMS_Core_DocumentContent
+add new methode getPreviewFile()
@@ -406,5 +403,22 @@ make sure list of converters is always an array
usage of mod_sendfile can be configured
+
+ 2019-02-11
+
+
+ 1.2.10
+ 1.2.10
+
+
+ stable
+ stable
+
+ GPL License
+
+new parameter for enabling/disabling xsendfile
+fix creation of pdf preview if document content class is not SeedDMS_Core_DocumentContent
+
+
diff --git a/out/out.ViewDocument.php b/out/out.ViewDocument.php
index 8d9387628..0eb348312 100644
--- a/out/out.ViewDocument.php
+++ b/out/out.ViewDocument.php
@@ -90,6 +90,7 @@ if($view) {
$view->setParam('pdfConverters', isset($settings->_converters['pdf']) ? $settings->_converters['pdf'] : array());
$view->setParam('checkOutDir', $settings->_checkOutDir);
$view->setParam('showFullPreview', $settings->_showFullPreview);
+ $view->setParam('showtree', showtree());
$view->setParam('convertToPdf', $settings->_convertToPdf);
$view->setParam('currenttab', isset($_GET['currenttab']) ? $_GET['currenttab'] : "");
$view->setParam('timeout', $settings->_cmdTimeout);