From c8ec7d70f0fc85de7571bc03b3a66095f8aa3cc5 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 12 May 2022 09:02:24 +0200 Subject: [PATCH 01/64] set logger and add option to turn it off again --- utils/indexer.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/utils/indexer.php b/utils/indexer.php index 47744609a..3abb67a5b 100644 --- a/utils/indexer.php +++ b/utils/indexer.php @@ -18,12 +18,13 @@ function usage() { /* {{{ */ echo " -h, --help: print usage information and exit.".PHP_EOL; echo " -v, --version: print version and exit.".PHP_EOL; echo " -c: recreate index.".PHP_EOL; + echo " --no-log: do not log.".PHP_EOL; echo " --config: set alternative config file.".PHP_EOL; } /* }}} */ -$version = "0.0.2"; +$version = "0.0.3"; $shortoptions = "hvc"; -$longoptions = array('help', 'version', 'config:'); +$longoptions = array('help', 'version', 'config:', 'no-log'); if(false === ($options = getopt($shortoptions, $longoptions))) { usage(); exit(0); @@ -55,6 +56,8 @@ if(isset($options['c'])) { } include($myincpath."/inc/inc.Settings.php"); +if(empty($options['no-log'])) + include($myincpath."/inc/inc.LogInit.php"); include($myincpath."/inc/inc.Init.php"); include($myincpath."/inc/inc.Extension.php"); include($myincpath."/inc/inc.DBInit.php"); From 395e60ca713641111c8a74a7bf37ec953f195150 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 12 May 2022 09:03:27 +0200 Subject: [PATCH 02/64] logger can be set --- inc/inc.ClassFulltextService.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/inc/inc.ClassFulltextService.php b/inc/inc.ClassFulltextService.php index 90ec5f8d0..33cc46ae7 100644 --- a/inc/inc.ClassFulltextService.php +++ b/inc/inc.ClassFulltextService.php @@ -36,6 +36,11 @@ class SeedDMS_FulltextService { */ protected $conversionmgr; + /** + * @var logger + */ + protected $logger; + /** * Max file size for imediate indexing */ @@ -49,6 +54,7 @@ class SeedDMS_FulltextService { $this->services = array(); $this->converters = array(); $this->conversionmgr = null; + $this->logger = null; $this->maxsize = 0; $this->index = null; $this->search = null; @@ -63,6 +69,10 @@ class SeedDMS_FulltextService { $this->converters = $converters; } + public function setLogger($logger) { + $this->logger = $logger; + } + /** * Set conversion service manager * From 9a76df52bd00504b8592aa7957098b4431984f3b Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Fri, 13 May 2022 07:27:24 +0200 Subject: [PATCH 03/64] fix documentation of execute() methods --- inc/inc.Tasks.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/inc/inc.Tasks.php b/inc/inc.Tasks.php index bc2712589..c3cf13ca0 100644 --- a/inc/inc.Tasks.php +++ b/inc/inc.Tasks.php @@ -251,7 +251,6 @@ class SeedDMS_IndexingDocumentsTask extends SeedDMS_SchedulerTaskBase { /* {{{ * * Run the task * * @param $task task to be executed - * @param $dms dms * @return boolean true if task was executed succesfully, otherwise false */ public function execute(SeedDMS_SchedulerTask $task) { @@ -347,7 +346,6 @@ class SeedDMS_CheckSumTask extends SeedDMS_SchedulerTaskBase { /* {{{ */ * Run the task * * @param $task task to be executed - * @param $dms dms * @return boolean true if task was executed succesfully, otherwise false */ public function execute(SeedDMS_SchedulerTask $task) { @@ -435,7 +433,6 @@ class SeedDMS_PreviewTask extends SeedDMS_SchedulerTaskBase { /* {{{ */ * Run the task * * @param $task task to be executed - * @param $dms dms * @return boolean true if task was executed succesfully, otherwise false */ public function execute(SeedDMS_SchedulerTask $task) { @@ -488,7 +485,6 @@ class SeedDMS_CalendarTask extends SeedDMS_SchedulerTaskBase { /* {{{ */ * Run the task * * @param $task task to be executed - * @param $dms dms * @return boolean true if task was executed succesfully, otherwise false */ public function execute(SeedDMS_SchedulerTask $task) { From 30c2b8a493fb91aa5b6f6de770f3229d76eda725 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Fri, 13 May 2022 17:53:38 +0200 Subject: [PATCH 04/64] do not set orderby when clicking on link in sidebar as it is undefined anyway --- views/bootstrap/class.MyDocuments.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/bootstrap/class.MyDocuments.php b/views/bootstrap/class.MyDocuments.php index 9cbde242a..e0ccc3b5b 100644 --- a/views/bootstrap/class.MyDocuments.php +++ b/views/bootstrap/class.MyDocuments.php @@ -48,7 +48,7 @@ $(document).ready( function() { $('body').on('click', 'ul.sidenav li a', function(ev){ ev.preventDefault(); $('#kkkk.ajax').data('action', $(this).data('action')); - $('#kkkk.ajax').trigger('update', {orderby: $(this).data('orderby')}); + $('#kkkk.ajax').trigger('update', {}); }); $('body').on('click', 'table th a', function(ev){ ev.preventDefault(); From 9b07f6e943c5a31f7dc213fd970b2aabae523d9e Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 16 May 2022 15:45:23 +0200 Subject: [PATCH 05/64] pass logger to fulltextservice --- inc/inc.FulltextInit.php | 1 + 1 file changed, 1 insertion(+) diff --git a/inc/inc.FulltextInit.php b/inc/inc.FulltextInit.php index ef7954154..777d2ca2c 100644 --- a/inc/inc.FulltextInit.php +++ b/inc/inc.FulltextInit.php @@ -4,6 +4,7 @@ $fulltextservice = null; if($settings->_enableFullSearch) { require_once("inc.ClassFulltextService.php"); $fulltextservice = new SeedDMS_FulltextService(); + $fulltextservice->setLogger($logger); if($settings->_fullSearchEngine == 'sqlitefts') { $indexconf = array( From 49a1b33df4074b6be58d2e23759801f2eaefbd16 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 16 May 2022 15:54:04 +0200 Subject: [PATCH 06/64] check extension dependency on shell commands --- CHANGELOG | 1 + inc/inc.ClassExtensionMgr.php | 8 ++++++++ inc/inc.Utils.php | 31 +++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 5f7f5d223..ab08c277e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,7 @@ - add hook additionalDocumentContentInfo - add restapi function 'statstotal' - custom attributes of type 'date' regard the date format +- check extension dependency on shell commands -------------------------------------------------------------------------------- Changes in version 5.1.25 diff --git a/inc/inc.ClassExtensionMgr.php b/inc/inc.ClassExtensionMgr.php index b70f0fe3b..07e7d51d3 100644 --- a/inc/inc.ClassExtensionMgr.php +++ b/inc/inc.ClassExtensionMgr.php @@ -441,6 +441,14 @@ class SeedDMS_Extension_Mgr { } } break; + case 'cmd': + if(is_array($dval) && $dval) { + foreach($dval as $d) { + if(!commandExists($d)) + $this->errmsgs[] = sprintf("Missing command '%s'", $d); + } + } + break; default: $tmp = explode('-', $dval, 2); if(isset($this->extconf[$dkey]['version'])) { diff --git a/inc/inc.Utils.php b/inc/inc.Utils.php index 3192b6fbd..6628a5df2 100644 --- a/inc/inc.Utils.php +++ b/inc/inc.Utils.php @@ -696,6 +696,37 @@ function addDirSep($str) { /* {{{ */ return trim($str); } /* }}} */ +/** + * Determines if a command exists on the current environment + * + * @param string $command The command to check + * @return bool True if the command has been found ; otherwise, false. + */ +function commandExists ($command) { + $whereIsCommand = (PHP_OS == 'WINNT') ? 'where' : 'command -v'; + + $process = proc_open( + "$whereIsCommand $command", + array( + 0 => array("pipe", "r"), //STDIN + 1 => array("pipe", "w"), //STDOUT + 2 => array("pipe", "w"), //STDERR + ), + $pipes + ); + if ($process !== false) { + $stdout = stream_get_contents($pipes[1]); + $stderr = stream_get_contents($pipes[2]); + fclose($pipes[1]); + fclose($pipes[2]); + proc_close($process); + + return $stdout != ''; + } + + return false; +} + /** * Send a file from disk to the browser * From 983af33300cb68efee1d4bb2ecb070896910bc5c Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 17 May 2022 07:43:43 +0200 Subject: [PATCH 07/64] use conversion mgr --- out/out.MyDocuments.php | 1 + views/bootstrap/class.MyDocuments.php | 98 ++++++++++++++++++++++----- 2 files changed, 81 insertions(+), 18 deletions(-) diff --git a/out/out.MyDocuments.php b/out/out.MyDocuments.php index a684193ee..0d2a690b6 100644 --- a/out/out.MyDocuments.php +++ b/out/out.MyDocuments.php @@ -61,6 +61,7 @@ if($view) { $view->setParam('orderby', $orderby); $view->setParam('orderdir', $orderdir); $view->setParam('showtree', showtree()); + $view->setParam('conversionmgr', $conversionmgr); $view->setParam('listtype', $listtype); $view->setParam('workflowmode', $settings->_workflowMode); $view->setParam('cachedir', $settings->_cacheDir); diff --git a/views/bootstrap/class.MyDocuments.php b/views/bootstrap/class.MyDocuments.php index e0ccc3b5b..c0a69f3fd 100644 --- a/views/bootstrap/class.MyDocuments.php +++ b/views/bootstrap/class.MyDocuments.php @@ -125,6 +125,7 @@ $(document).ready( function() { $user = $this->params['user']; $orderby = $this->params['orderby']; $orderdir = $this->params['orderdir']; + $conversionmgr = $this->params['conversionmgr']; $cachedir = $this->params['cachedir']; $previewwidth = $this->params['previewWidthList']; $previewconverters = $this->params['previewConverters']; @@ -133,7 +134,10 @@ $(document).ready( function() { $db = $dms->getDB(); $previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout, $xsendfile); - $previewer->setConverters($previewconverters); + if($conversionmgr) + $previewer->setConversionMgr($conversionmgr); + else + $previewer->setConverters($previewconverters); $resArr = $dms->getDocumentList('ReviewByMe', $user, false, $orderby, $orderdir); if (is_bool($resArr) && !$resArr) { @@ -157,6 +161,7 @@ $(document).ready( function() { $user = $this->params['user']; $orderby = $this->params['orderby']; $orderdir = $this->params['orderdir']; + $conversionmgr = $this->params['conversionmgr']; $cachedir = $this->params['cachedir']; $previewwidth = $this->params['previewWidthList']; $previewconverters = $this->params['previewConverters']; @@ -164,7 +169,10 @@ $(document).ready( function() { $xsendfile = $this->params['xsendfile']; $previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout, $xsendfile); - $previewer->setConverters($previewconverters); + if($conversionmgr) + $previewer->setConversionMgr($conversionmgr); + else + $previewer->setConverters($previewconverters); $resArr = $dms->getDocumentList('ApproveByMe', $user, false, $orderby, $orderdir); if (is_bool($resArr) && !$resArr) { @@ -186,6 +194,7 @@ $(document).ready( function() { $user = $this->params['user']; $orderby = $this->params['orderby']; $orderdir = $this->params['orderdir']; + $conversionmgr = $this->params['conversionmgr']; $workflowmode = $this->params['workflowmode']; $cachedir = $this->params['cachedir']; $previewwidth = $this->params['previewWidthList']; @@ -194,7 +203,10 @@ $(document).ready( function() { $xsendfile = $this->params['xsendfile']; $previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout, $xsendfile); - $previewer->setConverters($previewconverters); + if($conversionmgr) + $previewer->setConversionMgr($conversionmgr); + else + $previewer->setConverters($previewconverters); if($workflowmode != 'advanced') { /* Get list of documents owned by current user that are @@ -236,6 +248,7 @@ $(document).ready( function() { $user = $this->params['user']; $orderby = $this->params['orderby']; $orderdir = $this->params['orderdir']; + $conversionmgr = $this->params['conversionmgr']; $cachedir = $this->params['cachedir']; $showtree = $this->params['showtree']; $previewwidth = $this->params['previewWidthList']; @@ -244,7 +257,10 @@ $(document).ready( function() { $xsendfile = $this->params['xsendfile']; $previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout, $xsendfile); - $previewer->setConverters($previewconverters); + if($conversionmgr) + $previewer->setConversionMgr($conversionmgr); + else + $previewer->setConverters($previewconverters); /* Get list of documents owned by current user */ $resArr = $dms->getDocumentList('ReceiveOwner', $user, false, $orderby, $orderdir); @@ -267,6 +283,7 @@ $(document).ready( function() { $user = $this->params['user']; $orderby = $this->params['orderby']; $orderdir = $this->params['orderdir']; + $conversionmgr = $this->params['conversionmgr']; $cachedir = $this->params['cachedir']; $showtree = $this->params['showtree']; $previewwidth = $this->params['previewWidthList']; @@ -275,7 +292,10 @@ $(document).ready( function() { $xsendfile = $this->params['xsendfile']; $previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout, $xsendfile); - $previewer->setConverters($previewconverters); + if($conversionmgr) + $previewer->setConversionMgr($conversionmgr); + else + $previewer->setConverters($previewconverters); /* Get list of documents owned by current user */ $resArr = $dms->getDocumentList('NoReceiveOwner', $user, false, $orderby, $orderdir); @@ -298,6 +318,7 @@ $(document).ready( function() { $user = $this->params['user']; $orderby = $this->params['orderby']; $orderdir = $this->params['orderdir']; + $conversionmgr = $this->params['conversionmgr']; $cachedir = $this->params['cachedir']; $showtree = $this->params['showtree']; $previewwidth = $this->params['previewWidthList']; @@ -306,7 +327,10 @@ $(document).ready( function() { $xsendfile = $this->params['xsendfile']; $previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout, $xsendfile); - $previewer->setConverters($previewconverters); + if($conversionmgr) + $previewer->setConversionMgr($conversionmgr); + else + $previewer->setConverters($previewconverters); /* Get list of documents owned by current user */ $resArr = $dms->getDocumentList('MyDocs', $user, false, $orderby, $orderdir); @@ -329,6 +353,7 @@ $(document).ready( function() { $user = $this->params['user']; $orderby = $this->params['orderby']; $orderdir = $this->params['orderdir']; + $conversionmgr = $this->params['conversionmgr']; $cachedir = $this->params['cachedir']; $previewwidth = $this->params['previewWidthList']; $previewconverters = $this->params['previewConverters']; @@ -336,7 +361,10 @@ $(document).ready( function() { $xsendfile = $this->params['xsendfile']; $previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout, $xsendfile); - $previewer->setConverters($previewconverters); + if($conversionmgr) + $previewer->setConversionMgr($conversionmgr); + else + $previewer->setConverters($previewconverters); // Get document list for the current user. $workflowStatus = $user->getWorkflowStatus(); @@ -431,6 +459,7 @@ $(document).ready( function() { $user = $this->params['user']; $orderby = $this->params['orderby']; $orderdir = $this->params['orderdir']; + $conversionmgr = $this->params['conversionmgr']; $cachedir = $this->params['cachedir']; $previewwidth = $this->params['previewWidthList']; $previewconverters = $this->params['previewConverters']; @@ -438,7 +467,10 @@ $(document).ready( function() { $xsendfile = $this->params['xsendfile']; $previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout, $xsendfile); - $previewer->setConverters($previewconverters); + if($conversionmgr) + $previewer->setConversionMgr($conversionmgr); + else + $previewer->setConverters($previewconverters); // Get document list for the current user. $revisionStatus = $user->getRevisionStatus(); @@ -464,6 +496,7 @@ $(document).ready( function() { $user = $this->params['user']; $orderby = $this->params['orderby']; $orderdir = $this->params['orderdir']; + $conversionmgr = $this->params['conversionmgr']; $cachedir = $this->params['cachedir']; $previewwidth = $this->params['previewWidthList']; $previewconverters = $this->params['previewConverters']; @@ -471,7 +504,10 @@ $(document).ready( function() { $xsendfile = $this->params['xsendfile']; $previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout, $xsendfile); - $previewer->setConverters($previewconverters); + if($conversionmgr) + $previewer->setConversionMgr($conversionmgr); + else + $previewer->setConverters($previewconverters); $resArr = $dms->getDocumentList('ReceiptByMe', $user, false, $orderby, $orderdir); if (is_bool($resArr) && !$resArr) { @@ -495,6 +531,7 @@ $(document).ready( function() { $user = $this->params['user']; $orderby = $this->params['orderby']; $orderdir = $this->params['orderdir']; + $conversionmgr = $this->params['conversionmgr']; $cachedir = $this->params['cachedir']; $previewwidth = $this->params['previewWidthList']; $previewconverters = $this->params['previewConverters']; @@ -502,7 +539,10 @@ $(document).ready( function() { $xsendfile = $this->params['xsendfile']; $previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout, $xsendfile); - $previewer->setConverters($previewconverters); + if($conversionmgr) + $previewer->setConversionMgr($conversionmgr); + else + $previewer->setConverters($previewconverters); /* Get list of documents owned by current user that has * been rejected. @@ -528,6 +568,7 @@ $(document).ready( function() { $user = $this->params['user']; $orderby = $this->params['orderby']; $orderdir = $this->params['orderdir']; + $conversionmgr = $this->params['conversionmgr']; $cachedir = $this->params['cachedir']; $previewwidth = $this->params['previewWidthList']; $previewconverters = $this->params['previewConverters']; @@ -535,7 +576,10 @@ $(document).ready( function() { $xsendfile = $this->params['xsendfile']; $previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout, $xsendfile); - $previewer->setConverters($previewconverters); + if($conversionmgr) + $previewer->setConversionMgr($conversionmgr); + else + $previewer->setConverters($previewconverters); /* Get list of documents locked by current user */ $resArr = $dms->getDocumentList('LockedByMe', $user, false, $orderby, $orderdir); @@ -559,6 +603,7 @@ $(document).ready( function() { $user = $this->params['user']; $orderby = $this->params['orderby']; $orderdir = $this->params['orderdir']; + $conversionmgr = $this->params['conversionmgr']; $cachedir = $this->params['cachedir']; $previewwidth = $this->params['previewWidthList']; $previewconverters = $this->params['previewConverters']; @@ -566,7 +611,10 @@ $(document).ready( function() { $xsendfile = $this->params['xsendfile']; $previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout, $xsendfile); - $previewer->setConverters($previewconverters); + if($conversionmgr) + $previewer->setConversionMgr($conversionmgr); + else + $previewer->setConverters($previewconverters); /* Get list of documents expired and owned by current user */ $resArr = $dms->getDocumentList('ExpiredOwner', $user, false, $orderby, $orderdir); @@ -590,6 +638,7 @@ $(document).ready( function() { $user = $this->params['user']; $orderby = $this->params['orderby']; $orderdir = $this->params['orderdir']; + $conversionmgr = $this->params['conversionmgr']; $cachedir = $this->params['cachedir']; $previewwidth = $this->params['previewWidthList']; $previewconverters = $this->params['previewConverters']; @@ -597,7 +646,10 @@ $(document).ready( function() { $xsendfile = $this->params['xsendfile']; $previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout, $xsendfile); - $previewer->setConverters($previewconverters); + if($conversionmgr) + $previewer->setConversionMgr($conversionmgr); + else + $previewer->setConverters($previewconverters); /* Get list of obsolete documents and owned by current user */ $resArr = $dms->getDocumentList('ObsoleteOwner', $user, false, $orderby, $orderdir); @@ -621,6 +673,7 @@ $(document).ready( function() { $user = $this->params['user']; $orderby = $this->params['orderby']; $orderdir = $this->params['orderdir']; + $conversionmgr = $this->params['conversionmgr']; $cachedir = $this->params['cachedir']; $previewwidth = $this->params['previewWidthList']; $previewconverters = $this->params['previewConverters']; @@ -628,7 +681,10 @@ $(document).ready( function() { $xsendfile = $this->params['xsendfile']; $previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout, $xsendfile); - $previewer->setConverters($previewconverters); + if($conversionmgr) + $previewer->setConversionMgr($conversionmgr); + else + $previewer->setConverters($previewconverters); /* Get list of obsolete documents and owned by current user */ $resArr = $dms->getDocumentList('NeedsCorrectionOwner', $user, false, $orderby, $orderdir); @@ -652,6 +708,7 @@ $(document).ready( function() { $user = $this->params['user']; $orderby = $this->params['orderby']; $orderdir = $this->params['orderdir']; + $conversionmgr = $this->params['conversionmgr']; $cachedir = $this->params['cachedir']; $previewwidth = $this->params['previewWidthList']; $previewconverters = $this->params['previewConverters']; @@ -659,7 +716,10 @@ $(document).ready( function() { $xsendfile = $this->params['xsendfile']; $previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout, $xsendfile); - $previewer->setConverters($previewconverters); + if($conversionmgr) + $previewer->setConversionMgr($conversionmgr); + else + $previewer->setConverters($previewconverters); /* Get list of draft documents and owned by current user */ $resArr = $dms->getDocumentList('DraftOwner', $user, false, $orderby, $orderdir); @@ -683,6 +743,7 @@ $(document).ready( function() { $user = $this->params['user']; $orderby = $this->params['orderby']; $orderdir = $this->params['orderdir']; + $conversionmgr = $this->params['conversionmgr']; $cachedir = $this->params['cachedir']; $previewwidth = $this->params['previewWidthList']; $previewconverters = $this->params['previewConverters']; @@ -690,7 +751,10 @@ $(document).ready( function() { $xsendfile = $this->params['xsendfile']; $previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout, $xsendfile); - $previewer->setConverters($previewconverters); + if($conversionmgr) + $previewer->setConversionMgr($conversionmgr); + else + $previewer->setConverters($previewconverters); /* Get list of documents checked out by current user */ $resArr = $dms->getDocumentList('CheckedOutByMe', $user, false, $orderby, $orderdir); @@ -722,8 +786,6 @@ $(document).ready( function() { $xsendfile = $this->params['xsendfile']; $db = $dms->getDB(); - $previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout, $xsendfile); - $previewer->setConverters($previewconverters); $this->htmlAddHeader(''."\n", 'js'); From 1ae35ca6ad1f17662cbc609f3e3bfcb0a7d7b626 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 17 May 2022 07:45:05 +0200 Subject: [PATCH 08/64] do not show debug menu if all items are inaccessible --- views/bootstrap/class.Bootstrap.php | 8 +++++--- views/bootstrap4/class.Bootstrap4.php | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/views/bootstrap/class.Bootstrap.php b/views/bootstrap/class.Bootstrap.php index f392ec989..0240f663e 100644 --- a/views/bootstrap/class.Bootstrap.php +++ b/views/bootstrap/class.Bootstrap.php @@ -1019,9 +1019,11 @@ background-image: linear-gradient(to bottom, #882222, #111111);; } if ($settings->_enableDebugMode) { - $menuitems['debug'] = array('link'=>"#", 'label'=>getMLText('debug')); - if ($accessobject->check_view_access('Hooks')) - $menuitems['debug']['children']['hooks'] = array('link'=>"../out/out.Hooks.php", 'label'=>getMLText('list_hooks')); + if($accessobject->check_view_access(array('Hooks'))) { + $menuitems['debug'] = array('link'=>"#", 'label'=>getMLText('debug')); + if ($accessobject->check_view_access('Hooks')) + $menuitems['debug']['children']['hooks'] = array('link'=>"../out/out.Hooks.php", 'label'=>getMLText('list_hooks')); + } } /* Check if hook exists because otherwise callHook() will override $menuitems */ diff --git a/views/bootstrap4/class.Bootstrap4.php b/views/bootstrap4/class.Bootstrap4.php index 640517739..aee665d47 100644 --- a/views/bootstrap4/class.Bootstrap4.php +++ b/views/bootstrap4/class.Bootstrap4.php @@ -927,9 +927,11 @@ background-image: linear-gradient(to bottom, #882222, #111111);; } if ($settings->_enableDebugMode) { - $menuitems['debug'] = array('link'=>"#", 'label'=>getMLText('debug')); - if ($accessobject->check_view_access('Hooks')) - $menuitems['debug']['children']['hooks'] = array('link'=>"../out/out.Hooks.php", 'label'=>getMLText('list_hooks')); + if($accessobject->check_view_access(array('Hooks'))) { + $menuitems['debug'] = array('link'=>"#", 'label'=>getMLText('debug')); + if ($accessobject->check_view_access('Hooks')) + $menuitems['debug']['children']['hooks'] = array('link'=>"../out/out.Hooks.php", 'label'=>getMLText('list_hooks')); + } } /* Check if hook exists because otherwise callHook() will override $menuitems */ From c9d6d840d9696874a9d2f0ff78414261bcb0ab95 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 17 May 2022 07:51:17 +0200 Subject: [PATCH 09/64] use preview converters or conversion mgr --- out/out.MyDocuments.php | 2 ++ views/bootstrap/class.MyDocuments.php | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/out/out.MyDocuments.php b/out/out.MyDocuments.php index 311488d1d..e64a5b9ed 100644 --- a/out/out.MyDocuments.php +++ b/out/out.MyDocuments.php @@ -55,7 +55,9 @@ if($view) { $view->setParam('showinprocess', $showInProcess); $view->setParam('workflowmode', $settings->_workflowMode); $view->setParam('cachedir', $settings->_cacheDir); + $view->setParam('conversionmgr', $conversionmgr); $view->setParam('previewWidthList', $settings->_previewWidthList); + $view->setParam('previewConverters', isset($settings->_converters['preview']) ? $settings->_converters['preview'] : array()); $view->setParam('timeout', $settings->_cmdTimeout); $view->setParam('accessobject', $accessop); $view->setParam('xsendfile', $settings->_enableXsendfile); diff --git a/views/bootstrap/class.MyDocuments.php b/views/bootstrap/class.MyDocuments.php index dd3136c03..4e000f217 100644 --- a/views/bootstrap/class.MyDocuments.php +++ b/views/bootstrap/class.MyDocuments.php @@ -53,13 +53,19 @@ class SeedDMS_View_MyDocuments extends SeedDMS_Theme_Style { $orderby = $this->params['orderby']; $showInProcess = $this->params['showinprocess']; $cachedir = $this->params['cachedir']; + $conversionmgr = $this->params['conversionmgr']; $workflowmode = $this->params['workflowmode']; $previewwidth = $this->params['previewWidthList']; + $previewconverters = $this->params['previewConverters']; $timeout = $this->params['timeout']; $xsendfile = $this->params['xsendfile']; $db = $dms->getDB(); $previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout, $xsendfile); + if($conversionmgr) + $previewer->setConversionMgr($conversionmgr); + else + $previewer->setConverters($previewconverters); $this->htmlStartPage(getMLText("my_documents")); $this->globalNavigation(); @@ -951,7 +957,6 @@ class SeedDMS_View_MyDocuments extends SeedDMS_Theme_Style { print "".getMLText("action")."\n"; print "\n\n\n"; - $previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout, $xsendfile); foreach ($resArr as $res) { $document = $dms->getDocument($res["documentID"]); $document->verifyLastestContentExpriry(); From f306c186cfe7457ffe5d2c6a98e07bf136ded02e Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 19 May 2022 08:05:24 +0200 Subject: [PATCH 10/64] set line-height, max-width, white-space of popupbox --- views/bootstrap4/styles/application.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/views/bootstrap4/styles/application.css b/views/bootstrap4/styles/application.css index 69a840b9c..a5d5bcdd9 100644 --- a/views/bootstrap4/styles/application.css +++ b/views/bootstrap4/styles/application.css @@ -368,11 +368,14 @@ div.popupbox { color: black; text-align: left; text-shadow: none; + line-height: 1.4em; border: 1px solid #ccc; padding: 25px 15px 15px 15px; display: none; position: absolute; min-width: 230px; + max-width: 280px; + white-space: break-spaces; z-index: 10; } From afddc5a4d69add4030a69297558e3aa5d6156a4c Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 19 May 2022 08:05:47 +0200 Subject: [PATCH 11/64] remove spaces when showing content of popup box --- views/bootstrap4/class.Bootstrap4.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/views/bootstrap4/class.Bootstrap4.php b/views/bootstrap4/class.Bootstrap4.php index 1acf289df..25c6a8e5d 100644 --- a/views/bootstrap4/class.Bootstrap4.php +++ b/views/bootstrap4/class.Bootstrap4.php @@ -3765,9 +3765,7 @@ $("body").on("click", "span.openpopupbox", function(e) { */ $html = ' '.$title.' - From 218934fea6fe787b02b15d2587be716b7d98a052 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Sat, 21 May 2022 19:10:06 +0200 Subject: [PATCH 25/64] make sendFileToServer() and createStatusbar() public, add getMaxFileSize() and getMaxFileSizeMsg() --- views/bootstrap/styles/application.js | 26 ++++++++++++++++++-------- views/bootstrap4/styles/application.js | 26 ++++++++++++++++++-------- 2 files changed, 36 insertions(+), 16 deletions(-) diff --git a/views/bootstrap/styles/application.js b/views/bootstrap/styles/application.js index d1e6c607f..1ba70d1ca 100644 --- a/views/bootstrap/styles/application.js +++ b/views/bootstrap/styles/application.js @@ -673,11 +673,20 @@ function onAddClipboard(ev) { /* {{{ */ maxFileSize = size; } + SeedDMSUpload.getMaxFileSize = function() { + return maxFileSize; + } + SeedDMSUpload.setMaxFileSizeMsg = function(msg) { maxFileSizeMsg = msg; } - function sendFileToServer(formData,status,callback) { + SeedDMSUpload.getMaxFileSizeMsg = function() { + return maxFileSizeMsg; + } + +// function sendFileToServer(formData,status,callback) { + SeedDMSUpload.sendFileToServer = function(formData,status,callback) { var uploadURL = ajaxurl; //Upload URL var extraData ={}; //Extra Data. var jqXHR=$.ajax({ @@ -736,7 +745,8 @@ function onAddClipboard(ev) { /* {{{ */ status.setAbort(jqXHR); } - function createStatusbar(obj) { + //function createStatusbar(obj) { + SeedDMSUpload.createStatusbar = function(obj) { rowCount++; var row="odd"; this.obj = obj; @@ -832,9 +842,9 @@ function onAddClipboard(ev) { /* {{{ */ // fd.append('path', files[i].webkitRelativePath); statusbar.parent().show(); - var status = new createStatusbar(statusbar); + var status = new SeedDMSUpload.createStatusbar(statusbar); status.setFileNameSize(files[i].name,files[i].size); - sendFileToServer(fd,status,function(){ + SeedDMSUpload.sendFileToServer(fd,status,function(){ if(target_id == seeddms_folder) $("div.ajax[data-action='folderList']").trigger('update', {folderid: seeddms_folder}); }); @@ -860,9 +870,9 @@ function onAddClipboard(ev) { /* {{{ */ fd.append('userfile', files[i]); fd.append('command', 'uploaddocument'); - var status = new createStatusbar(statusbar); + var status = new SeedDMSUpload.createStatusbar(statusbar); status.setFileNameSize(files[i].name,files[i].size); - sendFileToServer(fd,status); + SeedDMSUpload.sendFileToServer(fd,status); } else { noty({ text: maxFileSizeMsg + '
' + files[i].name + ' (' + files[i].size + ' Bytes)', @@ -885,9 +895,9 @@ function onAddClipboard(ev) { /* {{{ */ fd.append('userfile', files[i]); fd.append('command', 'addfile'); - var status = new createStatusbar(statusbar); + var status = new SeedDMSUpload.createStatusbar(statusbar); status.setFileNameSize(files[i].name,files[i].size); - sendFileToServer(fd,status, function(){ + SeedDMSUpload.sendFileToServer(fd,status, function(){ $("div.ajax[data-action='documentFiles']").trigger('update', {documentid: target_id}); }); } else { diff --git a/views/bootstrap4/styles/application.js b/views/bootstrap4/styles/application.js index b45ea03f3..2662b4122 100644 --- a/views/bootstrap4/styles/application.js +++ b/views/bootstrap4/styles/application.js @@ -704,11 +704,20 @@ function onAddClipboard(ev) { /* {{{ */ maxFileSize = size; } + SeedDMSUpload.getMaxFileSize = function() { + return maxFileSize; + } + SeedDMSUpload.setMaxFileSizeMsg = function(msg) { maxFileSizeMsg = msg; } - function sendFileToServer(formData,status,callback) { + SeedDMSUpload.getMaxFileSizeMsg = function() { + return maxFileSizeMsg; + } + +// function sendFileToServer(formData,status,callback) { + SeedDMSUpload.sendFileToServer = function(formData,status,callback) { var uploadURL = ajaxurl; //Upload URL var extraData ={}; //Extra Data. var jqXHR=$.ajax({ @@ -767,7 +776,8 @@ function onAddClipboard(ev) { /* {{{ */ status.setAbort(jqXHR); } - function createStatusbar(obj) { + //function createStatusbar(obj) { + SeedDMSUpload.createStatusbar = function(obj) { rowCount++; var row="odd"; this.obj = obj; @@ -863,9 +873,9 @@ function onAddClipboard(ev) { /* {{{ */ // fd.append('path', files[i].webkitRelativePath); statusbar.parent().show(); - var status = new createStatusbar(statusbar); + var status = new SeedDMSUpload.createStatusbar(statusbar); status.setFileNameSize(files[i].name,files[i].size); - sendFileToServer(fd,status,function(){ + SeedDMSUpload.sendFileToServer(fd,status,function(){ if(target_id == seeddms_folder) $("div.ajax[data-action='folderList']").trigger('update', {folderid: seeddms_folder}); }); @@ -891,9 +901,9 @@ function onAddClipboard(ev) { /* {{{ */ fd.append('userfile', files[i]); fd.append('command', 'uploaddocument'); - var status = new createStatusbar(statusbar); + var status = new SeedDMSUpload.createStatusbar(statusbar); status.setFileNameSize(files[i].name,files[i].size); - sendFileToServer(fd,status); + SeedDMSUpload.sendFileToServer(fd,status); } else { noty({ text: maxFileSizeMsg + '
' + files[i].name + ' (' + files[i].size + ' Bytes)', @@ -916,9 +926,9 @@ function onAddClipboard(ev) { /* {{{ */ fd.append('userfile', files[i]); fd.append('command', 'addfile'); - var status = new createStatusbar(statusbar); + var status = new SeedDMSUpload.createStatusbar(statusbar); status.setFileNameSize(files[i].name,files[i].size); - sendFileToServer(fd,status, function(){ + SeedDMSUpload.sendFileToServer(fd,status, function(){ $("div.ajax[data-action='documentFiles']").trigger('update', {documentid: target_id}); }); } else { From 56cda2798f91998cf92734ed31f6ee7384805fe0 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Sat, 21 May 2022 19:10:53 +0200 Subject: [PATCH 26/64] add iterm for 5.1.26 --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 70798b703..01af1b38a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -7,6 +7,7 @@ - check extension dependency on shell commands - log reason for notification - add list of notification services +- clicking on the file selection button no longer submits the form in firefox -------------------------------------------------------------------------------- Changes in version 5.1.25 From c974c2957857d462b26cde57b99da881c1892f1e Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Sat, 21 May 2022 19:35:15 +0200 Subject: [PATCH 27/64] fix setting max upload file size --- views/bootstrap/class.ViewFolder.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/views/bootstrap/class.ViewFolder.php b/views/bootstrap/class.ViewFolder.php index 5e222986a..11be8f321 100644 --- a/views/bootstrap/class.ViewFolder.php +++ b/views/bootstrap/class.ViewFolder.php @@ -239,11 +239,7 @@ $('body').on('click', '.order-btn', function(ev) { echo "SeedDMSUpload.setUrl('".$this->params['settings']->_httpRoot."op/op.Ajax.php');"; echo "SeedDMSUpload.setAbortBtnLabel('".getMLText("cancel")."');"; echo "SeedDMSUpload.setEditBtnLabel('".getMLText("edit_document_props")."');"; - $mus2 = SeedDMS_Core_File::parse_filesize(ini_get("upload_max_filesize")); - if($maxuploadsize && $maxuploadsize < $mus2) - echo "SeedDMSUpload.setMaxFileSize($maxuploadsize);\n"; - else - echo "SeedDMSUpload.setMaxFileSize($mus2);\n"; + echo "SeedDMSUpload.setMaxFileSize($maxuploadsize);\n"; echo "SeedDMSUpload.setMaxFileSizeMsg('".getMLText("uploading_maxsize")."');"; } From a1f2ecf22d6a50bee18d2b72a0c861fa4ade1e6b Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 23 May 2022 09:34:22 +0200 Subject: [PATCH 28/64] set width of progress bar in % instead of px --- views/bootstrap/styles/application.js | 4 ++-- views/bootstrap4/styles/application.css | 1 + views/bootstrap4/styles/application.js | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/views/bootstrap/styles/application.js b/views/bootstrap/styles/application.js index 1ba70d1ca..5c8468836 100644 --- a/views/bootstrap/styles/application.js +++ b/views/bootstrap/styles/application.js @@ -772,8 +772,8 @@ function onAddClipboard(ev) { /* {{{ */ this.size.html(sizeStr); } this.setProgress = function(progress) { - var progressBarWidth =progress*this.progressBar.width()/ 100; - this.progressBar.find('div').animate({ width: progressBarWidth }, 10).html(progress + "% "); +// var progressBarWidth =progress*this.progressBar.width()/ 100; + this.progressBar.find('div').animate({ width: progress+"%" }, 10).html(progress + "% "); if(parseInt(progress) >= 100) { this.abort.hide(); } diff --git a/views/bootstrap4/styles/application.css b/views/bootstrap4/styles/application.css index a5d5bcdd9..2dde7e119 100644 --- a/views/bootstrap4/styles/application.css +++ b/views/bootstrap4/styles/application.css @@ -174,6 +174,7 @@ div.statusbar div.filesize { } div.statusbar div.progress { margin-bottom: 10px; + line-height: 1rem; } div.statusbar a.btn { margin-bottom: 10px; diff --git a/views/bootstrap4/styles/application.js b/views/bootstrap4/styles/application.js index 2662b4122..96fffda02 100644 --- a/views/bootstrap4/styles/application.js +++ b/views/bootstrap4/styles/application.js @@ -803,8 +803,8 @@ function onAddClipboard(ev) { /* {{{ */ this.size.html(sizeStr); } this.setProgress = function(progress) { - var progressBarWidth =progress*this.progressBar.width()/ 100; - this.progressBar.find('div').animate({ width: progressBarWidth }, 10).html(progress + "% "); +// var progressBarWidth =progress*this.progressBar.width()/ 100; + this.progressBar.find('div').animate({ width: progress+"%" }, 10).html(progress + "% "); if(parseInt(progress) >= 100) { this.abort.hide(); } From 4e7fb4a6e99281ed8b0164297f8d337e5182029d Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 23 May 2022 16:14:04 +0200 Subject: [PATCH 29/64] add btn-sm to remove button, manager cannot remove himself from group --- views/bootstrap/class.GroupView.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/views/bootstrap/class.GroupView.php b/views/bootstrap/class.GroupView.php index a4d08ee84..8e7745a3c 100644 --- a/views/bootstrap/class.GroupView.php +++ b/views/bootstrap/class.GroupView.php @@ -85,8 +85,8 @@ $(document).ready( function() { foreach($managers as $manager) if($manager->getId() == $member->getId()) echo ", ".getMLText("manager"); - if($ismanager) { - echo ' '.getMLText("rm_user").''; + if($ismanager && $member->getId() != $user->getId()) { + echo ' '.getMLText("rm_user").''; } echo ""; } @@ -94,7 +94,7 @@ $(document).ready( function() { echo "
  • ".getMLText("add_user_to_group").":"; echo "
    "; echo "getId()."\" />"; - echo ""; echo ""; foreach($allUsers as $u) { if(!$u->isAdmin() && !$u->isGuest() && !in_array($u->getId(), $memberids)) From 298f345ceaa4d0916a46894b3916e7c2328169e2 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 24 May 2022 08:39:21 +0200 Subject: [PATCH 30/64] fix clear clipboard link in menu --- views/bootstrap/class.Clipboard.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/bootstrap/class.Clipboard.php b/views/bootstrap/class.Clipboard.php index b30563881..cab5ce739 100644 --- a/views/bootstrap/class.Clipboard.php +++ b/views/bootstrap/class.Clipboard.php @@ -78,7 +78,7 @@ class SeedDMS_View_Clipboard extends SeedDMS_Theme_Style { } // $content .= "
  • params['refferer'])."\">".getMLText("clear_clipboard")."kkk
  • \n"; // $content .= "
  • ".getMLText("clear_clipboard")."
  • \n"; - $subitems[] = array('label'=>getMLText('clear_clipboard'), 'attributes'=>array(array('class', 'ajax-click'), array('data-href', $this->params['settings']->_httpRoot.'op/op.Ajax.php'), array('data-param1', 'command=clearclipboard'))); + $subitems[] = array('label'=>getMLText('clear_clipboard'), 'class'=>'ajax-click', 'attributes'=>array(array('data-href', $this->params['settings']->_httpRoot.'op/op.Ajax.php'), array('data-param1', 'command=clearclipboard'))); if($this->hasHook('clipboardMenuItems')) $subitems = $this->callHook('clipboardMenuItems', $clipboard, $subitems); /* From bb75ca5896cfd7bbabe0eeaa1d95f8228e20c206 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 24 May 2022 08:39:54 +0200 Subject: [PATCH 31/64] add change in 5.1.26 --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 01af1b38a..c60046578 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -8,6 +8,7 @@ - log reason for notification - add list of notification services - clicking on the file selection button no longer submits the form in firefox +- fix clear clipboard link in menu -------------------------------------------------------------------------------- Changes in version 5.1.25 From ece2eec12860df3f77390e8f2943a92b4f1a3fc7 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 25 May 2022 08:19:16 +0200 Subject: [PATCH 32/64] add sqlite to list of required php extensions --- views/bootstrap/class.Info.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/bootstrap/class.Info.php b/views/bootstrap/class.Info.php index d115120d4..17d36a385 100644 --- a/views/bootstrap/class.Info.php +++ b/views/bootstrap/class.Info.php @@ -111,7 +111,7 @@ class SeedDMS_View_Info extends SeedDMS_Theme_Style { echo "".getMLText("name"); echo "\n"; echo "\n\n\n"; - $requiredext = array('zip', 'xml', 'xsl', 'json', 'intl', 'fileinfo', 'mbstring', 'curl'); + $requiredext = array('zip', 'xml', 'xsl', 'json', 'intl', 'fileinfo', 'mbstring', 'curl', 'sqlite'); foreach(array_diff($requiredext, $phpextensions) as $extname) echo "".$extname.""."\n"; echo "\n\n"; From 93f6b01c7ff928d344b3d98d2338c6eaeeb6b2cd Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 25 May 2022 11:33:44 +0200 Subject: [PATCH 33/64] do not allow to set revision date if document status is 'in revision' --- views/bootstrap/class.SetRevisors.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/views/bootstrap/class.SetRevisors.php b/views/bootstrap/class.SetRevisors.php index 1c5c0135f..20b8b9abf 100644 --- a/views/bootstrap/class.SetRevisors.php +++ b/views/bootstrap/class.SetRevisors.php @@ -74,10 +74,14 @@ class SeedDMS_View_SetRevisors extends SeedDMS_Theme_Style { contentContainerStart(); - $this->formField( - getMLText("revision_date"), - $this->getDateChooser($startdate, "startdate", $this->params['session']->getLanguage()) - ); + if($content->getStatus()['status'] == S_IN_REVISION) { + echo ''; + } else { + $this->formField( + getMLText("revision_date"), + $this->getDateChooser($startdate, "startdate", $this->params['session']->getLanguage()) + ); + } ?>
    From a11bba23e4f3b342db9ca2358a258d4d3a783ff8 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 30 May 2022 09:15:08 +0200 Subject: [PATCH 34/64] check if logger is set before using it --- inc/inc.ClassNotificationService.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/inc/inc.ClassNotificationService.php b/inc/inc.ClassNotificationService.php index 7a323044c..b8da5e99d 100644 --- a/inc/inc.ClassNotificationService.php +++ b/inc/inc.ClassNotificationService.php @@ -93,13 +93,16 @@ class SeedDMS_NotificationService { if(!$service->toIndividual($sender, $recipient, $subject, $message, $params)) { $error = false; $this->errors[$name] = false; - $this->logger->log('Notification service \''.$name.'\': Sending notification \''.$subject.'\' to user \''.$to.'\' ('.$recvtype.') failed.', PEAR_LOG_ERR); + if($this->logger) + $this->logger->log('Notification service \''.$name.'\': Sending notification \''.$subject.'\' to user \''.$to.'\' ('.$recvtype.') failed.', PEAR_LOG_ERR); } else { - $this->logger->log('Notification service \''.$name.'\': Sending notification \''.$subject.'\' to user \''.$to.'\' ('.$recvtype.') successful (reason for notification: '.$recvtype.').', PEAR_LOG_INFO); + if($this->logger) + $this->logger->log('Notification service \''.$name.'\': Sending notification \''.$subject.'\' to user \''.$to.'\' ('.$recvtype.') successful (reason for notification: '.$recvtype.').', PEAR_LOG_INFO); $this->errors[$name] = true; } } else { - $this->logger->log('Notification service \''.$name.'\': Notification \''.$subject.'\' to user \''.$to.'\' ('.$recvtype.') filtered out (reason for notification: '.$recvtype.').', PEAR_LOG_INFO); + if($this->logger) + $this->logger->log('Notification service \''.$name.'\': Notification \''.$subject.'\' to user \''.$to.'\' ('.$recvtype.') filtered out (reason for notification: '.$recvtype.').', PEAR_LOG_INFO); } } return $error; From 0d5536f19803d80eb8666c2239bb4fce6c7e9c7c Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 30 May 2022 09:41:02 +0200 Subject: [PATCH 35/64] add conversion service from tiff, gif to png --- inc/inc.ConversionInit.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/inc/inc.ConversionInit.php b/inc/inc.ConversionInit.php index 908b71f33..1acb3d12a 100644 --- a/inc/inc.ConversionInit.php +++ b/inc/inc.ConversionInit.php @@ -26,6 +26,8 @@ $conversionmgr->addService(new SeedDMS_ConversionServicePdfToImage('application/ $conversionmgr->addService(new SeedDMS_ConversionServiceImageToImage('image/jpeg', 'image/png'))->setLogger($logger); $conversionmgr->addService(new SeedDMS_ConversionServiceImageToImage('image/png', 'image/png'))->setLogger($logger); $conversionmgr->addService(new SeedDMS_ConversionServiceImageToImage('image/jpg', 'image/png'))->setLogger($logger); +$conversionmgr->addService(new SeedDMS_ConversionServiceImageToImage('image/gif', 'image/png'))->setLogger($logger); +$conversionmgr->addService(new SeedDMS_ConversionServiceImageToImage('image/tiff', 'image/png'))->setLogger($logger); $conversionmgr->addService(new SeedDMS_ConversionServiceImageToImage('image/svg+xml', 'image/png'))->setLogger($logger); $conversionmgr->addService(new SeedDMS_ConversionServiceTextToText('text/plain', 'text/plain'))->setLogger($logger); From 6179e517b243853e93551c517bbbc29f2bdc94cc Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 30 May 2022 09:41:12 +0200 Subject: [PATCH 36/64] add changes for 5.1.26 --- CHANGELOG | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index c60046578..a4f8871b6 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -9,6 +9,8 @@ - add list of notification services - clicking on the file selection button no longer submits the form in firefox - fix clear clipboard link in menu +- add conversion service from tiff, gif to png +- do not use logger in notification service if it was not initialized -------------------------------------------------------------------------------- Changes in version 5.1.25 From 6d5d1a7703d350d2dde766f5c93eb8c148b42e80 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 30 May 2022 13:07:30 +0200 Subject: [PATCH 37/64] check if IndexedDocument() set error msg, call right hook after indexing document --- inc/inc.Tasks.php | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/inc/inc.Tasks.php b/inc/inc.Tasks.php index c3cf13ca0..9d8868465 100644 --- a/inc/inc.Tasks.php +++ b/inc/inc.Tasks.php @@ -139,15 +139,20 @@ class SeedDMS_Task_Indexer_Process_Folder { /* {{{ */ if(($this->numdocs == 0) || !($hit = $lucenesearch->getFolder($folder->getId()))) { try { $idoc = $this->fulltextservice->IndexedDocument($folder, true); - if(isset($GLOBALS['SEEDDMS_HOOKS']['indexFolder'])) { - foreach($GLOBALS['SEEDDMS_HOOKS']['indexFolder'] as $hookObj) { - if (method_exists($hookObj, 'preIndexFolder')) { - $hookObj->preIndexDocument(null, $folder, $idoc); + $error = $idoc->getErrorMsg(); + if(!$error) { + if(isset($GLOBALS['SEEDDMS_HOOKS']['indexFolder'])) { + foreach($GLOBALS['SEEDDMS_HOOKS']['indexFolder'] as $hookObj) { + if (method_exists($hookObj, 'preIndexFolder')) { + $hookObj->preIndexDocument(null, $folder, $idoc); + } } } + $this->fulltextservice->Indexer()->addDocument($idoc); + echo "(".getMLText('index_folder_added').")".PHP_EOL; + } else { + echo "(".$error.")".PHP_EOL; } - $this->fulltextservice->Indexer()->addDocument($idoc); - echo "(".getMLText('index_folder_added').")".PHP_EOL; } catch(Exception $e) { echo "(Timeout)".PHP_EOL; } @@ -168,15 +173,20 @@ class SeedDMS_Task_Indexer_Process_Folder { /* {{{ */ $this->fulltextservice->Indexer()->delete($hit->id); try { $idoc = $this->fulltextservice->IndexedDocument($folder, true); - if(isset($GLOBALS['SEEDDMS_HOOKS']['indexFolder'])) { - foreach($GLOBALS['SEEDDMS_HOOKS']['indexFolder'] as $hookObj) { - if (method_exists($hookObj, 'preIndexFolder')) { - $hookObj->preIndexDocument(null, $folder, $idoc); + $error = $idoc->getErrorMsg(); + if(!$error) { + if(isset($GLOBALS['SEEDDMS_HOOKS']['indexDocument'])) { + foreach($GLOBALS['SEEDDMS_HOOKS']['indexDocument'] as $hookObj) { + if (method_exists($hookObj, 'preIndexDocument')) { + $hookObj->preIndexDocument(null, $folder, $idoc); + } } } + $this->fulltextservice->Indexer()->addDocument($idoc); + echo "(".getMLText('index_folder_updated').")".PHP_EOL; + } else { + echo "(".$error.")".PHP_EOL; } - $this->fulltextservice->Indexer()->addDocument($idoc); - echo "(".getMLText('index_folder_updated').")".PHP_EOL; } catch(Exception $e) { echo "(Timeout)".PHP_EOL; } From c6470efc6ffc21cc62018f9f4fc4bf8d4bfc07bd Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 31 May 2022 14:24:45 +0200 Subject: [PATCH 38/64] fix deleting a document by clicking on the icon in the document list --- views/bootstrap/class.MyDocuments.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/views/bootstrap/class.MyDocuments.php b/views/bootstrap/class.MyDocuments.php index f1b974914..d89a56830 100644 --- a/views/bootstrap/class.MyDocuments.php +++ b/views/bootstrap/class.MyDocuments.php @@ -42,6 +42,7 @@ class SeedDMS_View_MyDocuments extends SeedDMS_Theme_Style { header('Content-Type: application/javascript; charset=UTF-8'); parent::jsTranslations(array('cancel', 'splash_move_document', 'confirm_move_document', 'move_document', 'confirm_transfer_link_document', 'transfer_content', 'link_document', 'splash_move_folder', 'confirm_move_folder', 'move_folder')); + $this->printDeleteDocumentButtonJs(); $this->printClickDocumentJs(); ?> $(document).ready( function() { @@ -787,8 +788,6 @@ $(document).ready( function() { $db = $dms->getDB(); - $this->htmlAddHeader(''."\n", 'js'); - $this->htmlStartPage(getMLText("my_documents")); $this->globalNavigation(); $this->contentStart(); From 7ba81f50e3bfd5817e93488c74f619ec3b732161 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 31 May 2022 14:25:23 +0200 Subject: [PATCH 39/64] fix deletion of task when using bootstrap4 theme --- views/bootstrap/class.SchedulerTaskMgr.php | 49 +++++++++++++++++++++- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/views/bootstrap/class.SchedulerTaskMgr.php b/views/bootstrap/class.SchedulerTaskMgr.php index c19521a28..554266025 100644 --- a/views/bootstrap/class.SchedulerTaskMgr.php +++ b/views/bootstrap/class.SchedulerTaskMgr.php @@ -28,6 +28,7 @@ class SeedDMS_View_SchedulerTaskMgr extends SeedDMS_Theme_Style { function js() { /* {{{ */ + $theme = $this->params['theme']; header('Content-Type: application/javascript'); ?> $(document).ready( function() { @@ -53,6 +54,7 @@ $(document).ready( function() { confirmmsg = $(ev.currentTarget).attr('confirmmsg'); msg = $(ev.currentTarget).attr('msg'); formtoken = ''; + bootbox.dialog(confirmmsg, [{ "label" : " ", "class" : "btn-danger", @@ -90,6 +92,51 @@ $(document).ready( function() { "callback": function() { } }]); + + bootbox.confirm({ + "message": confirmmsg, + "buttons": { + "confirm": { + "label" : " ", + "className" : "btn-danger", + }, + "cancel": { + "label" : "", + "className" : "btn-secondary", + } + }, + "callback": function(result) { + if(result) { + $.post('../op/op.SchedulerTaskMgr.php', + { action: 'removetask', taskid: id, formtoken: formtoken }, + function(data) { + if(data.success) { + $('#table-row-task-'+id).hide('slow'); + noty({ + text: msg, + type: 'success', + dismissQueue: true, + layout: 'topRight', + theme: 'defaultTheme', + timeout: 1500, + }); + } else { + noty({ + text: data.message, + type: 'error', + dismissQueue: true, + layout: 'topRight', + theme: 'defaultTheme', + timeout: 3500, + }); + } + }, + 'json' + ); + } + } + }); + }); }); params['extname']; $taskname = $this->params['taskname']; $scheduler = $this->params['scheduler']; - - $this->htmlAddHeader(''."\n", 'js'); $this->htmlStartPage(getMLText("admin_tools")); $this->globalNavigation(); From a91003d5fa22c9d7d0d3590416484a0bcbc9067e Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 31 May 2022 14:27:05 +0200 Subject: [PATCH 40/64] do not include bootbox.min.js --- views/bootstrap/class.ObjectCheck.php | 2 -- views/bootstrap/class.ReceiptSummary.php | 2 -- views/bootstrap/class.RevisionSummary.php | 2 -- 3 files changed, 6 deletions(-) diff --git a/views/bootstrap/class.ObjectCheck.php b/views/bootstrap/class.ObjectCheck.php index 67169fb66..ad38b5cd8 100644 --- a/views/bootstrap/class.ObjectCheck.php +++ b/views/bootstrap/class.ObjectCheck.php @@ -606,8 +606,6 @@ $(document).ready( function() { $repairobjects = $this->params['repairobjects']; $this->enableClipboard = $this->params['enableclipboard']; -// $this->htmlAddHeader(''."\n", 'js'); - $this->htmlStartPage(getMLText("admin_tools")); $this->globalNavigation(); $this->contentStart(); diff --git a/views/bootstrap/class.ReceiptSummary.php b/views/bootstrap/class.ReceiptSummary.php index ce6ac1c42..657433a1f 100644 --- a/views/bootstrap/class.ReceiptSummary.php +++ b/views/bootstrap/class.ReceiptSummary.php @@ -55,8 +55,6 @@ class SeedDMS_View_ReceiptSummary extends SeedDMS_Theme_Style { $previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout); $previewer->setConverters($previewconverters); - $this->htmlAddHeader(''."\n", 'js'); - $this->htmlStartPage(getMLText("my_documents")); $this->globalNavigation(); $this->contentStart(); diff --git a/views/bootstrap/class.RevisionSummary.php b/views/bootstrap/class.RevisionSummary.php index fccc06735..323ef6a6f 100644 --- a/views/bootstrap/class.RevisionSummary.php +++ b/views/bootstrap/class.RevisionSummary.php @@ -56,8 +56,6 @@ class SeedDMS_View_RevisionSummary extends SeedDMS_Theme_Style { $previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout, $xsendfile); $previewer->setConverters($previewconverters); - $this->htmlAddHeader(''."\n", 'js'); - $this->htmlStartPage(getMLText("my_documents")); $this->globalNavigation(); $this->contentStart(); From 490fe093900731e6cfd179f0fed040b781e5b879 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 31 May 2022 14:27:28 +0200 Subject: [PATCH 41/64] add changes for 6.0.19 --- CHANGELOG | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index a8b31d3ac..ef8f399be 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,8 @@ Changes in version 6.0.19 -------------------------------------------------------------------------------- - merge changes up to 5.1.26 +- fix deletion of tasks when using bootstrap4 theme +- fix deletion of documents when clicking on icon in document list (my documents) -------------------------------------------------------------------------------- Changes in version 6.0.18 From fce2ba2bd7e9bfa3ec60322fa9ea6ffe315694d0 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 31 May 2022 20:05:38 +0200 Subject: [PATCH 42/64] fix getLongReadableDate() --- inc/inc.Utils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/inc.Utils.php b/inc/inc.Utils.php index 6628a5df2..cfe4c7cef 100644 --- a/inc/inc.Utils.php +++ b/inc/inc.Utils.php @@ -81,7 +81,7 @@ function getLongReadableDate($timestamp=0) { /* {{{ */ $timestamp = strtotime($timestamp); elseif(!is_numeric($timestamp)) return ''; - if($settings->_dateformat) + if($settings->_datetimeformat) return date($settings->_datetimeformat, $timestamp); else return date("Y-m-d H:i:s", $timestamp); From dc4c26916b6fd8033bc7befcec961ce21356c952 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 1 Jun 2022 15:01:38 +0200 Subject: [PATCH 43/64] add request uri to start line of sql log --- SeedDMS_Core/Core/inc.DBAccessPDO.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SeedDMS_Core/Core/inc.DBAccessPDO.php b/SeedDMS_Core/Core/inc.DBAccessPDO.php index 02e1ccdcb..1c3a48a9f 100644 --- a/SeedDMS_Core/Core/inc.DBAccessPDO.php +++ b/SeedDMS_Core/Core/inc.DBAccessPDO.php @@ -217,7 +217,7 @@ class SeedDMS_Core_DatabaseAccess { if($this->_logfile) { $this->_logfp = fopen($this->_logfile, 'a+'); if($this->_logfp) - fwrite($this->_logfp, microtime()." BEGIN ------------------------------------------\n"); + fwrite($this->_logfp, microtime()." BEGIN ".$_SERVER['REQUEST_URI']." ------------------------------------------\n"); } else $this->_logfp = null; // $tt*****id is a hack to ensure that we do not try to create the From 249e42f956888b6df5d8c9a69b539304f6dd1589 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 1 Jun 2022 15:02:00 +0200 Subject: [PATCH 44/64] remove colon after name of config vars --- views/bootstrap/class.Settings.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/views/bootstrap/class.Settings.php b/views/bootstrap/class.Settings.php index 04b400c5c..e6e1103c5 100644 --- a/views/bootstrap/class.Settings.php +++ b/views/bootstrap/class.Settings.php @@ -117,7 +117,7 @@ class SeedDMS_View_Settings extends SeedDMS_Theme_Style { $settings = $this->params['settings']; ?> "> - : + arrayToString($settings->{"_".$name}); @@ -144,7 +144,7 @@ class SeedDMS_View_Settings extends SeedDMS_Theme_Style { $settings = $this->params['settings']; ?> - : + params['settings']; ?> "> - : + {"_".$name}) echo "checked" ?> /> "> - : + + '; break; diff --git a/views/bootstrap4/class.Bootstrap4.php b/views/bootstrap4/class.Bootstrap4.php index 4755ed258..5953a72ea 100644 --- a/views/bootstrap4/class.Bootstrap4.php +++ b/views/bootstrap4/class.Bootstrap4.php @@ -1862,7 +1862,7 @@ $(document).ready(function() { */ $content = '
    - +
    From 82e25025abcaaa43a8193bc495bfb1fc6663c317 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 7 Jun 2022 17:45:16 +0200 Subject: [PATCH 47/64] add entry for 5.1.26 --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index a4f8871b6..3e577c9c4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -11,6 +11,7 @@ - fix clear clipboard link in menu - add conversion service from tiff, gif to png - do not use logger in notification service if it was not initialized +- fix editing of custom date fields -------------------------------------------------------------------------------- Changes in version 5.1.25 From 0d5a1ba3c74894e683b8a330a96322052cb7df24 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 8 Jun 2022 15:52:27 +0200 Subject: [PATCH 48/64] rawurlencode path of files and folders --- webdav/webdav.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/webdav/webdav.php b/webdav/webdav.php index 4b504bf91..8f6c1082c 100644 --- a/webdav/webdav.php +++ b/webdav/webdav.php @@ -384,8 +384,8 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server array_shift($patharr); $path = ''; foreach($patharr as $pathseg) -// $path .= '/'.rawurlencode($pathseg->getName()); - $path .= '/'.$pathseg->getName(); + $path .= '/'.rawurlencode($pathseg->getName()); +// $path .= '/'.$pathseg->getName(); if(!$path) { $path = '/'; $info["props"][] = $this->mkprop("isroot", "true"); @@ -407,8 +407,8 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server array_shift($patharr); $path = '/'; foreach($patharr as $pathseg) -// $path .= rawurlencode($pathseg->getName()).'/'; - $path .= $pathseg->getName().'/'; + $path .= rawurlencode($pathseg->getName()).'/'; +// $path .= $pathseg->getName().'/'; // $info["path"] = htmlspecialchars($path.rawurlencode($obj->getName())); if($this->useorgfilename) { /* Add the document id and version to the display name. From 6cb9556e8778ebde84291cdc483f9040009299ba Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 8 Jun 2022 15:53:26 +0200 Subject: [PATCH 49/64] add entry for 5.1.26 --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 3e577c9c4..2ecff270e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -12,6 +12,7 @@ - add conversion service from tiff, gif to png - do not use logger in notification service if it was not initialized - fix editing of custom date fields +- fix listing files/folders with umlauts when using webdav -------------------------------------------------------------------------------- Changes in version 5.1.25 From 3dd4fb145b935554b08f4246c789673652133430 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 8 Jun 2022 16:05:39 +0200 Subject: [PATCH 50/64] add mimetype as title attribute in folder listing --- webdav/webdav.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webdav/webdav.php b/webdav/webdav.php index 8f6c1082c..110a45675 100644 --- a/webdav/webdav.php +++ b/webdav/webdav.php @@ -572,6 +572,7 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server $displayname = $obj->getName().'/'; $filesize = 0; $mtime = $obj->getDate(); + $mimetype = ''; } else { $content = $obj->getLatestContent(); @@ -604,7 +605,7 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server printf($format, number_format($filesize), strftime("%Y-%m-%d %H:%M:%S", $mtime), - "".htmlspecialchars($displayname, ENT_QUOTES).""); + "".htmlspecialchars($displayname, ENT_QUOTES).""); } echo ""; From 83fa62a386a9c72afb8a784efbdeea445c5cd839 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 8 Jun 2022 16:08:18 +0200 Subject: [PATCH 51/64] add imagick to list of required php extensions, sqlite -> sqlite3 --- views/bootstrap/class.Info.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/bootstrap/class.Info.php b/views/bootstrap/class.Info.php index 17d36a385..e7623c98a 100644 --- a/views/bootstrap/class.Info.php +++ b/views/bootstrap/class.Info.php @@ -111,7 +111,7 @@ class SeedDMS_View_Info extends SeedDMS_Theme_Style { echo "".getMLText("name"); echo "\n"; echo "\n\n\n"; - $requiredext = array('zip', 'xml', 'xsl', 'json', 'intl', 'fileinfo', 'mbstring', 'curl', 'sqlite'); + $requiredext = array('zip', 'xml', 'xsl', 'json', 'intl', 'fileinfo', 'mbstring', 'curl', 'sqlite3', 'imagick'); foreach(array_diff($requiredext, $phpextensions) as $extname) echo "".$extname.""."\n"; echo "\n\n"; From 12e9a803bcfec663ad60e1d44aa4c580cc60ee55 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 9 Jun 2022 12:44:17 +0200 Subject: [PATCH 52/64] set cmd and mimetype in returned json data in case of an error when indexing a document/folder --- op/op.Ajax.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/op/op.Ajax.php b/op/op.Ajax.php index 937c05cfc..5c2944d18 100644 --- a/op/op.Ajax.php +++ b/op/op.Ajax.php @@ -958,7 +958,7 @@ switch($command) { $ires = $index->addDocument($idoc); header('Content-Type: application/json'); if(false === $ires) { - echo json_encode(array('success'=>false, 'message'=>getMLText('error_document_indexed'), 'data'=>$prefix.$object->getID())); + echo json_encode(array('success'=>false, 'message'=>getMLText('error_document_indexed'), 'data'=>$prefix.$object->getID(), 'mimetype'=>$idoc->getMimeType(), 'cmd'=>$idoc->getCmd())); } else { echo json_encode(array('success'=>true, 'message'=>getMLText('splash_document_indexed'), 'data'=>$prefix.$object->getID(), 'cmd'=>$idoc->getCmd())); } From 89c6dc580a9bbebc2cf8d387438f909696922c21 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 9 Jun 2022 15:18:53 +0200 Subject: [PATCH 53/64] fix query if rootFolder or startFolder is set --- SeedDMS_SQLiteFTS/SQLiteFTS/Search.php | 4 ++-- SeedDMS_SQLiteFTS/package.xml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/SeedDMS_SQLiteFTS/SQLiteFTS/Search.php b/SeedDMS_SQLiteFTS/SQLiteFTS/Search.php index d9a793974..d6ba6b6a7 100644 --- a/SeedDMS_SQLiteFTS/SQLiteFTS/Search.php +++ b/SeedDMS_SQLiteFTS/SQLiteFTS/Search.php @@ -130,14 +130,14 @@ class SeedDMS_SQliteFTS_Search { $querystr .= ' AND '; $querystr .= '(path:'; $querystr .= str_replace(':', 'x', $fields['rootFolder']->getFolderList().$fields['rootFolder']->getID().':'); - $querystr .= ')'; + $querystr .= '*)'; } if(!empty($fields['startFolder']) && $fields['startFolder']->getFolderList()) { if($querystr) $querystr .= ' AND '; $querystr .= '(path:'; $querystr .= str_replace(':', 'x', $fields['startFolder']->getFolderList().$fields['startFolder']->getID().':'); - $querystr .= ')'; + $querystr .= '*)'; } try { $result = $this->index->find($querystr, $limit); diff --git a/SeedDMS_SQLiteFTS/package.xml b/SeedDMS_SQLiteFTS/package.xml index a0d990920..a862245cf 100644 --- a/SeedDMS_SQLiteFTS/package.xml +++ b/SeedDMS_SQLiteFTS/package.xml @@ -24,6 +24,7 @@ GPL License - throw exeption in find() instead of returning false +- fix query if rootFolder or startFolder is set From 6e6851d165ecccae9aa75d7b2496e2cebdb5f782 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 9 Jun 2022 16:00:38 +0200 Subject: [PATCH 54/64] fix upload with fine-uploader --- CHANGELOG | 1 + views/bootstrap/class.AddDocument.php | 2 +- views/bootstrap4/class.Bootstrap4.php | 16 +++++++++------- views/bootstrap4/styles/application.css | 9 --------- 4 files changed, 11 insertions(+), 17 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 2ecff270e..dd49c400c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -13,6 +13,7 @@ - do not use logger in notification service if it was not initialized - fix editing of custom date fields - fix listing files/folders with umlauts when using webdav +- fix upload with fine-uploader -------------------------------------------------------------------------------- Changes in version 5.1.25 diff --git a/views/bootstrap/class.AddDocument.php b/views/bootstrap/class.AddDocument.php index fb6fbdd86..bee74b937 100644 --- a/views/bootstrap/class.AddDocument.php +++ b/views/bootstrap/class.AddDocument.php @@ -41,7 +41,7 @@ class SeedDMS_View_AddDocument extends SeedDMS_Theme_Style { parent::jsTranslations(array('js_form_error', 'js_form_errors')); if($enablelargefileupload) { - $this->printFineUploaderJs('../op/op.UploadChunks.php', $partitionsize, $maxuploadsize, $enablemultiupload); + $this->printFineUploaderJs('../op/op.UploadChunks.php', $partitionsize, $maxuploadsize, $enablemultiupload, 'userfile', 'adddocform'); } ?> $(document).ready(function() { diff --git a/views/bootstrap4/class.Bootstrap4.php b/views/bootstrap4/class.Bootstrap4.php index 5953a72ea..de5965c4c 100644 --- a/views/bootstrap4/class.Bootstrap4.php +++ b/views/bootstrap4/class.Bootstrap4.php @@ -3423,11 +3423,13 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
    -
    -
    +
    +
    - '.getMLText('browse').'… +
    + '.getMLText('choose_target_file').'… +
    @@ -3441,22 +3443,22 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev) - +
  • - +
    - - + +
    diff --git a/views/bootstrap4/styles/application.css b/views/bootstrap4/styles/application.css index 2dde7e119..51ef35ded 100644 --- a/views/bootstrap4/styles/application.css +++ b/views/bootstrap4/styles/application.css @@ -425,15 +425,6 @@ ul.qq-upload-list li span { display: inline-block; } -.qq-upload-drop-area { - display: inline-block; - width: 200px; - height: 22px; - padding: 3px; - background-color: #fff; - border: 1px solid #cccccc; - border-radius: 4px; -} .qq-hide, .qq-uploader dialog { display: none; } From 9eae4c4863633339f177841546ab048639b6a956 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Fri, 10 Jun 2022 08:51:33 +0200 Subject: [PATCH 55/64] make getConfigDir() public, because it is used in install/install.php --- inc/inc.ClassSettings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/inc.ClassSettings.php b/inc/inc.ClassSettings.php index f28049be9..9e65b2f8c 100644 --- a/inc/inc.ClassSettings.php +++ b/inc/inc.ClassSettings.php @@ -1196,7 +1196,7 @@ class Settings { /* {{{ */ * If none was found a final try will be made checking /etc/seeddms * @return NULL|string config directory */ - protected static function getConfigDir() { /* {{{ */ + public static function getConfigDir() { /* {{{ */ if(defined("SEEDDMS_CONFIG_FILE")) return dirname(SEEDDMS_CONFIG_FILE); elseif(getenv("SEEDDMS_CONFIG_FILE")) From 573fe293aca1f21bee2f99058304e01b2339b6d5 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Fri, 10 Jun 2022 16:44:11 +0200 Subject: [PATCH 56/64] better layout of footer, especially of disclaimer is turned off --- views/bootstrap4/styles/styles.css | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/views/bootstrap4/styles/styles.css b/views/bootstrap4/styles/styles.css index 19f7d45d3..bac17d55f 100644 --- a/views/bootstrap4/styles/styles.css +++ b/views/bootstrap4/styles/styles.css @@ -25,9 +25,6 @@ body { position: absolute; bottom: 0; width: 100%; - /* Set the fixed height of the footer here */ - height: 68px; - _line-height: 17px; /* Vertically center the text there */ background-color: #f5f5f5; } @media (max-width: 991px) { @@ -45,9 +42,9 @@ body { } .footer .disclaimer { display: inline-block; - padding: 15px 0px 0px 0px; + padding: 7px 0px 7px 0px; } .footer .footNote { display: inline-block; - padding: 0px 0px 15px 0px; + padding: 7px 0px 7px 0px; } From 199f26703c5670f26a9cff2223d334f2ee33e002 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 16 Jun 2022 12:42:53 +0200 Subject: [PATCH 57/64] set default of $class to 'Style' --- inc/inc.ClassUI.php | 1 + 1 file changed, 1 insertion(+) diff --git a/inc/inc.ClassUI.php b/inc/inc.ClassUI.php index 88fda7fc2..b8f4de275 100644 --- a/inc/inc.ClassUI.php +++ b/inc/inc.ClassUI.php @@ -48,6 +48,7 @@ class UI extends UI_Default { global $settings, $session, $extMgr; if(!$class) { $class = 'Bootstrap'; + $class = 'Style'; $classname = "SeedDMS_Bootstrap_Style"; } else { $classname = "SeedDMS_View_".$class; From c3f5a637f6d4b8fc651e88478a3dcc93f3a9a04e Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 16 Jun 2022 12:43:50 +0200 Subject: [PATCH 58/64] getHookObjects() takes parent classes into account --- inc/inc.ClassViewCommon.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/inc/inc.ClassViewCommon.php b/inc/inc.ClassViewCommon.php index 045de262c..28a268831 100644 --- a/inc/inc.ClassViewCommon.php +++ b/inc/inc.ClassViewCommon.php @@ -217,13 +217,16 @@ class SeedDMS_View_Common { */ public function getHookObjects($classname='') { /* {{{ */ if($classname) - $tmp = explode('_', $classname); + $tmps = array(explode('_', $classname)[2]); else - $tmp = explode('_', get_class($this)); - if(isset($GLOBALS['SEEDDMS_HOOKS']['view'][lcfirst($tmp[2])])) { - return $GLOBALS['SEEDDMS_HOOKS']['view'][lcfirst($tmp[2])]; + $tmps = $this->getHookClassNames(); + $hooks = []; + foreach($tmps as $tmp) { + if(isset($GLOBALS['SEEDDMS_HOOKS']['view'][lcfirst($tmp)])) { + $hooks = array_merge($hooks, $GLOBALS['SEEDDMS_HOOKS']['view'][lcfirst($tmp)]); + } } - return array(); + return $hooks; } /* }}} */ /** From d3e6cecaa745d06f59252ac1ac275929e0fd421d Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 16 Jun 2022 12:44:53 +0200 Subject: [PATCH 59/64] do not call hook documentNavigationBar with callHook, but iterate over hookObjs --- views/bootstrap/class.Bootstrap.php | 11 +++-------- views/bootstrap4/class.Bootstrap4.php | 11 +++-------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/views/bootstrap/class.Bootstrap.php b/views/bootstrap/class.Bootstrap.php index 6aa6f0a1f..0379e1104 100644 --- a/views/bootstrap/class.Bootstrap.php +++ b/views/bootstrap/class.Bootstrap.php @@ -751,21 +751,16 @@ background-image: linear-gradient(to bottom, #882222, #111111);; $menuitems['transfer_document'] = array('link'=>$this->params['settings']->_httpRoot."out/out.TransferDocument". $docid, 'label'=>getMLText('transfer_document')); } - /* Check if hook exists because otherwise callHook() will override $menuitems */ - if($this->hasHook('documentNavigationBar')) - $menuitems = $this->callHook('documentNavigationBar', $document, $menuitems); - - /* Do not use $this->callHook() because $menuitems must be returned by the hook - * or left unchanged + /* Do not use $this->callHook() because $menuitems must be returned by the the + * first hook and passed to next hook. $this->callHook() will just pass + * the menuitems to each single hook. Hence, the last hook will win. */ - /* $hookObjs = $this->getHookObjects(); foreach($hookObjs as $hookObj) { if (method_exists($hookObj, 'documentNavigationBar')) { $menuitems = $hookObj->documentNavigationBar($this, $document, $menuitems); } } - */ self::showNavigationBar($menuitems); diff --git a/views/bootstrap4/class.Bootstrap4.php b/views/bootstrap4/class.Bootstrap4.php index de5965c4c..f1f878a54 100644 --- a/views/bootstrap4/class.Bootstrap4.php +++ b/views/bootstrap4/class.Bootstrap4.php @@ -748,21 +748,16 @@ background-image: linear-gradient(to bottom, #882222, #111111);; $menuitems['transfer_document'] = array('link'=>$this->params['settings']->_httpRoot."out/out.TransferDocument". $docid, 'label'=>getMLText('transfer_document')); } - /* Check if hook exists because otherwise callHook() will override $menuitems */ - if($this->hasHook('documentNavigationBar')) - $menuitems = $this->callHook('documentNavigationBar', $document, $menuitems); - - /* Do not use $this->callHook() because $menuitems must be returned by the hook - * or left unchanged + /* Do not use $this->callHook() because $menuitems must be returned by the the + * first hook and passed to next hook. $this->callHook() will just pass + * the menuitems to each single hook. Hence, the last hook will win. */ - /* $hookObjs = $this->getHookObjects(); foreach($hookObjs as $hookObj) { if (method_exists($hookObj, 'documentNavigationBar')) { $menuitems = $hookObj->documentNavigationBar($this, $document, $menuitems); } } - */ self::showNavigationBar($menuitems); } /* }}} */ From 23c6a6b5d93a5ef492085f21446b73368a414b49 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 16 Jun 2022 12:45:56 +0200 Subject: [PATCH 60/64] allow ext/*/node_modules --- .htaccess | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.htaccess b/.htaccess index 474adf2bf..b8963585e 100644 --- a/.htaccess +++ b/.htaccess @@ -30,7 +30,7 @@ RewriteRule "^styles/.*$" "-" [L] # Added for old extensions which do not use routes RewriteRule ^ext/[^/]+/icon.(?:png|svg)$ - [L] RewriteCond %{REQUEST_URI} "ext/[^/]+/" -RewriteRule !^ext/[^/]+/.*(?:op|out|res) - [F] +RewriteRule !^ext/[^/]+/.*(?:op|out|res|node_modules) - [F] RewriteCond %{REQUEST_URI} "ext/[^/]+/res/.*$" [NC] RewriteRule !^ext/[^/]+/res/.*\.(?:css|js|png|svg) - [F] RewriteCond %{REQUEST_FILENAME} -f From 6b5826ded4e8719b75ce049011a29b6bb45cfe41 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Fri, 17 Jun 2022 20:10:34 +0200 Subject: [PATCH 61/64] check if totalreceipts != 0 --- views/bootstrap/class.ViewDocument.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/views/bootstrap/class.ViewDocument.php b/views/bootstrap/class.ViewDocument.php index e2fe3c64b..b94039bc0 100644 --- a/views/bootstrap/class.ViewDocument.php +++ b/views/bootstrap/class.ViewDocument.php @@ -1670,9 +1670,9 @@ $(document).ready( function() {
    -
    - -
    +
    + +
    From c9e61ccf302fc993ac8c7421efd8dbe24c0a2db7 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 22 Jun 2022 16:45:37 +0200 Subject: [PATCH 62/64] set role to button for each nav-item --- views/bootstrap/class.Bootstrap.php | 2 +- views/bootstrap/class.EditOnline.php | 4 ++-- views/bootstrap/class.ExtensionMgr.php | 4 ++-- views/bootstrap/class.Search.php | 4 ++-- views/bootstrap/class.ViewDocument.php | 14 +++++++------- views/bootstrap4/class.Bootstrap4.php | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/views/bootstrap/class.Bootstrap.php b/views/bootstrap/class.Bootstrap.php index 0379e1104..e3af611d8 100644 --- a/views/bootstrap/class.Bootstrap.php +++ b/views/bootstrap/class.Bootstrap.php @@ -638,7 +638,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);; } /* }}} */ protected function showPaneHeader($name, $title, $isactive) { /* {{{ */ - echo ''."\n"; + echo ''."\n"; } /* }}} */ protected function showStartPaneContent($name, $isactive) { /* {{{ */ diff --git a/views/bootstrap/class.EditOnline.php b/views/bootstrap/class.EditOnline.php index effa3e0da..e47036b0f 100644 --- a/views/bootstrap/class.EditOnline.php +++ b/views/bootstrap/class.EditOnline.php @@ -97,8 +97,8 @@ $(document).ready(function() { $version = $this->params['version']; ?>
    diff --git a/views/bootstrap/class.ExtensionMgr.php b/views/bootstrap/class.ExtensionMgr.php index 995e4011f..79e06794e 100644 --- a/views/bootstrap/class.ExtensionMgr.php +++ b/views/bootstrap/class.ExtensionMgr.php @@ -286,8 +286,8 @@ class SeedDMS_View_ExtensionMgr extends SeedDMS_Theme_Style { $this->columnStart(8); ?>
    diff --git a/views/bootstrap/class.Search.php b/views/bootstrap/class.Search.php index 9e2466e60..647fa1e45 100644 --- a/views/bootstrap/class.Search.php +++ b/views/bootstrap/class.Search.php @@ -197,11 +197,11 @@ function typeahead() { /* {{{ */ } ?>