mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 07:22:11 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
f89011f2ee
|
@ -312,6 +312,8 @@
|
||||||
- checking of ssl certificate for smtp can be turned off
|
- checking of ssl certificate for smtp can be turned off
|
||||||
- add chart for disk space per month
|
- add chart for disk space per month
|
||||||
- clearing cache of js files works for a large number of files
|
- clearing cache of js files works for a large number of files
|
||||||
|
- WebDAV returns `quota-used-bytes` and `quota-available-bytes`
|
||||||
|
- fix settings SeedDMS attributes in WebDAV server
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
Changes in version 5.1.35
|
Changes in version 5.1.35
|
||||||
|
|
|
@ -30,6 +30,9 @@
|
||||||
"seeddms/sqlitefts": "dev-master",
|
"seeddms/sqlitefts": "dev-master",
|
||||||
"seeddms/http_webdav_server": "dev-master"
|
"seeddms/http_webdav_server": "dev-master"
|
||||||
},
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"composer/composer": "dev-main"
|
||||||
|
},
|
||||||
"repositories": [
|
"repositories": [
|
||||||
{
|
{
|
||||||
"type": "path",
|
"type": "path",
|
||||||
|
|
|
@ -57,7 +57,7 @@
|
||||||
enableLanguageSelector = "true"
|
enableLanguageSelector = "true"
|
||||||
stopWordsFile = ""
|
stopWordsFile = ""
|
||||||
sortUsersInList = ""
|
sortUsersInList = ""
|
||||||
enableDropUpload = "false"
|
enableDropUpload = "true"
|
||||||
enableRecursiveCount = "false"
|
enableRecursiveCount = "false"
|
||||||
maxRecursiveCount = "0"
|
maxRecursiveCount = "0"
|
||||||
enableThemeSelector = "true"
|
enableThemeSelector = "true"
|
||||||
|
@ -112,6 +112,7 @@
|
||||||
dropFolderDir = ""
|
dropFolderDir = ""
|
||||||
cacheDir = ""
|
cacheDir = ""
|
||||||
backupDir = ""
|
backupDir = ""
|
||||||
|
logFileMaxLevel="6"
|
||||||
/>
|
/>
|
||||||
<!--
|
<!--
|
||||||
- enableGuestLogin: If you want anybody to login as guest, set the following line to true
|
- enableGuestLogin: If you want anybody to login as guest, set the following line to true
|
||||||
|
|
|
@ -35,7 +35,7 @@ if (!$user->isAdmin()) {
|
||||||
if (isset($_POST["action"])) $action=$_POST["action"];
|
if (isset($_POST["action"])) $action=$_POST["action"];
|
||||||
else $action=NULL;
|
else $action=NULL;
|
||||||
|
|
||||||
//Neue Kategorie anlegen -----------------------------------------------------------------------------
|
// Add new category ---------------------------------------------------------
|
||||||
if ($action == "addcategory") {
|
if ($action == "addcategory") {
|
||||||
|
|
||||||
/* Check if the form data comes from a trusted request */
|
/* Check if the form data comes from a trusted request */
|
||||||
|
@ -60,7 +60,7 @@ if ($action == "addcategory") {
|
||||||
add_log_line(".php&action=addcategory&categoryid=".$categoryid);
|
add_log_line(".php&action=addcategory&categoryid=".$categoryid);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Kategorie löschen ----------------------------------------------------------------------------------
|
// Delete category ---------------------------------------------------------
|
||||||
else if ($action == "removecategory") {
|
else if ($action == "removecategory") {
|
||||||
|
|
||||||
/* Check if the form data comes from a trusted request */
|
/* Check if the form data comes from a trusted request */
|
||||||
|
@ -86,7 +86,7 @@ else if ($action == "removecategory") {
|
||||||
$categoryid=-1;
|
$categoryid=-1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Kategorie bearbeiten: Neuer Name --------------------------------------------------------------------
|
// Edit category -----------------------------------------------------------
|
||||||
else if ($action == "editcategory") {
|
else if ($action == "editcategory") {
|
||||||
|
|
||||||
/* Check if the form data comes from a trusted request */
|
/* Check if the form data comes from a trusted request */
|
||||||
|
@ -118,4 +118,3 @@ else {
|
||||||
|
|
||||||
header("Location:../out/out.Categories.php?categoryid=".$categoryid);
|
header("Location:../out/out.Categories.php?categoryid=".$categoryid);
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
|
@ -72,7 +72,9 @@ $(document).ready( function() {
|
||||||
if($conversionmgr)
|
if($conversionmgr)
|
||||||
$previewer->setConversionMgr($conversionmgr);
|
$previewer->setConversionMgr($conversionmgr);
|
||||||
foreach($documents as $doc) {
|
foreach($documents as $doc) {
|
||||||
echo $this->documentListRow($doc, $previewer);
|
$extracontent = array();
|
||||||
|
$extracontent['below_title'] = $this->getListRowPath($doc);
|
||||||
|
echo $this->documentListRow($doc, $previewer, false, 0, $extracontent);
|
||||||
}
|
}
|
||||||
print "</tbody></table>";
|
print "</tbody></table>";
|
||||||
}
|
}
|
||||||
|
@ -173,9 +175,11 @@ $(document).ready( function() {
|
||||||
<?php
|
<?php
|
||||||
$this->columnEnd();
|
$this->columnEnd();
|
||||||
$this->columnStart(6);
|
$this->columnStart(6);
|
||||||
|
echo $this->callHook('rightContentPre', $selcat);
|
||||||
?>
|
?>
|
||||||
<div class="ajax" data-view="Categories" data-action="form" <?php echo ($selcat ? "data-query=\"categoryid=".$selcat->getID()."\"" : "") ?>></div>
|
<div class="ajax" data-view="Categories" data-action="form" <?php echo ($selcat ? "data-query=\"categoryid=".$selcat->getID()."\"" : "") ?>></div>
|
||||||
<?php
|
<?php
|
||||||
|
echo $this->callHook('rightContentPost', $selcat);
|
||||||
$this->columnEnd();
|
$this->columnEnd();
|
||||||
$this->rowEnd();
|
$this->rowEnd();
|
||||||
|
|
||||||
|
|
|
@ -677,8 +677,11 @@ if(($kkk = $this->callHook('getFullSearchEngine')) && is_array($kkk))
|
||||||
echo '<a class="scrollto" data-target="#'.$extname.'">'.$extconf['title']."</a> ● ";
|
echo '<a class="scrollto" data-target="#'.$extname.'">'.$extconf['title']."</a> ● ";
|
||||||
}
|
}
|
||||||
foreach($extmgr->getExtensionConfiguration() as $extname=>$extconf) {
|
foreach($extmgr->getExtensionConfiguration() as $extname=>$extconf) {
|
||||||
if($this->hasHook('processConfig'))
|
if($this->hasHook('processConfig')) {
|
||||||
$extconf = $this->callHook('processConfig', $extname, $extconf);
|
$ttt = $this->callHook('processConfig', $extname, $extconf);
|
||||||
|
if($ttt)
|
||||||
|
$extconf = $ttt;
|
||||||
|
}
|
||||||
if($this->isVisible($extname.'|')) {
|
if($this->isVisible($extname.'|')) {
|
||||||
if($extconf['config']) {
|
if($extconf['config']) {
|
||||||
$this->showRawConfigHeadline("<a id=\"".$extname."\" name=\"".$extname."\"></a>".'<input type="hidden" name="extensions['.$extname.'][__disable__]" value="'.(isset($settings->_extensions[$extname]["__disable__"]) && $settings->_extensions[$extname]["__disable__"] ? '1' : '').'" /><i class="fa fa-circle'.(isset($settings->_extensions[$extname]["__disable__"]) && $settings->_extensions[$extname]["__disable__"] ? ' disabled' : ' enabled').'"></i> <span title="'.$extname.'">'.$extconf['title'].'</span>');
|
$this->showRawConfigHeadline("<a id=\"".$extname."\" name=\"".$extname."\"></a>".'<input type="hidden" name="extensions['.$extname.'][__disable__]" value="'.(isset($settings->_extensions[$extname]["__disable__"]) && $settings->_extensions[$extname]["__disable__"] ? '1' : '').'" /><i class="fa fa-circle'.(isset($settings->_extensions[$extname]["__disable__"]) && $settings->_extensions[$extname]["__disable__"] ? ' disabled' : ' enabled').'"></i> <span title="'.$extname.'">'.$extconf['title'].'</span>');
|
||||||
|
|
|
@ -59,6 +59,22 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
|
||||||
*/
|
*/
|
||||||
var $user = "";
|
var $user = "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disk space occupied by user
|
||||||
|
*
|
||||||
|
* @access private
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
private $diskspace;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Max disk space occupied by user
|
||||||
|
*
|
||||||
|
* @access private
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
private $quota;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set to true if original file shall be used instead of document name
|
* Set to true if original file shall be used instead of document name
|
||||||
* This can lead to duplicate file names in a directory because the original
|
* This can lead to duplicate file names in a directory because the original
|
||||||
|
@ -191,6 +207,8 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
|
||||||
$this->logger->log('check_auth: type='.$type.', user='.$user.' authenticated', PEAR_LOG_INFO);
|
$this->logger->log('check_auth: type='.$type.', user='.$user.' authenticated', PEAR_LOG_INFO);
|
||||||
|
|
||||||
$this->user = $controller->getUser();
|
$this->user = $controller->getUser();
|
||||||
|
$this->diskspace = $this->user->getUsedDiskSpace();
|
||||||
|
$this->quota = $this->user->getQuota();
|
||||||
if(!$this->user) {
|
if(!$this->user) {
|
||||||
if($this->logger) {
|
if($this->logger) {
|
||||||
$this->logger->log($controller->getErrorMsg(), PEAR_LOG_NOTICE);
|
$this->logger->log($controller->getErrorMsg(), PEAR_LOG_NOTICE);
|
||||||
|
@ -402,6 +420,9 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
|
||||||
$info["props"][] = $this->mkprop("displayname", $obj->getName());
|
$info["props"][] = $this->mkprop("displayname", $obj->getName());
|
||||||
$info["props"][] = $this->mkprop("resourcetype", "collection");
|
$info["props"][] = $this->mkprop("resourcetype", "collection");
|
||||||
$info["props"][] = $this->mkprop("getcontenttype", "httpd/unix-directory");
|
$info["props"][] = $this->mkprop("getcontenttype", "httpd/unix-directory");
|
||||||
|
$info["props"][] = $this->mkprop("quota-used-bytes", $this->diskspace);
|
||||||
|
if($this->quota)
|
||||||
|
$info["props"][] = $this->mkprop("quota-available-bytes", $this->quota-$this->diskspace);
|
||||||
} else {
|
} else {
|
||||||
// modification time
|
// modification time
|
||||||
$info["props"][] = $this->mkprop("getlastmodified",$obj->getLatestContent()->getDate());
|
$info["props"][] = $this->mkprop("getlastmodified",$obj->getLatestContent()->getDate());
|
||||||
|
@ -464,13 +485,68 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
|
||||||
if($attributes) {
|
if($attributes) {
|
||||||
foreach($attributes as $attribute) {
|
foreach($attributes as $attribute) {
|
||||||
$attrdef = $attribute->getAttributeDefinition();
|
$attrdef = $attribute->getAttributeDefinition();
|
||||||
$valueset = $attrdef->getValueSetAsArray();
|
// $fname = 'attr_'.$attrdef->getId();//str_replace(array(' ', '|'), array('', ''), $attrdef->getName());
|
||||||
if($valueset && $attrdef->getMultipleValues()) {
|
$attrregex = '/[^a-zA-ZÄäÜüÖöß0-9_-]/';
|
||||||
|
$fname = 'attr_'.preg_replace($attrregex, '', $attrdef->getName());
|
||||||
|
$isvalueset = $attrdef->getValueSet();
|
||||||
|
$ismulti = $attrdef->getMultipleValues();
|
||||||
|
$fvalue = null;
|
||||||
|
if($ismulti) {
|
||||||
|
switch($attrdef->getType()) {
|
||||||
|
case SeedDMS_Core_AttributeDefinition::type_int:
|
||||||
|
$fvalue = $attribute->getValueAsArray();
|
||||||
|
break;
|
||||||
|
case SeedDMS_Core_AttributeDefinition::type_date:
|
||||||
|
$fvalue = array_map(fn($value): int => strtotime($value), $attribute->getValueAsArray());
|
||||||
|
break;
|
||||||
|
case SeedDMS_Core_AttributeDefinition::type_document:
|
||||||
|
$fvalue = array_map(fn($value): string => $value->getName(), $attribute->getValueAsArray());
|
||||||
|
break;
|
||||||
|
case SeedDMS_Core_AttributeDefinition::type_folder:
|
||||||
|
$fvalue = array_map(fn($value): string => $value->getName(), $attribute->getValueAsArray());
|
||||||
|
break;
|
||||||
|
case SeedDMS_Core_AttributeDefinition::type_user:
|
||||||
|
$fvalue = array_map(fn($value): string => $value->getFullName(), $attribute->getValueAsArray());
|
||||||
|
break;
|
||||||
|
case SeedDMS_Core_AttributeDefinition::type_group:
|
||||||
|
$fvalue = array_map(fn($value): string => $value->getName(), $attribute->getValueAsArray());
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$fvalue = $attribute->getValue();
|
||||||
|
}
|
||||||
$valuesetstr = $attrdef->getValueSet();
|
$valuesetstr = $attrdef->getValueSet();
|
||||||
$delimiter = substr($valuesetstr, 0, 1);
|
$delimiter = substr($valuesetstr, 0, 1);
|
||||||
$info["props"][] = $this->mkprop("SeedDMS:", 'attr_'.str_replace(array(' ', '|'), array('', ''), $attrdef->getName()), $delimiter.implode($delimiter, $attribute->getValueAsArray()));
|
$fvalue = $delimiter.implode($delimiter, $fvalue);
|
||||||
} else
|
} else {
|
||||||
$info["props"][] = $this->mkprop("SeedDMS:", 'attr_'.str_replace(array(' ','|'), array('', '',''), $attrdef->getName()), $attribute->getValue());
|
switch($attrdef->getType()) {
|
||||||
|
case SeedDMS_Core_AttributeDefinition::type_int:
|
||||||
|
$fvalue = (int) $attribute->getValue();
|
||||||
|
break;
|
||||||
|
case SeedDMS_Core_AttributeDefinition::type_date:
|
||||||
|
$fvalue = strtotime($attribute->getValue());
|
||||||
|
break;
|
||||||
|
case SeedDMS_Core_AttributeDefinition::type_document:
|
||||||
|
$fvalue = $attribute->getValue()->getName();
|
||||||
|
break;
|
||||||
|
case SeedDMS_Core_AttributeDefinition::type_folder:
|
||||||
|
$fvalue = $attribute->getValue()->getName();
|
||||||
|
break;
|
||||||
|
case SeedDMS_Core_AttributeDefinition::type_user:
|
||||||
|
$fvalue = $attribute->getValue()->getFullName();
|
||||||
|
break;
|
||||||
|
case SeedDMS_Core_AttributeDefinition::type_group:
|
||||||
|
$fvalue = $attribute->getValue()->getName();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$fvalue = $attribute->getValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if($fvalue) {
|
||||||
|
// if($this->logger) {
|
||||||
|
// $this->logger->log('Adding property '.$fname." = ".$fvalue, PEAR_LOG_INFO);
|
||||||
|
// }
|
||||||
|
$info["props"][] = $this->mkprop("SeedDMS:", $fname, $fvalue);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user