Commit bcf5b808163683e97560d98669d3e1cb2d013e56

Authored by Michael Joseph
1 parent d064c630

added folder sorting


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1743 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/documentmanagement/DocumentBrowser.inc
@@ -90,7 +90,9 @@ class DocumentBrowser { @@ -90,7 +90,9 @@ class DocumentBrowser {
90 90
91 // now find all the child folders relative to this one 91 // now find all the child folders relative to this one
92 // FIXME: in the same unit? 92 // FIXME: in the same unit?
93 - $folderQuery = "SELECT id FROM $default->owl_folders_table WHERE parent_id=" . $folderID . " ORDER BY name ASC"; 93 +
  94 + // if we're sorting by name then sort folders in the appropriate direction
  95 + $folderQuery = "SELECT id FROM $default->owl_folders_table WHERE parent_id=" . $folderID . " ORDER BY name " . ($sSortField == "name" ? $sSortDirection : "ASC");
94 $default->log->debug("DocumentBrowser::browseByFolder child folder query=$folderQuery"); 96 $default->log->debug("DocumentBrowser::browseByFolder child folder query=$folderQuery");
95 if ($sql->query($folderQuery)) { 97 if ($sql->query($folderQuery)) {
96 while ($sql->next_record()) { 98 while ($sql->next_record()) {