Backed out change to Search.pm using group_by.
This commit is contained in:
ghendricks%novell.com 2007-05-24 23:48:59 +00:00
Родитель 729d50024c
Коммит 9deb706d3e
9 изменённых файлов: 32 добавлений и 60 удалений

Просмотреть файл

@ -1297,7 +1297,7 @@ sub init {
push(@groupby, $field) if !grep($_ eq $field, @groupby);
}
}
#unshift(@groupby, "test_${obj}s.${obj}_id");
unshift(@groupby, "test_${obj}s.${obj}_id");
$query .= " " . $dbh->sql_group_by(join(', ', @groupby)) if @groupby;

Просмотреть файл

@ -371,8 +371,8 @@ Returns an ineger representing how many items should appear on a page
sub page_size {
my $self = shift;
my $cgi = $self->{'cgi'};
return $cgi->param('pagesize') if $cgi->param('pagesize');
return 25;
my $size = $cgi->param('pagesize') || 25;
return $size;
}
=head2 get_order_url
@ -384,7 +384,7 @@ column headers to produce a sort order
sub get_order_url {
my $self = shift;
return $self->get_url('(page|order)');
return $self->get_url('page','order');
}
=head2 get_page_url
@ -396,26 +396,14 @@ the page navigation links to move from page to page.
sub get_page_url {
my $self = shift;
return $self->get_url('page');
my $cgi = $self->{'cgi'};
return $self->{'url_loc'} ."?". $cgi->canonicalise_query('page', 'pagesize');
}
sub get_url {
my ($self, $regxp) = @_;
my ($self, @drops) = @_;
my $cgi = $self->{'cgi'};
my @keys = $cgi->param;
my $qstring ='';
foreach my $key (@keys){
if ((defined $regxp) && ($key =~ $regxp)){
next;
}
my @vals = $cgi->param($key);
foreach my $val (@vals){
$qstring .= $key ."=". url_quote($val) ."&";
}
}
chop $qstring;
$qstring = $self->{'url_loc'} ."?". $qstring;
$self->{'url'} = $qstring;
$self->{'url'} = $self->{'url_loc'} ."?". $cgi->canonicalise_query(@drops);
return $self->{'url'};
}

Просмотреть файл

@ -1003,7 +1003,14 @@ Returns a count of the test cases associated with this run
sub case_count {
my $self = shift;
return scalar @{$self->cases};
my $dbh = Bugzilla->dbh;
my ($count) = $dbh->selectrow_array(
"SELECT COUNT(case_run_id) FROM test_case_runs
WHERE run_id=? AND iscurrent=1", undef,
$self->{'run_id'});
return scalar $count;
}
sub case_run_count {

Просмотреть файл

@ -44,7 +44,7 @@
[% url = "javascript:page(" %]
[% pc = ")" %]
[% ELSE %]
[% url = "$table.get_page_url&page="%]
[% url = "$table.get_page_url&pagesize=$table.page_size&page="%]
[%# url = "$table.url_loc?direction=$direction&getlist=1&page="%]
[% END %]
[% pagesizelist = [{name => 25, id => 25},
@ -67,7 +67,7 @@
}
};
function adjustPageSize(psize) {
document.location = "[% url %]&pagesize=" + psize;
document.location = "[% table.get_page_url %]&pagesize=" + psize;
}
</script>

Просмотреть файл

@ -174,8 +174,7 @@
<h3>Test Case Run Logs</h3><a name="table" />
[% PROCESS testopia/caserun/filter.html.tmpl %]
<br/>
[% PROCESS testopia/caserun/table.html.tmpl
caseruns = run.current_caseruns %]
[% PROCESS testopia/caserun/table.html.tmpl %]
[% table.list_count FILTER none %] test cases found.
<br/>

Просмотреть файл

@ -1,32 +0,0 @@
[%# 1.0@bugzilla.org %]
[%# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is the Bugzilla Testopia System.
#
# The Initial Developer of the Original Code is Greg Hendricks.
# Portions created by Greg Hendricks are Copyright (C) 2001
# Greg Hendricks. All Rights Reserved.
#
# Contributor(s): Greg Hendricks <ghendricks@novell.com>
#%]
<div id="testopia_save_search">
[% IF qname %]
<a href="tr_query.cgi?action=delete_query&query_name=[% qname FILTER url_quote %]">Delete saved query [% qname FILTER html %]</a>
[% ELSE %]
<form action="tr_query.cgi" method="POST">
<input type="hidden" name="query_part" value="[% table.get_url %][% table.get_query_part %]">
<input type="hidden" name="action" value="save_query">
<input type="submit" value="Save Search"> as
<input name="query_name">
</form>
[% END %]
</div>

Просмотреть файл

@ -92,8 +92,19 @@ if ($action eq 'Commit'){
push @uneditable, $run;
next;
}
my $error_mode_cache = Bugzilla->error_mode;
Bugzilla->error_mode(ERROR_MODE_DIE);
eval{
login_to_id(trim($cgi->param('manager')));
};
Bugzilla->error_mode($error_mode_cache);
if ($@){
print $cgi->multipart_end if $serverpush;
}
my $manager = login_to_id(trim($cgi->param('manager')));
trick_taint($manager);
if ($cgi->param('manager') && !$manager){
print $cgi->multipart_end if $serverpush;
ThrowUserError("invalid_username", { name => $cgi->param('manager') }) if $cgi->param('manager');

Просмотреть файл

@ -27,13 +27,12 @@ use Bugzilla::Constants;
use Bugzilla::Testopia::Constants;
use Bugzilla::Error;
use Bugzilla::Util;
use Bugzilla::User;
use Bugzilla::Testopia::Util;
use Bugzilla::Testopia::Product;
use vars qw($vars);
require 'globals.pl';
local our $template = Bugzilla->template;
local our $cgi = Bugzilla->cgi;
@ -124,6 +123,7 @@ sub do_update {
detaint_natural($perms);
$plan->update_tester($row->{'user'}->id, $perms);
}
$vars->{'tr_message'} = " Access updated";
}
sub display {

Просмотреть файл

@ -153,7 +153,6 @@ sub display {
my $dbh = Bugzilla->dbh;
my @tags;
my $user = login_to_id($cgi->param('user')) if $cgi->param('user');
trick_taint($user);
if ($cgi->param('action') eq 'show_all' && Bugzilla->user->in_group('admin')){
my $tags = $dbh->selectcol_arrayref(