From 4147c29dd3919c7fe9d43f650a1a6fa12f8ae552 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 12 Dec 2016 18:14:54 +0100 Subject: [PATCH 01/29] set availlanguages to empty array() if not set in configuration --- op/op.Settings.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/op/op.Settings.php b/op/op.Settings.php index 6da83c1bd..83a0611f5 100644 --- a/op/op.Settings.php +++ b/op/op.Settings.php @@ -56,8 +56,11 @@ if ($action == "saveSettings") $settings->_siteName = $_POST["siteName"]; $settings->_footNote = $_POST["footNote"]; $settings->_printDisclaimer = getBoolValue("printDisclaimer"); - $settings->_language = $_POST["language"]; - $settings->_availablelanguages = $_POST["availablelanguages"]; + $settings->_language = $_POST["language"]; + if(empty($_POST["availablelanguages"])) + $settings->_availablelanguages = array(); + else + $settings->_availablelanguages = $_POST["availablelanguages"]; $settings->_theme = $_POST["theme"]; $settings->_previewWidthList = $_POST["previewWidthList"]; $settings->_previewWidthDetail = $_POST["previewWidthDetail"]; From 9319aabd3ecb5b8c13cd5e692fd114539a04c894 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 12 Dec 2016 18:17:44 +0100 Subject: [PATCH 02/29] start version 4.3.32 --- CHANGELOG | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 099a58372..c359a8f89 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,8 @@ +-------------------------------------------------------------------------------- + Changes in version 4.3.32 +-------------------------------------------------------------------------------- +- fix saving new mimetype for fulltext search, available languages + -------------------------------------------------------------------------------- Changes in version 4.3.31 -------------------------------------------------------------------------------- From cf597a4bedc05a840ea760d0f3660891d9db954e Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 22 Dec 2016 07:54:07 +0100 Subject: [PATCH 03/29] get $dms from view in preview() --- views/bootstrap/class.ViewDocument.php | 1 + 1 file changed, 1 insertion(+) diff --git a/views/bootstrap/class.ViewDocument.php b/views/bootstrap/class.ViewDocument.php index 4deaa1297..a7a97238d 100644 --- a/views/bootstrap/class.ViewDocument.php +++ b/views/bootstrap/class.ViewDocument.php @@ -128,6 +128,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { } /* }}} */ function preview() { /* {{{ */ + $dms = $this->params['dms']; $document = $this->params['document']; $timeout = $this->params['timeout']; $showfullpreview = $this->params['showFullPreview']; From bd67ea6abd052051eadb2e27618b9fb4f3a1e439 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 22 Dec 2016 07:54:52 +0100 Subject: [PATCH 04/29] set filetype when uploading file --- restapi/index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/restapi/index.php b/restapi/index.php index da6a89a04..b25be4089 100644 --- a/restapi/index.php +++ b/restapi/index.php @@ -425,8 +425,9 @@ function uploadDocument($id) { /* {{{ */ fclose($handle); $finfo = finfo_open(FILEINFO_MIME_TYPE); $userfiletype = finfo_file($finfo, $temp); + $fileType = ".".pathinfo($origfilename, PATHINFO_EXTENSION); finfo_close($finfo); - $res = $mfolder->addDocument($docname, '', 0, $userobj, '', array(), $temp, $origfilename ? $origfilename : basename($temp), '.', $userfiletype, 0); + $res = $mfolder->addDocument($docname, '', 0, $userobj, '', array(), $temp, $origfilename ? $origfilename : basename($temp), $fileType, $userfiletype, 0); unlink($temp); if($res) { $doc = $res[0]; From 259c7ffc3c3fd79fca8b252471c92a55ae9b298c Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 22 Dec 2016 09:11:40 +0100 Subject: [PATCH 05/29] add hooks for showing preview of document --- views/bootstrap/class.ViewDocument.php | 66 +++++++++++++++----------- 1 file changed, 39 insertions(+), 27 deletions(-) diff --git a/views/bootstrap/class.ViewDocument.php b/views/bootstrap/class.ViewDocument.php index be25c1de6..a135ae1f1 100644 --- a/views/bootstrap/class.ViewDocument.php +++ b/views/bootstrap/class.ViewDocument.php @@ -174,34 +174,46 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { if(!$showfullpreview) return; - $latestContent = $document->getLatestContent(); - switch($latestContent->getMimeType()) { - case 'audio/mpeg': - case 'audio/mp3': - case 'audio/ogg': - case 'audio/wav': - $this->contentHeading(getMLText("preview")); -?> - -contentHeading(getMLText("preview")); -?> - -contentHeading(getMLText("preview")); -?> - -callHook('preDocumentPreview', $document); + if(is_string($txt)) + echo $txt; + else { + $latestContent = $document->getLatestContent(); + switch($latestContent->getMimeType()) { + case 'audio/mpeg': + case 'audio/mp3': + case 'audio/ogg': + case 'audio/wav': + $this->contentHeading(getMLText("preview")); + ?> + + contentHeading(getMLText("preview")); + ?> + + contentHeading(getMLText("preview")); + ?> + + callHook('additionalDocumentPreview', $document); + if(is_string($txt)) + echo $txt; + break; + } } + $txt = $this->callHook('postDocumentPreview', $document); + if(is_string($txt)) + echo $txt; + if($converttopdf) { $pdfpreviewer = new SeedDMS_Preview_PdfPreviewer($cachedir, $timeout); if($pdfpreviewer->hasConverter($latestContent->getMimeType())) { From db0021d65bbad6d7f1ea530ce5e12b191723f3f0 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 22 Dec 2016 09:21:20 +0100 Subject: [PATCH 06/29] pass content instead of document to preview hooks --- views/bootstrap/class.ViewDocument.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/views/bootstrap/class.ViewDocument.php b/views/bootstrap/class.ViewDocument.php index a135ae1f1..3252ca1da 100644 --- a/views/bootstrap/class.ViewDocument.php +++ b/views/bootstrap/class.ViewDocument.php @@ -174,11 +174,11 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { if(!$showfullpreview) return; - $txt = $this->callHook('preDocumentPreview', $document); + $latestContent = $document->getLatestContent(); + $txt = $this->callHook('preDocumentPreview', $latestContent); if(is_string($txt)) echo $txt; else { - $latestContent = $document->getLatestContent(); switch($latestContent->getMimeType()) { case 'audio/mpeg': case 'audio/mp3': @@ -204,13 +204,13 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { callHook('additionalDocumentPreview', $document); + $txt = $this->callHook('additionalDocumentPreview', $latestContent); if(is_string($txt)) echo $txt; break; } } - $txt = $this->callHook('postDocumentPreview', $document); + $txt = $this->callHook('postDocumentPreview', $latestContent); if(is_string($txt)) echo $txt; From d47982a6719a6f90da552dd0dff39a029a98191d Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 22 Dec 2016 09:25:10 +0100 Subject: [PATCH 07/29] do not allow to edit content if file doesn't exist --- views/bootstrap/class.ViewDocument.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/views/bootstrap/class.ViewDocument.php b/views/bootstrap/class.ViewDocument.php index a7a97238d..49fe3bbfe 100644 --- a/views/bootstrap/class.ViewDocument.php +++ b/views/bootstrap/class.ViewDocument.php @@ -488,8 +488,10 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { } print ""; print "