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

This commit is contained in:
Uwe Steinmann 2018-04-12 15:57:21 +02:00
commit 0199019ee6
9 changed files with 237 additions and 122 deletions

View File

@ -2210,13 +2210,17 @@ class SeedDMS_Core_DMS {
// Send the complete search query to the database. // Send the complete search query to the database.
$resArr = $this->db->getResultArray($searchQuery); $resArr = $this->db->getResultArray($searchQuery);
if($resArr === false)
return false;
} else { } else {
$resArr = array(); $resArr = array();
} }
} else { } else {
// Send the complete search query to the database. // Send the complete search query to the database.
$resArr = $this->db->getResultArray($searchQuery); $resArr = $this->db->getResultArray($searchQuery);
} if($resArr === false)
return false;
}
// ------------------- Ausgabe der Ergebnisse ---------------------------- // ------------------- Ausgabe der Ergebnisse ----------------------------
$numResults = count($resArr); $numResults = count($resArr);

View File

@ -1582,6 +1582,23 @@ add lots of DocBlocks from merge request #8
add SeedDMS_Core_AttributeDefinition::removeValue() add SeedDMS_Core_AttributeDefinition::removeValue()
</notes> </notes>
</release> </release>
<release>
<date>2018-04-11</date>
<time>09:19:24</time>
<version>
<release>5.1.8</release>
<api>5.1.8</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
<notes>
SeedDMS_Core_DMS::search() returns false in case of an error
do not use views in DBAccessPDO by default anymore, use temp. tables
</notes>
</release>
<release> <release>
<date>2017-02-28</date> <date>2017-02-28</date>
<time>06:34:50</time> <time>06:34:50</time>

View File

@ -71,6 +71,9 @@
calendarDefaultView = "y" calendarDefaultView = "y"
firstDayOfWeek = "0" firstDayOfWeek = "0"
/> />
<webdav
enableWebdavReplaceDoc="true"
/>
</site> </site>
<system> <system>
<!-- <!--

View File

