diff --git a/CHANGELOG b/CHANGELOG index 2995346c0..6cd3c8179 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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 diff --git a/composer-dist.json b/composer-dist.json index 23a4d0311..e1a5fa567 100644 --- a/composer-dist.json +++ b/composer-dist.json @@ -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" diff --git a/composer.json b/composer.json index 50aa63c2a..95413c28c 100644 --- a/composer.json +++ b/composer.json @@ -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", diff --git a/controllers/class.EditAttributes.php b/controllers/class.EditAttributes.php index 1df2c91e6..25caf2dab 100644 --- a/controllers/class.EditAttributes.php +++ b/controllers/class.EditAttributes.php @@ -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)) diff --git a/controllers/class.EditDocument.php b/controllers/class.EditDocument.php index cd86dfedf..ea77f46da 100644 --- a/controllers/class.EditDocument.php +++ b/controllers/class.EditDocument.php @@ -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")) { diff --git a/inc/inc.ClassSettings.php b/inc/inc.ClassSettings.php index 035315d09..b086f0d08 100644 --- a/inc/inc.ClassSettings.php +++ b/inc/inc.ClassSettings.php @@ -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 diff --git a/op/op.Ajax.php b/op/op.Ajax.php index 61d58f071..76bc54570 100644 --- a/op/op.Ajax.php +++ b/op/op.Ajax.php @@ -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'); diff --git a/op/op.ExtensionMgr.php b/op/op.ExtensionMgr.php index 9df8b72b6..d67871ddd 100644 --- a/op/op.ExtensionMgr.php +++ b/op/op.ExtensionMgr.php @@ -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'))); } diff --git a/out/out.EditMarkdown.php b/out/out.EditMarkdown.php index 2ba54550d..a85c2038f 100644 --- a/out/out.EditMarkdown.php +++ b/out/out.EditMarkdown.php @@ -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")); } diff --git a/out/out.SetRecipients.php b/out/out.SetRecipients.php index 6bee9e9d2..e296cd151 100644 --- a/out/out.SetRecipients.php +++ b/out/out.SetRecipients.php @@ -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; diff --git a/views/bootstrap/class.Bootstrap.php b/views/bootstrap/class.Bootstrap.php index 2af0f5ccf..87726c1b5 100644 --- a/views/bootstrap/class.Bootstrap.php +++ b/views/bootstrap/class.Bootstrap.php @@ -1399,7 +1399,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);; break; default: if(!empty($value['addon'])) - echo ''; + echo ''; echo '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 { extensionIsDisabled('pdfviewer')) { $this->contentHeading(getMLText("preview")); ?> - - _httpRoot ?>ext/pdfviewer/res/web/viewer.html?file=_httpRoot.'op/op.ViewOnline.php?documentid='.$version->getDocument()->getID().'&version='.$version->getVersion()); ?>" width="100%" height="700px"> +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(" ".getMLText('update')); ?> @@ -169,4 +164,3 @@ class SeedDMS_View_SetRecipients extends SeedDMS_Theme_Style { $this->htmlEndPage(); } /* }}} */ } -?> diff --git a/views/bootstrap/class.SetRevisors.php b/views/bootstrap/class.SetRevisors.php index 9bef66cb0..b40af30ed 100644 --- a/views/bootstrap/class.SetRevisors.php +++ b/views/bootstrap/class.SetRevisors.php @@ -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())); } } diff --git a/views/bootstrap/class.Settings.php b/views/bootstrap/class.Settings.php index 3ad174f25..300cf02e5 100644 --- a/views/bootstrap/class.Settings.php +++ b/views/bootstrap/class.Settings.php @@ -142,8 +142,8 @@ class SeedDMS_View_Settings extends SeedDMS_Theme_Style { protected function showConfigText($title, $name, $type='', $placeholder='') { /* {{{ */ $settings = $this->params['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']; ?> - - + + > params['settings']; ?> - "> - + + > isVisible($name)) { @@ -206,8 +206,8 @@ class SeedDMS_View_Settings extends SeedDMS_Theme_Style { // var_dump($values); // echo $isass ? 'asso' : 'indexed'; ?> - "> - + + >