Commit 6b8975276ff61066d80d6537d4d8c8d05466072e
1 parent
db070caf
added copyright and gpl notice
removed owl prefix from table aliases git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2556 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
12 changed files
with
253 additions
and
107 deletions
lib/browse/Browser.inc
| 1 | <?php | 1 | <?php |
| 2 | - | ||
| 3 | require_once("$default->fileSystemRoot/lib/security/permission.inc"); | 2 | require_once("$default->fileSystemRoot/lib/security/permission.inc"); |
| 4 | require_once("$default->fileSystemRoot/lib/users/User.inc"); | 3 | require_once("$default->fileSystemRoot/lib/users/User.inc"); |
| 5 | require_once("$default->fileSystemRoot/lib/documentmanagement/Document.inc"); | 4 | require_once("$default->fileSystemRoot/lib/documentmanagement/Document.inc"); |
| 6 | require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc"); | 5 | require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc"); |
| 7 | - | ||
| 8 | /** | 6 | /** |
| 9 | - * | ||
| 10 | * $Id$ | 7 | * $Id$ |
| 11 | - * | 8 | + * |
| 12 | * Contains document browsing business logic. | 9 | * Contains document browsing business logic. |
| 13 | * | 10 | * |
| 14 | - * Licensed under the GNU GPL. For full terms see the file COPYING. | 11 | + * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com |
| 12 | + * | ||
| 13 | + * This program is free software; you can redistribute it and/or modify | ||
| 14 | + * it under the terms of the GNU General Public License as published by | ||
| 15 | + * the Free Software Foundation; either version 2 of the License, or | ||
| 16 | + * (at your option) any later version. | ||
| 17 | + * | ||
| 18 | + * This program is distributed in the hope that it will be useful, | ||
| 19 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 20 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 21 | + * GNU General Public License for more details. | ||
| 22 | + * | ||
| 23 | + * You should have received a copy of the GNU General Public License | ||
| 24 | + * along with this program; if not, write to the Free Software | ||
| 25 | + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 15 | * | 26 | * |
| 16 | * @version $Revision$ | 27 | * @version $Revision$ |
| 17 | * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa | 28 | * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa |
| 18 | - * | ||
| 19 | * @package lib.browse | 29 | * @package lib.browse |
| 20 | */ | 30 | */ |
| 21 | class Browser { | 31 | class Browser { |
lib/browse/BrowserFactory.inc
| @@ -4,18 +4,29 @@ require_once("$default->fileSystemRoot/lib/browse/Browser.inc"); | @@ -4,18 +4,29 @@ require_once("$default->fileSystemRoot/lib/browse/Browser.inc"); | ||
| 4 | require_once("$default->fileSystemRoot/lib/browse/FolderBrowser.inc"); | 4 | require_once("$default->fileSystemRoot/lib/browse/FolderBrowser.inc"); |
| 5 | require_once("$default->fileSystemRoot/lib/browse/CategoryBrowser.inc"); | 5 | require_once("$default->fileSystemRoot/lib/browse/CategoryBrowser.inc"); |
| 6 | require_once("$default->fileSystemRoot/lib/browse/DocumentTypeBrowser.inc"); | 6 | require_once("$default->fileSystemRoot/lib/browse/DocumentTypeBrowser.inc"); |
| 7 | - | ||
| 8 | /** | 7 | /** |
| 9 | - * | ||
| 10 | * $Id$ | 8 | * $Id$ |
| 11 | - * | 9 | + * |
| 12 | * Responsible for generating the appropriate browser class instance. | 10 | * Responsible for generating the appropriate browser class instance. |
| 13 | * | 11 | * |
| 14 | - * Licensed under the GNU GPL. For full terms see the file COPYING. | 12 | + * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com |
| 13 | + * | ||
| 14 | + * This program is free software; you can redistribute it and/or modify | ||
| 15 | + * it under the terms of the GNU General Public License as published by | ||
| 16 | + * the Free Software Foundation; either version 2 of the License, or | ||
| 17 | + * (at your option) any later version. | ||
| 18 | + * | ||
| 19 | + * This program is distributed in the hope that it will be useful, | ||
| 20 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 21 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 22 | + * GNU General Public License for more details. | ||
| 23 | + * | ||
| 24 | + * You should have received a copy of the GNU General Public License | ||
| 25 | + * along with this program; if not, write to the Free Software | ||
| 26 | + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 15 | * | 27 | * |
| 16 | * @version $Revision$ | 28 | * @version $Revision$ |
| 17 | * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa | 29 | * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa |
| 18 | - * | ||
| 19 | * @package lib.browse | 30 | * @package lib.browse |
| 20 | */ | 31 | */ |
| 21 | class BrowserFactory { | 32 | class BrowserFactory { |
lib/browse/CategoryBrowser.inc
| @@ -4,19 +4,30 @@ require_once("$default->fileSystemRoot/lib/security/permission.inc"); | @@ -4,19 +4,30 @@ require_once("$default->fileSystemRoot/lib/security/permission.inc"); | ||
| 4 | require_once("$default->fileSystemRoot/lib/users/User.inc"); | 4 | require_once("$default->fileSystemRoot/lib/users/User.inc"); |
| 5 | require_once("$default->fileSystemRoot/lib/documentmanagement/Document.inc"); | 5 | require_once("$default->fileSystemRoot/lib/documentmanagement/Document.inc"); |
| 6 | require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc"); | 6 | require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc"); |
| 7 | - | ||
| 8 | /** | 7 | /** |
| 9 | - * | ||
| 10 | * $Id$ | 8 | * $Id$ |
| 11 | - * | ||
| 12 | - * Contains document browsing business logic. | ||
| 13 | * | 9 | * |
| 14 | - * Licensed under the GNU GPL. For full terms see the file COPYING. | 10 | + * Contains category view document browsing business logic. |
| 11 | + * | ||
| 12 | + * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com | ||
| 13 | + * | ||
| 14 | + * This program is free software; you can redistribute it and/or modify | ||
| 15 | + * it under the terms of the GNU General Public License as published by | ||
| 16 | + * the Free Software Foundation; either version 2 of the License, or | ||
| 17 | + * (at your option) any later version. | ||
| 18 | + * | ||
| 19 | + * This program is distributed in the hope that it will be useful, | ||
| 20 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 21 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 22 | + * GNU General Public License for more details. | ||
| 23 | + * | ||
| 24 | + * You should have received a copy of the GNU General Public License | ||
| 25 | + * along with this program; if not, write to the Free Software | ||
| 26 | + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 15 | * | 27 | * |
| 16 | * @version $Revision$ | 28 | * @version $Revision$ |
| 17 | * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa | 29 | * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa |
| 18 | - * | ||
| 19 | - * @package lib.documentmanagement | 30 | + * @package lib.browse |
| 20 | */ | 31 | */ |
| 21 | class CategoryBrowser extends Browser { | 32 | class CategoryBrowser extends Browser { |
| 22 | 33 | ||
| @@ -48,7 +59,7 @@ class CategoryBrowser extends Browser { | @@ -48,7 +59,7 @@ class CategoryBrowser extends Browser { | ||
| 48 | $sql = $default->db; | 59 | $sql = $default->db; |
| 49 | 60 | ||
| 50 | // lookup document_fields id for category | 61 | // lookup document_fields id for category |
| 51 | - $categoryFieldID = lookupID($default->owl_fields_table, "name", "$categoryField"); | 62 | + $categoryFieldID = lookupID($default->document_fields_table, "name", "$categoryField"); |
| 52 | $default->log->debug("CategoryBrowser::browse() categoryFieldID=$categoryFieldID"); | 63 | $default->log->debug("CategoryBrowser::browse() categoryFieldID=$categoryFieldID"); |
| 53 | 64 | ||
| 54 | if ($sCategoryName == "") { | 65 | if ($sCategoryName == "") { |
| @@ -57,7 +68,7 @@ class CategoryBrowser extends Browser { | @@ -57,7 +68,7 @@ class CategoryBrowser extends Browser { | ||
| 57 | // set the first value to "categories" | 68 | // set the first value to "categories" |
| 58 | $results["categories"][] = "Categories"; | 69 | $results["categories"][] = "Categories"; |
| 59 | // get a list of category values | 70 | // get a list of category values |
| 60 | - $query = "SELECT DISTINCT value FROM $default->owl_document_fields_table WHERE document_field_id=$categoryFieldID ORDER BY value " . ($this->sSortField == "name" ? $this->sSortDirection : "ASC"); | 71 | + $query = "SELECT DISTINCT value FROM $default->document_fields_link_table WHERE document_field_id=$categoryFieldID ORDER BY value " . ($this->sSortField == "name" ? $this->sSortDirection : "ASC"); |
| 61 | $default->log->info("CategoryBrowser::browse() category listing query=$query; $this->sSortField"); | 72 | $default->log->info("CategoryBrowser::browse() category listing query=$query; $this->sSortField"); |
| 62 | $sql->query($query); | 73 | $sql->query($query); |
| 63 | // loop through resultset, build array and return | 74 | // loop through resultset, build array and return |
| @@ -74,8 +85,8 @@ class CategoryBrowser extends Browser { | @@ -74,8 +85,8 @@ class CategoryBrowser extends Browser { | ||
| 74 | 85 | ||
| 75 | // we have a category to use, so find all the documents | 86 | // we have a category to use, so find all the documents |
| 76 | // with this category value | 87 | // with this category value |
| 77 | - $categoryQuery = "SELECT df.document_id FROM $default->owl_document_fields_table df " . | ||
| 78 | - "INNER JOIN $default->owl_documents_table d ON df.document_id = d.id "; | 88 | + $categoryQuery = "SELECT df.document_id FROM $default->document_fields_link_table df " . |
| 89 | + "INNER JOIN $default->documents_table d ON df.document_id = d.id "; | ||
| 79 | if ( isset($aLookupCriteria) ) { | 90 | if ( isset($aLookupCriteria) ) { |
| 80 | $categoryQuery .= "INNER JOIN " . $aLookupCriteria["table"] . " lt ON "; | 91 | $categoryQuery .= "INNER JOIN " . $aLookupCriteria["table"] . " lt ON "; |
| 81 | $categoryQuery .= "d.$this->sSortField" . "=lt." . (isset($aLookupCriteria["joinColumn"]) ? $aLookupCriteria["joinColumn"] : "id"); | 92 | $categoryQuery .= "d.$this->sSortField" . "=lt." . (isset($aLookupCriteria["joinColumn"]) ? $aLookupCriteria["joinColumn"] : "id"); |
lib/browse/DocumentTypeBrowser.inc
| 1 | <?php | 1 | <?php |
| 2 | - | ||
| 3 | require_once("$default->fileSystemRoot/lib/security/permission.inc"); | 2 | require_once("$default->fileSystemRoot/lib/security/permission.inc"); |
| 4 | require_once("$default->fileSystemRoot/lib/users/User.inc"); | 3 | require_once("$default->fileSystemRoot/lib/users/User.inc"); |
| 5 | require_once("$default->fileSystemRoot/lib/documentmanagement/Document.inc"); | 4 | require_once("$default->fileSystemRoot/lib/documentmanagement/Document.inc"); |
| 6 | require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc"); | 5 | require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc"); |
| 7 | - | ||
| 8 | /** | 6 | /** |
| 9 | - * | ||
| 10 | * $Id$ | 7 | * $Id$ |
| 11 | - * | ||
| 12 | - * Contains document browsing business logic. | ||
| 13 | * | 8 | * |
| 14 | - * Licensed under the GNU GPL. For full terms see the file COPYING. | 9 | + * Contains document type view document browsing business logic. |
| 10 | + * | ||
| 11 | + * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com | ||
| 12 | + * | ||
| 13 | + * This program is free software; you can redistribute it and/or modify | ||
| 14 | + * it under the terms of the GNU General Public License as published by | ||
| 15 | + * the Free Software Foundation; either version 2 of the License, or | ||
| 16 | + * (at your option) any later version. | ||
| 17 | + * | ||
| 18 | + * This program is distributed in the hope that it will be useful, | ||
| 19 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 20 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 21 | + * GNU General Public License for more details. | ||
| 22 | + * | ||
| 23 | + * You should have received a copy of the GNU General Public License | ||
| 24 | + * along with this program; if not, write to the Free Software | ||
| 25 | + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 15 | * | 26 | * |
| 16 | * @version $Revision$ | 27 | * @version $Revision$ |
| 17 | * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa | 28 | * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa |
| 18 | - * | ||
| 19 | - * @package lib.documentmanagement | 29 | + * @package lib.browse |
| 20 | */ | 30 | */ |
| 21 | class DocumentTypeBrowser extends Browser { | 31 | class DocumentTypeBrowser extends Browser { |
| 22 | 32 | ||
| @@ -51,7 +61,7 @@ class DocumentTypeBrowser extends Browser { | @@ -51,7 +61,7 @@ class DocumentTypeBrowser extends Browser { | ||
| 51 | $results["documentTypes"][] = array("name" => "Document Types"); | 61 | $results["documentTypes"][] = array("name" => "Document Types"); |
| 52 | 62 | ||
| 53 | // return a list of document types | 63 | // return a list of document types |
| 54 | - $query = "SELECT * FROM $default->owl_document_types_table ORDER BY name " . ($this->sSortField == "name" ? $this->sSortDirection : "ASC"); | 64 | + $query = "SELECT * FROM $default->document_types_table ORDER BY name " . ($this->sSortField == "name" ? $this->sSortDirection : "ASC"); |
| 55 | 65 | ||
| 56 | $sql->query($query); | 66 | $sql->query($query); |
| 57 | while ($sql->next_record()) { | 67 | while ($sql->next_record()) { |
| @@ -62,11 +72,11 @@ class DocumentTypeBrowser extends Browser { | @@ -62,11 +72,11 @@ class DocumentTypeBrowser extends Browser { | ||
| 62 | $aLookupCriteria = $this->aSortCriteria[$this->sSortField]["lookup"]; | 72 | $aLookupCriteria = $this->aSortCriteria[$this->sSortField]["lookup"]; |
| 63 | 73 | ||
| 64 | // lookup document type name from the passed in id | 74 | // lookup document type name from the passed in id |
| 65 | - $documentTypeName = lookupField($default->owl_document_types_table, "name", "id", $iDocumentTypeID); | 75 | + $documentTypeName = lookupField($default->document_types_table, "name", "id", $iDocumentTypeID); |
| 66 | $results["documentTypes"][] = array("id" => $iDocumentTypeID, "name" => $documentTypeName); | 76 | $results["documentTypes"][] = array("id" => $iDocumentTypeID, "name" => $documentTypeName); |
| 67 | 77 | ||
| 68 | // create query to retrieve documents with this document type | 78 | // create query to retrieve documents with this document type |
| 69 | - $documentQuery = "SELECT d.id as id FROM $default->owl_documents_table d "; | 79 | + $documentQuery = "SELECT d.id as id FROM $default->documents_table d "; |
| 70 | if ( isset($aLookupCriteria) ) { | 80 | if ( isset($aLookupCriteria) ) { |
| 71 | //$documentQuery .= "INNER JOIN " . $aLookupCriteria["table"] . " lt ON d.$this->sSortField=lt.id "; | 81 | //$documentQuery .= "INNER JOIN " . $aLookupCriteria["table"] . " lt ON d.$this->sSortField=lt.id "; |
| 72 | $documentQuery .= "INNER JOIN " . $aLookupCriteria["table"] . " lt ON "; | 82 | $documentQuery .= "INNER JOIN " . $aLookupCriteria["table"] . " lt ON "; |
lib/browse/FolderBrowser.inc
| 1 | <?php | 1 | <?php |
| 2 | - | ||
| 3 | require_once("$default->fileSystemRoot/lib/browse/Browser.inc"); | 2 | require_once("$default->fileSystemRoot/lib/browse/Browser.inc"); |
| 4 | require_once("$default->fileSystemRoot/lib/security/permission.inc"); | 3 | require_once("$default->fileSystemRoot/lib/security/permission.inc"); |
| 5 | require_once("$default->fileSystemRoot/lib/users/User.inc"); | 4 | require_once("$default->fileSystemRoot/lib/users/User.inc"); |
| 6 | require_once("$default->fileSystemRoot/lib/documentmanagement/Document.inc"); | 5 | require_once("$default->fileSystemRoot/lib/documentmanagement/Document.inc"); |
| 7 | require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc"); | 6 | require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc"); |
| 8 | - | ||
| 9 | /** | 7 | /** |
| 10 | - * | ||
| 11 | * $Id$ | 8 | * $Id$ |
| 12 | - * | ||
| 13 | - * Contains document browsing business logic. | ||
| 14 | * | 9 | * |
| 15 | - * Licensed under the GNU GPL. For full terms see the file COPYING. | 10 | + * Contains folder view document browsing business logic. |
| 11 | + * | ||
| 12 | + * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com | ||
| 13 | + * | ||
| 14 | + * This program is free software; you can redistribute it and/or modify | ||
| 15 | + * it under the terms of the GNU General Public License as published by | ||
| 16 | + * the Free Software Foundation; either version 2 of the License, or | ||
| 17 | + * (at your option) any later version. | ||
| 18 | + * | ||
| 19 | + * This program is distributed in the hope that it will be useful, | ||
| 20 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 21 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 22 | + * GNU General Public License for more details. | ||
| 23 | + * | ||
| 24 | + * You should have received a copy of the GNU General Public License | ||
| 25 | + * along with this program; if not, write to the Free Software | ||
| 26 | + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 16 | * | 27 | * |
| 17 | * @version $Revision$ | 28 | * @version $Revision$ |
| 18 | * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa | 29 | * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa |
| 19 | - * | ||
| 20 | - * @package lib.documentmanagement | 30 | + * @package lib.browse |
| 21 | */ | 31 | */ |
| 22 | class FolderBrowser extends Browser { | 32 | class FolderBrowser extends Browser { |
| 23 | 33 | ||
| @@ -58,7 +68,7 @@ class FolderBrowser extends Browser { | @@ -58,7 +68,7 @@ class FolderBrowser extends Browser { | ||
| 58 | // if the user is in a unit, start at the unit's root folder | 68 | // if the user is in a unit, start at the unit's root folder |
| 59 | 69 | ||
| 60 | // lookup the unit name | 70 | // lookup the unit name |
| 61 | - $unitName = lookupField($default->owl_units_table, "name", "id", $unitID); | 71 | + $unitName = lookupField($default->units_table, "name", "id", $unitID); |
| 62 | 72 | ||
| 63 | // the unit root folder has the same name as the unit | 73 | // the unit root folder has the same name as the unit |
| 64 | // FIXME: dodgy i know, but its easy | 74 | // FIXME: dodgy i know, but its easy |
| @@ -69,7 +79,7 @@ class FolderBrowser extends Browser { | @@ -69,7 +79,7 @@ class FolderBrowser extends Browser { | ||
| 69 | 79 | ||
| 70 | if (!$aFolders) { | 80 | if (!$aFolders) { |
| 71 | // no folder exists with this name, so start at the root | 81 | // no folder exists with this name, so start at the root |
| 72 | - $iFolderID = lookupID($default->owl_folders_table, "parent_id", 0); | 82 | + $iFolderID = lookupID($default->folders_table, "parent_id", 0); |
| 73 | } else { | 83 | } else { |
| 74 | $iFolderID = $aFolders[0]->getID(); | 84 | $iFolderID = $aFolders[0]->getID(); |
| 75 | } | 85 | } |
| @@ -77,7 +87,7 @@ class FolderBrowser extends Browser { | @@ -77,7 +87,7 @@ class FolderBrowser extends Browser { | ||
| 77 | } else { | 87 | } else { |
| 78 | // else just start at the root | 88 | // else just start at the root |
| 79 | // FIXME: start at the root folder for the default organisation | 89 | // FIXME: start at the root folder for the default organisation |
| 80 | - $iFolderID = lookupID($default->owl_folders_table, "parent_id", 0); | 90 | + $iFolderID = lookupID($default->folders_table, "parent_id", 0); |
| 81 | } | 91 | } |
| 82 | } | 92 | } |
| 83 | 93 | ||
| @@ -93,7 +103,7 @@ class FolderBrowser extends Browser { | @@ -93,7 +103,7 @@ class FolderBrowser extends Browser { | ||
| 93 | $aLookupCriteria = $this->aSortCriteria[$this->sSortField]["lookup"]; | 103 | $aLookupCriteria = $this->aSortCriteria[$this->sSortField]["lookup"]; |
| 94 | 104 | ||
| 95 | // if we're sorting by name or creator_id then sort folders in the appropriate direction | 105 | // if we're sorting by name or creator_id then sort folders in the appropriate direction |
| 96 | - $sFolderQuery = "SELECT f.id FROM $default->owl_folders_table AS f "; | 106 | + $sFolderQuery = "SELECT f.id FROM $default->folders_table AS f "; |
| 97 | if (in_array($this->sSortField, array("name", "creator_id"))) { | 107 | if (in_array($this->sSortField, array("name", "creator_id"))) { |
| 98 | if (isset($aLookupCriteria)) { | 108 | if (isset($aLookupCriteria)) { |
| 99 | $sFolderQuery .= "INNER JOIN " . $aLookupCriteria["table"] . " lt ON f.$this->sSortField=lt.id WHERE parent_id=" . $iFolderID; | 109 | $sFolderQuery .= "INNER JOIN " . $aLookupCriteria["table"] . " lt ON f.$this->sSortField=lt.id WHERE parent_id=" . $iFolderID; |
| @@ -113,7 +123,7 @@ class FolderBrowser extends Browser { | @@ -113,7 +123,7 @@ class FolderBrowser extends Browser { | ||
| 113 | } | 123 | } |
| 114 | 124 | ||
| 115 | // create query to retrieve documents in this folder | 125 | // create query to retrieve documents in this folder |
| 116 | - $documentQuery = "SELECT d.id as id FROM $default->owl_documents_table AS d "; | 126 | + $documentQuery = "SELECT d.id as id FROM $default->documents_table AS d "; |
| 117 | if ( isset($aLookupCriteria) ) { | 127 | if ( isset($aLookupCriteria) ) { |
| 118 | $documentQuery .= "INNER JOIN " . $aLookupCriteria["table"] . " lt ON "; | 128 | $documentQuery .= "INNER JOIN " . $aLookupCriteria["table"] . " lt ON "; |
| 119 | $documentQuery .= "d.$this->sSortField" . "=lt." . (isset($aLookupCriteria["joinColumn"]) ? $aLookupCriteria["joinColumn"] : "id"); | 129 | $documentQuery .= "d.$this->sSortField" . "=lt." . (isset($aLookupCriteria["joinColumn"]) ? $aLookupCriteria["joinColumn"] : "id"); |
lib/dashboard/Dashboard.inc
| 1 | <?php | 1 | <?php |
| 2 | - | ||
| 3 | require_once("$default->fileSystemRoot/lib/subscriptions/SubscriptionManager.inc"); | 2 | require_once("$default->fileSystemRoot/lib/subscriptions/SubscriptionManager.inc"); |
| 4 | require_once("$default->fileSystemRoot/lib/web/WebDocument.inc"); | 3 | require_once("$default->fileSystemRoot/lib/web/WebDocument.inc"); |
| 5 | require_once("$default->fileSystemRoot/lib/links/link.inc"); | 4 | require_once("$default->fileSystemRoot/lib/links/link.inc"); |
| 6 | require_once("$default->fileSystemRoot/lib/documentmanagement/DependantDocumentInstance.inc"); | 5 | require_once("$default->fileSystemRoot/lib/documentmanagement/DependantDocumentInstance.inc"); |
| 7 | require_once("$default->fileSystemRoot/lib/archiving/ArchiveRestorationRequest.inc"); | 6 | require_once("$default->fileSystemRoot/lib/archiving/ArchiveRestorationRequest.inc"); |
| 8 | - | ||
| 9 | /** | 7 | /** |
| 10 | * $Id$ | 8 | * $Id$ |
| 9 | + * | ||
| 10 | + * Contains dashboard helper functions. | ||
| 11 | + * | ||
| 12 | + * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com | ||
| 13 | + * | ||
| 14 | + * This program is free software; you can redistribute it and/or modify | ||
| 15 | + * it under the terms of the GNU General Public License as published by | ||
| 16 | + * the Free Software Foundation; either version 2 of the License, or | ||
| 17 | + * (at your option) any later version. | ||
| 11 | * | 18 | * |
| 12 | - * Contains dashboard helper functions | 19 | + * This program is distributed in the hope that it will be useful, |
| 20 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 21 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 22 | + * GNU General Public License for more details. | ||
| 13 | * | 23 | * |
| 14 | - * Licensed under the GNU GPL. For full terms see the file COPYING. | 24 | + * You should have received a copy of the GNU General Public License |
| 25 | + * along with this program; if not, write to the Free Software | ||
| 26 | + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 15 | * | 27 | * |
| 16 | * @version $Revision$ | 28 | * @version $Revision$ |
| 17 | * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa | 29 | * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa |
| 18 | * @package lib.dashboard | 30 | * @package lib.dashboard |
| 19 | */ | 31 | */ |
| 20 | - | ||
| 21 | class Dashboard { | 32 | class Dashboard { |
| 22 | 33 | ||
| 23 | /** | 34 | /** |
| @@ -66,7 +77,7 @@ class Dashboard { | @@ -66,7 +77,7 @@ class Dashboard { | ||
| 66 | function getPendingCollaborationDocuments(){ | 77 | function getPendingCollaborationDocuments(){ |
| 67 | global $default; | 78 | global $default; |
| 68 | 79 | ||
| 69 | - $sQuery = "SELECT document_id FROM $default->owl_folders_user_roles_table WHERE active=1 AND user_id=" . $this->iUserID; | 80 | + $sQuery = "SELECT document_id FROM $default->folders_user_roles_table WHERE active=1 AND user_id=" . $this->iUserID; |
| 70 | $aDocumentList = array(); | 81 | $aDocumentList = array(); |
| 71 | $sql = $default->db; | 82 | $sql = $default->db; |
| 72 | if ($sql->query($sQuery)) { | 83 | if ($sql->query($sQuery)) { |
| @@ -109,7 +120,7 @@ class Dashboard { | @@ -109,7 +120,7 @@ class Dashboard { | ||
| 109 | */ | 120 | */ |
| 110 | function getDependantDocuments() { | 121 | function getDependantDocuments() { |
| 111 | global $default; | 122 | global $default; |
| 112 | - $sQuery = "SELECT id FROM $default->owl_dependant_document_instance_table WHERE user_id = " . $this->iUserID; | 123 | + $sQuery = "SELECT id FROM $default->dependant_document_instance_table WHERE user_id = " . $this->iUserID; |
| 113 | $aDocumentList = array(); | 124 | $aDocumentList = array(); |
| 114 | $sql = $default->db; | 125 | $sql = $default->db; |
| 115 | $sql->query($sQuery); | 126 | $sql->query($sQuery); |
lib/dashboard/DashboardNews.inc
| 1 | <?php | 1 | <?php |
| 2 | - | ||
| 3 | require_once("$default->fileSystemRoot/lib/documentmanagement/PhysicalDocumentManager.inc"); | 2 | require_once("$default->fileSystemRoot/lib/documentmanagement/PhysicalDocumentManager.inc"); |
| 4 | - | ||
| 5 | /** | 3 | /** |
| 6 | * $Id$ | 4 | * $Id$ |
| 7 | - * | 5 | + * |
| 8 | * Represents a dashboard news item. | 6 | * Represents a dashboard news item. |
| 7 | + * | ||
| 8 | + * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com | ||
| 9 | + * | ||
| 10 | + * This program is free software; you can redistribute it and/or modify | ||
| 11 | + * it under the terms of the GNU General Public License as published by | ||
| 12 | + * the Free Software Foundation; either version 2 of the License, or | ||
| 13 | + * (at your option) any later version. | ||
| 9 | * | 14 | * |
| 10 | - * Licensed under the GNU GPL. For full terms see the file COPYING. | 15 | + * This program is distributed in the hope that it will be useful, |
| 16 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 17 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 18 | + * GNU General Public License for more details. | ||
| 19 | + * | ||
| 20 | + * You should have received a copy of the GNU General Public License | ||
| 21 | + * along with this program; if not, write to the Free Software | ||
| 22 | + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 11 | * | 23 | * |
| 12 | * @version $Revision$ | 24 | * @version $Revision$ |
| 13 | * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa | 25 | * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa |
| 14 | * @package lib.dashboard | 26 | * @package lib.dashboard |
| 15 | */ | 27 | */ |
| 16 | - | ||
| 17 | class DashboardNews { | 28 | class DashboardNews { |
| 18 | 29 | ||
| 19 | /** | 30 | /** |
| @@ -294,7 +305,7 @@ class DashboardNews { | @@ -294,7 +305,7 @@ class DashboardNews { | ||
| 294 | //if the id >= 0, then the object has already been created | 305 | //if the id >= 0, then the object has already been created |
| 295 | if ($this->iId < 0) { | 306 | if ($this->iId < 0) { |
| 296 | $sql = $default->db; | 307 | $sql = $default->db; |
| 297 | - $result = $sql->query("INSERT INTO $default->owl_news_table (synopsis, body, rank, image, image_size, image_mime_type_id, active) " . | 308 | + $result = $sql->query("INSERT INTO $default->news_table (synopsis, body, rank, image, image_size, image_mime_type_id, active) " . |
| 298 | "VALUES ('" . addslashes($this->sSynopsis) . "', '" . addslashes($this->sBody) . "', $this->iRank, " . | 309 | "VALUES ('" . addslashes($this->sSynopsis) . "', '" . addslashes($this->sBody) . "', $this->iRank, " . |
| 299 | "'" . addslashes($this->sImage) . "', $this->iImageSize, $this->iImageMimeTypeID, " . ($this->bActive ? "1" : "0") . ")"); | 310 | "'" . addslashes($this->sImage) . "', $this->iImageSize, $this->iImageMimeTypeID, " . ($this->bActive ? "1" : "0") . ")"); |
| 300 | if ($result) { | 311 | if ($result) { |
| @@ -303,7 +314,7 @@ class DashboardNews { | @@ -303,7 +314,7 @@ class DashboardNews { | ||
| 303 | 314 | ||
| 304 | if ($this->bActive) { | 315 | if ($this->bActive) { |
| 305 | // we're setting this entry to active, so set all the others to inactive | 316 | // we're setting this entry to active, so set all the others to inactive |
| 306 | - $sql->query("UPDATE $default->owl_news_table SET active=0 WHERE id <> $this->iId"); | 317 | + $sql->query("UPDATE $default->news_table SET active=0 WHERE id <> $this->iId"); |
| 307 | } | 318 | } |
| 308 | 319 | ||
| 309 | return true; | 320 | return true; |
| @@ -322,7 +333,7 @@ class DashboardNews { | @@ -322,7 +333,7 @@ class DashboardNews { | ||
| 322 | global $default; | 333 | global $default; |
| 323 | if ($this->iId >= 0) { | 334 | if ($this->iId >= 0) { |
| 324 | $sql = $default->db; | 335 | $sql = $default->db; |
| 325 | - $sQuery = "UPDATE " . $default->owl_news_table . " SET " . | 336 | + $sQuery = "UPDATE " . $default->news_table . " SET " . |
| 326 | "synopsis = '" . addslashes($this->sSynopsis) . "', " . | 337 | "synopsis = '" . addslashes($this->sSynopsis) . "', " . |
| 327 | "body = '" . addslashes($this->sBody) . "', " . | 338 | "body = '" . addslashes($this->sBody) . "', " . |
| 328 | "rank = $this->iRank, " . | 339 | "rank = $this->iRank, " . |
| @@ -335,12 +346,12 @@ class DashboardNews { | @@ -335,12 +346,12 @@ class DashboardNews { | ||
| 335 | if ($result) { | 346 | if ($result) { |
| 336 | if ($this->bActive) { | 347 | if ($this->bActive) { |
| 337 | // we're setting this entry to active, so set all the others to inactive | 348 | // we're setting this entry to active, so set all the others to inactive |
| 338 | - $sql->query("UPDATE $default->owl_news_table SET active=0"); | 349 | + $sql->query("UPDATE $default->news_table SET active=0"); |
| 339 | // now set our entry to active | 350 | // now set our entry to active |
| 340 | - $sql->query("UPDATE $default->owl_news_table SET active=1 where id=$this->iId"); | 351 | + $sql->query("UPDATE $default->news_table SET active=1 where id=$this->iId"); |
| 341 | } else { | 352 | } else { |
| 342 | // set this to inactive | 353 | // set this to inactive |
| 343 | - $sql->query("UPDATE $default->owl_news_table SET active=0 where id=$this->iId"); | 354 | + $sql->query("UPDATE $default->news_table SET active=0 where id=$this->iId"); |
| 344 | } | 355 | } |
| 345 | return true; | 356 | return true; |
| 346 | } | 357 | } |
| @@ -359,7 +370,7 @@ class DashboardNews { | @@ -359,7 +370,7 @@ class DashboardNews { | ||
| 359 | global $default; | 370 | global $default; |
| 360 | if ($this->iId >= 0) { | 371 | if ($this->iId >= 0) { |
| 361 | $sql = $default->db; | 372 | $sql = $default->db; |
| 362 | - $result = $sql->query("DELETE FROM " . $default->owl_news_table . " WHERE id = $this->iId"); | 373 | + $result = $sql->query("DELETE FROM " . $default->news_table . " WHERE id = $this->iId"); |
| 363 | if ($result) { | 374 | if ($result) { |
| 364 | $this->iId = -1; | 375 | $this->iId = -1; |
| 365 | return true; | 376 | return true; |
| @@ -379,7 +390,7 @@ class DashboardNews { | @@ -379,7 +390,7 @@ class DashboardNews { | ||
| 379 | function & get($iNewsID) { | 390 | function & get($iNewsID) { |
| 380 | global $default; | 391 | global $default; |
| 381 | $sql = $default->db; | 392 | $sql = $default->db; |
| 382 | - $sql->query("SELECT * FROM $default->owl_news_table WHERE id = $iNewsID"); | 393 | + $sql->query("SELECT * FROM $default->news_table WHERE id = $iNewsID"); |
| 383 | if ($sql->next_record()) { | 394 | if ($sql->next_record()) { |
| 384 | $aImage = array( "image" => $sql->f("image"), | 395 | $aImage = array( "image" => $sql->f("image"), |
| 385 | "filesize" => $sql->f("image_size"), | 396 | "filesize" => $sql->f("image_size"), |
| @@ -403,7 +414,7 @@ class DashboardNews { | @@ -403,7 +414,7 @@ class DashboardNews { | ||
| 403 | global $default; | 414 | global $default; |
| 404 | $aDashboardNewsArray = array(); | 415 | $aDashboardNewsArray = array(); |
| 405 | $sql = $default->db; | 416 | $sql = $default->db; |
| 406 | - $result = $sql->query("SELECT * FROM " . $default->owl_news_table . (isset($sWhereClause) ? " WHERE " . $sWhereClause : "") . " ORDER BY rank ASC"); | 417 | + $result = $sql->query("SELECT * FROM " . $default->news_table . (isset($sWhereClause) ? " WHERE " . $sWhereClause : "") . " ORDER BY rank ASC"); |
| 407 | if ($result) { | 418 | if ($result) { |
| 408 | $iCount = 0; | 419 | $iCount = 0; |
| 409 | while ($sql->next_record()) { | 420 | while ($sql->next_record()) { |
lib/database/datetime.inc
| 1 | <?php | 1 | <?php |
| 2 | - | ||
| 3 | /** | 2 | /** |
| 4 | * $Id$ | 3 | * $Id$ |
| 5 | * | 4 | * |
| 6 | - * Contains datetime functions | 5 | + * Contains datetime functions. |
| 6 | + * | ||
| 7 | + * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com | ||
| 7 | * | 8 | * |
| 8 | - * Licensed under the GNU GPL. For full terms see the file DOCS/COPYING. | 9 | + * This program is free software; you can redistribute it and/or modify |
| 10 | + * it under the terms of the GNU General Public License as published by | ||
| 11 | + * the Free Software Foundation; either version 2 of the License, or | ||
| 12 | + * (at your option) any later version. | ||
| 13 | + * | ||
| 14 | + * This program is distributed in the hope that it will be useful, | ||
| 15 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 16 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 17 | + * GNU General Public License for more details. | ||
| 18 | + * | ||
| 19 | + * You should have received a copy of the GNU General Public License | ||
| 20 | + * along with this program; if not, write to the Free Software | ||
| 21 | + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 9 | * | 22 | * |
| 10 | * @version $Revision$ | 23 | * @version $Revision$ |
| 11 | * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa | 24 | * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa |
| 12 | - * @package lib.database | 25 | + * @package lib.database |
| 13 | */ | 26 | */ |
| 14 | 27 | ||
| 15 | /** | 28 | /** |
lib/database/db.inc
| @@ -4,11 +4,25 @@ | @@ -4,11 +4,25 @@ | ||
| 4 | * | 4 | * |
| 5 | * The default database wrapper class. | 5 | * The default database wrapper class. |
| 6 | * | 6 | * |
| 7 | - * Licensed under the GNU GPL. For full terms see the file COPYING. | ||
| 8 | - * | ||
| 9 | - * @version $Revision$ | ||
| 10 | - * @author Mukhtar Dharsey | ||
| 11 | - * @package lib.database | 7 | + * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com |
| 8 | + * | ||
| 9 | + * This program is free software; you can redistribute it and/or modify | ||
| 10 | + * it under the terms of the GNU General Public License as published by | ||
| 11 | + * the Free Software Foundation; either version 2 of the License, or | ||
| 12 | + * (at your option) any later version. | ||
| 13 | + * | ||
| 14 | + * This program is distributed in the hope that it will be useful, | ||
| 15 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 16 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 17 | + * GNU General Public License for more details. | ||
| 18 | + * | ||
| 19 | + * You should have received a copy of the GNU General Public License | ||
| 20 | + * along with this program; if not, write to the Free Software | ||
| 21 | + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 22 | + * | ||
| 23 | + * @version $Revision$ | ||
| 24 | + * @author Mukhtar Dharsey, Jam Warehouse (Pty) Ltd, South Africa | ||
| 25 | + * @package lib.database | ||
| 12 | */ | 26 | */ |
| 13 | class Database extends DB_Sql { | 27 | class Database extends DB_Sql { |
| 14 | 28 |
lib/database/lookup.inc
| 1 | <?php | 1 | <?php |
| 2 | - | ||
| 3 | /** | 2 | /** |
| 4 | * $Id$ | 3 | * $Id$ |
| 5 | * | 4 | * |
| 6 | - * Contains database helper functions | 5 | + * Contains database helper functions. |
| 6 | + * | ||
| 7 | + * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com | ||
| 7 | * | 8 | * |
| 8 | - * Licensed under the GNU GPL. For full terms see the file COPYING. | 9 | + * This program is free software; you can redistribute it and/or modify |
| 10 | + * it under the terms of the GNU General Public License as published by | ||
| 11 | + * the Free Software Foundation; either version 2 of the License, or | ||
| 12 | + * (at your option) any later version. | ||
| 13 | + * | ||
| 14 | + * This program is distributed in the hope that it will be useful, | ||
| 15 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 16 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 17 | + * GNU General Public License for more details. | ||
| 18 | + * | ||
| 19 | + * You should have received a copy of the GNU General Public License | ||
| 20 | + * along with this program; if not, write to the Free Software | ||
| 21 | + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 9 | * | 22 | * |
| 10 | * @version $Revision$ | 23 | * @version $Revision$ |
| 11 | - * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa | ||
| 12 | - * @package lib.database | 24 | +* @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa |
| 25 | + * @package lib.database | ||
| 13 | */ | 26 | */ |
| 14 | 27 | ||
| 15 | /** | 28 | /** |
| @@ -37,7 +50,7 @@ function lookupName($tableName, $idFieldValue){ | @@ -37,7 +50,7 @@ function lookupName($tableName, $idFieldValue){ | ||
| 37 | 50 | ||
| 38 | function lookupStatusID($statusName) { | 51 | function lookupStatusID($statusName) { |
| 39 | global $default; | 52 | global $default; |
| 40 | - return lookupID($default->owl_status_table, "name", $statusName); | 53 | + return lookupID($default->status_table, "name", $statusName); |
| 41 | } | 54 | } |
| 42 | 55 | ||
| 43 | /** | 56 | /** |
| @@ -51,7 +64,7 @@ function lookupGroupIDs($userID) { | @@ -51,7 +64,7 @@ function lookupGroupIDs($userID) { | ||
| 51 | $groupIDs = array(); | 64 | $groupIDs = array(); |
| 52 | 65 | ||
| 53 | $sql = $default->db; | 66 | $sql = $default->db; |
| 54 | - $sql->query("select group_id from $default->owl_users_groups_table where user_id = '$userID'"); | 67 | + $sql->query("select group_id from $default->users_groups_table where user_id = '$userID'"); |
| 55 | while($sql->next_record()) { | 68 | while($sql->next_record()) { |
| 56 | $groupIDs[] = $sql->f("group_id"); | 69 | $groupIDs[] = $sql->f("group_id"); |
| 57 | } | 70 | } |
lib/discussions/DiscussionComment.inc
| @@ -2,11 +2,27 @@ | @@ -2,11 +2,27 @@ | ||
| 2 | /** | 2 | /** |
| 3 | * $Id$ | 3 | * $Id$ |
| 4 | * | 4 | * |
| 5 | - * Contains static functions concerned with sending emails | 5 | + * Represents a document discussion comment. |
| 6 | + * | ||
| 7 | + * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com | ||
| 8 | + * | ||
| 9 | + * This program is free software; you can redistribute it and/or modify | ||
| 10 | + * it under the terms of the GNU General Public License as published by | ||
| 11 | + * the Free Software Foundation; either version 2 of the License, or | ||
| 12 | + * (at your option) any later version. | ||
| 13 | + * | ||
| 14 | + * This program is distributed in the hope that it will be useful, | ||
| 15 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 16 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 17 | + * GNU General Public License for more details. | ||
| 18 | + * | ||
| 19 | + * You should have received a copy of the GNU General Public License | ||
| 20 | + * along with this program; if not, write to the Free Software | ||
| 21 | + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 6 | * | 22 | * |
| 7 | - * @author Omar Rahbeeni, CS Holdings, South Africa | ||
| 8 | * @version $Revision$ | 23 | * @version $Revision$ |
| 9 | - * @package lib.discussions | 24 | + * @author Omar Rahbeeni, CS Holdings, South Africa |
| 25 | + * @package lib.discussions | ||
| 10 | */ | 26 | */ |
| 11 | class DiscussionComment { | 27 | class DiscussionComment { |
| 12 | 28 | ||
| @@ -123,7 +139,7 @@ class DiscussionComment { | @@ -123,7 +139,7 @@ class DiscussionComment { | ||
| 123 | function & get($iNewCommentID) { | 139 | function & get($iNewCommentID) { |
| 124 | global $default; | 140 | global $default; |
| 125 | $sql = $default->db; | 141 | $sql = $default->db; |
| 126 | - $result = $sql->query("SELECT * FROM $default->owl_discussion_comments_table WHERE id = $iNewCommentID"); | 142 | + $result = $sql->query("SELECT * FROM $default->discussion_comments_table WHERE id = $iNewCommentID"); |
| 127 | if ($result) { | 143 | if ($result) { |
| 128 | if ($sql->next_record()) { | 144 | if ($sql->next_record()) { |
| 129 | $oDiscussionComment = & new DiscussionComment($sql->f("body"),$sql->f("subject"),$sql->f("user_id"),$sql->f("thread_id")); | 145 | $oDiscussionComment = & new DiscussionComment($sql->f("body"),$sql->f("subject"),$sql->f("user_id"),$sql->f("thread_id")); |
| @@ -131,7 +147,7 @@ class DiscussionComment { | @@ -131,7 +147,7 @@ class DiscussionComment { | ||
| 131 | $oDiscussionComment->dDate = $sql->f("date"); | 147 | $oDiscussionComment->dDate = $sql->f("date"); |
| 132 | return $oDiscussionComment; | 148 | return $oDiscussionComment; |
| 133 | } | 149 | } |
| 134 | - $_SESSION["errorMessage"] = $lang_err_object_not_exist . "id = " . $iNewCommentID . " table = $default->owl_discussion_comments_table"; | 150 | + $_SESSION["errorMessage"] = $lang_err_object_not_exist . "id = " . $iNewCommentID . " table = $default->discussion_comments_table"; |
| 135 | return false; | 151 | return false; |
| 136 | } | 152 | } |
| 137 | $_SESSION["errorMessage"] = $lang_err_database; | 153 | $_SESSION["errorMessage"] = $lang_err_database; |
| @@ -144,7 +160,7 @@ class DiscussionComment { | @@ -144,7 +160,7 @@ class DiscussionComment { | ||
| 144 | if ($this->iId < 0) { //check to see if comment exists | 160 | if ($this->iId < 0) { //check to see if comment exists |
| 145 | $sql = $default->db; | 161 | $sql = $default->db; |
| 146 | 162 | ||
| 147 | - $result = $sql->query("INSERT INTO " . $default->owl_discussion_comments_table . " (thread_id,user_id,subject, body, date)" . | 163 | + $result = $sql->query("INSERT INTO " . $default->discussion_comments_table . " (thread_id,user_id,subject, body, date)" . |
| 148 | "VALUES (" . $this->iThreadID . "," . $this->iUserID . ",\"" . $this->sSubject . "\",\"" . $this->sBody . "\",Now())"); | 164 | "VALUES (" . $this->iThreadID . "," . $this->iUserID . ",\"" . $this->sSubject . "\",\"" . $this->sBody . "\",Now())"); |
| 149 | if ($result) { | 165 | if ($result) { |
| 150 | $this->iId = $sql->insert_id(); | 166 | $this->iId = $sql->insert_id(); |
| @@ -154,7 +170,7 @@ class DiscussionComment { | @@ -154,7 +170,7 @@ class DiscussionComment { | ||
| 154 | return false; | 170 | return false; |
| 155 | 171 | ||
| 156 | } | 172 | } |
| 157 | - $_SESSION["errorMessage"] = $lang_err_object_exists . "id = " . $this->iId . " table = $default->owl_units_table"; | 173 | + $_SESSION["errorMessage"] = $lang_err_object_exists . "id = " . $this->iId . " table = $default->units_table"; |
| 158 | return false; | 174 | return false; |
| 159 | } | 175 | } |
| 160 | 176 | ||
| @@ -165,7 +181,7 @@ class DiscussionComment { | @@ -165,7 +181,7 @@ class DiscussionComment { | ||
| 165 | $sql = $default->db; | 181 | $sql = $default->db; |
| 166 | // Do update query | 182 | // Do update query |
| 167 | 183 | ||
| 168 | - $result = $sql->query( "UPDATE " . $default->owl_discussion_comments_table . | 184 | + $result = $sql->query( "UPDATE " . $default->discussion_comments_table . |
| 169 | " SET thread_id = " . $this->iThreadID . | 185 | " SET thread_id = " . $this->iThreadID . |
| 170 | " AND user_id = " . $this->iUserID . | 186 | " AND user_id = " . $this->iUserID . |
| 171 | " AND subject = " . $this->sSubject . | 187 | " AND subject = " . $this->sSubject . |
| @@ -189,7 +205,7 @@ class DiscussionComment { | @@ -189,7 +205,7 @@ class DiscussionComment { | ||
| 189 | if ($this->iId > 0) { | 205 | if ($this->iId > 0) { |
| 190 | //check to see if group is linked to a unit | 206 | //check to see if group is linked to a unit |
| 191 | $sql = $default->db; | 207 | $sql = $default->db; |
| 192 | - $query = "SELECT * FROM ". $default->owl_discussion_comments_table . " WHERE id = " . $this->iId ; | 208 | + $query = "SELECT * FROM ". $default->discussion_comments_table . " WHERE id = " . $this->iId ; |
| 193 | $sql->query($query); | 209 | $sql->query($query); |
| 194 | $rows = $sql->num_rows($sql); | 210 | $rows = $sql->num_rows($sql); |
| 195 | 211 | ||
| @@ -200,7 +216,7 @@ class DiscussionComment { | @@ -200,7 +216,7 @@ class DiscussionComment { | ||
| 200 | 216 | ||
| 201 | } else { | 217 | } else { |
| 202 | $sql = $default->db; | 218 | $sql = $default->db; |
| 203 | - $result = $sql->query("DELETE FROM $default->owl_discussion_comments_table WHERE id = $this->iId"); | 219 | + $result = $sql->query("DELETE FROM $default->discussion_comments_table WHERE id = $this->iId"); |
| 204 | if ($result) { | 220 | if ($result) { |
| 205 | return true; | 221 | return true; |
| 206 | } | 222 | } |
lib/discussions/DiscussionThread.inc
| @@ -2,11 +2,27 @@ | @@ -2,11 +2,27 @@ | ||
| 2 | /** | 2 | /** |
| 3 | * $Id$ | 3 | * $Id$ |
| 4 | * | 4 | * |
| 5 | - * Contains static functions concerned with Discusion threads | 5 | + * Represents a document discussion thread. |
| 6 | + * | ||
| 7 | + * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com | ||
| 8 | + * | ||
| 9 | + * This program is free software; you can redistribute it and/or modify | ||
| 10 | + * it under the terms of the GNU General Public License as published by | ||
| 11 | + * the Free Software Foundation; either version 2 of the License, or | ||
| 12 | + * (at your option) any later version. | ||
| 13 | + * | ||
| 14 | + * This program is distributed in the hope that it will be useful, | ||
| 15 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 16 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 17 | + * GNU General Public License for more details. | ||
| 18 | + * | ||
| 19 | + * You should have received a copy of the GNU General Public License | ||
| 20 | + * along with this program; if not, write to the Free Software | ||
| 21 | + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 6 | * | 22 | * |
| 7 | - * @author Omar Rahbeeni, CS Holdings, South Africa | ||
| 8 | * @version $Revision$ | 23 | * @version $Revision$ |
| 9 | - * @package lib.discussions | 24 | + * @author Omar Rahbeeni, CS Holdings, South Africa |
| 25 | + * @package lib.discussions | ||
| 10 | */ | 26 | */ |
| 11 | class DiscussionThread { | 27 | class DiscussionThread { |
| 12 | 28 | ||
| @@ -114,12 +130,12 @@ class DiscussionThread { | @@ -114,12 +130,12 @@ class DiscussionThread { | ||
| 114 | global $default; | 130 | global $default; |
| 115 | 131 | ||
| 116 | $sql = $default->db; | 132 | $sql = $default->db; |
| 117 | - $result = $sql->query("SELECT id FROM $default->owl_discussion_threads_table WHERE document_id = $this->iDocumentID ORDER BY id"); | 133 | + $result = $sql->query("SELECT id FROM $default->discussion_threads_table WHERE document_id = $this->iDocumentID ORDER BY id"); |
| 118 | if ($result) { | 134 | if ($result) { |
| 119 | $sql->next_record(); | 135 | $sql->next_record(); |
| 120 | $iThreadID = $sql->f("id"); | 136 | $iThreadID = $sql->f("id"); |
| 121 | 137 | ||
| 122 | - $result = $sql->query("SELECT id FROM $default->owl_discussion_comments_table WHERE thread_id = $iThreadID ORDER BY date Desc"); | 138 | + $result = $sql->query("SELECT id FROM $default->discussion_comments_table WHERE thread_id = $iThreadID ORDER BY date Desc"); |
| 123 | 139 | ||
| 124 | if ($result) { | 140 | if ($result) { |
| 125 | while ($sql->next_record()) { | 141 | while ($sql->next_record()) { |
| @@ -142,7 +158,7 @@ class DiscussionThread { | @@ -142,7 +158,7 @@ class DiscussionThread { | ||
| 142 | function getThreadIDforDoc($iDocumentID){ | 158 | function getThreadIDforDoc($iDocumentID){ |
| 143 | global $default; | 159 | global $default; |
| 144 | $sql = $default->db; | 160 | $sql = $default->db; |
| 145 | - $result = $sql->query("SELECT id FROM $default->owl_discussion_threads_table WHERE document_id = $iDocumentID"); | 161 | + $result = $sql->query("SELECT id FROM $default->discussion_threads_table WHERE document_id = $iDocumentID"); |
| 146 | if ($result) { | 162 | if ($result) { |
| 147 | if ($sql->next_record()) { | 163 | if ($sql->next_record()) { |
| 148 | if ($sql->f("id") > 0) { | 164 | if ($sql->f("id") > 0) { |
| @@ -151,7 +167,7 @@ class DiscussionThread { | @@ -151,7 +167,7 @@ class DiscussionThread { | ||
| 151 | return "false"; | 167 | return "false"; |
| 152 | } | 168 | } |
| 153 | } | 169 | } |
| 154 | - $_SESSION["errorMessage"] = $lang_err_object_not_exist . "Document_id = " . $iDocumentID . " table = $default->owl_discussion_threads_table"; | 170 | + $_SESSION["errorMessage"] = $lang_err_object_not_exist . "Document_id = " . $iDocumentID . " table = $default->discussion_threads_table"; |
| 155 | return false; | 171 | return false; |
| 156 | } | 172 | } |
| 157 | $_SESSION["errorMessage"] = $lang_err_database; | 173 | $_SESSION["errorMessage"] = $lang_err_database; |
| @@ -170,7 +186,7 @@ class DiscussionThread { | @@ -170,7 +186,7 @@ class DiscussionThread { | ||
| 170 | function & get($iNewThreadID) { | 186 | function & get($iNewThreadID) { |
| 171 | global $default; | 187 | global $default; |
| 172 | $sql = $default->db; | 188 | $sql = $default->db; |
| 173 | - $result = $sql->query("SELECT * FROM $default->owl_discussion_threads_table WHERE id = $iNewThreadID"); | 189 | + $result = $sql->query("SELECT * FROM $default->discussion_threads_table WHERE id = $iNewThreadID"); |
| 174 | if ($result) { | 190 | if ($result) { |
| 175 | if ($sql->next_record()) { | 191 | if ($sql->next_record()) { |
| 176 | 192 | ||
| @@ -184,7 +200,7 @@ class DiscussionThread { | @@ -184,7 +200,7 @@ class DiscussionThread { | ||
| 184 | $oDiscussionThread->iNumberOfReplies = $sql->f("replies"); | 200 | $oDiscussionThread->iNumberOfReplies = $sql->f("replies"); |
| 185 | return $oDiscussionThread; | 201 | return $oDiscussionThread; |
| 186 | } | 202 | } |
| 187 | - $_SESSION["errorMessage"] = $lang_err_object_not_exist . "id = " . $iNewThreadID . " table = $default->owl_discussion_threads_table"; | 203 | + $_SESSION["errorMessage"] = $lang_err_object_not_exist . "id = " . $iNewThreadID . " table = $default->discussion_threads_table"; |
| 188 | return false; | 204 | return false; |
| 189 | } | 205 | } |
| 190 | $_SESSION["errorMessage"] = $lang_err_database; | 206 | $_SESSION["errorMessage"] = $lang_err_database; |
| @@ -200,7 +216,7 @@ class DiscussionThread { | @@ -200,7 +216,7 @@ class DiscussionThread { | ||
| 200 | $sQuery = "what the hell"; | 216 | $sQuery = "what the hell"; |
| 201 | if ($this->iId < 0) { //check to see if entry exists | 217 | if ($this->iId < 0) { //check to see if entry exists |
| 202 | $sql = $default->db; | 218 | $sql = $default->db; |
| 203 | - $sQuery = "INSERT INTO " . $default->owl_discussion_threads_table . | 219 | + $sQuery = "INSERT INTO " . $default->discussion_threads_table . |
| 204 | " (document_id, first_comment_id, last_comment_id, views, replies, creator_id) " . | 220 | " (document_id, first_comment_id, last_comment_id, views, replies, creator_id) " . |
| 205 | "VALUES (" . $this->iDocumentID . "," . $this->iFirstCommentID . "," . $this->iLastCommentID . "," . $this->iNumberOfViews . "," . $this->iNumberOfReplies ."," . $this->iCreatorID . ")"; | 221 | "VALUES (" . $this->iDocumentID . "," . $this->iFirstCommentID . "," . $this->iLastCommentID . "," . $this->iNumberOfViews . "," . $this->iNumberOfReplies ."," . $this->iCreatorID . ")"; |
| 206 | $result = $sql->query($sQuery); | 222 | $result = $sql->query($sQuery); |
| @@ -212,7 +228,7 @@ class DiscussionThread { | @@ -212,7 +228,7 @@ class DiscussionThread { | ||
| 212 | $_SESSION["errorMessage"] = $lang_err_database; | 228 | $_SESSION["errorMessage"] = $lang_err_database; |
| 213 | return false; | 229 | return false; |
| 214 | } | 230 | } |
| 215 | - $_SESSION["errorMessage"] = $lang_err_object_exists . "id = " . $this->iId . " table = $default->owl_discussion_threads_table"; | 231 | + $_SESSION["errorMessage"] = $lang_err_object_exists . "id = " . $this->iId . " table = $default->discussion_threads_table"; |
| 216 | return false; | 232 | return false; |
| 217 | } | 233 | } |
| 218 | 234 | ||
| @@ -224,7 +240,7 @@ class DiscussionThread { | @@ -224,7 +240,7 @@ class DiscussionThread { | ||
| 224 | //only update if the object has been stored | 240 | //only update if the object has been stored |
| 225 | if ($this->iId > 0) { | 241 | if ($this->iId > 0) { |
| 226 | $sql = $default->db; | 242 | $sql = $default->db; |
| 227 | - $sQuery = "UPDATE " . $default->owl_discussion_threads_table . | 243 | + $sQuery = "UPDATE " . $default->discussion_threads_table . |
| 228 | " SET document_id = " . $this->iDocumentID . | 244 | " SET document_id = " . $this->iDocumentID . |
| 229 | ", first_comment_id = " . $this->iFirstCommentID . | 245 | ", first_comment_id = " . $this->iFirstCommentID . |
| 230 | ", last_comment_id = " . $this->iLastCommentID . | 246 | ", last_comment_id = " . $this->iLastCommentID . |
| @@ -256,7 +272,7 @@ class DiscussionThread { | @@ -256,7 +272,7 @@ class DiscussionThread { | ||
| 256 | if ($this->iId > 0) { | 272 | if ($this->iId > 0) { |
| 257 | //check to see if group is linked to a unit | 273 | //check to see if group is linked to a unit |
| 258 | $sql = $default->db; | 274 | $sql = $default->db; |
| 259 | - $query = "SELECT * FROM ". $default->owl_discussion_threads_table ." WHERE id = " . $this->iId ; | 275 | + $query = "SELECT * FROM ". $default->discussion_threads_table ." WHERE id = " . $this->iId ; |
| 260 | $sql->query($query); | 276 | $sql->query($query); |
| 261 | $rows = $sql->num_rows($sql); | 277 | $rows = $sql->num_rows($sql); |
| 262 | 278 | ||
| @@ -267,7 +283,7 @@ class DiscussionThread { | @@ -267,7 +283,7 @@ class DiscussionThread { | ||
| 267 | 283 | ||
| 268 | } else { | 284 | } else { |
| 269 | $sql = $default->db; | 285 | $sql = $default->db; |
| 270 | - $result = $sql->query("DELETE FROM $default->owl_discussion_threads_table WHERE id = $this->iId"); | 286 | + $result = $sql->query("DELETE FROM $default->discussion_threads_table WHERE id = $this->iId"); |
| 271 | if ($result) { | 287 | if ($result) { |
| 272 | return true; | 288 | return true; |
| 273 | } | 289 | } |