From 04fd726c56367bcf2a26cd65eea06b57e77e946e Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Fri, 18 Aug 2006 03:16:46 +0000 Subject: [PATCH] r1068: Removing all inwards signs of "favourite" in favor of "favorite" --- docs/schema_changes.sql | 2 ++ favorite.php | 20 ++++++++++---------- includes/api_bug.php | 2 +- includes/api_user.php | 2 +- includes/class_notification.php | 4 ++-- search.php | 6 +++--- showreport.php | 2 +- templates/{favourites.tpl => favorites.tpl} | 0 8 files changed, 20 insertions(+), 18 deletions(-) rename templates/{favourites.tpl => favorites.tpl} (100%) diff --git a/docs/schema_changes.sql b/docs/schema_changes.sql index 76f36ef..57bcd43 100644 --- a/docs/schema_changes.sql +++ b/docs/schema_changes.sql @@ -5,3 +5,5 @@ DROP TABLE localization; ALTER TABLE language DROP filename; ALTER TABLE language CHANGE languagecode langcode VARCHAR(5) NOT NULL; + +ALTER TABLE favourite RENAME favorite; diff --git a/favorite.php b/favorite.php index 5b58022..a110f83 100644 --- a/favorite.php +++ b/favorite.php @@ -29,7 +29,7 @@ if (empty($_REQUEST['do'])) $focus[ ($_REQUEST['do'] == 'handle' ? 'showreport' : 'favorites') ] = 'focus'; $fetchtemplates = array( - 'favourites', + 'favorites', 'trackerhome_bits' ); @@ -51,14 +51,14 @@ if ($_REQUEST['do'] == 'handle') $message->error_permission(); } - if ($db->query_first("SELECT * FROM " . TABLE_PREFIX . "favourite WHERE userid = " . $bugsys->userinfo['userid'] . " AND bugid = " . $bugsys->in['bugid'])) + if ($db->query_first("SELECT * FROM " . TABLE_PREFIX . "favorite WHERE userid = " . $bugsys->userinfo['userid'] . " AND bugid = " . $bugsys->in['bugid'])) { - $db->query("DELETE FROM " . TABLE_PREFIX . "favourite WHERE userid = " . $bugsys->userinfo['userid'] . " AND bugid = " . $bugsys->in['bugid']); + $db->query("DELETE FROM " . TABLE_PREFIX . "favorite WHERE userid = " . $bugsys->userinfo['userid'] . " AND bugid = " . $bugsys->in['bugid']); $message->redirect(_('This bug has been removed from your favorites list.'), "showreport.php?bugid=" . $bugsys->in['bugid']); } else { - $db->query("INSERT INTO " . TABLE_PREFIX . "favourite (userid, bugid) VALUES (" . $bugsys->userinfo['userid'] . ", " . $bugsys->in['bugid'] . ")"); + $db->query("INSERT INTO " . TABLE_PREFIX . "favorite (userid, bugid) VALUES (" . $bugsys->userinfo['userid'] . ", " . $bugsys->in['bugid'] . ")"); $message->redirect(_('This bug has been added to your favorites list.'), "showreport.php?bugid=" . $bugsys->in['bugid']); } } @@ -67,13 +67,13 @@ if ($_REQUEST['do'] == 'handle') if ($_REQUEST['do'] == 'manage') { - $favourites = $db->query(" - SELECT favourite.bugid, bug.* FROM " . TABLE_PREFIX . "favourite AS favourite + $favorites = $db->query(" + SELECT favorite.bugid, bug.* FROM " . TABLE_PREFIX . "favorite AS favorite RIGHT JOIN " . TABLE_PREFIX . "bug AS bug - ON (favourite.bugid = bug.bugid) - WHERE favourite.userid = " . $bugsys->userinfo['userid'] + ON (favorite.bugid = bug.bugid) + WHERE favorite.userid = " . $bugsys->userinfo['userid'] ); - while ($bug = $db->fetch_array($favourites)) + while ($bug = $db->fetch_array($favorites)) { $funct->exec_swap_bg($stylevar['alt_colour'], ''); $bug['bgcolour'] = ($bugsys->userinfo['showcolours'] ? $bugsys->datastore['status']["$bug[status]"]['color'] : $funct->bgcolour); @@ -93,7 +93,7 @@ if ($_REQUEST['do'] == 'manage') eval('$bugs .= "' . $template->fetch('trackerhome_bits') . '";'); } - eval('$template->flush("' . $template->fetch('favourites') . '");'); + eval('$template->flush("' . $template->fetch('favorites') . '");'); } /*=====================================================================*\ diff --git a/includes/api_bug.php b/includes/api_bug.php index 2fbc5ed..c5cfdc7 100644 --- a/includes/api_bug.php +++ b/includes/api_bug.php @@ -112,7 +112,7 @@ class BugAPI extends API { $this->registry->db->query("DELETE FROM " . TABLE_PREFIX . "bugvaluefill WHERE bugid = " . $this->values['bugid']); $this->registry->db->query("DELETE FROM " . TABLE_PREFIX . "comment WHERE bugid = " . $this->values['bugid']); - $this->registry->db->query("DELETE FROM " . TABLE_PREFIX . "favourite WHERE bugid = " . $this->values['bugid']); + $this->registry->db->query("DELETE FROM " . TABLE_PREFIX . "favorite WHERE bugid = " . $this->values['bugid']); $this->registry->db->query("DELETE FROM " . TABLE_PREFIX . "history WHERE bugid = " . $this->values['bugid']); $this->registry->db->query("DELETE FROM " . TABLE_PREFIX . "vote WHERE bugid = " . $this->values['bugid']); } diff --git a/includes/api_user.php b/includes/api_user.php index dc869a2..37bc38d 100644 --- a/includes/api_user.php +++ b/includes/api_user.php @@ -254,7 +254,7 @@ class UserAPI extends API function post_delete() { $this->registry->db->query("DELETE FROM " . TABLE_PREFIX . "user WHERE userid = " . $this->values['userid']); - $this->registry->db->query("DELETE FROM " . TABLE_PREFIX . "favourite WHERE userid = " . $this->values['userid']); + $this->registry->db->query("DELETE FROM " . TABLE_PREFIX . "favorite WHERE userid = " . $this->values['userid']); $this->registry->db->query("DELETE FROM " . TABLE_PREFIX . "useractivation WHERE userid = " . $this->values['userid']); $this->registry->db->query("DELETE FROM " . TABLE_PREFIX . "useremail WHERE userid = " . $this->values['userid']); diff --git a/includes/class_notification.php b/includes/class_notification.php index a91c3f1..4a280ee 100644 --- a/includes/class_notification.php +++ b/includes/class_notification.php @@ -153,8 +153,8 @@ class NotificationCenter */ function fetch_user_cache() { - $favourites = $this->registry->db->query("SELECT userid FROM " . TABLE_PREFIX . "favourite WHERE bugid = " . $this->registry->clean($this->bug['bugid'], TYPE_UINT)); - while ($fav = $this->registry->db->fetch_array($favourites)) + $favorites = $this->registry->db->query("SELECT userid FROM " . TABLE_PREFIX . "favorite WHERE bugid = " . $this->registry->clean($this->bug['bugid'], TYPE_UINT)); + while ($fav = $this->registry->db->fetch_array($favorites)) { $this->roles['favorite']["$fav[userid]"] = $fav['userid']; } diff --git a/search.php b/search.php index a1cb733..d8a3315 100644 --- a/search.php +++ b/search.php @@ -182,10 +182,10 @@ if ($_REQUEST['do'] == 'process') // favoritess if (($bugsys->in['favorite'] == 1 OR $bugsys->in['favorite'] == 0) AND $bugsys->userinfo['userid']) { - $favourites = $db->query("SELECT * FROM " . TABLE_PREFIX . "favourite WHERE userid = " . $bugsys->userinfo['userid']); - while ($favourite = $db->fetch_array($favourites)) + $favorites = $db->query("SELECT * FROM " . TABLE_PREFIX . "favorite WHERE userid = " . $bugsys->userinfo['userid']); + while ($favorite = $db->fetch_array($favorites)) { - $ids[] = $favourite['bugid']; + $ids[] = $favorite['bugid']; } $querybuild['favorites'] = "AND bug.bugid " . ($bugsys->in['favorite'] == 0 ? "NOT IN" : "IN") . " (" . implode(', ', $ids) . ")"; } diff --git a/showreport.php b/showreport.php index 77ceb4f..e27a5e6 100644 --- a/showreport.php +++ b/showreport.php @@ -203,7 +203,7 @@ else $show['subscribe'] = can_perform('cansubscribe', $bug['product']); -$favorite = (bool)$db->query_first("SELECT * FROM " . TABLE_PREFIX . "favourite WHERE bugid = $bug[bugid] AND userid = " . $bugsys->userinfo['userid']); +$favorite = (bool)$db->query_first("SELECT * FROM " . TABLE_PREFIX . "favorite WHERE bugid = $bug[bugid] AND userid = " . $bugsys->userinfo['userid']); $favoritetext = ($favorite ? _('Remove from Favorites') : _('Add to Favorites')); $bug['userinfo'] = construct_user_display($bug); diff --git a/templates/favourites.tpl b/templates/favorites.tpl similarity index 100% rename from templates/favourites.tpl rename to templates/favorites.tpl -- 2.43.5