View | Details | Raw Unified | Return to bug 330321
Collapse All | Expand All

(-)checksetup.pl (+4 lines)
 Lines 4614-4619   if (!$dbh->bz_column_info('profiles', 'i Link Here 
4614
                        {TYPE => 'BOOLEAN', NOTNULL => 1, DEFAULT => 'FALSE'});
4614
                        {TYPE => 'BOOLEAN', NOTNULL => 1, DEFAULT => 'FALSE'});
4615
}
4615
}
4616
4616
4617
# Bugzilla.gnome.org:
4618
$dbh->bz_add_table('traces') if !$dbh->bz_table_info('traces');
4619
AddGroup('edittraces', 'Can edit stack traces for all products');
4620
4617
# 2006-08-19 LpSolit@gmail.com - Bug 87795
4621
# 2006-08-19 LpSolit@gmail.com - Bug 87795
4618
$dbh->bz_alter_column('tokens', 'userid', {TYPE => 'INT3'});
4622
$dbh->bz_alter_column('tokens', 'userid', {TYPE => 'INT3'});
4619
4623
(-)edittraces.cgi (+229 lines)
Added Link Here 
1
#!/usr/bin/perl -wT
2
# -*- Mode: perl; indent-tabs-mode: nil -*-
3
#
4
# The contents of this file are subject to the Mozilla Public
5
# License Version 1.1 (the "License"); you may not use this file
6
# except in compliance with the License. You may obtain a copy of
7
# the License at http://www.mozilla.org/MPL/
8
#
9
# Software distributed under the License is distributed on an "AS
10
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
11
# implied. See the License for the specific language governing
12
# rights and limitations under the License.
13
#
14
# The Original Code is the Bugzilla Bug Tracking System.
15
#
16
# The Initial Developer of the Original Code is Netscape Communications
17
# Corporation. Portions created by Netscape are
18
# Copyright (C) 1998 Netscape Communications Corporation. All
19
# Rights Reserved.
20
#
21
# Contributor(s): Terry Weissman <terry@mozilla.org>
22
23
use strict;
24
25
use lib qw(.);
26
use vars qw ($template $vars);
27
# Suppress "used only once" warnings.
28
use vars 
29
  qw(
30
    %proddesc
31
    %classdesc
32
  );
33
34
use Bugzilla;
35
use Bugzilla::Constants;
36
use Bugzilla::GNOME;
37
use Digest::MD5 qw(md5_hex);
38
39
require "CGI.pl";
40
41
use vars qw($vars @legal_product @legal_gnome_target @legal_gnome_version
42
            @legal_priority @legal_severity);
43
44
my $cgi = Bugzilla->cgi;
45
my $dbh = Bugzilla->dbh;
46
47
###############################################################################
48
# Begin Data/Security Validation
49
###############################################################################
50
51
# Check whether or not the user is currently logged in. 
52
Bugzilla->login(LOGIN_REQUIRED);
53
GetVersionTable();
54
55
UserInGroup("edittraces")
56
  || ThrowUserError("auth_failure", {group  => "edittraces",
57
                                     action => "edit",
58
                                     object => "traces"});
59
60
my $action   = trim($cgi->param('action')   || '');
61
my $hash     = trim($cgi->param('hash')     || '');
62
my $old_hash = trim($cgi->param('old_hash') || '');
63
trick_taint($hash); trick_taint($old_hash);
64
65
my $report = "traces/list.html.tmpl";
66
my $cur_trace;
67
68
print $cgi->header();
69
70
sub ValidateForm {
71
    my %cur_trace;
72
73
    my $id = trim($cgi->param('dupe_of') || '');
74
    ValidateBugID($id);
75
76
    my $trace = trim($cgi->param('trace') || '');
77
    trick_taint($trace);
78
    my $version = trim($cgi->param('version') || '');
79
    trick_taint($version);
80
    $version = undef unless $version;
81
    
82
    my $product_id = trim($cgi->param('product_id') || undef);
83
84
    my $product;
85
    if ($product_id) {
86
        detaint_natural($product_id) || ThrowCodeError("invalid_product_id");
87
        $product = get_product_name($product_id);
88
        CanEnterProductOrWarn($product);
89
    }
90
   
91
    CheckFormField($cgi, 'gnome_version', \@legal_gnome_version)
92
        if $cgi->param('gnome_version');
93
    my $gnome_version = $cgi->param('gnome_version');
94
    $gnome_version = undef unless $gnome_version;
95
    trick_taint($gnome_version) if $gnome_version;
96
97
    my $functions = join(' ', get_traces_from_string($trace));
98
    my $hash = md5_hex($functions);
99
100
    %cur_trace = (
101
        hash => $hash,
102
        dupe_of => $id,
103
        product_id => $product_id,
104
        user_id => Bugzilla->user->id,
105
        version => $version,
106
        gnome_version => $gnome_version,
107
        trace => $trace,
108
109
        functions => $functions,
110
        product => $product,
111
    );
112
113
    return \%cur_trace;
114
}
115
116
if ($action eq 'add') {
117
    $report = "traces/show.html.tmpl";
118
119
    $cur_trace = ValidateForm();
120
121
    $cur_trace->{'is_dupe'} = $dbh->selectrow_array(
122
        'SELECT 1 FROM traces WHERE hash = ?', undef, $cur_trace->{'hash'});
123
124
    if ($cgi->param('do_add') && $cur_trace->{'functions'} ne ''
125
        && !$cur_trace->{'is_dupe'})
126
    {
127
        $dbh->do('INSERT INTO traces (hash, dupe_of, product_id, user_id,
128
                                      version, gnome_version, trace)
129
                       VALUES (?, ?, ?, ?, ?, ?, ?)',
130
               undef, ($cur_trace->{'hash'}, $cur_trace->{'dupe_of'},
131
                       $cur_trace->{'product_id'}, $cur_trace->{'user_id'},
132
                       $cur_trace->{'version'}, $cur_trace->{'gnome_version'},
133
                       $cur_trace->{'trace'}));
134
        
135
        $vars->{'message'} = 'trace_created';
136
        $action = 'edit';
137
        $old_hash = '';
138
    }
