fix ordering of folders in DocumentChooser and FolderChooser

This commit is contained in:
Uwe Steinmann 2020-07-21 06:24:55 +02:00
parent 55eb876bb6
commit 23cf76aef2
4 changed files with 8 additions and 4 deletions

View File

@ -12,6 +12,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

View File

@ -49,9 +49,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);

View File

@ -42,9 +42,10 @@ class SeedDMS_View_DocumentChooser extends SeedDMS_Bootstrap_Style {
function js() { /* {{{ */
$folder = $this->params['folder'];
$form = $this->params['form'];
$orderby = $this->params['orderby'];
header('Content-Type: application/javascript');
$this->printNewTreeNavigationJs($folder->getID(), M_READ, 1, $form);
$this->printNewTreeNavigationJs($folder->getID(), M_READ, 1, $form, '', $orderby);
} /* }}} */
function show() { /* {{{ */
@ -52,11 +53,12 @@ class SeedDMS_View_DocumentChooser extends SeedDMS_Bootstrap_Style {
$user = $this->params['user'];
$folder = $this->params['folder'];
$form = $this->params['form'];
$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);
$this->printNewTreeNavigationHtml($folder->getID(), M_READ, 1, $form, 0, $orderby);
echo '<script src="../out/out.DocumentChooser.php?action=js&'.$_SERVER['QUERY_STRING'].'"></script>'."\n";
// $this->contentContainerEnd();
// $this->htmlEndPage(true);

View File

@ -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() { /* {{{ */