mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-12 20:51:30 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
0199019ee6
|
@ -2210,12 +2210,16 @@ class SeedDMS_Core_DMS {
|
|||
|
||||
// Send the complete search query to the database.
|
||||
$resArr = $this->db->getResultArray($searchQuery);
|
||||
if($resArr === false)
|
||||
return false;
|
||||
} else {
|
||||
$resArr = array();
|
||||
}
|
||||
} else {
|
||||
// Send the complete search query to the database.
|
||||
$resArr = $this->db->getResultArray($searchQuery);
|
||||
if($resArr === false)
|
||||
return false;
|
||||
}
|
||||
|
||||
// ------------------- Ausgabe der Ergebnisse ----------------------------
|
||||
|
|
|
@ -1582,6 +1582,23 @@ add lots of DocBlocks from merge request #8
|
|||
add SeedDMS_Core_AttributeDefinition::removeValue()
|
||||
</notes>
|
||||
</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>
|
||||
<date>2017-02-28</date>
|
||||
<time>06:34:50</time>
|
||||
|
|
|
@ -71,6 +71,9 @@
|
|||
calendarDefaultView = "y"
|
||||
firstDayOfWeek = "0"
|
||||
/>
|
||||
<webdav
|
||||
enableWebdavReplaceDoc="true"
|
||||
/>
|
||||
</site>
|
||||
<system>
|
||||
<!--
|
||||
|
|
|
@ -13,17 +13,45 @@ and its content, while a file system knows just files.
|
|||
In SeedDMS a document is uniquely identified
|
||||
by its document id and not neccessarily by its name. A filesystem
|
||||
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
|
||||
this, you should always disallow identical document names in the
|
||||
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
|
||||
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
|
||||
nasty side effects when you often save a file, because any save
|
||||
operation will create a new version. This is because the WebDAV
|
||||
server replaces the content of document instead of creating a new
|
||||
version if a document is saved again.
|
||||
nasty side effects when you edit a document version via WebDAV and
|
||||
often save it, because any save
|
||||
operation will create a new version. This is why the WebDAV
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
is saved a backup is created and the new content is written into a new
|
||||
file with the name of the original file. On a file system you
|
||||
won't see a difference between the file before and after saveing, though
|
||||
is actually a new one. In SeedDMS you won't notice a difference either
|
||||
if just looking at the document name. It's still the same, but the
|
||||
is saved a backup is created by renaming the file to the same name with a
|
||||
'~' at the end and writing the file content into a new
|
||||
file with the name of the original file. Afterwards vim deleteѕ the backup
|
||||
file. On a regular file system you
|
||||
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
|
||||
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
|
||||
to not create the backup. Creating the backup file in a directory
|
||||
outside of WebDAV doesn't help in this case.
|
||||
to not create the backup file. You can do that by either passing additional
|
||||
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'.
|
||||
|
|
|
@ -204,6 +204,8 @@ class Settings { /* {{{ */
|
|||
var $_maxUploadSize = 0;
|
||||
// enable/disable users images
|
||||
var $_enableUserImage = false;
|
||||
// enable/disable replacing documents by webdav
|
||||
var $_enableWebdavReplaceDoc = true;
|
||||
// enable/disable calendar
|
||||
var $_enableCalendar = true;
|
||||
// calendar default view ("w" for week,"m" for month,"y" for year)
|
||||
|
@ -509,15 +511,25 @@ class Settings { /* {{{ */
|
|||
$this->_libraryFolder = intval($tab["libraryFolder"]);
|
||||
$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
|
||||
$node = $xml->xpath('/configuration/site/calendar');
|
||||
if($node) {
|
||||
$tab = $node[0]->attributes();
|
||||
$this->_enableCalendar = Settings::boolVal($tab["enableCalendar"]);
|
||||
$this->_calendarDefaultView = strval($tab["calendarDefaultView"]);
|
||||
$this->_firstDayOfWeek = intval($tab["firstDayOfWeek"]);
|
||||
}
|
||||
|
||||
// XML Path: /configuration/system/server
|
||||
$node = $xml->xpath('/configuration/system/server');
|
||||
if($node) {
|
||||
$tab = $node[0]->attributes();
|
||||
$this->_rootDir = strval($tab["rootDir"]);
|
||||
$this->_httpRoot = strval($tab["httpRoot"]);
|
||||
|
@ -559,6 +571,7 @@ class Settings { /* {{{ */
|
|||
$this->_restricted = Settings::boolVal($tab["restricted"]);
|
||||
$this->_enableUserImage = Settings::boolVal($tab["enableUserImage"]);
|
||||
$this->_disableSelfEdit = Settings::boolVal($tab["disableSelfEdit"]);
|
||||
}
|
||||
|
||||
// XML Path: /configuration/system/authentication/connectors/connector
|
||||
// attributs mandatories : type enable
|
||||
|
@ -604,6 +617,7 @@ class Settings { /* {{{ */
|
|||
|
||||
// XML Path: /configuration/system/database
|
||||
$node = $xml->xpath('/configuration/system/database');
|
||||
if($node) {
|
||||
$tab = $node[0]->attributes();
|
||||
$this->_dbDriver = strval($tab["dbDriver"]);
|
||||
$this->_dbHostname = strval($tab["dbHostname"]);
|
||||
|
@ -611,6 +625,7 @@ class Settings { /* {{{ */
|
|||
$this->_dbUser = strval($tab["dbUser"]);
|
||||
$this->_dbPass = strval($tab["dbPass"]);
|
||||
$this->_doNotCheckDBVersion = Settings::boolVal($tab["doNotCheckDBVersion"]);
|
||||
}
|
||||
|
||||
// XML Path: /configuration/system/smtp
|
||||
$node = $xml->xpath('/configuration/system/smtp');
|
||||
|
@ -639,20 +654,25 @@ class Settings { /* {{{ */
|
|||
|
||||
// XML Path: /configuration/advanced/display
|
||||
$node = $xml->xpath('/configuration/advanced/display');
|
||||
if($node) {
|
||||
$tab = $node[0]->attributes();
|
||||
$this->_siteDefaultPage = strval($tab["siteDefaultPage"]);
|
||||
$this->_rootFolderID = intval($tab["rootFolderID"]);
|
||||
$this->_titleDisplayHack = Settings::boolval($tab["titleDisplayHack"]);
|
||||
$this->_showMissingTranslations = Settings::boolval($tab["showMissingTranslations"]);
|
||||
}
|
||||
|
||||
// XML Path: /configuration/advanced/authentication
|
||||
$node = $xml->xpath('/configuration/advanced/authentication');
|
||||
if($node) {
|
||||
$tab = $node[0]->attributes();
|
||||
$this->_guestID = intval($tab["guestID"]);
|
||||
$this->_adminIP = strval($tab["adminIP"]);
|
||||
}
|
||||
|
||||
// XML Path: /configuration/advanced/edition
|
||||
$node = $xml->xpath('/configuration/advanced/edition');
|
||||
if($node) {
|
||||
$tab = $node[0]->attributes();
|
||||
$this->_enableAdminRevApp = Settings::boolval($tab["enableAdminRevApp"]);
|
||||
$this->_enableOwnerRevApp = Settings::boolval($tab["enableOwnerRevApp"]);
|
||||
|
@ -677,6 +697,7 @@ class Settings { /* {{{ */
|
|||
$this->_overrideMimeType = Settings::boolval($tab["overrideMimeType"]);
|
||||
$this->_advancedAcl = Settings::boolval($tab["advancedAcl"]);
|
||||
$this->_removeFromDropFolder = Settings::boolval($tab["removeFromDropFolder"]);
|
||||
}
|
||||
|
||||
// XML Path: /configuration/advanced/notification
|
||||
$node = $xml->xpath('/configuration/advanced/notification');
|
||||
|
@ -689,6 +710,7 @@ class Settings { /* {{{ */
|
|||
|
||||
// XML Path: /configuration/advanced/server
|
||||
$node = $xml->xpath('/configuration/advanced/server');
|
||||
if($node) {
|
||||
$tab = $node[0]->attributes();
|
||||
$this->_coreDir = strval($tab["coreDir"]);
|
||||
$this->_luceneClassDir = strval($tab["luceneClassDir"]);
|
||||
|
@ -701,6 +723,7 @@ class Settings { /* {{{ */
|
|||
$this->_maxExecutionTime = intval($tab["maxExecutionTime"]);
|
||||
else
|
||||
$this->_maxExecutionTime = ini_get("max_execution_time");
|
||||
}
|
||||
|
||||
// XML Path: /configuration/system/advanced/converters
|
||||
$convertergroups = $xml->xpath('/configuration/advanced/converters');
|
||||
|
@ -847,6 +870,10 @@ class Settings { /* {{{ */
|
|||
$this->setXMLAttributValue($node, "libraryFolder", $this->_libraryFolder);
|
||||
$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
|
||||
$node = $this->getXMLNode($xml, '/configuration/site', 'calendar');
|
||||
$this->setXMLAttributValue($node, "enableCalendar", $this->_enableCalendar);
|
||||
|
|
|
@ -105,6 +105,9 @@ if ($action == "saveSettings")
|
|||
$settings->_defaultDocPosition = $_POST["defaultDocPosition"];
|
||||
$settings->_libraryFolder = intval($_POST["libraryFolder"]);
|
||||
|
||||
// SETTINGS - SITE - WEBDAV
|
||||
$settings->_enableWebdavReplaceDoc = getBoolValue("enableWebdavReplaceDoc");
|
||||
|
||||
// SETTINGS - SITE - CALENDAR
|
||||
$settings->_enableCalendar = getBoolValue("enableCalendar");
|
||||
$settings->_calendarDefaultView = $_POST["calendarDefaultView"];
|
||||
|
|
|
@ -1226,6 +1226,10 @@ function doSearch() { /* {{{ */
|
|||
if(!$limit = $app->request()->get('limit'))
|
||||
$limit = 5;
|
||||
$resArr = $dms->search($querystr);
|
||||
if($resArr === false) {
|
||||
$app->response()->header('Content-Type', 'application/json');
|
||||
echo json_encode(array());
|
||||
}
|
||||
$entries = array();
|
||||
$count = 0;
|
||||
if($resArr['folders']) {
|
||||
|
|
|
@ -381,6 +381,15 @@ if(!is_writeable($settings->_configFilePath)) {
|
|||
<td><?php $this->printFolderChooserHtml("form1", M_READWRITE, -1, $dms->getFolder($settings->_libraryFolder), 'libraryFolder');?></td>
|
||||
</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
|
||||
-->
|
||||
|
|
|
@ -91,7 +91,14 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
|
|||
*/
|
||||
function log_options($methode, $options) { /* {{{ */
|
||||
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) {
|
||||
if(is_array($option)) {
|
||||
$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() &&
|
||||
$name == $lc->getOriginalFileName() &&
|
||||
$fileType == $lc->getFileType() &&
|
||||
$mimetype == $lc->getMimeType()) {
|
||||
$mimetype == $lc->getMimeType() &&
|
||||
$settings->_enableWebdavReplaceDoc) {
|
||||
if($this->logger)
|
||||
$this->logger->log('PUT: replacing latest version', PEAR_LOG_INFO);
|
||||
if(!$document->replaceContent($lc->getVersion(), $this->user, $tmpFile, $name, $fileType, $mimetype)) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user