Commit 46fb8c86a60cb252202438fdf02f27a34d3e0c21
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
Showing
20 changed files
with
523 additions
and
236 deletions
lib/DefaultLookup.inc
| 1 | 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 | 28 | class DefaultLookup { |
| 16 | 29 | |
| 17 | 30 | /** database table name */ | ... | ... |
lib/Log.inc
| 1 | 1 | <?php |
| 2 | - | |
| 3 | 2 | require_once("$default->fileSystemRoot/lib/database/datetime.inc"); |
| 4 | - | |
| 5 | 3 | // define error levels |
| 6 | 4 | define("DEBUG", 0); |
| 7 | 5 | define("INFO", 1); |
| 8 | 6 | define("ERROR", 2); |
| 9 | - | |
| 10 | 7 | /** |
| 11 | 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 | 28 | * @version $Revision$ |
| 18 | 29 | * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa |
| 19 | 30 | * @package lib |
| 20 | - */ | |
| 31 | + */ | |
| 21 | 32 | class Log { |
| 22 | 33 | /** |
| 23 | 34 | * The minimum logging level- log everything with | ... | ... |
lib/System.inc
| 1 | 1 | <?php |
| 2 | - | |
| 3 | 2 | require_once("$default->fileSystemRoot/phplib/db_mysql.inc"); |
| 4 | 3 | require_once("$default->fileSystemRoot/lib/database/db.inc"); |
| 5 | - | |
| 6 | - | |
| 7 | 4 | /** |
| 8 | 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 | 25 | * @version $Revision$ |
| 15 | 26 | * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa |
| 16 | 27 | * @package lib |
| 17 | - */ | |
| 28 | + */ | |
| 18 | 29 | class System { |
| 19 | 30 | |
| 20 | 31 | var $db; |
| ... | ... | @@ -63,9 +74,9 @@ class System { |
| 63 | 74 | function set($sSettingName, $sSettingValue) { |
| 64 | 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 | 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 | 80 | return true; |
| 70 | 81 | } else { |
| 71 | 82 | $_SESSION["errorMessage"] = $lang_err_database; |
| ... | ... | @@ -73,7 +84,7 @@ class System { |
| 73 | 84 | } |
| 74 | 85 | } else { |
| 75 | 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 | 88 | return true; |
| 78 | 89 | } else { |
| 79 | 90 | $_SESSION["errorMessage"] = $lang_err_database; | ... | ... |
lib/dms.inc
| 1 | 1 | <?php |
| 2 | - | |
| 3 | 2 | /** |
| 4 | - * @package lib | |
| 5 | - * | |
| 6 | 3 | * $Id$ |
| 7 | 4 | * |
| 8 | 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 | 23 | * @version $Revision$ |
| 13 | 24 | * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa |
| ... | ... | @@ -53,12 +64,12 @@ if(isset($default->defaultLanguage)) { |
| 53 | 64 | } else { |
| 54 | 65 | |
| 55 | 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 | 68 | $sql->next_record(); |
| 58 | 69 | $numrows = $sql->num_rows($sql); |
| 59 | 70 | $userID = $sql->f("user_id"); |
| 60 | 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 | 73 | $sql->next_record(); |
| 63 | 74 | $language = $sql->f("language"); |
| 64 | 75 | // BEGIN wes fix | ... | ... |
lib/visualpatterns/NavBar.inc
| 1 | 1 | <?php |
| 2 | - | |
| 3 | 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 | 28 | class NavBar { |
| 13 | 29 | //variable used to pass highlighting |
| 14 | 30 | var $home; | ... | ... |
lib/visualpatterns/PatternBrowsableSearchResults.inc
| 1 | 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 | 27 | class PatternBrowseableSearchResults { |
| 4 | 28 | |
| 5 | 29 | /** query to be executed */ | ... | ... |
lib/visualpatterns/PatternCreate.inc
| 1 | 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 | 28 | class PatternCreate { |
| 14 | 29 | |
| 15 | 30 | var $sObject; | ... | ... |
lib/visualpatterns/PatternCustom.inc
| 1 | 1 | <?php |
| 2 | - | |
| 3 | -/** | |
| 4 | - * | |
| 2 | +/** | |
| 5 | 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 | 25 | * @package lib.visualpatterns |
| 9 | - */ | |
| 26 | + */ | |
| 10 | 27 | class PatternCustom { |
| 11 | 28 | |
| 12 | 29 | /** Custom HTML string */ | ... | ... |
lib/visualpatterns/PatternDatabaseTable.inc
| 1 | 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 | 36 | class PatternDatabaseTable { |
| 26 | 37 | |
| 27 | 38 | /* Name of table to query */ | ... | ... |
lib/visualpatterns/PatternEditableListFromQuery.inc
| 1 | 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 | 29 | class PatternEditableListFromQuery { |
| 15 | 30 | |
| 16 | 31 | /** SQL query to execute */ | ... | ... |
lib/visualpatterns/PatternEditableTableSqlQuery.inc
| 1 | 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 | 41 | class PatternEditableTableSqlQuery { |
| 28 | 42 | |
| 29 | 43 | /** query to execute*/ | ... | ... |
lib/visualpatterns/PatternImage.inc
| 1 | 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 | 24 | * @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa |
| 8 | - * @date 7 January 2003 | |
| 9 | 25 | * @package lib.visualpatterns |
| 10 | - | |
| 11 | -*/ | |
| 12 | - | |
| 26 | + */ | |
| 13 | 27 | class PatternImage { |
| 14 | 28 | |
| 15 | 29 | /** Image URL */ | ... | ... |
lib/visualpatterns/PatternListBox.inc
| 1 | 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 | 32 | class PatternListBox { |
| 20 | 33 | |
| 21 | 34 | /** Database table to get information from */ | ... | ... |
lib/visualpatterns/PatternListFromQuery.inc
| 1 | 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 | 29 | class PatternListFromQuery { |
| 15 | 30 | |
| 16 | 31 | /** SQL query to execute */ | ... | ... |
lib/visualpatterns/PatternMainPage.inc
| 1 | 1 | <?php |
| 2 | - | |
| 3 | 2 | /** |
| 4 | 3 | * $Id$ |
| 5 | - * | |
| 4 | + * | |
| 6 | 5 | * Main page of the document management system. Consists of a 2 x 2 HTML table. |
| 7 | 6 | * Custom defined payloads can be placed in each of the table cells, giving a reasonable |
| 8 | 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 | 26 | * @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa |
| 15 | - * @date 12 December 2002 | |
| 16 | 27 | * @package lib.visualpatterns |
| 17 | - */ | |
| 18 | - | |
| 28 | + */ | |
| 19 | 29 | class PatternMainPage { |
| 20 | 30 | |
| 21 | 31 | /** property holder for $oNorthWestPayload */ | ... | ... |
lib/visualpatterns/PatternMetaData.inc
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 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 | 29 | class PatternMetaData { |
| 6 | 30 | |
| 7 | 31 | var $sMetaDataField; |
| ... | ... | @@ -20,7 +44,7 @@ class PatternMetaData { |
| 20 | 44 | |
| 21 | 45 | function render() { |
| 22 | 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 | 49 | $sql = $default->db; |
| 26 | 50 | $sql->query($sQuery); |
| ... | ... | @@ -28,8 +52,8 @@ class PatternMetaData { |
| 28 | 52 | if ($sql->f("has_lookup")) { |
| 29 | 53 | //is a lookup, so display a drop down list |
| 30 | 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 | 57 | if ($this->sValue != null) { |
| 34 | 58 | $oPatternListBox->setSelectedValue($this->sValue); |
| 35 | 59 | } | ... | ... |
lib/visualpatterns/PatternTableLinks.inc
| 1 | 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 | 2 | define("TEXT", 1); |
| 14 | 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 | 30 | class PatternTableLinks { |
| 17 | 31 | |
| 18 | 32 | /** Array of link URLS to display in tables */ | ... | ... |
lib/visualpatterns/PatternTableSqlQuery.inc
| 1 | 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 | 39 | class PatternTableSqlQuery { |
| 27 | 40 | |
| 28 | 41 | /** query to execute*/ | ... | ... |
lib/web/WebDocument.inc
| ... | ... | @@ -3,18 +3,31 @@ |
| 3 | 3 | DEFINE("PENDING",1); |
| 4 | 4 | DEFINE("PUBLISHED", 2); |
| 5 | 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 | 31 | class WebDocument { |
| 19 | 32 | |
| 20 | 33 | /** primary key of web document */ |
| ... | ... | @@ -94,7 +107,7 @@ class WebDocument { |
| 94 | 107 | //if the object hasn't been created |
| 95 | 108 | if ($this->iId < 0) { |
| 96 | 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 | 111 | if ($result) { |
| 99 | 112 | $this->iId = $sql->insert_id(); |
| 100 | 113 | return true; |
| ... | ... | @@ -117,7 +130,7 @@ class WebDocument { |
| 117 | 130 | //only update if the object has been stored |
| 118 | 131 | if ($this->iId > 0) { |
| 119 | 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 | 134 | if ($result) { |
| 122 | 135 | return true; |
| 123 | 136 | } |
| ... | ... | @@ -139,7 +152,7 @@ class WebDocument { |
| 139 | 152 | //only delete the object if it exists in the database |
| 140 | 153 | if ($this->iId >= 0) { |
| 141 | 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 | 156 | if ($result) { |
| 144 | 157 | return true; |
| 145 | 158 | } |
| ... | ... | @@ -161,14 +174,14 @@ class WebDocument { |
| 161 | 174 | function & get($iWebDocumentsID) { |
| 162 | 175 | global $default; |
| 163 | 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 | 178 | if ($result) { |
| 166 | 179 | if ($sql->next_record()) { |
| 167 | 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 | 181 | $oWebDocument->iId = $iWebDocumentsID; |
| 169 | 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 | 185 | return false; |
| 173 | 186 | } |
| 174 | 187 | $_SESSION["errorMessage"] = $lang_err_database; |
| ... | ... | @@ -188,7 +201,7 @@ class WebDocument { |
| 188 | 201 | $aWebDocumentArray; |
| 189 | 202 | settype($aWebDocumentArray, "array"); |
| 190 | 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 | 205 | if ($result) { |
| 193 | 206 | while ($sql->next_record()) { |
| 194 | 207 | $aWebDocumentArray[]= & WebDocument::get($sql->f("id")); | ... | ... |
lib/web/WebSite.inc
| 1 | 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 | 28 | class WebSite { |
| 16 | 29 | |
| 17 | 30 | /** primary key of web site */ |
| ... | ... | @@ -122,7 +135,7 @@ class WebSite { |
| 122 | 135 | if ($this->iId < 0) { |
| 123 | 136 | //check to see if name exsits |
| 124 | 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 | 139 | $sql->query($query); |
| 127 | 140 | $rows = $sql->num_rows($sql); |
| 128 | 141 | if ($rows > 0) { |
| ... | ... | @@ -133,7 +146,7 @@ class WebSite { |
| 133 | 146 | } else { |
| 134 | 147 | |
| 135 | 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 | 150 | if ($result) { |
| 138 | 151 | $this->iId = $sql->insert_id(); |
| 139 | 152 | return true; |
| ... | ... | @@ -142,7 +155,7 @@ class WebSite { |
| 142 | 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 | 159 | return false; |
| 147 | 160 | } |
| 148 | 161 | |
| ... | ... | @@ -157,7 +170,7 @@ class WebSite { |
| 157 | 170 | //only update if the object has been stored |
| 158 | 171 | if ($this->iId > 0) { |
| 159 | 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 | 174 | if ($result) { |
| 162 | 175 | return true; |
| 163 | 176 | } |
| ... | ... | @@ -179,7 +192,7 @@ class WebSite { |
| 179 | 192 | //only delete the object if it exists in the database |
| 180 | 193 | if ($this->iId >= 0) { |
| 181 | 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 | 196 | if ($result) { |
| 184 | 197 | return true; |
| 185 | 198 | } |
| ... | ... | @@ -201,14 +214,14 @@ class WebSite { |
| 201 | 214 | function & get($iWebSiteID) { |
| 202 | 215 | global $default; |
| 203 | 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 | 218 | if ($result) { |
| 206 | 219 | if ($sql->next_record()) { |
| 207 | 220 | $oWebSite = & new WebSite(stripslashes($sql->f("web_site_name")), stripslashes($sql->f("web_site_url")), $sql->f("web_master_id")); |
| 208 | 221 | $oWebSite->iId = $iWebSiteID; |
| 209 | 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 | 225 | return false; |
| 213 | 226 | } |
| 214 | 227 | $_SESSION["errorMessage"] = $lang_err_database; |
| ... | ... | @@ -226,7 +239,7 @@ class WebSite { |
| 226 | 239 | $aWebSiteArray; |
| 227 | 240 | settype($aWebSiteArray, "array"); |
| 228 | 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 | 243 | if ($result) { |
| 231 | 244 | $iCount = 0; |
| 232 | 245 | while ($sql->next_record()) { | ... | ... |