diff options
author | bbaetz%student.usyd.edu.au <> | 2002-08-12 14:42:42 +0200 |
---|---|---|
committer | bbaetz%student.usyd.edu.au <> | 2002-08-12 14:42:42 +0200 |
commit | 61ddf0a32846fdf2607043d94af1a0a86b80f6fc (patch) | |
tree | 714517b4c6b9e33b10a12aa5a4b99641bcafefef /votes.cgi | |
parent | 17b301e76d886afd5be8f4e9919afb4446e49405 (diff) | |
download | bugzilla-61ddf0a32846fdf2607043d94af1a0a86b80f6fc.tar.gz bugzilla-61ddf0a32846fdf2607043d94af1a0a86b80f6fc.tar.xz |
Bug 43600 - Convert products/components to use ids instead of names.
Initial attempt by jake@bugzilla.org, updated by me
r=joel, preed
Diffstat (limited to 'votes.cgi')
-rwxr-xr-x | votes.cgi | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -153,7 +153,7 @@ sub show_user { # we can do it all in one query. my %maxvotesperbug; if($canedit) { - SendSQL("SELECT products.product, products.maxvotesperbug + SendSQL("SELECT products.name, products.maxvotesperbug FROM products"); while (MoreSQLData()) { my ($prod, $max) = FetchSQLData(); @@ -173,10 +173,11 @@ sub show_user { SendSQL("SELECT votes.bug_id, votes.count, bugs.short_desc, bugs.bug_status - FROM votes, bugs + FROM votes, bugs, products WHERE votes.who = $who AND votes.bug_id = bugs.bug_id - AND bugs.product = " . SqlQuote($product) . + AND bugs.product_id = products.id + AND products.name = " . SqlQuote($product) . "ORDER BY votes.bug_id"); while (MoreSQLData()) { @@ -270,9 +271,9 @@ sub record_votes { # If the user is voting for bugs, make sure they aren't overstuffing # the ballot box. if (scalar(@buglist)) { - SendSQL("SELECT bugs.bug_id, bugs.product, products.maxvotesperbug + SendSQL("SELECT bugs.bug_id, products.name, products.maxvotesperbug FROM bugs, products - WHERE products.product = bugs.product + WHERE products.id = bugs.product_id AND bugs.bug_id IN (" . join(", ", @buglist) . ")"); my %prodcount; |