Commit 46fb8c86a60cb252202438fdf02f27a34d3e0c21

Authored by Michael Joseph
1 parent a62143f0

added copyright and gpl notice

removed owl prefix from table aliases


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2567 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/DefaultLookup.inc
1 <?php 1 <?php
2 -  
3 /** 2 /**
4 -*  
5 -* Class DefaultLookup  
6 -*  
7 -* Represents the base class for any table in the database that ends in a _lookup  
8 -* i.e. any tables containing only an ID and name column  
9 -*  
10 -* @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa  
11 -* @date 19 January 2003  
12 -* @package lib  
13 -*/  
14 - 3 + * $Id$
  4 + *
  5 + * Represents the base class for any table in the database that ends in a _lookup
  6 + * i.e. any tables containing only an ID and name column
  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.
  14 + *
  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
  23 + *
  24 + * @version $Revision$
  25 + * @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa
  26 + * @package lib
  27 + */
15 class DefaultLookup { 28 class DefaultLookup {
16 29
17 /** database table name */ 30 /** database table name */
lib/Log.inc
1 <?php 1 <?php
2 -  
3 require_once("$default->fileSystemRoot/lib/database/datetime.inc"); 2 require_once("$default->fileSystemRoot/lib/database/datetime.inc");
4 -  
5 // define error levels 3 // define error levels
6 define("DEBUG", 0); 4 define("DEBUG", 0);
7 define("INFO", 1); 5 define("INFO", 1);
8 define("ERROR", 2); 6 define("ERROR", 2);
9 -  
10 /** 7 /**
11 * $Id$ 8 * $Id$
12 - *  
13 - * File logging class  
14 - *  
15 - * Licensed under the GNU GPL. For full terms see the file COPYING. 9 + *
  10 + * File logging class.
  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 * @package lib 30 * @package lib
20 - */ 31 + */
21 class Log { 32 class Log {
22 /** 33 /**
23 * The minimum logging level- log everything with 34 * The minimum logging level- log everything with
lib/System.inc
1 <?php 1 <?php
2 -  
3 require_once("$default->fileSystemRoot/phplib/db_mysql.inc"); 2 require_once("$default->fileSystemRoot/phplib/db_mysql.inc");
4 require_once("$default->fileSystemRoot/lib/database/db.inc"); 3 require_once("$default->fileSystemRoot/lib/database/db.inc");
5 -  
6 -  
7 /** 4 /**
8 * $Id$ 5 * $Id$
9 - *  
10 - * Stores system settings  
11 - *  
12 - * Licensed under the GNU GPL. For full terms see the file COPYING. 6 + *
  7 + * Stores system settings.
  8 + *
  9 + * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com
  10 + *
  11 + * This program is free software; you can redistribute it and/or modify
  12 + * it under the terms of the GNU General Public License as published by
  13 + * the Free Software Foundation; either version 2 of the License, or
  14 + * (at your option) any later version.
  15 + *
  16 + * This program is distributed in the hope that it will be useful,
  17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19 + * GNU General Public License for more details.
  20 + *
  21 + * You should have received a copy of the GNU General Public License
  22 + * along with this program; if not, write to the Free Software
  23 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
13 * 24 *
14 * @version $Revision$ 25 * @version $Revision$
15 * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa 26 * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa
16 * @package lib 27 * @package lib
17 - */ 28 + */
18 class System { 29 class System {
19 30
20 var $db; 31 var $db;
@@ -63,9 +74,9 @@ class System { @@ -63,9 +74,9 @@ class System {
63 function set($sSettingName, $sSettingValue) { 74 function set($sSettingName, $sSettingValue) {
64 global $default, $lang_err_database; 75 global $default, $lang_err_database;
65 76
66 - if (lookupField($default->owl_system_settings_table, "name", "name", $sSettingName)) { 77 + if (lookupField($default->system_settings_table, "name", "name", $sSettingName)) {
67 // the setting exists, so overwrite it 78 // the setting exists, so overwrite it
68 - if ($default->db->query("UPDATE $default->owl_system_settings_table SET value='$sSettingValue' where name='$sSettingName'")) { 79 + if ($default->db->query("UPDATE $default->system_settings_table SET value='$sSettingValue' where name='$sSettingName'")) {
69 return true; 80 return true;
70 } else { 81 } else {
71 $_SESSION["errorMessage"] = $lang_err_database; 82 $_SESSION["errorMessage"] = $lang_err_database;
@@ -73,7 +84,7 @@ class System { @@ -73,7 +84,7 @@ class System {
73 } 84 }
74 } else { 85 } else {
75 // the setting doesn't exist, lets insert it 86 // the setting doesn't exist, lets insert it
76 - if ($default->db->query("INSERT INTO $default->owl_system_settings_table (name, value) VALUES ('$sSettingName', '$sSettingValue')")) { 87 + if ($default->db->query("INSERT INTO $default->system_settings_table (name, value) VALUES ('$sSettingName', '$sSettingValue')")) {
77 return true; 88 return true;
78 } else { 89 } else {
79 $_SESSION["errorMessage"] = $lang_err_database; 90 $_SESSION["errorMessage"] = $lang_err_database;
lib/dms.inc
1 <?php 1 <?php
2 -  
3 /** 2 /**
4 - * @package lib  
5 - *  
6 * $Id$ 3 * $Id$
7 * 4 *
8 * DMS default routines and functions 5 * DMS default routines and functions
9 * 6 *
10 - * Licensed under the GNU GPL. For full terms see the file COPYING. 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
11 * 22 *
12 * @version $Revision$ 23 * @version $Revision$
13 * @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
@@ -53,12 +64,12 @@ if(isset($default-&gt;defaultLanguage)) { @@ -53,12 +64,12 @@ if(isset($default-&gt;defaultLanguage)) {
53 } else { 64 } else {
54 65
55 $sql = $default->db; 66 $sql = $default->db;
56 - $sql->query("select * from $default->owl_sessions_table where id = '" . session_id() . "'"); 67 + $sql->query("select * from $default->sessions_table where id = '" . session_id() . "'");
57 $sql->next_record(); 68 $sql->next_record();
58 $numrows = $sql->num_rows($sql); 69 $numrows = $sql->num_rows($sql);
59 $userID = $sql->f("user_id"); 70 $userID = $sql->f("user_id");
60 if($numrows == 1) { 71 if($numrows == 1) {
61 - $sql->query("select * from $default->owl_users_table where id = $userID"); 72 + $sql->query("select * from $default->users_table where id = $userID");
62 $sql->next_record(); 73 $sql->next_record();
63 $language = $sql->f("language"); 74 $language = $sql->f("language");
64 // BEGIN wes fix 75 // BEGIN wes fix
lib/visualpatterns/NavBar.inc
1 <?php 1 <?php
2 -  
3 require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); 2 require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc");
4 -global $default;  
5 -  
6 /** 3 /**
7 -* Contains all the functions to create the navbar...  
8 -*  
9 -* @author Mukhtar Dharsey  
10 -* @date 22 January 2003  
11 -*/ 4 + * $Id$
  5 + *
  6 + * Contains all the functions to create the Navbar.
  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.
  14 + *
  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
  23 + *
  24 + * @version $Revision$
  25 + * @author Mukhtar Dharsey, Jam Warehouse (Pty) Ltd, South Africa
  26 + * @package lib.visualpatterns
  27 + */
12 class NavBar { 28 class NavBar {
13 //variable used to pass highlighting 29 //variable used to pass highlighting
14 var $home; 30 var $home;
lib/visualpatterns/PatternBrowsableSearchResults.inc
1 <?php 1 <?php
2 - 2 +/**
  3 + * $Id$
  4 + *
  5 + * Renders paginated query results in a table.
  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
  22 + *
  23 + * @version $Revision$
  24 + * @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa
  25 + * @package lib.visualpatterns
  26 + */
3 class PatternBrowseableSearchResults { 27 class PatternBrowseableSearchResults {
4 28
5 /** query to be executed */ 29 /** query to be executed */
lib/visualpatterns/PatternCreate.inc
1 <?php 1 <?php
2 /** 2 /**
3 -* Class PatternCreate  
4 -*  
5 -* This pattern facilities the creation of new entries in the database using  
6 -* the objects associated with those entries  
7 -*  
8 -* @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa  
9 -* @date 4 February 2003  
10 -* @package presentation.lib.visualpatterns  
11 -*/  
12 - 3 + * $Id$
  4 + *
  5 + * This pattern facilities the creation of new entries in the database using
  6 + * the objects associated with those entries.
  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.
  14 + *
  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
  23 + *
  24 + * @version $Revision$
  25 + * @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa
  26 + * @package lib.visualpatterns
  27 + */
13 class PatternCreate { 28 class PatternCreate {
14 29
15 var $sObject; 30 var $sObject;
lib/visualpatterns/PatternCustom.inc
1 <?php 1 <?php
2 -  
3 -/**  
4 - * 2 +/**
5 * $Id$ 3 * $Id$
6 * 4 *
7 - * Used to specify html code that is not catered for by any of the other patterns 5 + * Used to specify html code that is not catered for by any of the other patterns.
  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
  22 + *
  23 + * @version $Revision$
  24 + * @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa
8 * @package lib.visualpatterns 25 * @package lib.visualpatterns
9 - */ 26 + */
10 class PatternCustom { 27 class PatternCustom {
11 28
12 /** Custom HTML string */ 29 /** Custom HTML string */
lib/visualpatterns/PatternDatabaseTable.inc
1 <?php 1 <?php
2 -  
3 /** 2 /**
4 -*  
5 -* Class PatternDatabaseTable  
6 -*  
7 -* Builds a query using the table name and the array of specified columns  
8 -* and displays the results in an HTML table. The ID column of the table is  
9 -* included by default (basically renders a database table in html)  
10 -*  
11 -* The first column in the table can be rendered as a link  
12 -* to the document/folder using the $iLinkType variable to specify the link type,  
13 -* the $sLinkPageURL to specify the page URL to link to and $sLinkImageURL to specify  
14 -* the image to display in the case of either a $iLinkType of 2 (image only) or 3 (image + text)  
15 -*  
16 -* @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa  
17 -* @date 7 January 2003  
18 -*  
19 -* @todo $iLinkImageURL is hard coded - change  
20 -* @todo $sLinkPageURL is hard coded - change  
21 -*  
22 -* @package lib.visualpatterns  
23 -*/  
24 - 3 + * $Id$
  4 + *
  5 + * Builds a query using the table name and the array of specified columns
  6 + * and displays the results in an HTML table. The ID column of the table is
  7 + * included by default (basically renders a database table in html)
  8 + *
  9 + * The first column in the table can be rendered as a link
  10 + * to the document/folder using the $iLinkType variable to specify the link type,
  11 + * the $sLinkPageURL to specify the page URL to link to and $sLinkImageURL to specify
  12 + * the image to display in the case of either a $iLinkType of 2 (image only) or 3 (image + text)
  13 + *
  14 + * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com
  15 + *
  16 + * This program is free software; you can redistribute it and/or modify
  17 + * it under the terms of the GNU General Public License as published by
  18 + * the Free Software Foundation; either version 2 of the License, or
  19 + * (at your option) any later version.
  20 + *
  21 + * This program is distributed in the hope that it will be useful,
  22 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  23 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  24 + * GNU General Public License for more details.
  25 + *
  26 + * You should have received a copy of the GNU General Public License
  27 + * along with this program; if not, write to the Free Software
  28 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  29 + *
  30 + * @version $Revision$
  31 + * @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa
  32 + * @package lib.visualpatterns
  33 + * @todo $iLinkImageURL is hard coded - change
  34 + * @todo $sLinkPageURL is hard coded - change
  35 + */
25 class PatternDatabaseTable { 36 class PatternDatabaseTable {
26 37
27 /* Name of table to query */ 38 /* Name of table to query */
lib/visualpatterns/PatternEditableListFromQuery.inc
1 <?php 1 <?php
2 /** 2 /**
3 -* Class PatternEditableListFromQuery  
4 -* Takes a SQL query, an array of column names and and an array of column types  
5 -* and displays the data in an editable two column list format  
6 -*  
7 -* @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa  
8 -* @date 27 January 2003  
9 -* @package lib.visualpatterns  
10 -*  
11 -* @todo implement HyperLinkURL option  
12 -*/  
13 - 3 + * $Id$
  4 + *
  5 + * Takes a SQL query, an array of column names and and an array of column types
  6 + * and displays the data in an editable two column list format.
  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.
  14 + *
  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
  23 + *
  24 + * @version $Revision$
  25 + * @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa
  26 + * @package lib.visualpatterns
  27 + * @todo implement HyperLinkURL option
  28 + */
14 class PatternEditableListFromQuery { 29 class PatternEditableListFromQuery {
15 30
16 /** SQL query to execute */ 31 /** SQL query to execute */
lib/visualpatterns/PatternEditableTableSqlQuery.inc
1 <?php 1 <?php
2 -  
3 /** 2 /**
4 -* Class PatternEditableTableSqlQuery  
5 -*  
6 -* Will take a query that generates a table like  
7 -* result and create and editable HTML table from it that can  
8 -* be used as part of a form.  
9 -*  
10 -* 1 columns is REQUIRED in the Sql query:  
11 -* o column giving primary key of entry in table (primary key column name specified in $aPrimaryKey)  
12 -*  
13 -* 3 hidden fields are generated for each editable entry:  
14 -* o <uniquename>_id: holds the primary key of the entry in the table (-1 = no entry in table i.e. create not update)  
15 -* o <uniquename>_tn: holds the tablename for which the primary key is valid  
16 -* o <uniquename>_type: holds the type of entry (text/boolean/list) - for parsing purposes  
17 -*  
18 -* The actual value is held in a form field name <uniquename>  
19 -*  
20 -* @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa  
21 -* @date 25 January 2003  
22 -* @todo - add client side validation stuff  
23 -* @todo - add column type 3 -> select field stuff  
24 -* @package lib.visualpatterns  
25 -*/  
26 - 3 + * $Id$
  4 + *
  5 + * Will take a query that generates a table like
  6 + * result and create and editable HTML table from it that can
  7 + * be used as part of a form.
  8 + *
  9 + * 1 columns is REQUIRED in the Sql query:
  10 + * o column giving primary key of entry in table (primary key column name specified in $aPrimaryKey)
  11 + *
  12 + * 3 hidden fields are generated for each editable entry:
  13 + * o <uniquename>_id: holds the primary key of the entry in the table (-1 = no entry in table i.e. create not update)
  14 + * o <uniquename>_tn: holds the tablename for which the primary key is valid
  15 + * o <uniquename>_type: holds the type of entry (text/boolean/list) - for parsing purposes
  16 + *
  17 + * The actual value is held in a form field name <uniquename>
  18 + *
  19 + * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com
  20 + *
  21 + * This program is free software; you can redistribute it and/or modify
  22 + * it under the terms of the GNU General Public License as published by
  23 + * the Free Software Foundation; either version 2 of the License, or
  24 + * (at your option) any later version.
  25 + *
  26 + * This program is distributed in the hope that it will be useful,
  27 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  28 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  29 + * GNU General Public License for more details.
  30 + *
  31 + * You should have received a copy of the GNU General Public License
  32 + * along with this program; if not, write to the Free Software
  33 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  34 + *
  35 + * @version $Revision$
  36 + * @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa
  37 + * @package lib.visualpatterns
  38 + * @todo - add client side validation stuff
  39 + * @todo - add column type 3 -> select field stuff
  40 + */
27 class PatternEditableTableSqlQuery { 41 class PatternEditableTableSqlQuery {
28 42
29 /** query to execute*/ 43 /** query to execute*/
lib/visualpatterns/PatternImage.inc
1 <?php 1 <?php
2 -  
3 -/*  
4 - *  
5 - * Given an image URL, this class will render it inside a single cell table 2 +/**
  3 + * $Id$
  4 + *
  5 + * Given an image URL, this class will render it inside a single cell table.
  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.
6 * 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$
7 * @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa 24 * @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa
8 - * @date 7 January 2003  
9 * @package lib.visualpatterns 25 * @package lib.visualpatterns
10 -  
11 -*/  
12 - 26 + */
13 class PatternImage { 27 class PatternImage {
14 28
15 /** Image URL */ 29 /** Image URL */
lib/visualpatterns/PatternListBox.inc
1 <?php 1 <?php
2 /** 2 /**
3 -*  
4 -* Class PatternListBox  
5 -*  
6 -* Creates a drop down list box using a table name and  
7 -* two column names (one column is the display value, the other  
8 -* is the option value). The option value column should always  
9 -* be an ID that is a primary key in a table.  
10 -*  
11 -* @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa  
12 -* @date 16 January 2003  
13 -* @todo - if the list is set to submit on change, it submits the form. Investigate ways  
14 -* to get a list action to occur, instead of the default form action  
15 -* @package lib.visualpatterns  
16 -*  
17 -*/  
18 - 3 + * $Id$
  4 + *
  5 + * Creates a drop down list box using a table name and
  6 + * two column names (one column is the display value, the other
  7 + * is the option value). The option value column should always
  8 + * be an ID that is a primary key in a table
  9 + *
  10 + * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com
  11 + *
  12 + * This program is free software; you can redistribute it and/or modify
  13 + * it under the terms of the GNU General Public License as published by
  14 + * the Free Software Foundation; either version 2 of the License, or
  15 + * (at your option) any later version.
  16 + *
  17 + * This program is distributed in the hope that it will be useful,
  18 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20 + * GNU General Public License for more details.
  21 + *
  22 + * You should have received a copy of the GNU General Public License
  23 + * along with this program; if not, write to the Free Software
  24 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  25 + *
  26 + * @version $Revision$
  27 + * @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa
  28 + * @package lib.visualpatterns
  29 + * @todo - if the list is set to submit on change, it submits the form. Investigate ways
  30 + * to get a list action to occur, instead of the default form action
  31 + */
19 class PatternListBox { 32 class PatternListBox {
20 33
21 /** Database table to get information from */ 34 /** Database table to get information from */
lib/visualpatterns/PatternListFromQuery.inc
1 <?php 1 <?php
2 /** 2 /**
3 -* Class PatternListFromQuery  
4 -* Takes a SQL query, an array of column names and and an array of column types  
5 -* and displays the data in a two column list format  
6 -*  
7 -* @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa  
8 -* @date 22 January 2003  
9 -* @package lib.visualpatterns  
10 -*  
11 -* @todo implement HyperLinkURL option  
12 -*/  
13 - 3 + * $Id$
  4 + *
  5 + * Takes a SQL query, an array of column names and and an array of column types
  6 + * and displays the data in a two column list format.
  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.
  14 + *
  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
  23 + *
  24 + * @version $Revision$
  25 + * @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa
  26 + * @package lib.visualpatterns
  27 + * @todo implement HyperLinkURL option
  28 + */
14 class PatternListFromQuery { 29 class PatternListFromQuery {
15 30
16 /** SQL query to execute */ 31 /** SQL query to execute */
lib/visualpatterns/PatternMainPage.inc
1 <?php 1 <?php
2 -  
3 /** 2 /**
4 * $Id$ 3 * $Id$
5 - * 4 + *
6 * Main page of the document management system. Consists of a 2 x 2 HTML table. 5 * Main page of the document management system. Consists of a 2 x 2 HTML table.
7 * Custom defined payloads can be placed in each of the table cells, giving a reasonable 6 * Custom defined payloads can be placed in each of the table cells, giving a reasonable
8 * amount of layout/design flexibility 7 * amount of layout/design flexibility
9 * 8 *
10 - * JavaScript to validate numbers and strings is included by default 9 + * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com
  10 + *
  11 + * This program is free software; you can redistribute it and/or modify
  12 + * it under the terms of the GNU General Public License as published by
  13 + * the Free Software Foundation; either version 2 of the License, or
  14 + * (at your option) any later version.
11 * 15 *
12 - * Licensed under the GNU GPL. For full terms see the file DOCS/COPYING. 16 + * This program is distributed in the hope that it will be useful,
  17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19 + * GNU General Public License for more details.
13 * 20 *
  21 + * You should have received a copy of the GNU General Public License
  22 + * along with this program; if not, write to the Free Software
  23 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  24 + *
  25 + * @version $Revision$
14 * @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa 26 * @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa
15 - * @date 12 December 2002  
16 * @package lib.visualpatterns 27 * @package lib.visualpatterns
17 - */  
18 - 28 + */
19 class PatternMainPage { 29 class PatternMainPage {
20 30
21 /** property holder for $oNorthWestPayload */ 31 /** property holder for $oNorthWestPayload */
lib/visualpatterns/PatternMetaData.inc
1 <?php 1 <?php
2 2
3 require_once("PatternListBox.inc"); 3 require_once("PatternListBox.inc");
4 - 4 +/**
  5 + * $Id$
  6 + *
  7 + * Renders document field appropriately (as a listbox if required).
  8 + *
  9 + * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com
  10 + *
  11 + * This program is free software; you can redistribute it and/or modify
  12 + * it under the terms of the GNU General Public License as published by
  13 + * the Free Software Foundation; either version 2 of the License, or
  14 + * (at your option) any later version.
  15 + *
  16 + * This program is distributed in the hope that it will be useful,
  17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19 + * GNU General Public License for more details.
  20 + *
  21 + * You should have received a copy of the GNU General Public License
  22 + * along with this program; if not, write to the Free Software
  23 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  24 + *
  25 + * @version $Revision$
  26 + * @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa
  27 + * @package lib.visualpatterns
  28 + */
5 class PatternMetaData { 29 class PatternMetaData {
6 30
7 var $sMetaDataField; 31 var $sMetaDataField;
@@ -20,7 +44,7 @@ class PatternMetaData { @@ -20,7 +44,7 @@ class PatternMetaData {
20 44
21 function render() { 45 function render() {
22 global $default; 46 global $default;
23 - $sQuery = "SELECT has_lookup FROM $default->owl_fields_table WHERE name LIKE '" . $this->sMetaDataField . "'"; 47 + $sQuery = "SELECT has_lookup FROM $default->document_fields_table WHERE name LIKE '" . $this->sMetaDataField . "'";
24 48
25 $sql = $default->db; 49 $sql = $default->db;
26 $sql->query($sQuery); 50 $sql->query($sQuery);
@@ -28,8 +52,8 @@ class PatternMetaData { @@ -28,8 +52,8 @@ class PatternMetaData {
28 if ($sql->f("has_lookup")) { 52 if ($sql->f("has_lookup")) {
29 //is a lookup, so display a drop down list 53 //is a lookup, so display a drop down list
30 $sWhereClause = "DF.name LIKE '" . $this->sMetaDataField . "'"; 54 $sWhereClause = "DF.name LIKE '" . $this->sMetaDataField . "'";
31 - $sFromClause = "INNER JOIN $default->owl_fields_table AS DF ON ST.document_field_id = DF.id";  
32 - $oPatternListBox = & new PatternListBox("$default->owl_document_fields_lookup_tables", "name", "name", $this->sFormName); 55 + $sFromClause = "INNER JOIN $default->document_fields_table AS DF ON ST.document_field_id = DF.id";
  56 + $oPatternListBox = & new PatternListBox("$default->document_fields_lookup_tables", "name", "name", $this->sFormName);
33 if ($this->sValue != null) { 57 if ($this->sValue != null) {
34 $oPatternListBox->setSelectedValue($this->sValue); 58 $oPatternListBox->setSelectedValue($this->sValue);
35 } 59 }
lib/visualpatterns/PatternTableLinks.inc
1 <?php 1 <?php
2 -/*  
3 -*  
4 -*  
5 -* Given an array of URLs, this class will render them as an  
6 -* HTML table with with specified number of rows and columns  
7 -*  
8 -* @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa  
9 -* @date 7 January 2003  
10 -* @package lib.visualpatterns  
11 -*/  
12 -  
13 define("TEXT", 1); 2 define("TEXT", 1);
14 define("IMAGE", 2); 3 define("IMAGE", 2);
15 - 4 +/**
  5 + * $Id$
  6 + *
  7 + * Given an array of URLs, this class will render them as an
  8 + * HTML table with with specified number of rows and columns
  9 + *
  10 + * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com
  11 + *
  12 + * This program is free software; you can redistribute it and/or modify
  13 + * it under the terms of the GNU General Public License as published by
  14 + * the Free Software Foundation; either version 2 of the License, or
  15 + * (at your option) any later version.
  16 + *
  17 + * This program is distributed in the hope that it will be useful,
  18 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20 + * GNU General Public License for more details.
  21 + *
  22 + * You should have received a copy of the GNU General Public License
  23 + * along with this program; if not, write to the Free Software
  24 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  25 + *
  26 + * @version $Revision$
  27 + * @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa
  28 + * @package lib.visualpatterns
  29 + */
16 class PatternTableLinks { 30 class PatternTableLinks {
17 31
18 /** Array of link URLS to display in tables */ 32 /** Array of link URLS to display in tables */
lib/visualpatterns/PatternTableSqlQuery.inc
1 <?php 1 <?php
2 -  
3 /** 2 /**
4 -* Class PatternTableSqlQuery  
5 -*  
6 -* Renders query results in a table.  
7 -*  
8 -* The first column in the table can be rendered as a link  
9 -* to the document/folder using the $iLinkType variable to specify the link type,  
10 -* the $sLinkPageURL to specify the page URL to link to and $sLinkImageURL to specify  
11 -* the image to display in the case of either a $iLinkType of 2 (image only) or 3 (image + text)  
12 -*  
13 -* If you wish to include images, there are two ways to do this  
14 -* o set the image url - this means that all rows will use the same image  
15 -* o set $bUseImageURLFromQuery to true - this will look for a column entitled image_url in  
16 -* the sql result set, allowing you to specify different images for each entry  
17 -*  
18 -* @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa  
19 -* @date 7 January 2003  
20 -*  
21 -* @todo $iLinkImageURL is hard coded - change  
22 -* @todo $sLinkPageURL is hard coded - change  
23 -* @package lib.visualpatterns  
24 -*/  
25 - 3 + * $Id$
  4 + *
  5 + * Renders query results in a table.
  6 + *
  7 + * The first column in the table can be rendered as a link
  8 + * to the document/folder using the $iLinkType variable to specify the link type,
  9 + * the $sLinkPageURL to specify the page URL to link to and $sLinkImageURL to specify
  10 + * the image to display in the case of either a $iLinkType of 2 (image only) or 3 (image + text)
  11 + *
  12 + * If you wish to include images, there are two ways to do this
  13 + * o set the image url - this means that all rows will use the same image
  14 + * o set $bUseImageURLFromQuery to true - this will look for a column entitled image_url in
  15 + * the sql result set, allowing you to specify different images for each entry
  16 + *
  17 + * Copyright (c) 2003 Jam Warehouse http://www.jamwarehouse.com
  18 + *
  19 + * This program is free software; you can redistribute it and/or modify
  20 + * it under the terms of the GNU General Public License as published by
  21 + * the Free Software Foundation; either version 2 of the License, or
  22 + * (at your option) any later version.
  23 + *
  24 + * This program is distributed in the hope that it will be useful,
  25 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  26 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  27 + * GNU General Public License for more details.
  28 + *
  29 + * You should have received a copy of the GNU General Public License
  30 + * along with this program; if not, write to the Free Software
  31 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  32 + *
  33 + * @version $Revision$
  34 + * @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa
  35 + * @package lib.visualpatterns
  36 + * @todo $iLinkImageURL is hard coded - change
  37 + * @todo $sLinkPageURL is hard coded - change
  38 + */
26 class PatternTableSqlQuery { 39 class PatternTableSqlQuery {
27 40
28 /** query to execute*/ 41 /** query to execute*/
lib/web/WebDocument.inc
@@ -3,18 +3,31 @@ @@ -3,18 +3,31 @@
3 DEFINE("PENDING",1); 3 DEFINE("PENDING",1);
4 DEFINE("PUBLISHED", 2); 4 DEFINE("PUBLISHED", 2);
5 DEFINE("NOT_PUBLISHED",3); 5 DEFINE("NOT_PUBLISHED",3);
6 -  
7 /** 6 /**
8 -*  
9 -* Class Web Documents  
10 -*  
11 -* Represents a web document as per the web_documents table in the database  
12 -*  
13 -* @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa  
14 -* @date 19 January 2003  
15 -* @package lib.web  
16 -*/  
17 - 7 + * $Id$
  8 + *
  9 + * Represents a web document as per the web_documents table in the database.
  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
  26 + *
  27 + * @version $Revision$
  28 + * @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa
  29 + * @package lib.web
  30 + */
18 class WebDocument { 31 class WebDocument {
19 32
20 /** primary key of web document */ 33 /** primary key of web document */
@@ -94,7 +107,7 @@ class WebDocument { @@ -94,7 +107,7 @@ class WebDocument {
94 //if the object hasn't been created 107 //if the object hasn't been created
95 if ($this->iId < 0) { 108 if ($this->iId < 0) {
96 $sql = $default->db; 109 $sql = $default->db;
97 - $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')"); 110 + $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')");
98 if ($result) { 111 if ($result) {
99 $this->iId = $sql->insert_id(); 112 $this->iId = $sql->insert_id();
100 return true; 113 return true;
@@ -117,7 +130,7 @@ class WebDocument { @@ -117,7 +130,7 @@ class WebDocument {
117 //only update if the object has been stored 130 //only update if the object has been stored
118 if ($this->iId > 0) { 131 if ($this->iId > 0) {
119 $sql = $default->db; 132 $sql = $default->db;
120 - $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"); 133 + $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");
121 if ($result) { 134 if ($result) {
122 return true; 135 return true;
123 } 136 }
@@ -139,7 +152,7 @@ class WebDocument { @@ -139,7 +152,7 @@ class WebDocument {
139 //only delete the object if it exists in the database 152 //only delete the object if it exists in the database
140 if ($this->iId >= 0) { 153 if ($this->iId >= 0) {
141 $sql = $default->db; 154 $sql = $default->db;
142 - $result = $sql->query("DELETE FROM $default->owl_web_documents_table WHERE id = $this->iId"); 155 + $result = $sql->query("DELETE FROM $default->web_documents_table WHERE id = $this->iId");
143 if ($result) { 156 if ($result) {
144 return true; 157 return true;
145 } 158 }
@@ -161,14 +174,14 @@ class WebDocument { @@ -161,14 +174,14 @@ class WebDocument {
161 function & get($iWebDocumentsID) { 174 function & get($iWebDocumentsID) {
162 global $default; 175 global $default;
163 $sql = $default->db; 176 $sql = $default->db;
164 - $result = $sql->query("SELECT * FROM $default->owl_web_documents_table WHERE id = $iWebDocumentsID"); 177 + $result = $sql->query("SELECT * FROM $default->web_documents_table WHERE id = $iWebDocumentsID");
165 if ($result) { 178 if ($result) {
166 if ($sql->next_record()) { 179 if ($sql->next_record()) {
167 $oWebDocument = & new WebDocument($sql->f("document_id"), $sql->f("web_site_id"), $sql->f("unit_id"), $sql->f("status_id"), $sql->f("datetime")); 180 $oWebDocument = & new WebDocument($sql->f("document_id"), $sql->f("web_site_id"), $sql->f("unit_id"), $sql->f("status_id"), $sql->f("datetime"));
168 $oWebDocument->iId = $iWebDocumentsID; 181 $oWebDocument->iId = $iWebDocumentsID;
169 return $oWebDocument; 182 return $oWebDocument;
170 } 183 }
171 - $_SESSION["errorMessage"] = $lang_err_object_not_exist . "id = " . $iWebDocumentsID . " table = $default->owl_web_documents_table"; 184 + $_SESSION["errorMessage"] = $lang_err_object_not_exist . "id = " . $iWebDocumentsID . " table = $default->web_documents_table";
172 return false; 185 return false;
173 } 186 }
174 $_SESSION["errorMessage"] = $lang_err_database; 187 $_SESSION["errorMessage"] = $lang_err_database;
@@ -188,7 +201,7 @@ class WebDocument { @@ -188,7 +201,7 @@ class WebDocument {
188 $aWebDocumentArray; 201 $aWebDocumentArray;
189 settype($aWebDocumentArray, "array"); 202 settype($aWebDocumentArray, "array");
190 $sql = $default->db; 203 $sql = $default->db;
191 - $result = $sql->query("SELECT * FROM " . $default->owl_web_documents_table . (isset($sWhereClause) ? " WHERE " . $sWhereClause : "")); 204 + $result = $sql->query("SELECT * FROM " . $default->web_documents_table . (isset($sWhereClause) ? " WHERE " . $sWhereClause : ""));
192 if ($result) { 205 if ($result) {
193 while ($sql->next_record()) { 206 while ($sql->next_record()) {
194 $aWebDocumentArray[]= & WebDocument::get($sql->f("id")); 207 $aWebDocumentArray[]= & WebDocument::get($sql->f("id"));
lib/web/WebSite.inc
1 <?php 1 <?php
2 -  
3 /** 2 /**
4 -*  
5 -* Class WebSite  
6 -* Represents a web site as per the web_sites database table  
7 -*  
8 -* @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa  
9 -* @date 20 January 2003  
10 -*  
11 -* @todo - add regex parsing to ensure URL is valid  
12 -* @package lib.web  
13 -*/  
14 - 3 + * $Id$
  4 + *
  5 + * Represents a web site as per the web_sites database table.
  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
  22 + *
  23 + * @version $Revision$
  24 + * @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa
  25 + * @package lib.web
  26 + * @todo - add regex parsing to ensure URL is valid
  27 + */
15 class WebSite { 28 class WebSite {
16 29
17 /** primary key of web site */ 30 /** primary key of web site */
@@ -122,7 +135,7 @@ class WebSite { @@ -122,7 +135,7 @@ class WebSite {
122 if ($this->iId < 0) { 135 if ($this->iId < 0) {
123 //check to see if name exsits 136 //check to see if name exsits
124 $sql = $default->db; 137 $sql = $default->db;
125 - $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 . "'"; 138 + $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 . "'";
126 $sql->query($query); 139 $sql->query($query);
127 $rows = $sql->num_rows($sql); 140 $rows = $sql->num_rows($sql);
128 if ($rows > 0) { 141 if ($rows > 0) {
@@ -133,7 +146,7 @@ class WebSite { @@ -133,7 +146,7 @@ class WebSite {
133 } else { 146 } else {
134 147
135 $sql = $default->db; 148 $sql = $default->db;
136 - $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)"); 149 + $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)");
137 if ($result) { 150 if ($result) {
138 $this->iId = $sql->insert_id(); 151 $this->iId = $sql->insert_id();
139 return true; 152 return true;
@@ -142,7 +155,7 @@ class WebSite { @@ -142,7 +155,7 @@ class WebSite {
142 return false; 155 return false;
143 } 156 }
144 } 157 }
145 - $_SESSION["errorMessage"] = $lang_err_object_exists . "id = " . $this->iId . " table = $default->owl_web_sites_table"; 158 + $_SESSION["errorMessage"] = $lang_err_object_exists . "id = " . $this->iId . " table = $default->web_sites_table";
146 return false; 159 return false;
147 } 160 }
148 161
@@ -157,7 +170,7 @@ class WebSite { @@ -157,7 +170,7 @@ class WebSite {
157 //only update if the object has been stored 170 //only update if the object has been stored
158 if ($this->iId > 0) { 171 if ($this->iId > 0) {
159 $sql = $default->db; 172 $sql = $default->db;
160 - $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"); 173 + $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");
161 if ($result) { 174 if ($result) {
162 return true; 175 return true;
163 } 176 }
@@ -179,7 +192,7 @@ class WebSite { @@ -179,7 +192,7 @@ class WebSite {
179 //only delete the object if it exists in the database 192 //only delete the object if it exists in the database
180 if ($this->iId >= 0) { 193 if ($this->iId >= 0) {
181 $sql = $default->db; 194 $sql = $default->db;
182 - $result = $sql->query("DELETE FROM $default->owl_web_sites_table WHERE id = $this->iId"); 195 + $result = $sql->query("DELETE FROM $default->web_sites_table WHERE id = $this->iId");
183 if ($result) { 196 if ($result) {
184 return true; 197 return true;
185 } 198 }
@@ -201,14 +214,14 @@ class WebSite { @@ -201,14 +214,14 @@ class WebSite {
201 function & get($iWebSiteID) { 214 function & get($iWebSiteID) {
202 global $default; 215 global $default;
203 $sql = $default->db; 216 $sql = $default->db;
204 - $result = $sql->query("SELECT * FROM $default->owl_web_sites_table WHERE id = $iWebSiteID"); 217 + $result = $sql->query("SELECT * FROM $default->web_sites_table WHERE id = $iWebSiteID");
205 if ($result) { 218 if ($result) {
206 if ($sql->next_record()) { 219 if ($sql->next_record()) {
207 $oWebSite = & new WebSite(stripslashes($sql->f("web_site_name")), stripslashes($sql->f("web_site_url")), $sql->f("web_master_id")); 220 $oWebSite = & new WebSite(stripslashes($sql->f("web_site_name")), stripslashes($sql->f("web_site_url")), $sql->f("web_master_id"));
208 $oWebSite->iId = $iWebSiteID; 221 $oWebSite->iId = $iWebSiteID;
209 return $oWebSite; 222 return $oWebSite;
210 } 223 }
211 - $_SESSION["errorMessage"] = $lang_err_object_not_exist . "id = " . $iWebSiteID . " table = $default->owl_web_sites_table"; 224 + $_SESSION["errorMessage"] = $lang_err_object_not_exist . "id = " . $iWebSiteID . " table = $default->web_sites_table";
212 return false; 225 return false;
213 } 226 }
214 $_SESSION["errorMessage"] = $lang_err_database; 227 $_SESSION["errorMessage"] = $lang_err_database;
@@ -226,7 +239,7 @@ class WebSite { @@ -226,7 +239,7 @@ class WebSite {
226 $aWebSiteArray; 239 $aWebSiteArray;
227 settype($aWebSiteArray, "array"); 240 settype($aWebSiteArray, "array");
228 $sql = $default->db; 241 $sql = $default->db;
229 - $result = $sql->query("SELECT * FROM " . $default->owl_web_sites_table); 242 + $result = $sql->query("SELECT * FROM " . $default->web_sites_table);
230 if ($result) { 243 if ($result) {
231 $iCount = 0; 244 $iCount = 0;
232 while ($sql->next_record()) { 245 while ($sql->next_record()) {