139
    else {
140
        $vars->{'cur_trace'} = $cur_trace;
141
    }
142
}
143
if ($action eq 'edit') {
144
    $report = "traces/show.html.tmpl";
145
146
    if ($old_hash) {
147
        # Validate:
148
        $cur_trace = ValidateForm();
149
        my $trace_info = Bugzilla::GNOME->get_traces_info($old_hash);
150
        ThrowUserError('trace_nonexistent') unless @{$trace_info};
151
152
        $cur_trace->{'old_hash'} = $old_hash;
153
154
        if ($cur_trace->{'old_hash'} eq $cur_trace->{'hash'}) {
155
            $cur_trace->{'is_dupe'} = 0
156
        } else {
157
          $cur_trace->{'is_dupe'} = $dbh->selectrow_array(
158
                'SELECT 1 FROM traces WHERE hash = ?', undef, $cur_trace->{'hash'});
159
        }
160
161
        if ($cgi->param('do_edit') && $cur_trace->{'functions'} ne ''
162
            && !$cur_trace->{'is_dupe'})
163
        {
164
            $dbh->do('UPDATE traces
165
                         SET hash = ?, dupe_of = ?, product_id = ?, user_id = ?,
166
                             version = ?, gnome_version = ?, trace = ?
167
                       WHERE hash = ?',
168
                     undef, ($cur_trace->{'hash'}, $cur_trace->{'dupe_of'},
169
                             $cur_trace->{'product_id'}, $cur_trace->{'user_id'},
170
                             $cur_trace->{'version'}, $cur_trace->{'gnome_version'},
171
                             $cur_trace->{'trace'},
172
                             $cur_trace->{'old_hash'}));
173
174
            # Very important (old_hash has been changed in the database to hash!):
175
            $cur_trace->{'old_hash'} = $cur_trace->{'hash'};
176
177
            $trace_info = Bugzilla::GNOME->get_traces_info($cur_trace->{'hash'});
178
            $cur_trace = $trace_info->[0]; # get the data again from the database.. just for testing purposes
179
            $vars->{'message'} = 'trace_updated';
180
        }
181
182
    } else {
183
        my $trace_info = Bugzilla::GNOME->get_traces_info($hash);
184
        ThrowUserError('trace_nonexistent') unless @{$trace_info};
185
186
        $cur_trace = $trace_info->[0];
187
        $cur_trace->{'old_hash'} = $cur_trace->{'hash'};
188
    }
189
}
190
elsif ($action eq "delete") {
191
    my $trace_info = Bugzilla::GNOME->get_traces_info($hash);
192
    ThrowUserError('trace_nonexistent') unless @{$trace_info};
193
194
    $cur_trace = $trace_info->[0];
195
    
196
    if ($cgi->param('do_delete')) {
197
        $dbh->do('DELETE FROM traces WHERE hash = ?', undef, ($hash));
198
        $vars->{'message'} = 'trace_deleted';
199
    }
200
    else {
201
        $action = 'delete';
202
        $report = 'traces/confirm-delete.html.tmpl';
203
    }
204
}
205
206
$vars->{'legal_gnome_versions'} = \@legal_gnome_version;
207
my %products = reverse GetSelectableProducts(1);
208
$vars->{'products'} = \%products;
209
$vars->{'action'} = $action;
210
211
if ($cur_trace && %{$cur_trace}) {
212
    if (defined $cur_trace->{'dupe_of'}) {
213
        $cur_trace->{'dupe_of_bug'} =
214
            new Bugzilla::Bug($cur_trace->{'dupe_of'}, Bugzilla->user->id);
215
    }
216
217
    if (!defined $cur_trace->{'functions'}
218
        && defined $cur_trace->{'trace'})
219
    {
220
        $cur_trace->{'functions'} =
221
            join(' ', get_traces_from_string($cur_trace->{'trace'}));
222
    }
223
    $vars->{'cur_trace'} = $cur_trace;
224
}
225
226
$template->process($report, $vars)
227
  || ThrowTemplateError($template->error());
