Commit c1f3bef1713fac757987ffa09b6e8c25b5545c52

Authored by Michael Joseph
1 parent 196c4c49

fixed document browsing logic

TODO: perform lookups for org and unit instead of expecting them on the session


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@276 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/documentmanagement/DocumentBrowser.inc
@@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
6 * Contains document browsing business logic. 6 * Contains document browsing business logic.
7 * 7 *
8 * @version $Revision$ 8 * @version $Revision$
9 - * @author <a href="mailto:michael@jamwarehouse.com>Michael Joseph</a>, Jam Warehouse (Pty) Ltd, South Africa 9 + * @author <a href="mailto:michael@jamwarehouse.com">Michael Joseph</a>, Jam Warehouse (Pty) Ltd, South Africa
10 * @package dmslib 10 * @package dmslib
11 */ 11 */
12 class DocumentBrowser { 12 class DocumentBrowser {
@@ -29,7 +29,12 @@ class DocumentBrowser { @@ -29,7 +29,12 @@ class DocumentBrowser {
29 // TODO: organisationID (and name) should be on session 29 // TODO: organisationID (and name) should be on session
30 30
31 // TODO: use the organisation to find the root folder 31 // TODO: use the organisation to find the root folder
32 - // eg. $rootFolderName = $_SESSION["organisationName"] . " Document Root"; 32 + if (!isset($_SESSION["organisationName"])) {
  33 + $_SESSION["organisationName"] = "MRC";
  34 + }
  35 + $rootFolderName = $_SESSION["organisationName"] . " Document Root";
  36 + // lookup the id of the root folder
  37 + $folderID = lookupID($default->owl_folders_table, "name", "'$rootFolderName'");
33 38
34 // if this is a system administrator, start her at the ROOT 39 // if this is a system administrator, start her at the ROOT
35 // TODO: add to default->sysadmin_group 40 // TODO: add to default->sysadmin_group
@@ -38,9 +43,6 @@ class DocumentBrowser { @@ -38,9 +43,6 @@ class DocumentBrowser {
38 } else { 43 } else {
39 // otherwise start everyone relative to their unit 44 // otherwise start everyone relative to their unit
40 45
41 - // lookup the id of the root folder  
42 - //$folderID = lookupID($default->owl_folders_table, "name", "'$rootFolderName'");  
43 -  
44 // FIXME: actually need to lookup the unit root folder- which should map to the unitname 46 // FIXME: actually need to lookup the unit root folder- which should map to the unitname
45 // and descend directly from the organisation document root 47 // and descend directly from the organisation document root
46 $unitRootFolder = $_SESSION["unitName"] . " Document Root"; 48 $unitRootFolder = $_SESSION["unitName"] . " Document Root";