diff --git a/CHANGELOG b/CHANGELOG index 9efb58ace..487b72bd4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -363,6 +363,7 @@ - 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/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/views/bootstrap/class.Bootstrap.php b/views/bootstrap/class.Bootstrap.php index 31d59d7dd..33fe6f5d1 100644 --- a/views/bootstrap/class.Bootstrap.php +++ b/views/bootstrap/class.Bootstrap.php @@ -1388,7 +1388,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);; break; default: if(!empty($value['addon'])) - echo ''; + echo ''; echo 'callHook('getFullSearchEngine')) && is_array($kkk)) showConfigUser('settings_autoLoginUser', 'autoLoginUser', true); ?> showConfigText('settings_quota', 'quota'); ?> showConfigUser('settings_undelUserIds', 'undelUserIds', true, true); ?> -showConfigText('settings_encryptionKey', 'encryptionKey'); ?> +showConfigText('settings_encryptionKey', 'encryptionKey', 'password'); ?> showConfigText('settings_cookieLifetime', 'cookieLifetime'); ?> showConfigOption('settings_defaultAccessDocs', 'defaultAccessDocs', array(' 0'=>'inherited', ' '.M_NONE=>'access_mode_none', ' '.M_READ=>'access_mode_read', ' '.M_READWRITE=>'access_mode_readwrite'), false, true); ?> diff --git a/views/bootstrap/styles/application.js b/views/bootstrap/styles/application.js index 8f32d9bf6..304cd5831 100644 --- a/views/bootstrap/styles/application.js +++ b/views/bootstrap/styles/application.js @@ -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(); diff --git a/views/bootstrap4/class.Bootstrap4.php b/views/bootstrap4/class.Bootstrap4.php index 1a9e0835f..f40b52358 100644 --- a/views/bootstrap4/class.Bootstrap4.php +++ b/views/bootstrap4/class.Bootstrap4.php @@ -1299,7 +1299,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);; break; default: if(!empty($value['addon'])) - echo '
'; + echo '
'; echo '