|
From: Verdon V. <ve...@us...> - 2008-06-12 21:19:16
|
Update of /cvsroot/phpwebsite-comm/modules/rolodex/boost In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26163/boost Modified Files: install.sql Added Files: sql_update_070.sql update.php Log Message: add support for locations and features --- NEW FILE: sql_update_070.sql --- -- rolodex - phpwebsite module -- @version $Id: sql_update_070.sql,v 1.1 2008/06/12 21:18:48 verdonv Exp $ -- @author Verdon Vaillancourt <verdonv at users dot sourceforge dot net> CREATE TABLE rolodex_location ( id int not null default 0, title varchar(80) not null, description text, image_id INT NOT NULL default 0, PRIMARY KEY (id) ); CREATE TABLE rolodex_feature ( id int not null default 0, title varchar(80) not null, description text, image_id INT NOT NULL default 0, PRIMARY KEY (id) ); CREATE TABLE rolodex_location_items ( location_id int NOT NULL default 0, member_id int NOT NULL default 0 ); CREATE TABLE rolodex_feature_items ( feature_id int NOT NULL default 0, member_id int NOT NULL default 0 ); Index: install.sql =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/boost/install.sql,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** install.sql 11 Jun 2008 17:43:28 -0000 1.2 --- install.sql 12 Jun 2008 21:18:48 -0000 1.3 *************** *** 44,53 **** ); ! CREATE TABLE rolodex_loc_items ( location_id int NOT NULL default 0, member_id int NOT NULL default 0 ); ! CREATE TABLE rolodex_fea_items ( feature_id int NOT NULL default 0, member_id int NOT NULL default 0 --- 44,53 ---- ); ! CREATE TABLE rolodex_location_items ( location_id int NOT NULL default 0, member_id int NOT NULL default 0 ); ! CREATE TABLE rolodex_feature_items ( feature_id int NOT NULL default 0, member_id int NOT NULL default 0 --- NEW FILE: update.php --- <?php /** * rolodex - phpwebsite module * * See docs/AUTHORS and docs/COPYRIGHT for relevant info. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * @version $Id: update.php,v 1.1 2008/06/12 21:18:48 verdonv Exp $ * @author Verdon Vaillancourt <verdonv at users dot sourceforge dot net> */ function rolodex_update(&$content, $currentVersion) { $home_dir = PHPWS_Boost::getHomeDir(); switch ($currentVersion) { case version_compare($currentVersion, '0.7.0', '<'): $result = PHPWS_DB::importFile(PHPWS_SOURCE_DIR . 'mod/rolodex/boost/sql_update_070.sql'); if (PEAR::isError($result)) { PHPWS_Error::log($result); $content[] = '+ Unable to add the location and feature tables.'; return false; } else { $content[] = '<pre>'; $files = array('templates/edit_location.tpl', 'templates/edit_feature.tpl', 'templates/edit_member.tpl', 'templates/list_location.tpl', 'templates/list_feature.tpl', 'templates/view_location.tpl', 'templates/view_feature.tpl', 'templates/view_member.tpl', 'templates/edit_settings.tpl' ); rolodexUpdateFiles($files, $content); $content[] = '0.7.0 changes ---------------- + Added support for locations and features </pre>'; } } // end switch return true; } function rolodexUpdateFiles($files, &$content) { if (PHPWS_Boost::updateFiles($files, 'rolodex')) { $content[] = '--- Updated the following files:'; } else { $content[] = '--- Unable to update the following files:'; } $content[] = " " . implode("\n ", $files); } ?> |