From 9d69bd12eba4f05eaae1d533e542e5ca9e56e5c7 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 19 Jan 2023 07:05:41 +0100 Subject: [PATCH 1/5] fix text in comment --- inc/inc.ClassConversionMgr.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/inc.ClassConversionMgr.php b/inc/inc.ClassConversionMgr.php index a4606327e..13fd47e6f 100644 --- a/inc/inc.ClassConversionMgr.php +++ b/inc/inc.ClassConversionMgr.php @@ -29,7 +29,7 @@ require_once("inc/inc.ClassConversionServiceTextToImage.php"); */ class SeedDMS_ConversionMgr { /** - * List of services for searching fulltext + * List of services for converting documents */ public $services; From 2f0fdfca199e9f6da9d2a1604df00aea2170c02a Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 19 Jan 2023 07:06:45 +0100 Subject: [PATCH 2/5] make it work in recent versions of seeddms --- install/update-1.8.1/update.php | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/install/update-1.8.1/update.php b/install/update-1.8.1/update.php index 9e483850b..388b970c8 100644 --- a/install/update-1.8.1/update.php +++ b/install/update-1.8.1/update.php @@ -18,16 +18,12 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -include("../inc/inc.Settings.php"); -include("../inc/inc.AccessUtils.php"); -include("../inc/inc.ClassAccess.php"); -include("../inc/inc.ClassDocument.php"); -include("../inc/inc.ClassFolder.php"); -include("../inc/inc.ClassGroup.php"); -include("../inc/inc.ClassUser.php"); -include("../inc/inc.DBAccess.php"); -include("../inc/inc.FileUtils.php"); -include("../inc/inc.Authentication.php"); +include("../../inc/inc.Settings.php"); +include("../../inc/inc.Utils.php"); +include("../../inc/inc.LogInit.php"); +include("../../inc/inc.Language.php"); +include("../../inc/inc.Init.php"); +include("../../inc/inc.DBInit.php"); print ""; @@ -42,7 +38,7 @@ function update_content() GLOBAL $db,$settings; // create temp folder - if (!makedir($settings->_contentDir."/temp")) return false; + if (!SeedDMS_Core_File::makeDir($settings->_contentDir."/temp")) return false; // for all contents $queryStr = "SELECT * FROM tblDocumentContent"; @@ -53,19 +49,19 @@ function update_content() for ($i=0;$i_contentDir."/temp/".$contents[$i]["document"])) return false; + if (!SeedDMS_Core_File::makeDir($settings->_contentDir."/temp/".$contents[$i]["document"])) return false; // move every content in temp/documentID/version.fileType $source = $settings->_contentDir."/".$contents[$i]["dir"]."/data".$contents[$i]["fileType"]; $target = $settings->_contentDir."/temp/".$contents[$i]["document"]."/".$contents[$i]["version"].$contents[$i]["fileType"]; - if (!copyFile($source, $target)) return false; + if (!SeedDMS_Core_File::copyFile($source, $target)) return false; } // change directory - if (!renameDir($settings->_contentDir."/".$settings->_contentOffsetDir,$settings->_contentDir."/old")) return false; - if (!renameDir($settings->_contentDir."/temp",$settings->_contentDir."/".$settings->_contentOffsetDir)) return false; + if (!SeedDMS_Core_File::renameDir($settings->_contentDir."/".$settings->_contentOffsetDir,$settings->_contentDir."/old")) return false; + if (!SeedDMS_Core_File::renameDir($settings->_contentDir."/temp",$settings->_contentDir."/".$settings->_contentOffsetDir)) return false; return true; } From 19cdccbd880f4f9177fad47d4d603f6198a151ce Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 19 Jan 2023 07:07:08 +0100 Subject: [PATCH 3/5] fix syntax error --- out/out.OpensearchDesc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/out/out.OpensearchDesc.php b/out/out.OpensearchDesc.php index 1055d87dd..18569d6fb 100644 --- a/out/out.OpensearchDesc.php +++ b/out/out.OpensearchDesc.php @@ -32,7 +32,7 @@ require_once("inc/inc.ClassAccessOperation.php"); //require_once("inc/inc.Authentication.php"); $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); -$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=null)); +$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>null)); if($view) { $view($_GET); exit; From b6a52ee4de1bc15fb774b06bc8bac2c399a642a5 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 19 Jan 2023 07:07:36 +0100 Subject: [PATCH 4/5] _getDocumentsData returns filetype and origfilename --- restapi/index.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/restapi/index.php b/restapi/index.php index a988a63f2..ae5339117 100644 --- a/restapi/index.php +++ b/restapi/index.php @@ -91,6 +91,8 @@ class RestapiController { /* {{{ */ 'sequence'=>$document->getSequence(), 'expires'=>$document->getExpires() ? date('Y-m-d H:i:s', $document->getExpires()) : "", 'mimetype'=>$lc->getMimeType(), + 'filetype'=>$lc->getFileType(), + 'origfilename'=>$lc->getOriginalFileName(), 'version'=>$lc->getVersion(), 'version_comment'=>$lc->getComment(), 'version_date'=>date('Y-m-d H:i:s', $lc->getDate()), From 9ec87a727eeee19299454e7988f52d503ee79e6b Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 19 Jan 2023 07:08:04 +0100 Subject: [PATCH 5/5] do not show batch operation on categories if none are defined --- views/bootstrap/class.Search.php | 63 ++++++++++++++++---------------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/views/bootstrap/class.Search.php b/views/bootstrap/class.Search.php index 9f919b609..9d947d802 100644 --- a/views/bootstrap/class.Search.php +++ b/views/bootstrap/class.Search.php @@ -968,38 +968,39 @@ function typeahead() { /* {{{ */ ob_start(); $cats = $dms->getDocumentCategories(); - $options = array(); - $options[] = array("-1", getMLText("choose_category")); - foreach ($cats as $currcat) { - $options[] = array($currcat->getID(), htmlspecialchars($currcat->getName()), false); + if($cats) { + $options = array(); + $options[] = array("-1", getMLText("choose_category")); + foreach ($cats as $currcat) { + $options[] = array($currcat->getID(), htmlspecialchars($currcat->getName()), false); + } + $this->formField( + null, + array( + 'element'=>'select', + 'id'=>'batchcategory', + 'class'=>'chzn-select', + 'options'=>$options, + 'multiple'=>false, + 'placeholder'=>getMLText('select_category'), + 'attributes'=>array(array('style', 'width: 100%;')) + ) + ); + $this->formField( + getMLText("batch_remove_category"), + array( + 'element'=>'input', + 'type'=>'checkbox', + 'id'=>'removecategory', + 'value'=>'1', + ) + ); + + print $this->html_link('Search', array_merge($_GET, array('action'=>'changecategory')), array('class'=>'btn btn-primary change-category-btn mt-4', 'id'=>'changecategory'), " ".getMLText("batch_change_category"), false, true)."\n"; + + $content = ob_get_clean(); + $this->printAccordion(getMLText('batch_change_category'), $content); } - $this->formField( - null, - array( - 'element'=>'select', - 'id'=>'batchcategory', - 'class'=>'chzn-select', - 'options'=>$options, - 'multiple'=>false, - 'placeholder'=>getMLText('select_category'), - 'attributes'=>array(array('style', 'width: 100%;')) - ) - ); - $this->formField( - getMLText("batch_remove_category"), - array( - 'element'=>'input', - 'type'=>'checkbox', - 'id'=>'removecategory', - 'value'=>'1', - ) - ); -// print $this->html_link('Search', array_merge($_GET, array('action'=>'changeowner')), array('class'=>'btn btn-primary', 'id'=>'changeowner'), " ".getMLText("batch_change_owner"), false, true)."\n"; - - print $this->html_link('Search', array_merge($_GET, array('action'=>'changecategory')), array('class'=>'btn btn-primary change-category-btn mt-4', 'id'=>'changecategory'), " ".getMLText("batch_change_category"), false, true)."\n"; - - $content = ob_get_clean(); - $this->printAccordion(getMLText('batch_change_category'), $content); } // }}}