diff --git a/lib/DefaultLookup.inc b/lib/DefaultLookup.inc index 1eb692e..651e81b 100644 --- a/lib/DefaultLookup.inc +++ b/lib/DefaultLookup.inc @@ -1,17 +1,30 @@ fileSystemRoot/lib/database/datetime.inc"); - // define error levels define("DEBUG", 0); define("INFO", 1); define("ERROR", 2); - /** * $Id$ - * - * File logging class - * - * Licensed under the GNU GPL. For full terms see the file COPYING. + * + * File logging class. + * + * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * @version $Revision$ * @author Michael Joseph , Jam Warehouse (Pty) Ltd, South Africa * @package lib - */ + */ class Log { /** * The minimum logging level- log everything with diff --git a/lib/System.inc b/lib/System.inc index 7e29a7c..0601caa 100644 --- a/lib/System.inc +++ b/lib/System.inc @@ -1,20 +1,31 @@ fileSystemRoot/phplib/db_mysql.inc"); require_once("$default->fileSystemRoot/lib/database/db.inc"); - - /** * $Id$ - * - * Stores system settings - * - * Licensed under the GNU GPL. For full terms see the file COPYING. + * + * Stores system settings. + * + * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * @version $Revision$ * @author Michael Joseph , Jam Warehouse (Pty) Ltd, South Africa * @package lib - */ + */ class System { var $db; @@ -63,9 +74,9 @@ class System { function set($sSettingName, $sSettingValue) { global $default, $lang_err_database; - if (lookupField($default->owl_system_settings_table, "name", "name", $sSettingName)) { + if (lookupField($default->system_settings_table, "name", "name", $sSettingName)) { // the setting exists, so overwrite it - if ($default->db->query("UPDATE $default->owl_system_settings_table SET value='$sSettingValue' where name='$sSettingName'")) { + if ($default->db->query("UPDATE $default->system_settings_table SET value='$sSettingValue' where name='$sSettingName'")) { return true; } else { $_SESSION["errorMessage"] = $lang_err_database; @@ -73,7 +84,7 @@ class System { } } else { // the setting doesn't exist, lets insert it - if ($default->db->query("INSERT INTO $default->owl_system_settings_table (name, value) VALUES ('$sSettingName', '$sSettingValue')")) { + if ($default->db->query("INSERT INTO $default->system_settings_table (name, value) VALUES ('$sSettingName', '$sSettingValue')")) { return true; } else { $_SESSION["errorMessage"] = $lang_err_database; diff --git a/lib/dms.inc b/lib/dms.inc index fbcfa2e..a862dd1 100644 --- a/lib/dms.inc +++ b/lib/dms.inc @@ -1,13 +1,24 @@ , Jam Warehouse (Pty) Ltd, South Africa @@ -53,12 +64,12 @@ if(isset($default->defaultLanguage)) { } else { $sql = $default->db; - $sql->query("select * from $default->owl_sessions_table where id = '" . session_id() . "'"); + $sql->query("select * from $default->sessions_table where id = '" . session_id() . "'"); $sql->next_record(); $numrows = $sql->num_rows($sql); $userID = $sql->f("user_id"); if($numrows == 1) { - $sql->query("select * from $default->owl_users_table where id = $userID"); + $sql->query("select * from $default->users_table where id = $userID"); $sql->next_record(); $language = $sql->f("language"); // BEGIN wes fix diff --git a/lib/visualpatterns/NavBar.inc b/lib/visualpatterns/NavBar.inc index 0cf1b77..2e5e0eb 100644 --- a/lib/visualpatterns/NavBar.inc +++ b/lib/visualpatterns/NavBar.inc @@ -1,14 +1,30 @@ fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); -global $default; - /** -* Contains all the functions to create the navbar... -* -* @author Mukhtar Dharsey -* @date 22 January 2003 -*/ + * $Id$ + * + * Contains all the functions to create the Navbar. + * + * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @version $Revision$ + * @author Mukhtar Dharsey, Jam Warehouse (Pty) Ltd, South Africa + * @package lib.visualpatterns + */ class NavBar { //variable used to pass highlighting var $home; diff --git a/lib/visualpatterns/PatternBrowsableSearchResults.inc b/lib/visualpatterns/PatternBrowsableSearchResults.inc index 6c8e4fc..fcbc999 100644 --- a/lib/visualpatterns/PatternBrowsableSearchResults.inc +++ b/lib/visualpatterns/PatternBrowsableSearchResults.inc @@ -1,5 +1,29 @@ _id: holds the primary key of the entry in the table (-1 = no entry in table i.e. create not update) -* o _tn: holds the tablename for which the primary key is valid -* o _type: holds the type of entry (text/boolean/list) - for parsing purposes -* -* The actual value is held in a form field name -* -* @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa -* @date 25 January 2003 -* @todo - add client side validation stuff -* @todo - add column type 3 -> select field stuff -* @package lib.visualpatterns -*/ - + * $Id$ + * + * Will take a query that generates a table like + * result and create and editable HTML table from it that can + * be used as part of a form. + * + * 1 columns is REQUIRED in the Sql query: + * o column giving primary key of entry in table (primary key column name specified in $aPrimaryKey) + * + * 3 hidden fields are generated for each editable entry: + * o _id: holds the primary key of the entry in the table (-1 = no entry in table i.e. create not update) + * o _tn: holds the tablename for which the primary key is valid + * o _type: holds the type of entry (text/boolean/list) - for parsing purposes + * + * The actual value is held in a form field name + * + * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @version $Revision$ + * @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa + * @package lib.visualpatterns + * @todo - add client side validation stuff + * @todo - add column type 3 -> select field stuff + */ class PatternEditableTableSqlQuery { /** query to execute*/ diff --git a/lib/visualpatterns/PatternImage.inc b/lib/visualpatterns/PatternImage.inc index 262a437..de7f8b1 100644 --- a/lib/visualpatterns/PatternImage.inc +++ b/lib/visualpatterns/PatternImage.inc @@ -1,15 +1,29 @@ owl_fields_table WHERE name LIKE '" . $this->sMetaDataField . "'"; + $sQuery = "SELECT has_lookup FROM $default->document_fields_table WHERE name LIKE '" . $this->sMetaDataField . "'"; $sql = $default->db; $sql->query($sQuery); @@ -28,8 +52,8 @@ class PatternMetaData { if ($sql->f("has_lookup")) { //is a lookup, so display a drop down list $sWhereClause = "DF.name LIKE '" . $this->sMetaDataField . "'"; - $sFromClause = "INNER JOIN $default->owl_fields_table AS DF ON ST.document_field_id = DF.id"; - $oPatternListBox = & new PatternListBox("$default->owl_document_fields_lookup_tables", "name", "name", $this->sFormName); + $sFromClause = "INNER JOIN $default->document_fields_table AS DF ON ST.document_field_id = DF.id"; + $oPatternListBox = & new PatternListBox("$default->document_fields_lookup_tables", "name", "name", $this->sFormName); if ($this->sValue != null) { $oPatternListBox->setSelectedValue($this->sValue); } diff --git a/lib/visualpatterns/PatternTableLinks.inc b/lib/visualpatterns/PatternTableLinks.inc index c994083..d16de36 100644 --- a/lib/visualpatterns/PatternTableLinks.inc +++ b/lib/visualpatterns/PatternTableLinks.inc @@ -1,18 +1,32 @@ iId < 0) { $sql = $default->db; - $result = $sql->query("INSERT INTO " . $default->owl_web_documents_table . " (document_id, web_site_id, unit_id, status_id, datetime) VALUES ($this->iDocumentID, $this->iWebSiteID, $this->iUnitID, $this->iStatusID, '$this->dDateTime')"); + $result = $sql->query("INSERT INTO " . $default->web_documents_table . " (document_id, web_site_id, unit_id, status_id, datetime) VALUES ($this->iDocumentID, $this->iWebSiteID, $this->iUnitID, $this->iStatusID, '$this->dDateTime')"); if ($result) { $this->iId = $sql->insert_id(); return true; @@ -117,7 +130,7 @@ class WebDocument { //only update if the object has been stored if ($this->iId > 0) { $sql = $default->db; - $result = $sql->query("UPDATE " . $default->owl_web_documents_table . " SET document_id = $this->iDocumentID, web_site_id = $this->iWebSiteID, unit_id = $this->iUnitID, status_id = $this->iStatusID, datetime = '$this->dDateTime' WHERE id = $this->iId"); + $result = $sql->query("UPDATE " . $default->web_documents_table . " SET document_id = $this->iDocumentID, web_site_id = $this->iWebSiteID, unit_id = $this->iUnitID, status_id = $this->iStatusID, datetime = '$this->dDateTime' WHERE id = $this->iId"); if ($result) { return true; } @@ -139,7 +152,7 @@ class WebDocument { //only delete the object if it exists in the database if ($this->iId >= 0) { $sql = $default->db; - $result = $sql->query("DELETE FROM $default->owl_web_documents_table WHERE id = $this->iId"); + $result = $sql->query("DELETE FROM $default->web_documents_table WHERE id = $this->iId"); if ($result) { return true; } @@ -161,14 +174,14 @@ class WebDocument { function & get($iWebDocumentsID) { global $default; $sql = $default->db; - $result = $sql->query("SELECT * FROM $default->owl_web_documents_table WHERE id = $iWebDocumentsID"); + $result = $sql->query("SELECT * FROM $default->web_documents_table WHERE id = $iWebDocumentsID"); if ($result) { if ($sql->next_record()) { $oWebDocument = & new WebDocument($sql->f("document_id"), $sql->f("web_site_id"), $sql->f("unit_id"), $sql->f("status_id"), $sql->f("datetime")); $oWebDocument->iId = $iWebDocumentsID; return $oWebDocument; } - $_SESSION["errorMessage"] = $lang_err_object_not_exist . "id = " . $iWebDocumentsID . " table = $default->owl_web_documents_table"; + $_SESSION["errorMessage"] = $lang_err_object_not_exist . "id = " . $iWebDocumentsID . " table = $default->web_documents_table"; return false; } $_SESSION["errorMessage"] = $lang_err_database; @@ -188,7 +201,7 @@ class WebDocument { $aWebDocumentArray; settype($aWebDocumentArray, "array"); $sql = $default->db; - $result = $sql->query("SELECT * FROM " . $default->owl_web_documents_table . (isset($sWhereClause) ? " WHERE " . $sWhereClause : "")); + $result = $sql->query("SELECT * FROM " . $default->web_documents_table . (isset($sWhereClause) ? " WHERE " . $sWhereClause : "")); if ($result) { while ($sql->next_record()) { $aWebDocumentArray[]= & WebDocument::get($sql->f("id")); diff --git a/lib/web/WebSite.inc b/lib/web/WebSite.inc index a8223d7..95449c5 100644 --- a/lib/web/WebSite.inc +++ b/lib/web/WebSite.inc @@ -1,17 +1,30 @@ iId < 0) { //check to see if name exsits $sql = $default->db; - $query = "SELECT web_site_name FROM ". $default->owl_web_sites_table ." WHERE web_site_name = '" . $this->sWebSiteName . "' and web_site_url = '" . $this->sWebSiteURL . "' and web_master_id = '" . $this->iWebMasterID . "'"; + $query = "SELECT web_site_name FROM ". $default->web_sites_table ." WHERE web_site_name = '" . $this->sWebSiteName . "' and web_site_url = '" . $this->sWebSiteURL . "' and web_master_id = '" . $this->iWebMasterID . "'"; $sql->query($query); $rows = $sql->num_rows($sql); if ($rows > 0) { @@ -133,7 +146,7 @@ class WebSite { } else { $sql = $default->db; - $result = $sql->query("INSERT INTO " . $default->owl_web_sites_table . " (web_site_name, web_site_url, web_master_id) VALUES ('" . addslashes($this->sWebSiteName) . "', '" . addslashes($this->sWebSiteURL) . "', $this->iWebMasterID)"); + $result = $sql->query("INSERT INTO " . $default->web_sites_table . " (web_site_name, web_site_url, web_master_id) VALUES ('" . addslashes($this->sWebSiteName) . "', '" . addslashes($this->sWebSiteURL) . "', $this->iWebMasterID)"); if ($result) { $this->iId = $sql->insert_id(); return true; @@ -142,7 +155,7 @@ class WebSite { return false; } } - $_SESSION["errorMessage"] = $lang_err_object_exists . "id = " . $this->iId . " table = $default->owl_web_sites_table"; + $_SESSION["errorMessage"] = $lang_err_object_exists . "id = " . $this->iId . " table = $default->web_sites_table"; return false; } @@ -157,7 +170,7 @@ class WebSite { //only update if the object has been stored if ($this->iId > 0) { $sql = $default->db; - $result = $sql->query("UPDATE " . $default->owl_web_sites_table . " SET web_site_name = '" . addslashes($this->sWebSiteName) . "', web_site_url = '" . addslashes($this->sWebSiteURL) . "', web_master_id = '" . $this->iWebMasterID . "' WHERE id = $this->iId"); + $result = $sql->query("UPDATE " . $default->web_sites_table . " SET web_site_name = '" . addslashes($this->sWebSiteName) . "', web_site_url = '" . addslashes($this->sWebSiteURL) . "', web_master_id = '" . $this->iWebMasterID . "' WHERE id = $this->iId"); if ($result) { return true; } @@ -179,7 +192,7 @@ class WebSite { //only delete the object if it exists in the database if ($this->iId >= 0) { $sql = $default->db; - $result = $sql->query("DELETE FROM $default->owl_web_sites_table WHERE id = $this->iId"); + $result = $sql->query("DELETE FROM $default->web_sites_table WHERE id = $this->iId"); if ($result) { return true; } @@ -201,14 +214,14 @@ class WebSite { function & get($iWebSiteID) { global $default; $sql = $default->db; - $result = $sql->query("SELECT * FROM $default->owl_web_sites_table WHERE id = $iWebSiteID"); + $result = $sql->query("SELECT * FROM $default->web_sites_table WHERE id = $iWebSiteID"); if ($result) { if ($sql->next_record()) { $oWebSite = & new WebSite(stripslashes($sql->f("web_site_name")), stripslashes($sql->f("web_site_url")), $sql->f("web_master_id")); $oWebSite->iId = $iWebSiteID; return $oWebSite; } - $_SESSION["errorMessage"] = $lang_err_object_not_exist . "id = " . $iWebSiteID . " table = $default->owl_web_sites_table"; + $_SESSION["errorMessage"] = $lang_err_object_not_exist . "id = " . $iWebSiteID . " table = $default->web_sites_table"; return false; } $_SESSION["errorMessage"] = $lang_err_database; @@ -226,7 +239,7 @@ class WebSite { $aWebSiteArray; settype($aWebSiteArray, "array"); $sql = $default->db; - $result = $sql->query("SELECT * FROM " . $default->owl_web_sites_table); + $result = $sql->query("SELECT * FROM " . $default->web_sites_table); if ($result) { $iCount = 0; while ($sql->next_record()) {