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

This commit is contained in:
Uwe Steinmann 2019-02-12 12:16:13 +01:00
commit 8c826a0c0d
3 changed files with 17 additions and 4 deletions

View File

@ -140,7 +140,8 @@
user extension
- whether the apache module xsendfile is used, can be configured
- add hooks for filtering tasks shown in the menu bar
- allow to set more parameters when upload a document via restapi
- allow to set more parameters when upload a document or creating a new folder
via restapi
--------------------------------------------------------------------------------
Changes in version 5.1.9

View File

@ -388,6 +388,17 @@ function createFolder($request, $response, $args) { /* {{{ */
$params = $request->getParsedBody();
if(!empty($params['name'])) {
$comment = isset($params['comment']) ? $params['comment'] : '';
if(isset($params['sequence'])) {
$sequence = str_replace(',', '.', $params["sequence"]);
if (!is_numeric($sequence))
return $response->withJson(array('success'=>false, 'message'=>getMLText("invalid_sequence"), 'data'=>''), 400);
} else {
$dd = $parent->getSubFolders('s');
if(count($dd) > 1)
$sequence = $dd[count($dd)-1]->getSequence() + 1;
else
$sequence = 1.0;
}
$newattrs = array();
if(!empty($params['attributes'])) {
foreach($params['attributes'] as $attrname=>$attrvalue) {
@ -397,7 +408,7 @@ function createFolder($request, $response, $args) { /* {{{ */
}
}
}
if($folder = $parent->addSubFolder($params['name'], $comment, $userobj, 0, $newattrs)) {
if($folder = $parent->addSubFolder($params['name'], $comment, $userobj, $sequence, $newattrs)) {
$rec = __getFolderData($folder);
return $response->withJson(array('success'=>true, 'message'=>'', 'data'=>$rec), 201);

View File

@ -37,9 +37,10 @@ class SeedDMS_View_ErrorDlg extends SeedDMS_Bootstrap_Style {
$pagetitle = $this->params['pagetitle'];
$errormsg = $this->params['errormsg'];
$plain = $this->params['plain'];
$settings = $this->params['settings'];
if(!$plain) {
$this->htmlStartPage($pagetitle);
if(!$plain) {
$this->htmlStartPage($pagetitle, 'errorpage', $settings->_httpRoot."out");
$this->globalNavigation();
$this->contentStart();
}