From c1f3bef1713fac757987ffa09b6e8c25b5545c52 Mon Sep 17 00:00:00 2001 From: Michael Joseph Date: Thu, 16 Jan 2003 15:30:55 +0000 Subject: [PATCH] fixed document browsing logic TODO: perform lookups for org and unit instead of expecting them on the session --- lib/documentmanagement/DocumentBrowser.inc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/documentmanagement/DocumentBrowser.inc b/lib/documentmanagement/DocumentBrowser.inc index 0b8db23..8b2b9ea 100644 --- a/lib/documentmanagement/DocumentBrowser.inc +++ b/lib/documentmanagement/DocumentBrowser.inc @@ -6,7 +6,7 @@ * Contains document browsing business logic. * * @version $Revision$ - * @author Michael Joseph, Jam Warehouse (Pty) Ltd, South Africa * @package dmslib */ class DocumentBrowser { @@ -29,7 +29,12 @@ class DocumentBrowser { // TODO: organisationID (and name) should be on session // TODO: use the organisation to find the root folder - // eg. $rootFolderName = $_SESSION["organisationName"] . " Document Root"; + if (!isset($_SESSION["organisationName"])) { + $_SESSION["organisationName"] = "MRC"; + } + $rootFolderName = $_SESSION["organisationName"] . " Document Root"; + // lookup the id of the root folder + $folderID = lookupID($default->owl_folders_table, "name", "'$rootFolderName'"); // if this is a system administrator, start her at the ROOT // TODO: add to default->sysadmin_group @@ -38,9 +43,6 @@ class DocumentBrowser { } else { // otherwise start everyone relative to their unit - // lookup the id of the root folder - //$folderID = lookupID($default->owl_folders_table, "name", "'$rootFolderName'"); - // FIXME: actually need to lookup the unit root folder- which should map to the unitname // and descend directly from the organisation document root $unitRootFolder = $_SESSION["unitName"] . " Document Root"; -- libgit2 0.21.4