From 2fa2d33fe97fdf9221053929821d1419a706d6c6 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 9 Mar 2022 08:38:19 +0100 Subject: [PATCH] categories and keywords can be set in uploaddocument --- op/op.Ajax.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/op/op.Ajax.php b/op/op.Ajax.php index 87b4e0815..937c05cfc 100644 --- a/op/op.Ajax.php +++ b/op/op.Ajax.php @@ -781,13 +781,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'); @@ -796,7 +804,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);