@ -13,17 +13,45 @@ and its content, while a file system knows just files.
In SeedDMS a document is uniquely identified In SeedDMS a document is uniquely identified
by its document id and not neccessarily by its name. A filesystem by its document id and not neccessarily by its name. A filesystem
requires a unique paths for each file. Two identical files in the requires a unique paths for each file. Two identical files in the
same folder are not possible. SeedDMS can handle identifcally named same folder are not possible. SeedDMS can handle identically named
documents in one folder. In order to prevent any problems arising from documents in one folder. In order to prevent any problems arising from
this, you should always disallow identical document names in the this, you should always disallow identical document names in the
settings. By definition a file in WebDAV is mapped on the latest settings. By definition a file in WebDAV is mapped on the latest
version of a document in SeedDMS. There is no way to access previous version of a document in SeedDMS. There is no way to access previous
versions of a document via WebDAV. Whenever you modify a file, versions of a document via WebDAV. Whenever you modify a file and
upload it with the web gui,
a new version will be created. Unfortunately, this has some very a new version will be created. Unfortunately, this has some very
nasty side effects when you often save a file, because any save nasty side effects when you edit a document version via WebDAV and
operation will create a new version. This is because the WebDAV often save it, because any save
server replaces the content of document instead of creating a new operation will create a new version. This is why the WebDAV
version if a document is saved again. server has a configuration option which allows to either replace
the content of document or creating a new
version if a document is saved.
Configuring davfs2
===================
On Linux it is quite simple to mount the SeedDMS WebDAV server with
davfs2. Just place a line like the following in your /etc/fstab
http://seeddms.your-domain.com/webdav/index.php /media/webdav davfs noauto,user,rw,uid=1000,gid=1000
and mount it as root with
mount /media/webdav davfs
You may as well want to configure davfs2 in /etc/davfs2/davfs2.conf by setting
[/media/webdav]
use_locks 0
gui_optimize 1
and possibly add your login data to /etc/davfs2/secrets
/media/webdav admin secret
Making applications work with WebDAV
=====================================
Various programms have differnt strategies to save files to disk and Various programms have differnt strategies to save files to disk and
prevent data lost under all circumstances. Those strategies often don't prevent data lost under all circumstances. Those strategies often don't
@ -35,19 +63,31 @@ VIM
vim does a lot more than just reading and writing the file you want vim does a lot more than just reading and writing the file you want
to edit. It creates swap and backup files for data recovery if vim crashes to edit. It creates swap and backup files for data recovery if vim crashes
or is being kill unexpectivly. On a low bandwidth connection this can or is being killed unexpectively. On a low bandwidth connection this can
slow down the editing. For that reason you should either not create the slow down the editing. For that reason you should either not create the
swap file at all or create it outside the WebDAV server. A second problem swap file at all or create it outside the WebDAV server. A second problem
arises from how vim modifіes the file you are editing. Before a file arises from how vim modifіes the file you are editing. Before a file
is saved a backup is created and the new content is written into a new is saved a backup is created by renaming the file to the same name with a
file with the name of the original file. On a file system you '~' at the end and writing the file content into a new
won't see a difference between the file before and after saveing, though file with the name of the original file. Afterwards vim deleteѕ the backup
is actually a new one. In SeedDMS you won't notice a difference either file. On a regular file system you
if just looking at the document name. It's still the same, but the won't see a difference between the file before and after saving, though
it is actually a new one. In SeedDMS you won't notice a difference either
by just looking at the document name. It's still the same, but the
document id has changed. So saving a document will delete the document id has changed. So saving a document will delete the
old document and create a new one instead of creating a new version of old document and create a new one instead of creating a new version of
the old document. If you don't want this behaviour, then tell vim the old document. If you don't want this behaviour, then tell vim
to not create the backup. Creating the backup file in a directory to not create the backup file. You can do that by either passing additional
outside of WebDAV doesn't help in this case. parameters to vim
vi "+set nobackup" "+set nobackuwrite" -n test.txt vi "+set nobackup" "+set nowritebackup" -n test.txt
or by setting them in your .vimrc
set nobackup
set nowritebackup
set noswapfile
Creating the backup file in a directory outside of WebDAV doesn't help in
this case, because it still does the file renaming which is turned of by
'nowritebackup'.

View File

