Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
fef6f78c
Commit
fef6f78c
authored
Sep 19, 2006
by
mkanat%bugzilla.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 223880: "marked a duplicate" messages cannot be localized
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=myk
parent
5750cad1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
32 additions
and
11 deletions
+32
-11
Bugzilla.pm
Bugzilla.pm
+11
-0
BugMail.pm
Bugzilla/BugMail.pm
+1
-1
Template.pm
Bugzilla/Template.pm
+4
-2
Util.pm
Bugzilla/Util.pm
+1
-1
process_bug.cgi
process_bug.cgi
+6
-7
messages.html.tmpl
template/en/default/global/messages.html.tmpl
+9
-0
No files found.
Bugzilla.pm
View file @
fef6f78c
...
@@ -146,6 +146,12 @@ sub template {
...
@@ -146,6 +146,12 @@ sub template {
return
request_cache
()
->
{
template
};
return
request_cache
()
->
{
template
};
}
}
sub
template_inner
{
my
$class
=
shift
;
$class
->
request_cache
->
{
template_inner
}
||=
Bugzilla::
Template
->
create
();
return
$class
->
request_cache
->
{
template_inner
};
}
sub
cgi
{
sub
cgi
{
my
$class
=
shift
;
my
$class
=
shift
;
request_cache
()
->
{
cgi
}
||=
new
Bugzilla::
CGI
();
request_cache
()
->
{
cgi
}
||=
new
Bugzilla::
CGI
();
...
@@ -452,6 +458,11 @@ that.
...
@@ -452,6 +458,11 @@ that.
The current C<Template> object, to be used for output
The current C<Template> object, to be used for output
=item C<template_inner>
If you ever need a L<Bugzilla::Template> object while you're already
processing a template, use this.
=item C<cgi>
=item C<cgi>
The current C<cgi> object. Note that modules should B<not> be using this in
The current C<cgi> object. Note that modules should B<not> be using this in
...
...
Bugzilla/BugMail.pm
View file @
fef6f78c
...
@@ -645,7 +645,7 @@ sub sendMail {
...
@@ -645,7 +645,7 @@ sub sendMail {
};
};
my
$msg
;
my
$msg
;
my
$template
=
Bugzilla
::
Template
->
create
()
;
my
$template
=
Bugzilla
->
template_inner
;
$template
->
process
(
"email/newchangedmail.txt.tmpl"
,
$vars
,
\
$msg
)
$template
->
process
(
"email/newchangedmail.txt.tmpl"
,
$vars
,
\
$msg
)
||
ThrowTemplateError
(
$template
->
error
());
||
ThrowTemplateError
(
$template
->
error
());
...
...
Bugzilla/Template.pm
View file @
fef6f78c
...
@@ -331,7 +331,8 @@ sub quoteUrls {
...
@@ -331,7 +331,8 @@ sub quoteUrls {
# we have to do this in one pattern, and so this is semi-messy.
# we have to do this in one pattern, and so this is semi-messy.
# Also, we can't use $bug_re?$comment_re? because that will match the
# Also, we can't use $bug_re?$comment_re? because that will match the
# empty string
# empty string
my $bug_re = qr/bug\s*\#?\s*(\d+)/i;
my $bug_word = get_text('term', { term => 'bug' });
my $bug_re = qr/\Q$bug_word\E\s*\#?\s*(\d+)/i;
my $comment_re = qr/comment\s*\#?\s*(\d+)/i;
my $comment_re = qr/comment\s*\#?\s*(\d+)/i;
$text =~ s~\b($bug_re(?:\s*,?\s*$comment_re)?|$comment_re)
$text =~ s~\b($bug_re(?:\s*,?\s*$comment_re)?|$comment_re)
~ # We have several choices. $1 here is the link, and $2-4 are set
~ # We have several choices. $1 here is the link, and $2-4 are set
...
@@ -340,7 +341,8 @@ sub quoteUrls {
...
@@ -340,7 +341,8 @@ sub quoteUrls {
"
<
a
href
=\
"$current_bugurl#c$4\">$1</a>"
)
"
<
a
href
=\
"$current_bugurl#c$4\">$1</a>"
)
~
egox
;
~
egox
;
# Old duplicate markers
# Old duplicate markers. These don't use $bug_word because they are old
# and were never customizable.
$text
=~
s
~
(?
<=^\*\*\*\
This
\
bug
\
has
\
been
\
marked
\
as
\
a
\
duplicate
\
of
\
)
$text
=~
s
~
(?
<=^\*\*\*\
This
\
bug
\
has
\
been
\
marked
\
as
\
a
\
duplicate
\
of
\
)
(
\
d
+
)
(
\
d
+
)
(?
=\
\*\*\*\
Z
)
(?
=\
\*\*\*\
Z
)
...
...
Bugzilla/Util.pm
View file @
fef6f78c
...
@@ -400,7 +400,7 @@ sub clean_text {
...
@@ -400,7 +400,7 @@ sub clean_text {
sub
get_text
{
sub
get_text
{
my
(
$name
,
$vars
)
=
@_
;
my
(
$name
,
$vars
)
=
@_
;
my
$template
=
Bugzilla
->
template
;
my
$template
=
Bugzilla
->
template
_inner
;
$vars
||=
{};
$vars
||=
{};
$vars
->
{
'message'
}
=
$name
;
$vars
->
{
'message'
}
=
$name
;
my
$message
;
my
$message
;
...
...
process_bug.cgi
View file @
fef6f78c
...
@@ -1147,8 +1147,8 @@ SWITCH: for ($cgi->param('knob')) {
...
@@ -1147,8 +1147,8 @@ SWITCH: for ($cgi->param('knob')) {
ChangeStatus
(
'RESOLVED'
);
ChangeStatus
(
'RESOLVED'
);
ChangeResolution
(
'DUPLICATE'
);
ChangeResolution
(
'DUPLICATE'
);
my
$comment
=
$cgi
->
param
(
'comment'
);
my
$comment
=
$cgi
->
param
(
'comment'
);
$comment
.=
"\n\n
*** This bug has been marked "
.
$comment
.=
"\n\n
"
"as a duplicate of bug $duplicate ***"
;
.
get_text
(
'bug_duplicate_of'
,
{
dupe_of
=>
$duplicate
})
;
$cgi
->
param
(
'comment'
,
$comment
);
$cgi
->
param
(
'comment'
,
$comment
);
last
SWITCH
;
last
SWITCH
;
};
};
...
@@ -2025,11 +2025,10 @@ foreach my $id (@idlist) {
...
@@ -2025,11 +2025,10 @@ foreach my $id (@idlist) {
$dbh
->
do
(
q{INSERT INTO cc (who, bug_id) VALUES (?, ?)}
,
$dbh
->
do
(
q{INSERT INTO cc (who, bug_id) VALUES (?, ?)}
,
undef
,
$reporter
,
$duplicate
);
undef
,
$reporter
,
$duplicate
);
}
}
# Bug 171639 - Duplicate notifications do not need to be private.
my
$dupe_comment
=
get_text
(
'bug_has_duplicate'
,
AppendComment
(
$duplicate
,
$whoid
,
{
dupe
=>
$cgi
->
param
(
'id'
)
});
"*** Bug "
.
$cgi
->
param
(
'id'
)
.
# Bug 171639 - Duplicate notifications do not need to be private.
" has been marked as a duplicate of this bug. ***"
,
AppendComment
(
$duplicate
,
$whoid
,
$dupe_comment
,
0
,
$timestamp
);
0
,
$timestamp
);
$dbh
->
do
(
q{INSERT INTO duplicates VALUES (?, ?)}
,
undef
,
$dbh
->
do
(
q{INSERT INTO duplicates VALUES (?, ?)}
,
undef
,
$duplicate
,
$cgi
->
param
(
'id'
));
$duplicate
,
$cgi
->
param
(
'id'
));
...
...
template/en/default/global/messages.html.tmpl
View file @
fef6f78c
...
@@ -121,6 +121,12 @@
...
@@ -121,6 +121,12 @@
Please add your attachment by clicking the "Create a New Attachment" link
Please add your attachment by clicking the "Create a New Attachment" link
below.
below.
[% ELSIF message_tag == "bug_duplicate_of" %]
*** This [% terms.bug %] has been marked as a duplicate of [% terms.bug %] [%+ dupe_of FILTER html %] ***
[% ELSIF message_tag == "bug_has_duplicate" %]
*** [% terms.Bug %] [%+ dupe FILTER html %] has been marked as a duplicate of this [% terms.bug %]. ***
[% ELSIF message_tag == "buglist_adding_field" %]
[% ELSIF message_tag == "buglist_adding_field" %]
[% title = "Adding field to search page..." %]
[% title = "Adding field to search page..." %]
[% link = "Click here if the page does not redisplay automatically." %]
[% link = "Click here if the page does not redisplay automatically." %]
...
@@ -386,6 +392,9 @@
...
@@ -386,6 +392,9 @@
The cookie that was remembering your login is now gone.
The cookie that was remembering your login is now gone.
[% END %]
[% END %]
[% ELSIF message_tag == "term" %]
[% terms.$term FILTER html %]
[% ELSIF message_tag == "user_match_failed" %]
[% ELSIF message_tag == "user_match_failed" %]
You entered a username that did not match any known
You entered a username that did not match any known
[% terms.Bugzilla %] users, so we have instead left
[% terms.Bugzilla %] users, so we have instead left
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment