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

This commit is contained in:
Uwe Steinmann 2022-03-09 08:39:34 +01:00
commit b88e05fe22
3 changed files with 18 additions and 2 deletions

View File

@ -793,13 +793,21 @@ switch($command) {
$workflow = $user->getMandatoryWorkflow();
}
$expires = false;
if($settings->_presetExpirationDate) {
$expires = strtotime($settings->_presetExpirationDate);
}
$keywords = isset($_POST["keywords"]) ? trim($_POST["keywords"]) : '';
$categories = isset($_POST["categories"]) ? $_POST["categories"] : null;
$cats = array();
if($categories) {
foreach($categories as $catid) {
if($cat = $dms->getDocumentCategory($catid))
$cats[] = $cat;
}
}
$controller = Controller::factory('AddDocument', array('dms'=>$dms, 'user'=>$user));
$controller->setParam('documentsource', 'upload');
@ -808,7 +816,7 @@ switch($command) {
$controller->setParam('name', $name);
$controller->setParam('comment', $comment);
$controller->setParam('expires', $expires);
$controller->setParam('keywords', '');
$controller->setParam('keywords', $keywords);
$controller->setParam('categories', $cats);
$controller->setParam('owner', $user);
$controller->setParam('userfiletmp', $userfiletmp);

View File

@ -822,9 +822,13 @@ function onAddClipboard(ev) { /* {{{ */
if (typeof obj.data('comment') !== 'undefined') {
fd.append('comment', obj.data('comment'));
}
if (typeof obj.data('keywords') !== 'undefined') {
fd.append('keywords', obj.data('keywords'));
}
fd.append('userfile', files[i]);
fd.append('command', 'uploaddocument');
this.getFormData(fd, obj.data('attributes'), 'attributes');
this.getFormData(fd, obj.data('categories'), 'categories');
// fd.append('path', files[i].webkitRelativePath);
statusbar.parent().show();

View File

@ -853,9 +853,13 @@ function onAddClipboard(ev) { /* {{{ */
if (typeof obj.data('comment') !== 'undefined') {
fd.append('comment', obj.data('comment'));
}
if (typeof obj.data('keywords') !== 'undefined') {
fd.append('keywords', obj.data('keywords'));
}
fd.append('userfile', files[i]);
fd.append('command', 'uploaddocument');
this.getFormData(fd, obj.data('attributes'), 'attributes');
this.getFormData(fd, obj.data('categories'), 'categories');
// fd.append('path', files[i].webkitRelativePath);
statusbar.parent().show();