@ -204,6 +204,8 @@ class Settings { /* {{{ */
var $_maxUploadSize = 0; var $_maxUploadSize = 0;
// enable/disable users images // enable/disable users images
var $_enableUserImage = false; var $_enableUserImage = false;
// enable/disable replacing documents by webdav
var $_enableWebdavReplaceDoc = true;
// enable/disable calendar // enable/disable calendar
var $_enableCalendar = true; var $_enableCalendar = true;
// calendar default view ("w" for week,"m" for month,"y" for year) // calendar default view ("w" for week,"m" for month,"y" for year)
@ -509,56 +511,67 @@ class Settings { /* {{{ */
$this->_libraryFolder = intval($tab["libraryFolder"]); $this->_libraryFolder = intval($tab["libraryFolder"]);
$this->_defaultDocPosition = strval($tab["defaultDocPosition"]); $this->_defaultDocPosition = strval($tab["defaultDocPosition"]);
// XML Path: /configuration/site/calendar
$node = $xml->xpath('/configuration/site/webdav');
if($node) {
$tab = $node[0]->attributes();
$this->_enableWebdavReplaceDoc = Settings::boolVal($tab["enableWebdavReplaceDoc"]);
}
// XML Path: /configuration/site/calendar // XML Path: /configuration/site/calendar
$node = $xml->xpath('/configuration/site/calendar'); $node = $xml->xpath('/configuration/site/calendar');
$tab = $node[0]->attributes(); if($node) {
$this->_enableCalendar = Settings::boolVal($tab["enableCalendar"]); $tab = $node[0]->attributes();
$this->_calendarDefaultView = strval($tab["calendarDefaultView"]); $this->_enableCalendar = Settings::boolVal($tab["enableCalendar"]);
$this->_firstDayOfWeek = intval($tab["firstDayOfWeek"]); $this->_calendarDefaultView = strval($tab["calendarDefaultView"]);
$this->_firstDayOfWeek = intval($tab["firstDayOfWeek"]);
}
// XML Path: /configuration/system/server // XML Path: /configuration/system/server
$node = $xml->xpath('/configuration/system/server'); $node = $xml->xpath('/configuration/system/server');
$tab = $node[0]->attributes(); if($node) {
$this->_rootDir = strval($tab["rootDir"]); $tab = $node[0]->attributes();
$this->_httpRoot = strval($tab["httpRoot"]); $this->_rootDir = strval($tab["rootDir"]);
$this->_contentDir = strval($tab["contentDir"]); $this->_httpRoot = strval($tab["httpRoot"]);
if($this->_contentDir && substr($this->_contentDir, -1, 1) != DIRECTORY_SEPARATOR) $this->_contentDir = strval($tab["contentDir"]);
$this->_contentDir .= DIRECTORY_SEPARATOR; if($this->_contentDir && substr($this->_contentDir, -1, 1) != DIRECTORY_SEPARATOR)
$this->_cacheDir = strval($tab["cacheDir"]); $this->_contentDir .= DIRECTORY_SEPARATOR;
$this->_stagingDir = strval($tab["stagingDir"]); $this->_cacheDir = strval($tab["cacheDir"]);
$this->_luceneDir = strval($tab["luceneDir"]); $this->_stagingDir = strval($tab["stagingDir"]);
$this->_dropFolderDir = strval($tab["dropFolderDir"]); $this->_luceneDir = strval($tab["luceneDir"]);
$this->_backupDir = strval($tab["backupDir"]); $this->_dropFolderDir = strval($tab["dropFolderDir"]);
$this->_checkOutDir = strval($tab["checkOutDir"]); $this->_backupDir = strval($tab["backupDir"]);
$this->_createCheckOutDir = Settings::boolVal($tab["createCheckOutDir"]); $this->_checkOutDir = strval($tab["checkOutDir"]);
$this->_repositoryUrl = strval($tab["repositoryUrl"]); $this->_createCheckOutDir = Settings::boolVal($tab["createCheckOutDir"]);
$this->_logFileEnable = Settings::boolVal($tab["logFileEnable"]); $this->_repositoryUrl = strval($tab["repositoryUrl"]);
$this->_logFileRotation = strval($tab["logFileRotation"]); $this->_logFileEnable = Settings::boolVal($tab["logFileEnable"]);
$this->_enableLargeFileUpload = Settings::boolVal($tab["enableLargeFileUpload"]); $this->_logFileRotation = strval($tab["logFileRotation"]);
$this->_partitionSize = strval($tab["partitionSize"]); $this->_enableLargeFileUpload = Settings::boolVal($tab["enableLargeFileUpload"]);
$this->_maxUploadSize = strval($tab["maxUploadSize"]); $this->_partitionSize = strval($tab["partitionSize"]);
$this->_maxUploadSize = strval($tab["maxUploadSize"]);
// XML Path: /configuration/system/authentication // XML Path: /configuration/system/authentication
$node = $xml->xpath('/configuration/system/authentication'); $node = $xml->xpath('/configuration/system/authentication');
$tab = $node[0]->attributes(); $tab = $node[0]->attributes();
$this->_enableGuestLogin = Settings::boolVal($tab["enableGuestLogin"]); $this->_enableGuestLogin = Settings::boolVal($tab["enableGuestLogin"]);
$this->_enableGuestAutoLogin = Settings::boolVal($tab["enableGuestAutoLogin"]); $this->_enableGuestAutoLogin = Settings::boolVal($tab["enableGuestAutoLogin"]);
$this->_enable2FactorAuthentication = Settings::boolVal($tab["enable2FactorAuthentication"]); $this->_enable2FactorAuthentication = Settings::boolVal($tab["enable2FactorAuthentication"]);
$this->_enablePasswordForgotten = Settings::boolVal($tab["enablePasswordForgotten"]); $this->_enablePasswordForgotten = Settings::boolVal($tab["enablePasswordForgotten"]);
$this->_passwordStrength = intval($tab["passwordStrength"]); $this->_passwordStrength = intval($tab["passwordStrength"]);
$this->_passwordStrengthAlgorithm = strval($tab["passwordStrengthAlgorithm"]); $this->_passwordStrengthAlgorithm = strval($tab["passwordStrengthAlgorithm"]);
$this->_passwordExpiration = intval($tab["passwordExpiration"]); $this->_passwordExpiration = intval($tab["passwordExpiration"]);
$this->_passwordHistory = intval($tab["passwordHistory"]); $this->_passwordHistory = intval($tab["passwordHistory"]);
$this->_loginFailure = intval($tab["loginFailure"]); $this->_loginFailure = intval($tab["loginFailure"]);
$this->_autoLoginUser = intval($tab["autoLoginUser"]); $this->_autoLoginUser = intval($tab["autoLoginUser"]);
$this->_quota = intval($tab["quota"]); $this->_quota = intval($tab["quota"]);
$this->_undelUserIds = strval($tab["undelUserIds"]); $this->_undelUserIds = strval($tab["undelUserIds"]);
$this->_encryptionKey = strval($tab["encryptionKey"]); $this->_encryptionKey = strval($tab["encryptionKey"]);
$this->_cookieLifetime = intval($tab["cookieLifetime"]); $this->_cookieLifetime = intval($tab["cookieLifetime"]);
$this->_defaultAccessDocs = intval($tab["defaultAccessDocs"]); $this->_defaultAccessDocs = intval($tab["defaultAccessDocs"]);
$this->_restricted = Settings::boolVal($tab["restricted"]); $this->_restricted = Settings::boolVal($tab["restricted"]);
$this->_enableUserImage = Settings::boolVal($tab["enableUserImage"]); $this->_enableUserImage = Settings::boolVal($tab["enableUserImage"]);
$this->_disableSelfEdit = Settings::boolVal($tab["disableSelfEdit"]); $this->_disableSelfEdit = Settings::boolVal($tab["disableSelfEdit"]);
}
// XML Path: /configuration/system/authentication/connectors/connector // XML Path: /configuration/system/authentication/connectors/connector
// attributs mandatories : type enable // attributs mandatories : type enable
@ -604,13 +617,15 @@ class Settings { /* {{{ */
// XML Path: /configuration/system/database // XML Path: /configuration/system/database
$node = $xml->xpath('/configuration/system/database'); $node = $xml->xpath('/configuration/system/database');
$tab = $node[0]->attributes(); if($node) {
$this->_dbDriver = strval($tab["dbDriver"]); $tab = $node[0]->attributes();
$this->_dbHostname = strval($tab["dbHostname"]); $this->_dbDriver = strval($tab["dbDriver"]);
$this->_dbDatabase = strval($tab["dbDatabase"]); $this->_dbHostname = strval($tab["dbHostname"]);
$this->_dbUser = strval($tab["dbUser"]); $this->_dbDatabase = strval($tab["dbDatabase"]);
$this->_dbPass = strval($tab["dbPass"]); $this->_dbUser = strval($tab["dbUser"]);
$this->_doNotCheckDBVersion = Settings::boolVal($tab["doNotCheckDBVersion"]); $this->_dbPass = strval($tab["dbPass"]);
$this->_doNotCheckDBVersion = Settings::boolVal($tab["doNotCheckDBVersion"]);
}
// XML Path: /configuration/system/smtp // XML Path: /configuration/system/smtp
$node = $xml->xpath('/configuration/system/smtp'); $node = $xml->xpath('/configuration/system/smtp');
@ -639,44 +654,50 @@ class Settings { /* {{{ */
// XML Path: /configuration/advanced/display // XML Path: /configuration/advanced/display
$node = $xml->xpath('/configuration/advanced/display'); $node = $xml->xpath('/configuration/advanced/display');
$tab = $node[0]->attributes(); if($node) {
$this->_siteDefaultPage = strval($tab["siteDefaultPage"]); $tab = $node[0]->attributes();
$this->_rootFolderID = intval($tab["rootFolderID"]); $this->_siteDefaultPage = strval($tab["siteDefaultPage"]);
$this->_titleDisplayHack = Settings::boolval($tab["titleDisplayHack"]); $this->_rootFolderID = intval($tab["rootFolderID"]);
$this->_showMissingTranslations = Settings::boolval($tab["showMissingTranslations"]); $this->_titleDisplayHack = Settings::boolval($tab["titleDisplayHack"]);
$this->_showMissingTranslations = Settings::boolval($tab["showMissingTranslations"]);
}
// XML Path: /configuration/advanced/authentication // XML Path: /configuration/advanced/authentication
$node = $xml->xpath('/configuration/advanced/authentication'); $node = $xml->xpath('/configuration/advanced/authentication');
$tab = $node[0]->attributes(); if($node) {
$this->_guestID = intval($tab["guestID"]); $tab = $node[0]->attributes();
$this->_adminIP = strval($tab["adminIP"]); $this->_guestID = intval($tab["guestID"]);
$this->_adminIP = strval($tab["adminIP"]);
}
// XML Path: /configuration/advanced/edition // XML Path: /configuration/advanced/edition
$node = $xml->xpath('/configuration/advanced/edition'); $node = $xml->xpath('/configuration/advanced/edition');
$tab = $node[0]->attributes(); if($node) {
$this->_enableAdminRevApp = Settings::boolval($tab["enableAdminRevApp"]); $tab = $node[0]->attributes();
$this->_enableOwnerRevApp = Settings::boolval($tab["enableOwnerRevApp"]); $this->_enableAdminRevApp = Settings::boolval($tab["enableAdminRevApp"]);
$this->_enableSelfRevApp = Settings::boolval($tab["enableSelfRevApp"]); $this->_enableOwnerRevApp = Settings::boolval($tab["enableOwnerRevApp"]);
$this->_enableUpdateRevApp = Settings::boolval($tab["enableUpdateRevApp"]); $this->_enableSelfRevApp = Settings::boolval($tab["enableSelfRevApp"]);
$this->_enableSelfReceipt = Settings::boolval($tab["enableSelfReceipt"]); $this->_enableUpdateRevApp = Settings::boolval($tab["enableUpdateRevApp"]);
$this->_enableAdminReceipt = Settings::boolval($tab["enableAdminReceipt"]); $this->_enableSelfReceipt = Settings::boolval($tab["enableSelfReceipt"]);
$this->_enableOwnerReceipt = Settings::boolval($tab["enableOwnerReceipt"]); $this->_enableAdminReceipt = Settings::boolval($tab["enableAdminReceipt"]);
$this->_enableUpdateReceipt = Settings::boolval($tab["enableUpdateReceipt"]); $this->_enableOwnerReceipt = Settings::boolval($tab["enableOwnerReceipt"]);
$this->_enableFilterReceipt = Settings::boolval($tab["enableFilterReceipt"]); $this->_enableUpdateReceipt = Settings::boolval($tab["enableUpdateReceipt"]);
$this->_presetExpirationDate = strval($tab["presetExpirationDate"]); $this->_enableFilterReceipt = Settings::boolval($tab["enableFilterReceipt"]);
$this->_initialDocumentStatus = intval($tab["initialDocumentStatus"]); $this->_presetExpirationDate = strval($tab["presetExpirationDate"]);
$this->_versioningFileName = strval($tab["versioningFileName"]); $this->_initialDocumentStatus = intval($tab["initialDocumentStatus"]);
$this->_workflowMode = strval($tab["workflowMode"]); $this->_versioningFileName = strval($tab["versioningFileName"]);
$this->_enableReceiptWorkflow = strval($tab["enableReceiptWorkflow"]); $this->_workflowMode = strval($tab["workflowMode"]);
$this->_enableRevisionWorkflow = strval($tab["enableRevisionWorkflow"]); $this->_enableReceiptWorkflow = strval($tab["enableReceiptWorkflow"]);
$this->_enableRevisionOnVoteReject = strval($tab["enableRevisionOnVoteReject"]); $this->_enableRevisionWorkflow = strval($tab["enableRevisionWorkflow"]);
$this->_allowReviewerOnly = Settings::boolval($tab["allowReviewerOnly"]); $this->_enableRevisionOnVoteReject = strval($tab["enableRevisionOnVoteReject"]);
$this->_enableVersionDeletion = Settings::boolval($tab["enableVersionDeletion"]); $this->_allowReviewerOnly = Settings::boolval($tab["allowReviewerOnly"]);
$this->_enableVersionModification = Settings::boolval($tab["enableVersionModification"]); $this->_enableVersionDeletion = Settings::boolval($tab["enableVersionDeletion"]);
$this->_enableDuplicateDocNames = Settings::boolval($tab["enableDuplicateDocNames"]); $this->_enableVersionModification = Settings::boolval($tab["enableVersionModification"]);
$this->_overrideMimeType = Settings::boolval($tab["overrideMimeType"]); $this->_enableDuplicateDocNames = Settings::boolval($tab["enableDuplicateDocNames"]);
$this->_advancedAcl = Settings::boolval($tab["advancedAcl"]); $this->_overrideMimeType = Settings::boolval($tab["overrideMimeType"]);
$this->_removeFromDropFolder = Settings::boolval($tab["removeFromDropFolder"]); $this->_advancedAcl = Settings::boolval($tab["advancedAcl"]);
$this->_removeFromDropFolder = Settings::boolval($tab["removeFromDropFolder"]);
}
// XML Path: /configuration/advanced/notification // XML Path: /configuration/advanced/notification
$node = $xml->xpath('/configuration/advanced/notification'); $node = $xml->xpath('/configuration/advanced/notification');
@ -689,18 +710,20 @@ class Settings { /* {{{ */
// XML Path: /configuration/advanced/server // XML Path: /configuration/advanced/server
$node = $xml->xpath('/configuration/advanced/server'); $node = $xml->xpath('/configuration/advanced/server');
$tab = $node[0]->attributes(); if($node) {
$this->_coreDir = strval($tab["coreDir"]); $tab = $node[0]->attributes();
$this->_luceneClassDir = strval($tab["luceneClassDir"]); $this->_coreDir = strval($tab["coreDir"]);
$this->_extraPath = strval($tab["extraPath"]); $this->_luceneClassDir = strval($tab["luceneClassDir"]);
$this->_contentOffsetDir = strval($tab["contentOffsetDir"]); $this->_extraPath = strval($tab["extraPath"]);
$this->_maxDirID = intval($tab["maxDirID"]); $this->_contentOffsetDir = strval($tab["contentOffsetDir"]);
$this->_updateNotifyTime = intval($tab["updateNotifyTime"]); $this->_maxDirID = intval($tab["maxDirID"]);
$this->_cmdTimeout = intval($tab["cmdTimeout"]); $this->_updateNotifyTime = intval($tab["updateNotifyTime"]);
if (isset($tab["maxExecutionTime"])) $this->_cmdTimeout = intval($tab["cmdTimeout"]);
$this->_maxExecutionTime = intval($tab["maxExecutionTime"]); if (isset($tab["maxExecutionTime"]))
else $this->_maxExecutionTime = intval($tab["maxExecutionTime"]);
$this->_maxExecutionTime = ini_get("max_execution_time"); else
$this->_maxExecutionTime = ini_get("max_execution_time");
}
// XML Path: /configuration/system/advanced/converters // XML Path: /configuration/system/advanced/converters
$convertergroups = $xml->xpath('/configuration/advanced/converters'); $convertergroups = $xml->xpath('/configuration/advanced/converters');
@ -847,6 +870,10 @@ class Settings { /* {{{ */
$this->setXMLAttributValue($node, "libraryFolder", $this->_libraryFolder); $this->setXMLAttributValue($node, "libraryFolder", $this->_libraryFolder);
$this->setXMLAttributValue($node, "defaultDocPosition", $this->_defaultDocPosition); $this->setXMLAttributValue($node, "defaultDocPosition", $this->_defaultDocPosition);
// XML Path: /configuration/site/calendar
$node = $this->getXMLNode($xml, '/configuration/site', 'webdav');
$this->setXMLAttributValue($node, "enableWebdavReplaceDoc", $this->_enableWebdavReplaceDoc);
// XML Path: /configuration/site/calendar // XML Path: /configuration/site/calendar
$node = $this->getXMLNode($xml, '/configuration/site', 'calendar'); $node = $this->getXMLNode($xml, '/configuration/site', 'calendar');
$this->setXMLAttributValue($node, "enableCalendar", $this->_enableCalendar); $this->setXMLAttributValue($node, "enableCalendar", $this->_enableCalendar);

View File

@ -105,6 +105,9 @@ if ($action == "saveSettings")
$settings->_defaultDocPosition = $_POST["defaultDocPosition"]; $settings->_defaultDocPosition = $_POST["defaultDocPosition"];
$settings->_libraryFolder = intval($_POST["libraryFolder"]); $settings->_libraryFolder = intval($_POST["libraryFolder"]);
// SETTINGS - SITE - WEBDAV
$settings->_enableWebdavReplaceDoc = getBoolValue("enableWebdavReplaceDoc");
// SETTINGS - SITE - CALENDAR // SETTINGS - SITE - CALENDAR
$settings->_enableCalendar = getBoolValue("enableCalendar"); $settings->_enableCalendar = getBoolValue("enableCalendar");
$settings->_calendarDefaultView = $_POST["calendarDefaultView"]; $settings->_calendarDefaultView = $_POST["calendarDefaultView"];

View File

@ -427,7 +427,7 @@ function createFolder($id) { /* {{{ */
if($folder = $parent->addSubFolder($name, $comment, $userobj, 0, $newattrs)) { if($folder = $parent->addSubFolder($name, $comment, $userobj, 0, $newattrs)) {
$rec = __getFolderData($folder); $rec = __getFolderData($folder);
$app->response()->status(201); $app->response()->status(201);
$app->response()->header('Content-Type', 'application/json'); $app->response()->header('Content-Type', 'application/json');
echo json_encode(array('success'=>true, 'message'=>'', 'data'=>$rec)); echo json_encode(array('success'=>true, 'message'=>'', 'data'=>$rec));
} else { } else {
@ -747,10 +747,10 @@ function uploadDocumentFile($documentId) { /* {{{ */
$app->response()->header('Content-Type', 'application/json'); $app->response()->header('Content-Type', 'application/json');
echo json_encode(array('success'=>false, 'message'=>'No access', 'data'=>'')); echo json_encode(array('success'=>false, 'message'=>'No access', 'data'=>''));
} }
} else { } else {
if($document === null) if($document === null)
$app->response()->status(400); $app->response()->status(400);
else else
$app->response()->status(500); $app->response()->status(500);
$app->response()->header('Content-Type', 'application/json'); $app->response()->header('Content-Type', 'application/json');
echo json_encode(array('success'=>false, 'message'=>'No such document', 'data'=>'')); echo json_encode(array('success'=>false, 'message'=>'No such document', 'data'=>''));
@ -1226,6 +1226,10 @@ function doSearch() { /* {{{ */
if(!$limit = $app->request()->get('limit')) if(!$limit = $app->request()->get('limit'))
$limit = 5; $limit = 5;
$resArr = $dms->search($querystr); $resArr = $dms->search($querystr);
if($resArr === false) {
$app->response()->header('Content-Type', 'application/json');
echo json_encode(array());
}
$entries = array(); $entries = array();
$count = 0; $count = 0;
if($resArr['folders']) { if($resArr['folders']) {
@ -1377,7 +1381,7 @@ function getUsers() { /* {{{ */
$users = $dms->getAllUsers(); $users = $dms->getAllUsers();
$data = []; $data = [];
foreach($users as $u) foreach($users as $u)
$data[] = __getUserData($u); $data[] = __getUserData($u);
$app->response()->header('Content-Type', 'application/json'); $app->response()->header('Content-Type', 'application/json');
echo json_encode(array('success'=>true, 'message'=>'', 'data'=>$data)); echo json_encode(array('success'=>true, 'message'=>'', 'data'=>$data));
@ -1803,12 +1807,12 @@ function changeFolderAccess($id, $operationType, $userOrGroup) { /* {{{ */
function getCategories() { /* {{{ */ function getCategories() { /* {{{ */
global $app, $dms, $userobj; global $app, $dms, $userobj;
if(false === ($categories = $dms->getDocumentCategories())) { if(false === ($categories = $dms->getDocumentCategories())) {
$app->response()->status(500); $app->response()->status(500);
$app->response()->header('Content-Type', 'application/json'); $app->response()->header('Content-Type', 'application/json');
echo json_encode(array('success'=>false, 'message'=>'Could not get categories', 'data'=>null)); echo json_encode(array('success'=>false, 'message'=>'Could not get categories', 'data'=>null));
return; return;
} }
$data = []; $data = [];
foreach($categories as $category) foreach($categories as $category)
$data[] = ['id' => (int)$category->getId(), 'name' => $category->getName()]; $data[] = ['id' => (int)$category->getId(), 'name' => $category->getName()];

View File

@ -381,6 +381,15 @@ if(!is_writeable($settings->_configFilePath)) {
<td><?php $this->printFolderChooserHtml("form1", M_READWRITE, -1, $dms->getFolder($settings->_libraryFolder), 'libraryFolder');?></td> <td><?php $this->printFolderChooserHtml("form1", M_READWRITE, -1, $dms->getFolder($settings->_libraryFolder), 'libraryFolder');?></td>
</tr> </tr>
<!--
-- SETTINGS - SITE - WEBDAV
-->
<tr><td></td></tr><tr ><td><b> <?php printMLText("settings_webdav");?></b></td> </tr>
<tr title="<?php printMLText("settings_enableWebdavReplaceDoc_desc");?>">
<td><?php printMLText("settings_enableWebdavReplaceDoc");?>:</td>
<td><input name="enableWebdavReplaceDoc" type="checkbox" <?php if ($settings->_enableWebdavReplaceDoc) echo "checked" ?> /></td>
</tr>
<!-- <!--
-- SETTINGS - SITE - CALENDAR -- SETTINGS - SITE - CALENDAR
--> -->

View File

@ -91,7 +91,14 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
*/ */
function log_options($methode, $options) { /* {{{ */ function log_options($methode, $options) { /* {{{ */
if($this->logger) { if($this->logger) {
$this->logger->log($methode.': '.$options['path'], PEAR_LOG_INFO); switch($methode) {
case 'MOVE':
$msg = $methode.': '.$options['path'].' -> '.$options['dest'];
break;
default:
$msg = $methode.': '.$options['path'];
}
$this->logger->log($msg, PEAR_LOG_INFO);
foreach($options as $key=>$option) { foreach($options as $key=>$option) {
if(is_array($option)) { if(is_array($option)) {
$this->logger->log($methode.': '.$key.'='.var_export($option, true), PEAR_LOG_DEBUG); $this->logger->log($methode.': '.$key.'='.var_export($option, true), PEAR_LOG_DEBUG);
@ -613,7 +620,8 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
if($this->user->getID() == $lc->getUser()->getID() && if($this->user->getID() == $lc->getUser()->getID() &&
$name == $lc->getOriginalFileName() && $name == $lc->getOriginalFileName() &&
$fileType == $lc->getFileType() && $fileType == $lc->getFileType() &&
$mimetype == $lc->getMimeType()) { $mimetype == $lc->getMimeType() &&
$settings->_enableWebdavReplaceDoc) {
if($this->logger) if($this->logger)
$this->logger->log('PUT: replacing latest version', PEAR_LOG_INFO); $this->logger->log('PUT: replacing latest version', PEAR_LOG_INFO);
if(!$document->replaceContent($lc->getVersion(), $this->user, $tmpFile, $name, $fileType, $mimetype)) { if(!$document->replaceContent($lc->getVersion(), $this->user, $tmpFile, $name, $fileType, $mimetype)) {