228
229
(-)Bugzilla/GNOME.pm (+121 lines)
Added Link Here 
1
# -*- Mode: perl; indent-tabs-mode: nil -*-
2
#
3
# The contents of this file are subject to the Mozilla Public
4
# License Version 1.1 (the "License"); you may not use this file
5
# except in compliance with the License. You may obtain a copy of
6
# the License at http://www.mozilla.org/MPL/
7
#
8
# Software distributed under the License is distributed on an "AS
9
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
10
# implied. See the License for the specific language governing
11
# rights and limitations under the License.
12
#
13
# The Original Code is the Bugzilla Bug Tracking System.
14
#
15
# The Initial Developer of the Original Code is Netscape Communications
16
# Corporation. Portions created by Netscape are
17
# Copyright (C) 1998 Netscape Communications Corporation. All
18
# Rights Reserved.
19
#
20
# Contributor(s): Olav Vitters <olav@bkor.dhs.org>
21
22
use strict;
23
24
package Bugzilla::GNOME;
25
26
use Bugzilla;
27
use Bugzilla::Config;
28
use base qw(Exporter);
29
@Bugzilla::GNOME::EXPORT = qw(
30
    get_traces_from_string
31
); 
32
33
=head1 get_traces_from_string
34
35
takes a string that may contain a stack trace. If it does contain
36
a viable stack trace, the first five useful functions are returned.
37
38
=cut
39
sub get_traces_from_string {
40
  my ($string) = @_;
41
  my @functions = ();
42
  my $function_index = -1;
43
  my @lines = split('\n', $string);
44
45
  # For a simplification, all of this could be done in one
46
  # regexp. [Ben Frantzdale] You volunteering to write it, Ben? :)
47
  # [Luis 'not great with regexp' Villa]
48
49
  my $possible_starts = join('|', ('<signal handler called>',
50
                                   'killpg',
51
                                   'sigaction',
52
                                   'sigsuspend',
53
                                   '\(gdb\) bt',
54
                                   'gnome_init',
55
                                   'g_log'));
56
  my $bad_functions = join('|', ('__kernel_vsyscall',
57
                                 'raise',
58
                                 'abort'));
59
60
  foreach my $line (@lines) {
61
  # Here, we try to ignore things before <signal handler> and/or killpg()
62
    if ( $line =~ /$possible_starts/ ) {
63
      # Now we've started looking for real functions, or reset after
64
      # reading g_log tops
65
      $function_index = 0;
66
    }
67
    elsif ( $line =~ /^#\d+ +0x[0-9A-F]+ in ((\w|::|_)+) \(/i &&
68
	    $function_index >= 0){
69
      # eliminate dups
70
      if ($function_index != 0 && $functions[$function_index-1] eq $1) {
71
        next;
72
      }
73
74
      # eliminate meaningless functions in the stack trace
75
      if ($1 =~ /$bad_functions/) {
76
        next;
77
      }
78
      $functions[$function_index]=$1;
79
      $function_index++;
80
    }
81
    # We stop after five functions are found:
82
    last if $function_index > 4;
83
  }
84
85
  #did we go all the way through without getting any frames?
86
  #if so, we've got a weird trace; we'll pick it up ourselves [since we take for granted there is actually a trace there]
87
  if ( $function_index == -1 ) {
88
      foreach my $line (@lines) {
89
          if ( $line =~ /^#\d+ +0x[0-9A-F]+ in ((\w|::|_)+) \(/i ){
90
              push(@functions, $1);
91
              $function_index++;
92
          }
93
          # We stop after five functions are found:
94
          last if $function_index > 3; # only go to three because we started at -1
95
      }
96
  }
97
98
  return grep {$_} @functions;
99
}
100
101
sub get_traces_info {
102
    my $self = shift;
103
104
    my ($hash) = @_;
105
    my $dbh = Bugzilla->dbh;
106
107
    my @args = ();
108
    push @args, $hash if $hash;
109
110
    return $dbh->selectall_arrayref(
111
        'SELECT hash, dupe_of, product_id, user_id, version, gnome_version, 
112
                trace, products.name AS product
113
           FROM traces
114
      LEFT JOIN products
115
             ON traces.product_id = products.id' . (defined $hash ? '
116
          WHERE hash = ?' : ''),  {'Slice' => {}}, @args);
117
118
}
119
120
121
1;
(-)Bugzilla/RPC.pm (+36 lines)
 Lines 10-15   use Bugzilla::DB; Link Here 
10
use Bugzilla::Error;
10
use Bugzilla::Error;
11
use Bugzilla::Config;
11
use Bugzilla::Config;
12
use Bugzilla::User;
12
use Bugzilla::User;
13
use Bugzilla::GNOME;
14
use Digest::MD5 qw(md5_hex);
13
15
14
# These are functions written by me or extracted from hard-to-extract places.
16
# These are functions written by me or extracted from hard-to-extract places.
15
#  heavily hacked and custom function
17
#  heavily hacked and custom function
 Lines 232-237   sub Add { Link Here 
232
    push (@used_fields, 'product_id');
234
    push (@used_fields, 'product_id');
233
    $data{'component_id'} = $component_id;
235
    $data{'component_id'} = $component_id;
234
    push (@used_fields, 'component_id');
236
    push (@used_fields, 'component_id');
237
238
239
    my @functions = get_traces_from_string($comment);
240
    if (@functions) {
241
        my $hash = md5_hex(join(" ", @functions));
242
243
        my $dupe_id = $dbh->selectrow_array(
244
            'SELECT dupe_of
245
               FROM traces
246
              WHERE hash = ?
247
                AND (product_id = ? OR product_id IS NULL)
248
                AND (version = ? or version IS NULL)
249
                AND (gnome_version = ? or gnome_version IS NULL)',
250
            undef,
251
            ($hash, $product_id, $data{'version'}, $data{'gnome_version'}));
252
253
        if ($dupe_id) {
254
            # XXX - check status of dupe
255
            #
256
            # if NEEDINFO.. foo 1
257
            # if OPEN, add stack?
258
            # if CLOSED, do nothing?
259
            my $dupe_status = $dbh->selectrow_array(
260
                'SELECT bug_status FROM bugs WHERE bug_id = ?', undef, $dupe_id);
261
262
#            if (IsOpenedState($dupe_status)) {
263
#                # XXX - MIA
264
#                #
265
#            } else {
266
#                # Fake the reporter created the bug this strack is a duplicate of
267
                return $dupe_id;
268
#            }
269
        }
270
    }
235
271
236
    # get current time
272
    # get current time
237
    my $timestamp = $dbh->selectrow_array("SELECT NOW()");
273
    my $timestamp = $dbh->selectrow_array("SELECT NOW()");
(-)Bugzilla/DB/Schema.pm (+16 lines)
 Lines 696-701   use constant ABSTRACT_SCHEMA => { Link Here 
696
        ],
696
        ],
697
    },
