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
--------------------------------------------------------------------------------
- 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

View File

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

View File

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

View File

@ -181,14 +181,14 @@ class SeedDMS_FulltextService {
* document if its content is below the configured size.
* @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'))
$nocontent = $object->getLatestContent()->getFileSize() > $this->maxsize && $this->maxsize && !$forceupdate;
else
$nocontent = true;
$convcallback = $this->getConversionWithPreviewCallback();
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
@ -198,7 +198,7 @@ class SeedDMS_FulltextService {
*
* @return object instance of class specified in 'Indexer'
*/
public function Indexer($recreate=false) {
public function Indexer($recreate=false) { /* {{{ */
if($this->index)
return $this->index;
@ -210,9 +210,9 @@ class SeedDMS_FulltextService {
return $this->index;
} else
return null;
}
} /* }}} */
public function Search() {
public function Search() { /* {{{ */
if($this->search)
return $this->search;
if($this->services[0]) {
@ -221,7 +221,7 @@ class SeedDMS_FulltextService {
} else {
return null;
}
}
} /* }}} */
}

View File

@ -61,7 +61,11 @@ $dms->setMaxDirID($settings->_maxDirID);
if(isset($GLOBALS['SEEDDMS_HOOKS']['initDMS'])) {
foreach($GLOBALS['SEEDDMS_HOOKS']['initDMS'] as $hookObj) {
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
function getAttributesCallback($dms) {
return function () use ($dms) {
return $dms->getAllAttributeDefinitions();
};
}
$fulltextservice = null;
if($settings->_enableFullSearch) {
require_once("inc.ClassFulltextService.php");
@ -11,7 +17,10 @@ if($settings->_enableFullSearch) {
'Indexer' => 'SeedDMS_SQLiteFTS_Indexer',
'Search' => 'SeedDMS_SQLiteFTS_Search',
'IndexedDocument' => 'SeedDMS_SQLiteFTS_IndexedDocument',
'Conf' => array('indexdir' => $settings->_luceneDir)
'Conf' => array(
'indexdir' => $settings->_luceneDir,
'attrcallback' => getAttributesCallback($dms)
)
);
$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
* 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) == '')
return '';
if(substr(trim($str), -1, 1) != DIRECTORY_SEPARATOR)
return trim($str).DIRECTORY_SEPARATOR;
if(substr(trim($str), -1, 1) != $chr)
return trim($str).$chr;
else
return trim($str);
} /* }}} */
@ -812,12 +815,12 @@ function getBaseUrl() { /* {{{ */
if(!empty($settings->_baseUrl))
return $settings->_baseUrl;
if(isset($_SERVER['X-Forwarded-Host']))
$host = $_SERVER['X-Forwarded-Host'];
if(isset($_SERVER['HTTP_X_FORWARDED_HOST']))
$host = $_SERVER['HTTP_X_FORWARDED_HOST'];
else
$host = $_SERVER['HTTP_HOST'];
if(isset($_SERVER['X-Forwarded-Proto']))
$ssl = $_SERVER['X-Forwarded-Proto'] == 'https';
if(isset($_SERVER['HTTP_X_FORWARDED_PROTO']))
$ssl = $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https';
else
$ssl = (isset($_SERVER['HTTPS']) && (strcmp($_SERVER['HTTPS'],'off')!=0));