diff --git a/mozilla/webtools/testopia/Bugzilla/Testopia/Table.pm b/mozilla/webtools/testopia/Bugzilla/Testopia/Table.pm index 36be78c8634..ba0bf299fbd 100644 --- a/mozilla/webtools/testopia/Bugzilla/Testopia/Table.pm +++ b/mozilla/webtools/testopia/Bugzilla/Testopia/Table.pm @@ -108,6 +108,7 @@ sub init { my $debug = $cgi->param('debug') if $cgi; my @list; if ($query){ + my $serverpush = support_server_push($cgi); print "$query" if $debug; # For paging we need to know the total number of items # but Search.pm returns a query with a subset @@ -122,7 +123,23 @@ sub init { my @ids; my $list = $dbh->selectcol_arrayref($query); $dbh = Bugzilla->switch_to_main_db(); + + my $vars; + my $progress_interval = 1000; + my $i = 0; + my $total = scalar @$list; + foreach my $id (@$list){ + $i++; + if ($serverpush && $i % $progress_interval == 0){ + print $cgi->multipart_end; + print $cgi->multipart_start; + $vars->{'complete'} = $i; + $vars->{'total'} = $total; + + Bugzilla->template->process("testopia/progress.html.tmpl", $vars) + || ThrowTemplateError(Bugzilla->template->error()); + } my $o; if ($type eq 'case'){ $o = Bugzilla::Testopia::TestCase->new($id); diff --git a/mozilla/webtools/testopia/template/en/default/testopia/blocks.html.tmpl b/mozilla/webtools/testopia/template/en/default/testopia/blocks.html.tmpl index e21d581a230..9e23a2dd1a9 100644 --- a/mozilla/webtools/testopia/template/en/default/testopia/blocks.html.tmpl +++ b/mozilla/webtools/testopia/template/en/default/testopia/blocks.html.tmpl @@ -47,6 +47,11 @@ [% url = "$table.get_page_url&page="%] [%# url = "$table.url_loc?direction=$direction&getlist=1&page="%] [% END %] +[% pagesizelist = [{name => 25, id => 25}, + {name => 50, id => 50}, + {name => 100, id => 100}, + {name => 500, id => 500}]%] + - + [% IF table.page != 0 %] @@ -72,7 +80,7 @@ [% END %] - [% IF table.page < table.page_count - 1 %] @@ -124,6 +119,30 @@ [% END %] + + + + +
<< First < Previous<< First < Previous + [% SET framewidth = 10 %] [% IF (table.page_count - 1) < framewidth %] [% SET p = 0 %] @@ -103,19 +111,6 @@ [% END %] [% end_mark %]       - - -  Out of [% table.page_count %] -     - [% IF ajax %] - All  - [% ELSE %] - [% IF table.list_count < MAX_LIMIT %] - All  - [% ELSE %] - All - [% END %] - [% END %] Next >Next > Last >>
+ + +  Out of [% table.page_count %] pages +     + View [% PROCESS select sel = {list => pagesizelist, + default => table.page_size, + events => 'onchange="adjustPageSize(this.value)"' }%] + records at a time +     + [% IF ajax %] + View All  + [% ELSE %] + [% IF table.list_count < MAX_LIMIT %] + View All  + [% ELSE %] + View All + [% END %] + [% END %] +
[% table.list_count %] records found
[% END %] diff --git a/mozilla/webtools/testopia/template/en/default/testopia/case/list.html.tmpl b/mozilla/webtools/testopia/template/en/default/testopia/case/list.html.tmpl index 5f0431aafd3..dda7d4246b8 100644 --- a/mozilla/webtools/testopia/template/en/default/testopia/case/list.html.tmpl +++ b/mozilla/webtools/testopia/template/en/default/testopia/case/list.html.tmpl @@ -40,7 +40,12 @@ [% PROCESS testopia/style.none.tmpl %] [% PROCESS testopia/blocks.html.tmpl %] [% PROCESS testopia/messages.html.tmpl %] - + @@ -50,8 +56,7 @@

Select Test Cases

[% IF table.list_count > 0 %] -[% PROCESS testopia/case/table.html.tmpl - cases = plan.test_cases %] +[% PROCESS testopia/case/table.html.tmpl %] [% ELSE %] No CONFIRMED test cases found in this test plan. [% END %] diff --git a/mozilla/webtools/testopia/template/en/default/testopia/run/show.html.tmpl b/mozilla/webtools/testopia/template/en/default/testopia/run/show.html.tmpl index b8eceb15a71..934f303ebff 100644 --- a/mozilla/webtools/testopia/template/en/default/testopia/run/show.html.tmpl +++ b/mozilla/webtools/testopia/template/en/default/testopia/run/show.html.tmpl @@ -176,13 +176,13 @@ [% table.list_count FILTER none %] test cases found.
- + - +
diff --git a/mozilla/webtools/testopia/tr_list_cases.cgi b/mozilla/webtools/testopia/tr_list_cases.cgi index a35d8d05e21..06fa1354c22 100755 --- a/mozilla/webtools/testopia/tr_list_cases.cgi +++ b/mozilla/webtools/testopia/tr_list_cases.cgi @@ -257,7 +257,7 @@ if ($table->view_count > $query_limit){ ThrowUserError('testopia-query-too-large', {'limit' => $query_limit}); } # Check that all of the test cases returned only belong to one product. -if ($table->list_count > 0){ +if ($table->list_count > 0 && $table->list_count < 1000 && !$cgi->param('addrun')){ my %case_prods; my $prod_id; foreach my $case (@{$table->list}){ diff --git a/mozilla/webtools/testopia/tr_new_run.cgi b/mozilla/webtools/testopia/tr_new_run.cgi index 16a23a42cf0..831668ec8e1 100755 --- a/mozilla/webtools/testopia/tr_new_run.cgi +++ b/mozilla/webtools/testopia/tr_new_run.cgi @@ -190,7 +190,6 @@ if ($action eq 'Add'){ #################### else { $cgi->param('current_tab', 'case'); - $cgi->param('viewall', 1); my $search = Bugzilla::Testopia::Search->new($cgi); my $table = Bugzilla::Testopia::Table->new('case', 'tr_new_run.cgi', $cgi, undef, $search->query); $vars->{'case'} = Bugzilla::Testopia::TestCase->new({'case_id' => 0});