diff --git a/CHANGELOG b/CHANGELOG index 75975b444..192c27fdd 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -169,6 +169,7 @@ - fix parsing of file size - major rework of restapi which has now a swagger specification - fix indexing of documents by script (Closes: #479) +- fix ordering of folders in DocumentChooser and FolderChooser -------------------------------------------------------------------------------- Changes in version 5.1.17 diff --git a/out/out.DocumentChooser.php b/out/out.DocumentChooser.php index ff498d6c1..5a5fcba92 100644 --- a/out/out.DocumentChooser.php +++ b/out/out.DocumentChooser.php @@ -54,9 +54,9 @@ if(isset($_GET['action']) && $_GET['action'] == 'subtree') { $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); $view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user)); if($view) { + $view->setParam('orderby', $settings->_sortFoldersDefault); if(isset($_GET['action']) && $_GET['action'] == 'subtree') { $view->setParam('node', $node); - $view->setParam('orderby', $settings->_sortFoldersDefault); } else { $view->setParam('folder', $folder); $view->setParam('form', $form); diff --git a/views/bootstrap/class.DocumentChooser.php b/views/bootstrap/class.DocumentChooser.php index f88bd3d10..1d7ba5034 100644 --- a/views/bootstrap/class.DocumentChooser.php +++ b/views/bootstrap/class.DocumentChooser.php @@ -42,10 +42,11 @@ class SeedDMS_View_DocumentChooser extends SeedDMS_Bootstrap_Style { function js() { /* {{{ */ $folder = $this->params['folder']; $form = $this->params['form']; + $orderby = $this->params['orderby']; $partialtree = $this->params['partialtree']; header('Content-Type: application/javascript'); - $this->printNewTreeNavigationJs($folder->getID(), M_READ, 1, $form, 0, 'n', $partialtree); + $this->printNewTreeNavigationJs($folder->getID(), M_READ, 1, $form, 0, $orderby, $partialtree); } /* }}} */ function show() { /* {{{ */ @@ -54,11 +55,12 @@ class SeedDMS_View_DocumentChooser extends SeedDMS_Bootstrap_Style { $folder = $this->params['folder']; $form = $this->params['form']; $partialtree = $this->params['partialtree']; + $orderby = $this->params['orderby']; // $this->htmlStartPage(getMLText("choose_target_document")); // $this->contentContainerStart(); // $this->printNewTreeNavigationHtml($folder->getID(), M_READ, 1, $form); - $this->printNewTreeNavigationHtml($folder->getID(), M_READ, 1, $form, 0, '', $partialtree); + $this->printNewTreeNavigationHtml($folder->getID(), M_READ, 1, $form, 0, $orderby); echo ''."\n"; // $this->contentContainerEnd(); // $this->htmlEndPage(true); diff --git a/views/bootstrap/class.FolderChooser.php b/views/bootstrap/class.FolderChooser.php index ded83b32c..213a54162 100644 --- a/views/bootstrap/class.FolderChooser.php +++ b/views/bootstrap/class.FolderChooser.php @@ -43,9 +43,10 @@ class SeedDMS_View_FolderChooser extends SeedDMS_Bootstrap_Style { $rootfolderid = $this->params['rootfolderid']; $form = $this->params['form']; $mode = $this->params['mode']; + $orderby = $this->params['orderby']; header('Content-Type: application/javascript'); - $this->printNewTreeNavigationJs($rootfolderid, $mode, 0, $form); + $this->printNewTreeNavigationJs($rootfolderid, $mode, 0, $form, '', $orderby); } /* }}} */ function show() { /* {{{ */