Merge branch 'seeddms-5.1.x' into seeddms-6.0.x

This commit is contained in:
Uwe Steinmann 2023-02-21 14:21:13 +01:00
commit 0ffc8c78f7
7 changed files with 41 additions and 23 deletions

View File

@ -252,6 +252,7 @@
Changes in version 5.1.30 Changes in version 5.1.30
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
- conversion from pdf to png replaces alpha channel with white - conversion from pdf to png replaces alpha channel with white
- add list of conversion services in debug menu of admin tool
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
Changes in version 5.1.29 Changes in version 5.1.29

View File

@ -15,7 +15,7 @@
footNote = "SeedDMS free document management system - www.seeddms.org" footNote = "SeedDMS free document management system - www.seeddms.org"
printDisclaimer = "true" printDisclaimer = "true"
language = "en_GB" language = "en_GB"
theme = "bootstrap" theme = "bootstrap4"
previewWidthList = "40" previewWidthList = "40"
previewWidthDetail = "100" previewWidthDetail = "100"
onePageMode="true" onePageMode="true"
@ -60,8 +60,8 @@
enableDropUpload = "false" enableDropUpload = "false"
enableRecursiveCount = "false" enableRecursiveCount = "false"
maxRecursiveCount = "0" maxRecursiveCount = "0"
enableThemeSelector = "false" enableThemeSelector = "true"
fullSearchEngine = "lucene" fullSearchEngine = "sqlitefts"
sortFoldersDefault = "u" sortFoldersDefault = "u"
defaultDocPosition = "end" defaultDocPosition = "end"
defaultFolderPosition = "end" defaultFolderPosition = "end"

View File

@ -122,9 +122,10 @@ class SeedDMS_Extension_Mgr {
if(!file_exists($this->getExtensionsConfFile())) { if(!file_exists($this->getExtensionsConfFile())) {
$this->createExtensionConf(); $this->createExtensionConf();
} }
include($this->getExtensionsConfFile()); if(@include($this->getExtensionsConfFile())) {
if(!empty($EXT_CONF)) { if(!empty($EXT_CONF)) {
$this->extconf = $EXT_CONF; $this->extconf = $EXT_CONF;
}
} }
} }
} /* }}} */ } /* }}} */

View File

@ -181,14 +181,14 @@ class SeedDMS_FulltextService {
* document if its content is below the configured size. * document if its content is below the configured size.
* @return object indexed Document ready for passing to the indexer * @return object indexed Document ready for passing to the indexer
*/ */
public function IndexedDocument($object, $forceupdate=false) { public function IndexedDocument($object, $forceupdate=false) { /* {{{ */
if($object->isType('document')) if($object->isType('document'))
$nocontent = $object->getLatestContent()->getFileSize() > $this->maxsize && $this->maxsize && !$forceupdate; $nocontent = $object->getLatestContent()->getFileSize() > $this->maxsize && $this->maxsize && !$forceupdate;
else else
$nocontent = true; $nocontent = true;
$convcallback = $this->getConversionWithPreviewCallback(); $convcallback = $this->getConversionWithPreviewCallback();
return new $this->services[0]['IndexedDocument']($object->getDMS(), $object, $convcallback /*$this->conversionmgr ? $this->conversionmgr : $this->converters*/, $nocontent, $this->cmdtimeout); return new $this->services[0]['IndexedDocument']($object->getDMS(), $object, $convcallback /*$this->conversionmgr ? $this->conversionmgr : $this->converters*/, $nocontent, $this->cmdtimeout);
} } /* }}} */
/** /**
* Returns an instance of the indexer * Returns an instance of the indexer
@ -198,7 +198,7 @@ class SeedDMS_FulltextService {
* *
* @return object instance of class specified in 'Indexer' * @return object instance of class specified in 'Indexer'
*/ */
public function Indexer($recreate=false) { public function Indexer($recreate=false) { /* {{{ */
if($this->index) if($this->index)
return $this->index; return $this->index;
@ -210,9 +210,9 @@ class SeedDMS_FulltextService {
return $this->index; return $this->index;
} else } else
return null; return null;
} } /* }}} */
public function Search() { public function Search() { /* {{{ */
if($this->search) if($this->search)
return $this->search; return $this->search;
if($this->services[0]) { if($this->services[0]) {
@ -221,7 +221,7 @@ class SeedDMS_FulltextService {
} else { } else {
return null; return null;
} }
} } /* }}} */
} }

View File

