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

This commit is contained in:
Uwe Steinmann 2021-02-23 20:49:59 +01:00
commit 41e2d7b3be
2 changed files with 8 additions and 38 deletions

View File

@ -24,7 +24,7 @@ include("../inc/inc.Init.php");
include("../inc/inc.Extension.php");
include("../inc/inc.DBInit.php");
include("../inc/inc.ClassNotificationService.php");
include("../inc/inc.ClassEmailNotify.php");
//include("../inc/inc.ClassEmailNotify.php");
include("../inc/inc.Notification.php");
include("../inc/inc.ClassController.php");

View File

@ -618,7 +618,7 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
*/
function PUT(&$options) /* {{{ */
{
global $settings, $indexconf;
global $settings, $fulltextservice;
$this->log_options('PUT', $options);
@ -716,22 +716,13 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
if($this->logger)
$this->logger->log('PUT: adding new version', PEAR_LOG_INFO);
if($settings->_enableFullSearch) {
$index = $indexconf['Indexer']::open($settings->_luceneDir);
$indexconf['Indexer']::init($settings->_stopWordsFile);
} else {
$index = null;
$indexconf = null;
}
$controller = Controller::factory('UpdateDocument');
$controller->setParam('dms', $this->dms);
$controller->setParam('user', $this->user);
$controller->setParam('documentsource', 'webdav');
$controller->setParam('folder', $document->getFolder());
$controller->setParam('document', $document);
$controller->setParam('index', $index);
$controller->setParam('indexconf', $indexconf);
$controller->setParam('fulltextservice', $fulltextservice);
$controller->setParam('comment', '');
$controller->setParam('userfiletmp', $tmpFile);
$controller->setParam('userfilename', $name);
@ -799,8 +790,6 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
$controller->setParam('documentsource', 'webdav');
$controller->setParam('folder', $folder);
$controller->setParam('fulltextservice', $fulltextservice);
$controller->setParam('index', $index);
$controller->setParam('indexconf', $indexconf);
$controller->setParam('name', $name);
$controller->setParam('comment', '');
$controller->setParam('expires', 0);
@ -977,7 +966,7 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
*/
function DELETE($options) /* {{{ */
{
global $settings, $indexconf;
global $settings, $fulltextservice;
$this->log_options('DELETE', $options);
@ -997,14 +986,6 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
return "403 Forbidden";
}
if($settings->_enableFullSearch) {
$index = $indexconf['Indexer']::open($settings->_luceneDir);
$indexconf['Indexer']::init($settings->_stopWordsFile);
} else {
$index = null;
$indexconf = null;
}
if (get_class($obj) == $this->dms->getClassname('folder')) {
if($obj->hasDocuments() || $obj->hasSubFolders()) {
if($this->logger)
@ -1025,8 +1006,7 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
$controller->setParam('dms', $this->dms);
$controller->setParam('user', $this->user);
$controller->setParam('folder', $obj);
$controller->setParam('index', $index);
$controller->setParam('indexconf', $indexconf);
$controller->setParam('fulltextservice', $fulltextservice);
if(!$controller->run()) {
return "409 Conflict ".$controller->getErrorMsg();
}
@ -1065,8 +1045,7 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
$controller->setParam('dms', $this->dms);
$controller->setParam('user', $this->user);
$controller->setParam('document', $obj);
$controller->setParam('index', $index);
$controller->setParam('indexconf', $indexconf);
$controller->setParam('fulltextservice', $fulltextservice);
if(!$controller->run()) {
return "409 Conflict ".$controller->getErrorMsg();
}
@ -1279,7 +1258,7 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
*/
function COPY($options) /* {{{ */
{
global $settings, $indexconf;
global $settings, $fulltextservice;
$this->log_options('COPY', $options);
@ -1390,21 +1369,12 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
$content = $objsource->getLatestContent();
$fspath = $this->dms->contentDir.'/'.$content->getPath();
if($settings->_enableFullSearch) {
$index = $indexconf['Indexer']::open($settings->_luceneDir);
$indexconf['Indexer']::init($settings->_stopWordsFile);
} else {
$index = null;
$indexconf = null;
}
$controller = Controller::factory('AddDocument');
$controller->setParam('dms', $this->dms);
$controller->setParam('user', $this->user);
$controller->setParam('documentsource', 'webdav');
$controller->setParam('folder', $objdest);
$controller->setParam('index', $index);
$controller->setParam('indexconf', $indexconf);
$controller->setParam('fulltextservice', $fulltextservice);
$controller->setParam('name', $newdocname);
$controller->setParam('comment', '');
$controller->setParam('expires', 0);