697
    },
698
698
699
    traces => {
700
        FIELDS => [
701
            hash          => {TYPE => 'varchar(32)', NOTNULL => 1,
702
                              PRIMARYKEY => 1},
703
            dupe_of       => {TYPE => 'INT3', NOTNULL => 1},
704
            product_id    => {TYPE => 'INT3', NOTNULL => 1},
705
            user_id       => {TYPE => 'INT3', NOTNULL => 1},
706
            version       => {TYPE => 'varchar(64)'},
707
            gnome_version => {TYPE => 'varchar(64)'},
708
            trace         => {TYPE => 'MEDIUMTEXT'},
709
        ],
710
        INDEXES => [
711
            traces_dupe_of_idx  => ['dupe_of'],
712
        ],
713
    },
714
699
    namedqueries => {
715
    namedqueries => {
700
        FIELDS => [
716
        FIELDS => [
701
            userid       => {TYPE => 'INT3', NOTNULL => 1},
717
            userid       => {TYPE => 'INT3', NOTNULL => 1},
(-)Bugzilla/Template/Plugin/GNOME.pm (+64 lines)
Added Link Here 
1
# -*- Mode: perl; indent-tabs-mode: nil -*-
2
#
3
# The contents of this file are subject to the Mozilla Public
4
# License Version 1.1 (the "License"); you may not use this file
5
# except in compliance with the License. You may obtain a copy of
6
# the License at http://www.mozilla.org/MPL/
7
#
8
# Software distributed under the License is distributed on an "AS
9
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
10
# implied. See the License for the specific language governing
11
# rights and limitations under the License.
12
#
13
# The Original Code is the Bugzilla Bug Tracking System.
14
#
15
# The Initial Developer of the Original Code is Netscape Communications
16
# Corporation. Portions created by Netscape are
17
# Copyright (C) 1998 Netscape Communications Corporation. All
18
# Rights Reserved.
19
#
20
# Contributor(s): Olav Vitters <olav@bkor.dhs.org>
21
#
22
23
package Bugzilla::Template::Plugin::GNOME;
24
25
use strict;
26
27
use base qw(Template::Plugin);
28
29
use Bugzilla::GNOME;
30
31
sub new {
32
    my ($class, $context) = @_;
33
34
    return bless {}, $class;
35
}
36
37
sub AUTOLOAD {
38
    my $class = shift;
39
    our $AUTOLOAD;
40
41
    $AUTOLOAD =~ s/^.*:://;
42
43
    return if $AUTOLOAD eq 'DESTROY';
44
45
    return Bugzilla::GNOME->$AUTOLOAD(@_);
46
}
47
48
1;
49
50
__END__
51
52
=head1 NAME
53
54
Bugzilla::Template::Plugin::GNOME
55
56
=head1 DESCRIPTION
57
58
Template Toolkit plugin to allow access to the C<GNOME>
59
object.
60
61
=head1 SEE ALSO
62
63
L<Bugzilla::GNOME>, L<Template::Plugin>
64
(-)dupfinder/find-traces.pl (-72 lines)
 Lines 4-81   use strict; Link Here 
4
use Bugzilla;
4
use Bugzilla;
5
my $dbh = Bugzilla->dbh;
5
my $dbh = Bugzilla->dbh;
6
6
7
=head1 get_traces_from_string
8
9
takes a string that may contain a stack trace. If it does contain
10
a viable stack trace, the first five useful functions are returned.
11
12
=cut
13
14
sub get_traces_from_string {
15
  my ($string) = @_;
16
  my @functions = ();
17
  my $function_index = -1;
18
  my @lines = split('\n', $string);
19
20
  # For a simplification, all of this could be done in one
21
  # regexp. [Ben Frantzdale] You volunteering to write it, Ben? :)
22
  # [Luis 'not great with regexp' Villa]
23
24
  my $possible_starts = join('|', ('<signal handler called>',
25
                                   'killpg',
26
                                   'sigaction',
27
                                   'sigsuspend',
28
                                   '\(gdb\) bt',
29
                                   'gnome_init',
30
                                   'g_log'));
31
  my $bad_functions = join('|', ('__kernel_vsyscall',
32
                                 'raise',
33
                                 'abort'));
34
35
  foreach my $line (@lines) {
36
  # Here, we try to ignore things before <signal handler> and/or killpg()
37
    if ( $line =~ /$possible_starts/ ) {
38
      # Now we've started looking for real functions, or reset after
39
      # reading g_log tops
40
      $function_index = 0;
41
    }
42
    elsif ( $line =~ /^#\d+ +0x[0-9A-F]+ in ((\w|::|_)+) \(/i &&
43
	    $function_index >= 0){
44
      # eliminate dups
45
      if ($function_index != 0 && $functions[$function_index-1] eq $1) {
46
        next;
47
      }
48
49
      # eliminate meaningless functions in the stack trace
50
      if ($1 =~ /$bad_functions/) {
51
        next;
52
      }
53
      $functions[$function_index]=$1;
54
      $function_index++;
55
    }
56
    # We stop after five functions are found:
57
    last if $function_index > 4;
58
  }
59
60
  #did we go all the way through without getting any frames?
61
  #if so, we've got a weird trace; we'll pick it up ourselves [since we take for granted there is actually a trace there]
62
  if ( $function_index == -1 ) {
63
      foreach my $line (@lines) {
64
          if ( $line =~ /^#\d+ +0x[0-9A-F]+ in ((\w|::|_)+) \(/i ){
65
              push(@functions, $1);
66
              $function_index++;
67
          }
68
          # We stop after five functions are found:
69
          last if $function_index > 3; # only go to three because we started at -1
70
      }
71
  }
72
73
  return @functions;
74
}
75
76
77
78
79
7
80
=head1 get_long_description_from_database
8
=head1 get_long_description_from_database
81
9
(-)dupfinder/simple-dup-finder.cgi (-3 / +3 lines)
 Lines 72-86   if (defined($bug_id) || defined($custom_ Link Here 
72
  }
72
  }
73
  else {
73
  else {
74
    ValidateBugID($bug_id);
74
    ValidateBugID($bug_id);
75
    $comment_id || = 0;
75
    $comment_id ||= 0;
76
    $comment_id unless detaint_natural($comment_id);
76
    $comment_id = 0 unless detaint_natural($comment_id);
77
    
77
    
78
    $text = 
78
    $text = 
79
      $dbh->selectrow_array("SELECT substr(thetext, 1, 7500)
79
      $dbh->selectrow_array("SELECT substr(thetext, 1, 7500)
80
                               FROM longdescs
80
                               FROM longdescs
81
                              WHERE bug_id = ?
81
                              WHERE bug_id = ?
82
                           ORDER BY bug_when
82
                           ORDER BY bug_when
83
                              LIMIT 1 OFFSET ?", undef, ($bug_id, $comment_id));
83
                              LIMIT 1 OFFSET $comment_id", undef, ($bug_id));
84
    $vars->{'bug_id'} = $bug_id;
84
    $vars->{'bug_id'} = $bug_id;
85
    $vars->{'comment_id'} = $comment_id;
85
    $vars->{'comment_id'} = $comment_id;
86
  }
86
  }
(-)template/en/custom/pages/admin.html.tmpl (+2 lines)
 Lines 55-60   Choose one of: Link Here 
55
                                                 IF user.groups.editkeywords %]
55
                                                 IF user.groups.editkeywords %]
56
        [% ' <li> <a href="editwhines.cgi">Whining</a>' 
56
        [% ' <li> <a href="editwhines.cgi">Whining</a>' 
57
                                              IF user.groups.bz_canusewhines %]
57
                                              IF user.groups.bz_canusewhines %]
58
        [% ' <li> <a href="edittraces.cgi">Stack traces</a>'
59
                                              IF user.groups.edittraces %]
58
</ul>
60
</ul>
59
    </div>
61
    </div>
60
62
(-)template/en/custom/traces/confirm-delete.html.tmpl (+44 lines)
Added Link Here 
1
[%# 1.0@bugzilla.org %]
2
[%# The contents of this file are subject to the Mozilla Public
3
  # License Version 1.1 (the "License"); you may not use this file
4
  # except in compliance with the License. You may obtain a copy of
5
  # the License at http://www.mozilla.org/MPL/
6
  #
7
  # Software distributed under the License is distributed on an "AS
8
  # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
9
  # implied. See the License for the specific language governing
10
  # rights and limitations under the License.
11
  #
12
  # The Original Code is the Bugzilla Bug Tracking System.
13
  #
14
  # The Initial Developer of the Original Code is Netscape Communications
15
  # Corporation. Portions created by Netscape are
16
  # Copyright (C) 1998 Netscape Communications Corporation. All
17
  # Rights Reserved.
18
  #
19
  # Contributor(s): Terry Weissman <terry@mozilla.org>
20
  #                 Vlad Dascalu <jocuri@softhome.net>
21
  #%]
22
23
[%# INTERFACE:
24
  # name: string. The name of the keyword.
25
  # keyword_id: number. The ID of the keyword.
26
  # bug_count: number. The number of bugs with the keyword.
27
  #%]
28
29
[% PROCESS global/header.html.tmpl
30
  title = "Delete Trace"
31
%]
32
33
<p>
34
  Are you <b>sure</b> you want to delete
35
  the <code>[% name FILTER html %]</code> trace?
36
</p>
37
38
<form action="edittraces.cgi" method="POST">
39
  <input name="hash" type="hidden" value="[% cur_trace.hash FILTER html %]">
40
  <input type="hidden" name="action" value="[% action FILTER html %]">
41
  <input type="submit" name="do_delete" value="Yes, really delete the trace">
42
</form>
43
44
[% PROCESS global/footer.html.tmpl %] 
(-)template/en/custom/traces/list.html.tmpl (+77 lines)
Added Link Here 
1
[%# 1.0@bugzilla.org %]
2
[%# -*- mode: html -*- %]
3
[%# The contents of this file are subject to the Mozilla Public
4
  # License Version 1.1 (the "License"); you may not use this file
5
  # except in compliance with the License. You may obtain a copy of
6
  # the License at http://www.mozilla.org/MPL/
7
  #
8
  # Software distributed under the License is distributed on an "AS
9
  # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
10
  # implied. See the License for the specific language governing
11
  # rights and limitations under the License.
12
  #
13
  # The Original Code is the Bugzilla Bug Tracking System.
14
  #
15
  # The Initial Developer of the Original Code is Olav Vitters
16
  # Corporation. Portions created by Netscape are
17
  # Copyright (C) 2005 Olav Vitters Corporation. All
18
  # Rights Reserved.
19
  #
20
  #%]
21
22
[%# INTERFACE:
23
  # This template has no interface.
24
  #%]
25
26
[% PROCESS global/variables.none.tmpl %]
27
28
[% PROCESS global/header.html.tmpl
29
    title = "Auto strack trace rejecting"
30
    h1 = "" %]
31
32
[% USE GNOME %]
33
34
[% PROCESS "traces/show.html.tmpl" action="add" cur_trace = {} hide_header = 1 %]
35
36
<br><hr><br>
37
38
<table>
39
<tr><th>Action</th><th>Main bug</th><th>Product</th><th>user_id</th><th>Version</th><th>GNOME version</th></tr>
40
[% data = GNOME.get_traces_info %]
41
[% FOREACH row = data %]
42
  <tr>
43
    <td>
44
      <a name="[% row.hash FILTER html %]" href="edittraces.cgi?action=edit&amp;hash=[% row.hash FILTER url_quote %]">Edit</a>
45
      | <a href="edittraces.cgi?action=delete&amp;hash=[% row.hash FILTER url_quote %]">Remove</a>
46
      | <a href="#" onClick="document.getElementById('st_[% row.hash FILTER js %]').style.display = 'block'; return false">Show bt</a>
47
    </td>
48
    <td>[% row.dupe_of FILTER bug_link(row.dupe_of) %]</td>
49
    <td>
50
      [% IF product %]
51
        <a href="browse.cgi?product=[% row.product FILTER html %]">[% row.product FILTER html %]</a>
52
      [% ELSE %]
53
        <i>Any</i>
54
      [% END %]
55
    </td>
56
    <td>[% row.user_id FILTER html %]</td>
57
    <td>
58
      [% IF row.version %]
59
        [% row.version FILTER html %]
60
      [% ELSE %]
61
        <i>Any</i>
62
      [% END %]
63
    </td>
64
    <td>
65
      [% IF row.gnome_version %]
66
        [% row.gnome_version FILTER html %]
67
      [% ELSE %]
68
        <i>Any</i>
69
      [% END %]
70
    </td>
71
  </tr>
72
  <tr><td colspan="6"><div style="display: none" id="st_[% row.hash FILTER html %]">Stack trace:<br><pre>[% row.trace FILTER quoteUrls %]</pre></div></td></tr>
73
[% END %]
74
</table>
75
76
77
[% PROCESS global/footer.html.tmpl %]
(-)template/en/custom/traces/show.html.tmpl (+122 lines)
Added Link Here 
1
[%# 1.0@bugzilla.org %]
2
[%# -*- mode: html -*- %]
3
[%# The contents of this file are subject to the Mozilla Public
4
  # License Version 1.1 (the "License"); you may not use this file
5
  # except in compliance with the License. You may obtain a copy of
6
  # the License at http://www.mozilla.org/MPL/
7
  #
8
  # Software distributed under the License is distributed on an "AS
9
  # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
10
  # implied. See the License for the specific language governing
11
  # rights and limitations under the License.
12
  #
13
  # The Original Code is the Bugzilla Bug Tracking System.
14
  #
15
  # The Initial Developer of the Original Code is Olav Vitters
16
  # Corporation. Portions created by Netscape are
17
  # Copyright (C) 2005 Olav Vitters Corporation. All
18
  # Rights Reserved.
19
  #
20
  #%]
21
22
[%# INTERFACE:
23
  # action: action to take
24
  # hide_header: boolean; true if header and footer should not be shown.
25
  #%]
26
27
[% IF !hide_header %]
28
[% PROCESS global/variables.none.tmpl %]
29
30
[% PROCESS global/header.html.tmpl
31
    title = "Auto strack trace rejecting"
32
    h1 = "" %]
33
[% END %]
34
35
[% USE GNOME %]
36
37
<form action="edittraces.cgi" method="POST">
38
<input type="hidden" name="action" value="[% action FILTER html %]">
39
[% IF action == "edit" && cur_trace.old_hash %]
40
<input type="hidden" name="old_hash" value="[% cur_trace.old_hash FILTER html %]">
41
[% END %]
42
[% IF cur_trace.exists('hash') %]<input name="hash" type="hidden" value="[% cur_trace.hash FILTER html %]">[% END %]
43
<style><!--
44
.foo tr { vertical-align: top }
45
 --></style>
46
<table border=0 cellpadding=4 cellspacing=0 class="foo">
47
<tr>
48
  <th align="right"><label for="dupe_of">Duplicate of?</label>:</th>
49
  <td><input name="dupe_of" id="dupe_of" value="[% cur_trace.dupe_of FILTER html %]"></td>
50
</tr>
51
<tr>
52
  <th align="right"><label for="product_only">Product</label>:</th>
53
  <td><select name="product_id" id="product_id">
54
    <option value="">Do not reject for a specific product</option>
55
    [% FOREACH product = products.keys.sort %]
56
      <option value="[% products.$product FILTER html %]" [% IF products.$product == cur_trace.product_id %] selected="selected"[% END %]>[% product FILTER html %]</option>
57
    [% END %]</select>
58
    [% IF cur_trace.dupe_of_bug && cur_trace.dupe_of_bug.bug_id
59
          && (!cur_trace.product_id || cur_trace.dupe_of_bug.product != cur_trace.product) %]
60
      <br><font color="red">Main bugs product: [% cur_trace.dupe_of_bug.product FILTER html %]</font>
61
    [% END %]
62
  </td>
63
</tr>
64
<tr>
65
  <th align="right"><label for="version">Product version</label>:</th>
66
  <td>
67
    <input name="version" id="version" value="[% cur_trace.version FILTER html %]">
68
    <br>(leave empty to reject for all versions)
69
    [% IF cur_trace.dupe_of_bug && cur_trace.dupe_of_bug.bug_id
70
          && (!cur_trace.version || cur_trace.dupe_of_bug.version != cur_trace.version) %]
71
      <br><font color="red">Main bugs version: [% cur_trace.dupe_of_bug.version FILTER html %]</font>
72
    [% END %]
73
  </td>
74
</tr>
75
<tr>
76
  <th align="right"><label for="gnome_version">GNOME version</label>:</th>
77
  <td><select name="gnome_version" id="gnome_version">
78
    <option value="">Do not reject using GNOME version (recommended)</option>
79
    [% FOREACH opt = legal_gnome_versions %]
80
      <option value="[% opt FILTER html %]" [% IF opt == cur_trace.gnome_version %] selected="selected"[% END %]>[% opt FILTER html %]</option>
81
    [% END %]</select>
82
    <br>WARNING: GNOME version is optional
83
    [% IF cur_trace.dupe_of_bug && cur_trace.dupe_of_bug.bug_id
84
          && (!cur_trace.gnome_version || cur_trace.dupe_of_bug.gnome_version != cur_trace.gnome_version) %]
85
      <br><font color="red">Main bugs GNOME version: [% cur_trace.dupe_of_bug.gnome_version FILTER html %]</font>
86
    [% END %]
87
  </td>
88
</tr>
89
[% IF cur_trace.functions %]
90
  <tr>
91
    <th align="right"><label for="gnome_version">Detected functions</label>:</th>
92
    <td>
93
      [% cur_trace.functions FILTER html %]
94
      [% IF cur_trace.is_dupe %]
95
        <br><font color="red">ERROR: Stack trace is already rejected (perhaps for another product, etc). See <a href="edittraces.cgi?action=edit&amp;hash=[% cur_trace.hash FILTER url_quote %]" target="_new">here</a></font>
96
      [% END %]
97
    </td>
98
  </tr>
99
[% END %]
100
<tr>
101
  <th align="right"><label for="trace">Stack trace:</label></td>
102
  <td><textarea name="trace" id="trace" cols="80" rows=15>[% cur_trace.trace FILTER html %]</textarea></td>
103
</tr>
104
<tr>
105
  <td>&nbsp;</td>
106
  <td>
107
    [% IF action == "add" %]
108
      [% IF cur_trace.exists('hash') %]
109
        <input type="submit" value="Re-parse above stack trace">
110
        [% IF ! cur_trace.is_dupe %] <input type="submit" name="do_add" value="Reject above stack trace">[% END %]
111
      [% ELSE %]
112
        <input type="submit" value="Parse stack trace for functions">
113
      [% END %]
114
    [% ELSIF action == "edit" %]
115
      <input type="submit" value="Validate changes">
116
      [% IF ! cur_trace.is_dupe %] <input type="submit" name="do_edit" value="Update above stack trace">[% END %]
117
    [% END %]
118
  </td>
119
</table>
120
</form>
121
122
[% PROCESS global/footer.html.tmpl IF !hide_header %]
(-)template/en/default/global/messages.html.tmpl (+9 lines)
 Lines 264-269    Link Here 
264
    user, so we have instead left the [% match_field FILTER html %]
264
    user, so we have instead left the [% match_field FILTER html %]
265
    field blank.
265
    field blank.
266
    
266
    
267
  [% ELSIF message_tag == "trace_created" %]
268
    Stack trace has been created.
269
270
  [% ELSIF message_tag == "trace_updated" %]
271
    Stack trace has been updated.
272
273
  [% ELSIF message_tag == "trace_deleted" %]
274
    Stack trace has been deleted.
275
267
  [% ELSE %]
276
  [% ELSE %]
268
    [%# Give sensible error if error functions are used incorrectly.
277
    [%# Give sensible error if error functions are used incorrectly.
269
      #%]        
278
      #%]        
(-)template/en/default/global/user-error.html.tmpl (+2 lines)
 Lines 186-191    Link Here 
186
      users
186
      users
187
    [% ELSIF object == "versions" %]
187
    [% ELSIF object == "versions" %]
188
      versions
188
      versions
189
    [% ELSIF object == "traces" %]
190
      stack traces
189
    [% END %].
191
    [% END %].
190
192
191
  [% ELSIF error == "attachment_removed" %]
193
  [% ELSIF error == "attachment_removed" %]

Return to bug 330321