@ -61,7 +61,11 @@ $dms->setMaxDirID($settings->_maxDirID);
if(isset($GLOBALS['SEEDDMS_HOOKS']['initDMS'])) { if(isset($GLOBALS['SEEDDMS_HOOKS']['initDMS'])) {
foreach($GLOBALS['SEEDDMS_HOOKS']['initDMS'] as $hookObj) { foreach($GLOBALS['SEEDDMS_HOOKS']['initDMS'] as $hookObj) {
if (method_exists($hookObj, 'postInitDMS')) { if (method_exists($hookObj, 'postInitDMS')) {
$hookObj->postInitDMS(array('dms'=>$dms, 'settings'=>$settings, 'logger'=>$logger)); $ret = $hookObj->postInitDMS(array('dms'=>$dms, 'settings'=>$settings, 'logger'=>$logger));
if($ret === false) {
echo "Fatal error in postInitDMS Hook. No way to recover.";
exit;
}
} }
} }
} }

View File

@ -1,5 +1,11 @@
<?php <?php
function getAttributesCallback($dms) {
return function () use ($dms) {
return $dms->getAllAttributeDefinitions();
};
}
$fulltextservice = null; $fulltextservice = null;
if($settings->_enableFullSearch) { if($settings->_enableFullSearch) {
require_once("inc.ClassFulltextService.php"); require_once("inc.ClassFulltextService.php");
@ -11,7 +17,10 @@ if($settings->_enableFullSearch) {
'Indexer' => 'SeedDMS_SQLiteFTS_Indexer', 'Indexer' => 'SeedDMS_SQLiteFTS_Indexer',
'Search' => 'SeedDMS_SQLiteFTS_Search', 'Search' => 'SeedDMS_SQLiteFTS_Search',
'IndexedDocument' => 'SeedDMS_SQLiteFTS_IndexedDocument', 'IndexedDocument' => 'SeedDMS_SQLiteFTS_IndexedDocument',
'Conf' => array('indexdir' => $settings->_luceneDir) 'Conf' => array(
'indexdir' => $settings->_luceneDir,
'attrcallback' => getAttributesCallback($dms)
)
); );
$fulltextservice->addService('sqlitefts', $indexconf); $fulltextservice->addService('sqlitefts', $indexconf);

View File

@ -663,16 +663,19 @@ function get_extension($mimetype) { /* {{{ */
} /* }}} */ } /* }}} */
/** /**
* Adds a missing front slash to a string * Adds a missing directory separator (or any other char) to a string
* *
* This function is used for making sure a directory name has a * This function is used for making sure a directory name has a
* trailing directory separator * trailing directory separator. It can also be used to add
* any other char at the end of a string, e.g. an URL which must
* end in '/' (DIRECTORY_SEPARATOR wouldn't be right in that case,
* because it is '\' on Windows)
*/ */
function addDirSep($str) { /* {{{ */ function addDirSep($str, $chr=DIRECTORY_SEPARATOR) { /* {{{ */
if(trim($str) == '') if(trim($str) == '')
return ''; return '';
if(substr(trim($str), -1, 1) != DIRECTORY_SEPARATOR) if(substr(trim($str), -1, 1) != $chr)
return trim($str).DIRECTORY_SEPARATOR; return trim($str).$chr;
else else
return trim($str); return trim($str);
} /* }}} */ } /* }}} */
@ -812,12 +815,12 @@ function getBaseUrl() { /* {{{ */
if(!empty($settings->_baseUrl)) if(!empty($settings->_baseUrl))
return $settings->_baseUrl; return $settings->_baseUrl;
if(isset($_SERVER['X-Forwarded-Host'])) if(isset($_SERVER['HTTP_X_FORWARDED_HOST']))
$host = $_SERVER['X-Forwarded-Host']; $host = $_SERVER['HTTP_X_FORWARDED_HOST'];
else else
$host = $_SERVER['HTTP_HOST']; $host = $_SERVER['HTTP_HOST'];
if(isset($_SERVER['X-Forwarded-Proto'])) if(isset($_SERVER['HTTP_X_FORWARDED_PROTO']))
$ssl = $_SERVER['X-Forwarded-Proto'] == 'https'; $ssl = $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https';
else else
$ssl = (isset($_SERVER['HTTPS']) && (strcmp($_SERVER['HTTPS'],'off')!=0)); $ssl = (isset($_SERVER['HTTPS']) && (strcmp($_SERVER['HTTPS'],'off')!=0));