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

This commit is contained in:
Uwe Steinmann 2025-12-16 08:28:01 +01:00
commit 2baf52738a
20 changed files with 89 additions and 44 deletions

View File

@ -371,6 +371,8 @@
- use table sorter on clear cache page and conversion services page
- droping an url in the drag&drop area will download the url
- add button to all password fields to make password visible
- fix formatting of date input fields
- do not remove custom attributes which were not set when editing attributes
--------------------------------------------------------------------------------
Changes in version 5.1.42

View File

@ -72,7 +72,8 @@
"symfony/console": "^7.2",
"twig/twig": "^3.0",
"league/commonmark": "^2.7",
"symfony/process": "^7.3"
"symfony/process": "^7.3",
"symfony/http-client": "^7.4"
},
"require-dev": {
"composer/composer": "dev-main"

View File

@ -75,7 +75,8 @@
"symfony/console": "^7.2",
"twig/twig": "^3.0",
"league/commonmark": "^2.7",
"symfony/process": "^7.3"
"symfony/process": "^7.3",
"symfony/http-client": "^7.4"
},
"require-dev": {
"composer/composer": "dev-main",

View File

@ -83,7 +83,6 @@ class SeedDMS_Controller_EditAttributes extends SeedDMS_Controller_Common {
if(!isset($oldattributes[$attrdefid]) || $attribute != $oldattributes[$attrdefid]->getValue()) {
if(!$version->setAttributeValue($dms->getAttributeDefinition($attrdefid), $attribute)) {
//UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("error_occured"));
return false;
}
}
@ -92,7 +91,6 @@ class SeedDMS_Controller_EditAttributes extends SeedDMS_Controller_Common {
return false;
} elseif(isset($oldattributes[$attrdefid])) {
if(!$version->removeAttribute($dms->getAttributeDefinition($attrdefid)))
// UI::exitError(getMLText("document_title", array("documentname" => $folder->getName())),getMLText("error_occured"));
return false;
}
} else {
@ -102,12 +100,14 @@ class SeedDMS_Controller_EditAttributes extends SeedDMS_Controller_Common {
}
}
}
/* Do not remove any old attributes if they have not be set by the form
foreach($oldattributes as $attrdefid=>$oldattribute) {
if(!isset($attributes[$attrdefid])) {
if(!$version->removeAttribute($dms->getAttributeDefinition($attrdefid)))
return false;
}
}
*/
} elseif($result === false) {
if(empty($this->errormsg))

View File

@ -174,12 +174,14 @@ class SeedDMS_Controller_EditDocument extends SeedDMS_Controller_Common {
}
}
}
/* Do not remove any old attributes if they have not be set by the form
foreach($oldattributes as $attrdefid=>$oldattribute) {
if(!isset($attributes[$attrdefid])) {
if(!$document->removeAttribute($dms->getAttributeDefinition($attrdefid)))
return false;
}
}
*/
$sequence = $this->params['sequence'];
if(strcasecmp($sequence, "keep")) {

View File

@ -211,7 +211,7 @@ class Settings { /* {{{ */
// enable/disable listing logged in user as recipient
var $_enableSelfReceipt = false;
// enable/disable hidden user as recipient
var $_enableHiddenReceipt = true;
var $_enableHiddenReceipt = false;
// enable/disable update of a receipt by the recipient
var $_enableUpdateReceipt = false;
// enable/disable listing administrator as recipient

View File

@ -30,6 +30,7 @@ require_once("../inc/inc.ClassController.php");
require_once("../inc/inc.Notification.php");
use Seeddms\Seeddms\Session;
use Seeddms\Seeddms\Utilities;
require_once("../inc/inc.ClassSession.php");
require_once("../inc/inc.ClassPasswordStrength.php");
@ -105,6 +106,12 @@ switch($command) {
}
break; /* }}} */
case 'randomstring': /* {{{ */
$len = $_REQUEST["len"] ?? 16;
header('Content-Type: application/json');
echo json_encode(array('success'=>true, 'string'=>Utilities::makeRandomString($len)));
break; /* }}} */
case 'sessioninfo': /* {{{ */
if($user) {
header('Content-Type: application/json');

View File

@ -157,10 +157,11 @@ elseif ($action == "toggle") { /* {{{ */
else {
$ret = $extmgr->migrate($extname, $settings, $dms, $logger);
if($ret !== null) {
if($ret === true)
if($ret === true) {
echo json_encode(array('success'=>true, 'msg'=>getMLText('extension_migration_success')));
else
} else {
echo json_encode(array('success'=>false, 'msg'=>getMLText('extension_migration_error')));
}
} else {
echo json_encode(array('success'=>true, 'msg'=>getMLText('extension_is_on_now')));
}

View File

@ -79,7 +79,7 @@ if (!isset($settings->_editOnlineFileTypes) || !is_array($settings->_editOnlineF
*/
/* Create object for checking access to certain operations */
$accessop = new SeedDMS_AccessOperation($dms, $document, $user, $settings);
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
if(!$accessop->mayEditVersion($version)) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("access_denied"));
}

View File

@ -72,6 +72,7 @@ if($view) {
$view->setParam('enableownerreceipt', $settings->_enableOwnerReceipt);
$view->setParam('enableadminreceipt', $settings->_enableAdminReceipt);
$view->setParam('enablehiddenreceipt', $settings->_enableHiddenReceipt);
$view->setParam('enableselfreceipt', $settings->_enableSelfReceipt);
$view->setParam('accessobject', $accessop);
$view($_GET);
exit;

View File

@ -1399,7 +1399,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
break;
default:
if(!empty($value['addon']))
echo '<span class="input-append'.($value["type"]=='password' ? ' show-hide-password' : '').'">';
echo '<span class="input-append'.($value["type"]=='password' ? ' show-hide-password' : '').' '.substr(md5($value['addon']), 0, 6).'">';
echo '<input'.
(!empty($value['type']) ? ' type="'.$value['type'].'"' : '').
(!empty($value['id']) ? ' id="'.$value['id'].'"' : '').

View File

@ -83,6 +83,7 @@ class SeedDMS_View_DocumentVersionDetail extends SeedDMS_Theme_Style {
function preview() { /* {{{ */
$dms = $this->params['dms'];
$settings = $this->params['settings'];
$document = $this->params['document'];
$timeout = $this->params['timeout'];
$xsendfile = $this->params['xsendfile'];
@ -128,10 +129,12 @@ class SeedDMS_View_DocumentVersionDetail extends SeedDMS_Theme_Style {
<?php
break;
case 'application/pdf':
if (!$settings->extensionIsDisabled('pdfviewer')) {
$this->contentHeading(getMLText("preview"));
?>
<iframe src="../pdfviewer/web/viewer.html?file=<?php echo urlencode('../../op/op.ViewOnline.php?documentid='.$version->getDocument()->getID().'&version='.$version->getVersion()); ?>" width="100%" height="700px"></iframe>
<?php
<iframe src="<?= $settings->_httpRoot ?>ext/pdfviewer/res/web/viewer.html?file=<?= urlencode(getBaseUrl().$settings->_httpRoot.'op/op.ViewOnline.php?documentid='.$version->getDocument()->getID().'&version='.$version->getVersion()); ?>" width="100%" height="700px"></iframe>
<?php
}
break;
case 'image/svg+xml':
case 'image/jpg':

View File

@ -13,11 +13,6 @@
* @version Release: @package_version@
*/
/**
* Include parent class
*/
//require_once("class.Bootstrap.php");
/**
* Class which outputs the html page for SetRecipients view
*
@ -37,8 +32,9 @@ class SeedDMS_View_SetRecipients extends SeedDMS_Theme_Style {
$folder = $this->params['folder'];
$document = $this->params['document'];
$content = $this->params['version'];
$enableownerreceipt = $this->params['enableownerreceipt'];
$enableadminreceipt = $this->params['enableadminreceipt'];
$enableownerreceipt = $this->params['enableownerreceipt'];
$enableselfreceipt = $this->params['enableselfreceipt'];
$enablehiddenreceipt = $this->params['enablehiddenreceipt'];
$overallStatus = $content->getStatus();
@ -90,7 +86,8 @@ class SeedDMS_View_SetRecipients extends SeedDMS_Theme_Style {
break;
}
} else {
if(!$enablehiddenreceipt && $usr->isHidden()) continue;
if (!$enableselfreceipt && $usr->getID()==$user->getID()) continue;
if (!$enablehiddenreceipt && $usr->isHidden()) continue;
$options[] = array($usr->getID(), htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName()));
}
}
@ -106,7 +103,6 @@ class SeedDMS_View_SetRecipients extends SeedDMS_Theme_Style {
'options'=>$options
)
);
$options = [];
foreach ($docAccess["groups"] as $group) {
$optopt = [];
@ -159,7 +155,6 @@ class SeedDMS_View_SetRecipients extends SeedDMS_Theme_Style {
'options'=>$options
)
);
$this->contentContainerEnd();
$this->formSubmit("<i class=\"fa fa-save\"></i> ".getMLText('update'));
?>
@ -169,4 +164,3 @@ class SeedDMS_View_SetRecipients extends SeedDMS_Theme_Style {
$this->htmlEndPage();
} /* }}} */
}
?>

View File

@ -124,7 +124,7 @@ runValidation();
}
} else {
if (!$enableselfrevapp && $usr->getID()==$user->getID()) continue;
if(!$enablehiddenrevapp && $usr->isHidden()) continue;
if (!$enablehiddenrevapp && $usr->isHidden()) continue;
$options[] = array($usr->getID(), htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName()));
}
}

View File

@ -142,8 +142,8 @@ class SeedDMS_View_Settings extends SeedDMS_Theme_Style {
protected function showConfigText($title, $name, $type='', $placeholder='') { /* {{{ */
$settings = $this->params['settings'];
?>
<tr title="<?= getMLText($title."_desc") ?>">
<td><?= getMLText($title) ?></td>
<tr>
<td <?= 'title="'.getMLText($title."_desc").'" style="cursor: help;"' ?>><?= getMLText($title) ?></td>
<?php
if($type === 'array')
$value = $settings->arrayToString($settings->{"_".$name});
@ -169,8 +169,8 @@ class SeedDMS_View_Settings extends SeedDMS_Theme_Style {
protected function showConfigPlain($title, $title_desc, $rawdata) { /* {{{ */
$settings = $this->params['settings'];
?>
<tr title="<?= htmlspecialchars($title_desc) ?>">
<td><?= $title ?></td>
<tr>
<td <?= ($title_desc ? 'title="'.htmlspecialchars($title_desc).'" style="cursor: help;"' : '') ?>><?= $title ?></td>
<td><?= $rawdata ?></td>
</tr>
<?php
@ -185,8 +185,8 @@ class SeedDMS_View_Settings extends SeedDMS_Theme_Style {
protected function showConfigCheckbox($title, $name) { /* {{{ */
$settings = $this->params['settings'];
?>
<tr title="<?= getMLText($title."_desc") ?>">
<td><?= getMLText($title) ?></td>
<tr>
<td <?= 'title="'.getMLText($title."_desc").'" style="cursor: help;"' ?>><?= getMLText($title) ?></td>
<td>
<?php
if($this->isVisible($name)) {
@ -206,8 +206,8 @@ class SeedDMS_View_Settings extends SeedDMS_Theme_Style {
// var_dump($values);
// echo $isass ? 'asso' : 'indexed';
?>
<tr title="<?= getMLText($title."_desc") ?>">
<td><?= getMLText($title) ?></td>
<tr>
<td <?= 'title="'.getMLText($title."_desc").'" style="cursor: help;"' ?>><?= getMLText($title) ?></td>
<td>
<?php if($multiple) { ?>
<select class="chzn-select form-control" style="width: 100%;" name="<?= $name ?>[]" multiple>
@ -232,8 +232,8 @@ class SeedDMS_View_Settings extends SeedDMS_Theme_Style {
$settings = $this->params['settings'];
$dms = $this->params['dms'];
?>
<tr title="<?= getMLText($title."_desc") ?>">
<td><?= getMLText($title) ?></td>
<tr>
<td <?= 'title="'.getMLText($title."_desc").'" style="cursor: help;"' ?>><?= getMLText($title) ?></td>
<td>
<?php
$users = $dms->getAllUsers();
@ -263,8 +263,8 @@ class SeedDMS_View_Settings extends SeedDMS_Theme_Style {
$settings = $this->params['settings'];
$dms = $this->params['dms'];
?>
<tr title="<?= getMLText($title."_desc") ?>">
<td><?= getMLText($title) ?></td>
<tr>
<td <?= 'title="'.getMLText($title."_desc").'" style="cursor: help;"' ?>><?= getMLText($title) ?></td>
<td>
<?php
if(is_array($settings->{"_".$name}))
@ -292,8 +292,8 @@ class SeedDMS_View_Settings extends SeedDMS_Theme_Style {
$settings = $this->params['settings'];
$dms = $this->params['dms'];
?>
<tr title="<?= getMLText($title."_desc") ?>">
<td><?= getMLText($title) ?></td>
<tr>
<td <?= 'title="'.getMLText($title."_desc").'" style="cursor: help;"' ?>><?= getMLText($title) ?></td>
<td>
<?php
$groups = $dms->getAllGroups();
@ -323,8 +323,8 @@ class SeedDMS_View_Settings extends SeedDMS_Theme_Style {
$settings = $this->params['settings'];
$dms = $this->params['dms'];
?>
<tr title="<?= getMLText($title."_desc") ?>">
<td><?= getMLText($title) ?>:</td>
<tr>
<td <?= 'title="'.getMLText($title."_desc").'" style="cursor: help;"' ?>><?= getMLText($title) ?></td>
<td>
<?php $this->printFolderChooserHtml($name, M_READWRITE, -1, $dms->getFolder($settings->{"_".$name}), $name);?>
</td>
@ -786,7 +786,7 @@ if(($kkk = $this->callHook('getFullSearchEngine')) && is_array($kkk))
<?php $this->showConfigUser('settings_autoLoginUser', 'autoLoginUser', true); ?>
<?php $this->showConfigText('settings_quota', 'quota'); ?>
<?php $this->showConfigUser('settings_undelUserIds', 'undelUserIds', true, true); ?>
<?php $this->showConfigText('settings_encryptionKey', 'encryptionKey'); ?>
<?php $this->showConfigText('settings_encryptionKey', 'encryptionKey', 'password'); ?>
<?php $this->showConfigText('settings_cookieLifetime', 'cookieLifetime'); ?>
<?php $this->showConfigOption('settings_defaultAccessDocs', 'defaultAccessDocs', array(' 0'=>'inherited', ' '.M_NONE=>'access_mode_none', ' '.M_READ=>'access_mode_read', ' '.M_READWRITE=>'access_mode_readwrite'), false, true); ?>

View File

@ -692,12 +692,14 @@ $(document).ready( function() {
<?php
break;
case 'application/pdf':
if (!$settings->extensionIsDisabled('pdfviewer')) {
$this->contentHeading(getMLText("preview"));
?>
<div style="width:100%; height: 0; position:relative; padding-top: 141%;">
<iframe src="<?= $settings->_httpRoot ?>ext/pdfviewer/res/web/viewer.html?file=<?php echo urlencode($settings->_httpRoot.'op/op.ViewOnline.php?documentid='.$latestContent->getDocument()->getID().'&version='.$latestContent->getVersion()); ?>" _width="100%" _height="100%" style="position: absolute; top: 0; left: 0; bottom: 0; right: 0; width: 100%; height: 100%"></iframe>
<iframe src="<?= $settings->_httpRoot ?>ext/pdfviewer/res/web/viewer.html?file=<?php echo urlencode(getBaseUrl().$settings->_httpRoot.'op/op.ViewOnline.php?documentid='.$latestContent->getDocument()->getID().'&version='.$latestContent->getVersion()); ?>" _width="100%" _height="100%" style="position: absolute; top: 0; left: 0; bottom: 0; right: 0; width: 100%; height: 100%"></iframe>
</div>
<?php
}
break;
case 'image/svg+xml':
case 'image/jpg':
@ -732,7 +734,7 @@ $(document).ready( function() {
$this->contentHeading(getMLText("preview_pdf"));
?>
<div style="width:100%; height: 0; position:relative; padding-top: 141%;">
<iframe src="<?= $settings->_httpRoot ?>ext/pdfviewer/res/web/viewer.html?file=<?php echo urlencode($settings->_httpRoot.'op/op.PdfPreview.php?documentid='.$latestContent->getDocument()->getID().'&version='.$latestContent->getVersion()); ?>" _width="100%" _height="700px" style="position: absolute; top: 0; left: 0; bottom: 0; right: 0; width: 100%; height: 100%"></iframe>
<iframe src="<?= $settings->_httpRoot ?>ext/pdfviewer/res/web/viewer.html?file=<?php echo urlencode(getBaseUrl().$settings->_httpRoot.'op/op.PdfPreview.php?documentid='.$latestContent->getDocument()->getID().'&version='.$latestContent->getVersion()); ?>" _width="100%" _height="700px" style="position: absolute; top: 0; left: 0; bottom: 0; right: 0; width: 100%; height: 100%"></iframe>
</div>
<?php
}

View File

@ -385,6 +385,21 @@ $(document).ready( function() {
}
}); /* }}} */
$('body').on('click', 'div.8cf73c span', function(ev) { /* {{{ */
ev.preventDefault();
closest = $(this).closest('div.8cf73c');
$.get(seeddms_webroot+'op/op.Ajax.php',
{ command: 'randomstring', len: 16 },
function(data) {
if(data.success) {
input = closest.children(":first");
input.val(data.string);
}
},
'json'
);
}); /* }}} */
$('body').on('touchstart.dropdown', '.dropdown-menu', function (e) { e.stopPropagation(); });
initMost();

View File

@ -1253,8 +1253,8 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
echo ' '.$a[0].'="'.$a[1].'"';
echo ">";
if(isset($value['options']) && is_array($value['options'])) {
if($allowempty)
echo "<option value=\"\"></option>";
// if($allowempty)
// echo "<option value=\"\"></option>";
foreach($value['options'] as $val) {
if(is_string($val)) {
echo '<optgroup label="'.$val.'">';
@ -1308,7 +1308,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
break;
default:
if(!empty($value['addon']))
echo '<div class="input-group date'.($value["type"]=='password' ? ' show-hide-password' : '').'">';
echo '<div class="input-group'.($value["type"]=='password' ? ' show-hide-password' : '').' '.substr(md5($value['addon']), 0, 6).'">';
echo '<input'.
(!empty($value['type']) ? ' type="'.$value['type'].'"' : '').
(!empty($value['id']) ? ' id="'.$value['id'].'"' : '').

View File

@ -291,6 +291,7 @@ a.accordion2-toggle:focus, a.accordion2-toggle:hover {
}
.datepicker {
border-radius: 0px;
padding: 0.375rem 0.75rem;
}
span.datepicker {
padding: 0px;

View File

@ -419,6 +419,21 @@ $(document).ready( function() {
}
}); /* }}} */
$('body').on('click', 'div.8cf73c span', function(ev) { /* {{{ */
ev.preventDefault();
closest = $(this).closest('div.8cf73c');
$.get(seeddms_webroot+'op/op.Ajax.php',
{ command: 'randomstring', len: 16 },
function(data) {
if(data.success) {
input = closest.children(":first");
input.val(data.string);
}
},
'json'
);
}); /* }}} */
// $('body').on('touchstart.dropdown', '.dropdown-menu', function (e) { e.stopPropagation(); });
initMost();