/[collab-qa]/udd/web/bugs.cgi
ViewVC logotype

Diff of /udd/web/bugs.cgi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1793 by lucas, Wed Sep 15 18:42:57 2010 UTC revision 1794 by lucas, Wed Sep 15 20:03:08 2010 UTC
# Line 40  SORTS = [ Line 40  SORTS = [
40    ['id', 'bug#'],    ['id', 'bug#'],
41    ['source', 'source package'],    ['source', 'source package'],
42    ['package', 'binary package'],    ['package', 'binary package'],
43    ['last_modified', 'last modified']    ['last_modified', 'last modified'],
44      ['popcon', 'popularity contest'],
45  ]  ]
46    
47  cgi = CGI::new  cgi = CGI::new
# Line 196  if cgi.params != {} Line 197  if cgi.params != {}
197  # Generate and execute query  # Generate and execute query
198  tstart = Time::now  tstart = Time::now
199  dbh = DBI::connect('DBI:Pg:dbname=udd;port=5441;host=localhost', 'guest')  dbh = DBI::connect('DBI:Pg:dbname=udd;port=5441;host=localhost', 'guest')
200  q = "select id, bugs.package, bugs.source, title, last_modified from bugs \n"  if sortby != 'popcon'
201      q = "select id, bugs.package, bugs.source, title, last_modified from bugs \n"
202    else
203      q = "select id, bugs.package, bugs.source, title, last_modified, coalesce(popcon_src.insts, 0) as popcon\nfrom bugs left join popcon_src on (bugs.source = popcon_src.source) \n"
204    end
205  q += "where #{RELEASE_RESTRICT.select { |r| r[0] == release }[0][2]} \n"  q += "where #{RELEASE_RESTRICT.select { |r| r[0] == release }[0][2]} \n"
206  FILTERS.each do |f|  FILTERS.each do |f|
207    if filters[f[0]] == 'only'    if filters[f[0]] == 'only'
# Line 223  sth.execute Line 228  sth.execute
228  rows = sth.fetch_all  rows = sth.fetch_all
229    
230  puts "<p><b>#{rows.length} bugs found.</b></p>"  puts "<p><b>#{rows.length} bugs found.</b></p>"
231  puts <<-EOF  puts '<table class="buglist">'
232  <table class="buglist">  if sortby != 'popcon'
233  <tr><th>bug#</th><th>package</th><th>title</th><th>last&nbsp;modified</th></tr>    puts '<tr><th>bug#</th><th>package</th><th>title</th><th>last&nbsp;modified</th></tr>'
234  EOF  else
235      puts '<tr><th>bug#</th><th>package</th><th>title</th><th>popcon</th><th>last&nbsp;modified</th></tr>'
236    end
237    
238  rows.each do |r|  rows.each do |r|
239    puts "<tr><td style='text-align: center;'><a href=\"http://bugs.debian.org/#{r['id']}\">##{r['id']}</a></td>"    puts "<tr><td style='text-align: center;'><a href=\"http://bugs.debian.org/#{r['id']}\">##{r['id']}</a></td>"
240    puts "<td style='text-align: center;'>"    puts "<td style='text-align: center;'>"
# Line 234  rows.each do |r| Line 242  rows.each do |r|
242    bins = r['package'].split(/,\s*/)    bins = r['package'].split(/,\s*/)
243    puts (0...bins.length).map { |i| "<a href=\"http://packages.qa.debian.org/#{srcs[i]}\">#{bins[i]}</a>" }.join(', ')    puts (0...bins.length).map { |i| "<a href=\"http://packages.qa.debian.org/#{srcs[i]}\">#{bins[i]}</a>" }.join(', ')
244    puts "</td>"    puts "</td>"
245    puts <<-EOF    puts "<td>#{CGI::escapeHTML(r['title'])}</td>"
246    <td>#{CGI::escapeHTML(r['title'])}</td>    if sortby == 'popcon'
247    <td style='text-align: center;'>#{r['last_modified'].to_date}</td>      puts "<td>#{r['popcon']}</td>"
248    </tr>    end
249    EOF    puts "<td style='text-align: center;'>#{r['last_modified'].to_date}</td></tr>"
250  end  end
251  =begin  =begin
252  release goals:  release goals:

Legend:
Removed from v.1793  
changed lines
  Added in v.1794

  ViewVC Help
Powered by ViewVC 1.1.5