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
037942d0
Commit
037942d0
authored
Jul 25, 2011
by
Byron Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 589128: Adds a preference allowing users to choose between text or html
for bugmail. r=LpSolit, a=LpSolit
parent
7ddff2f3
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
44 additions
and
23 deletions
+44
-23
Bug.pm
Bugzilla/Bug.pm
+1
-1
BugMail.pm
Bugzilla/BugMail.pm
+15
-9
Flag.pm
Bugzilla/Flag.pm
+2
-2
Install.pm
Bugzilla/Install.pm
+3
-0
Quicksearch.pm
Bugzilla/Search/Quicksearch.pm
+1
-1
Token.pm
Bugzilla/Token.pm
+3
-3
User.pm
Bugzilla/User.pm
+10
-1
Extension.pm
extensions/Voting/Extension.pm
+1
-1
process_bug.cgi
process_bug.cgi
+1
-1
relogin.cgi
relogin.cgi
+1
-1
sanitycheck.cgi
sanitycheck.cgi
+1
-1
setting-descs.none.tmpl
template/en/default/global/setting-descs.none.tmpl
+3
-0
whine.pl
whine.pl
+1
-1
whineatnews.pl
whineatnews.pl
+1
-1
No files found.
Bugzilla/Bug.pm
View file @
037942d0
...
@@ -3300,7 +3300,7 @@ sub comments {
...
@@ -3300,7 +3300,7 @@ sub comments {
my
@comments
=
@
{
$self
->
{
'comments'
}
};
my
@comments
=
@
{
$self
->
{
'comments'
}
};
my
$order
=
$params
->
{
order
}
my
$order
=
$params
->
{
order
}
||
Bugzilla
->
user
->
setting
s
->
{
'comment_sort_order'
}
->
{
'value'
}
;
||
Bugzilla
->
user
->
setting
(
'comment_sort_order'
)
;
if
(
$order
ne
'oldest_to_newest'
)
{
if
(
$order
ne
'oldest_to_newest'
)
{
@comments
=
reverse
@comments
;
@comments
=
reverse
@comments
;
if
(
$order
eq
'newest_to_oldest_desc_first'
)
{
if
(
$order
eq
'newest_to_oldest_desc_first'
)
{
...
...
Bugzilla/BugMail.pm
View file @
037942d0
...
@@ -374,35 +374,41 @@ sub sendMail {
...
@@ -374,35 +374,41 @@ sub sendMail {
sub
_generate_bugmail
{
sub
_generate_bugmail
{
my
(
$user
,
$vars
)
=
@_
;
my
(
$user
,
$vars
)
=
@_
;
my
$template
=
Bugzilla
->
template_inner
(
$user
->
setting
s
->
{
'lang'
}
->
{
'value'
}
);
my
$template
=
Bugzilla
->
template_inner
(
$user
->
setting
(
'lang'
)
);
my
(
$msg_text
,
$msg_html
,
$msg_header
);
my
(
$msg_text
,
$msg_html
,
$msg_header
);
$template
->
process
(
"email/bugmail-header.txt.tmpl"
,
$vars
,
\
$msg_header
)
$template
->
process
(
"email/bugmail-header.txt.tmpl"
,
$vars
,
\
$msg_header
)
||
ThrowTemplateError
(
$template
->
error
());
||
ThrowTemplateError
(
$template
->
error
());
$template
->
process
(
"email/bugmail.txt.tmpl"
,
$vars
,
\
$msg_text
)
$template
->
process
(
"email/bugmail.txt.tmpl"
,
$vars
,
\
$msg_text
)
||
ThrowTemplateError
(
$template
->
error
());
||
ThrowTemplateError
(
$template
->
error
());
$template
->
process
(
"email/bugmail.html.tmpl"
,
$vars
,
\
$msg_html
)
||
ThrowTemplateError
(
$template
->
error
());
my
@parts
=
(
my
@parts
=
(
Email::
MIME
->
create
(
Email::
MIME
->
create
(
attributes
=>
{
attributes
=>
{
content_type
=>
"text/plain"
,
content_type
=>
"text/plain"
,
},
},
body
=>
$msg_text
,
body
=>
$msg_text
,
),
)
Email::
MIME
->
create
(
);
if
(
$user
->
setting
(
'email_format'
)
eq
'html'
)
{
$template
->
process
(
"email/bugmail.html.tmpl"
,
$vars
,
\
$msg_html
)
||
ThrowTemplateError
(
$template
->
error
());
push
@parts
,
Email::
MIME
->
create
(
attributes
=>
{
attributes
=>
{
content_type
=>
"text/html"
,
content_type
=>
"text/html"
,
},
},
body
=>
$msg_html
,
body
=>
$msg_html
,
)
,
)
;
);
}
# TT trims the trailing newline, and threadingmarker may be ignored.
# TT trims the trailing newline, and threadingmarker may be ignored.
my
$email
=
new
Email::
MIME
(
"$msg_header\n"
);
my
$email
=
new
Email::
MIME
(
"$msg_header\n"
);
if
(
scalar
(
@parts
)
==
1
)
{
$email
->
content_type_set
(
$parts
[
0
]
->
content_type
);
}
else
{
$email
->
content_type_set
(
'multipart/alternative'
);
}
$email
->
parts_set
(
\
@parts
);
$email
->
parts_set
(
\
@parts
);
$email
->
content_type_set
(
'multipart/alternative'
);
return
$email
;
return
$email
;
}
}
...
...
Bugzilla/Flag.pm
View file @
037942d0
...
@@ -970,7 +970,7 @@ sub notify {
...
@@ -970,7 +970,7 @@ sub notify {
# use the default language for email notifications.
# use the default language for email notifications.
my
$default_lang
;
my
$default_lang
;
if
(
grep
{
!
$_
}
values
%
recipients
)
{
if
(
grep
{
!
$_
}
values
%
recipients
)
{
$default_lang
=
Bugzilla::
User
->
new
()
->
setting
s
->
{
'lang'
}
->
{
'value'
}
;
$default_lang
=
Bugzilla::
User
->
new
()
->
setting
(
'lang'
)
;
}
}
foreach
my
$to
(
keys
%
recipients
)
{
foreach
my
$to
(
keys
%
recipients
)
{
...
@@ -987,7 +987,7 @@ sub notify {
...
@@ -987,7 +987,7 @@ sub notify {
'threadingmarker'
=>
build_thread_marker
(
$bug
->
id
,
$thread_user_id
)
};
'threadingmarker'
=>
build_thread_marker
(
$bug
->
id
,
$thread_user_id
)
};
my
$lang
=
$recipients
{
$to
}
?
my
$lang
=
$recipients
{
$to
}
?
$recipients
{
$to
}
->
setting
s
->
{
'lang'
}
->
{
'value'
}
:
$default_lang
;
$recipients
{
$to
}
->
setting
(
'lang'
)
:
$default_lang
;
my
$template
=
Bugzilla
->
template_inner
(
$lang
);
my
$template
=
Bugzilla
->
template_inner
(
$lang
);
my
$message
;
my
$message
;
...
...
Bugzilla/Install.pm
View file @
037942d0
...
@@ -90,6 +90,9 @@ sub SETTINGS {
...
@@ -90,6 +90,9 @@ sub SETTINGS {
timezone
=>
{
subclass
=>
'Timezone'
,
default
=>
'local'
},
timezone
=>
{
subclass
=>
'Timezone'
,
default
=>
'local'
},
# 2011-02-07 dkl@mozilla.com -- Bug 580490
# 2011-02-07 dkl@mozilla.com -- Bug 580490
quicksearch_fulltext
=>
{
options
=>
[
'on'
,
'off'
],
default
=>
'on'
},
quicksearch_fulltext
=>
{
options
=>
[
'on'
,
'off'
],
default
=>
'on'
},
# 2011-06-21 glob@mozilla.com -- Bug 589128
email_format
=>
{
options
=>
[
'html'
,
'text_only'
],
default
=>
'html'
},
}
}
};
};
...
...
Bugzilla/Search/Quicksearch.pm
View file @
037942d0
...
@@ -142,7 +142,7 @@ sub quicksearch {
...
@@ -142,7 +142,7 @@ sub quicksearch {
$searchstring
=~
s/(^[\s,]+|[\s,]+$)//g
;
$searchstring
=~
s/(^[\s,]+|[\s,]+$)//g
;
ThrowUserError
(
'buglist_parameters_required'
)
unless
(
$searchstring
);
ThrowUserError
(
'buglist_parameters_required'
)
unless
(
$searchstring
);
$fulltext
=
Bugzilla
->
user
->
setting
s
->
{
'quicksearch_fulltext'
}
->
{
'value'
}
eq
'on'
?
1
:
0
;
$fulltext
=
Bugzilla
->
user
->
setting
(
'quicksearch_fulltext'
)
eq
'on'
?
1
:
0
;
if
(
$searchstring
=~
m/^[0-9,\s]*$/
)
{
if
(
$searchstring
=~
m/^[0-9,\s]*$/
)
{
_bug_numbers_only
(
$searchstring
);
_bug_numbers_only
(
$searchstring
);
...
...
Bugzilla/Token.pm
View file @
037942d0
...
@@ -101,7 +101,7 @@ sub IssueEmailChangeToken {
...
@@ -101,7 +101,7 @@ sub IssueEmailChangeToken {
# Mail the user the token along with instructions for using it.
# Mail the user the token along with instructions for using it.
my
$template
=
Bugzilla
->
template_inner
(
$user
->
setting
s
->
{
'lang'
}
->
{
'value'
}
);
my
$template
=
Bugzilla
->
template_inner
(
$user
->
setting
(
'lang'
)
);
my
$vars
=
{};
my
$vars
=
{};
$vars
->
{
'oldemailaddress'
}
=
$old_email
.
$email_suffix
;
$vars
->
{
'oldemailaddress'
}
=
$old_email
.
$email_suffix
;
...
@@ -144,7 +144,7 @@ sub IssuePasswordToken {
...
@@ -144,7 +144,7 @@ sub IssuePasswordToken {
my
(
$token
,
$token_ts
)
=
_create_token
(
$user
->
id
,
'password'
,
remote_ip
());
my
(
$token
,
$token_ts
)
=
_create_token
(
$user
->
id
,
'password'
,
remote_ip
());
# Mail the user the token along with instructions for using it.
# Mail the user the token along with instructions for using it.
my
$template
=
Bugzilla
->
template_inner
(
$user
->
setting
s
->
{
'lang'
}
->
{
'value'
}
);
my
$template
=
Bugzilla
->
template_inner
(
$user
->
setting
(
'lang'
)
);
my
$vars
=
{};
my
$vars
=
{};
$vars
->
{
'token'
}
=
$token
;
$vars
->
{
'token'
}
=
$token
;
...
@@ -292,7 +292,7 @@ sub Cancel {
...
@@ -292,7 +292,7 @@ sub Cancel {
$vars
->
{
'cancelaction'
}
=
$cancelaction
;
$vars
->
{
'cancelaction'
}
=
$cancelaction
;
# Notify the user via email about the cancellation.
# Notify the user via email about the cancellation.
my
$template
=
Bugzilla
->
template_inner
(
$user
->
setting
s
->
{
'lang'
}
->
{
'value'
}
);
my
$template
=
Bugzilla
->
template_inner
(
$user
->
setting
(
'lang'
)
);
my
$message
;
my
$message
;
$template
->
process
(
"account/cancel-token.txt.tmpl"
,
$vars
,
\
$message
)
$template
->
process
(
"account/cancel-token.txt.tmpl"
,
$vars
,
\
$message
)
...
...
Bugzilla/User.pm
View file @
037942d0
...
@@ -593,11 +593,16 @@ sub settings {
...
@@ -593,11 +593,16 @@ sub settings {
return
$self
->
{
'settings'
};
return
$self
->
{
'settings'
};
}
}
sub
setting
{
my
(
$self
,
$name
)
=
@_
;
return
$self
->
settings
->
{
$name
}
->
{
'value'
};
}
sub
timezone
{
sub
timezone
{
my
$self
=
shift
;
my
$self
=
shift
;
if
(
!
defined
$self
->
{
timezone
})
{
if
(
!
defined
$self
->
{
timezone
})
{
my
$tz
=
$self
->
setting
s
->
{
timezone
}
->
{
value
}
;
my
$tz
=
$self
->
setting
(
'timezone'
)
;
if
(
$tz
eq
'local'
)
{
if
(
$tz
eq
'local'
)
{
# The user wants the local timezone of the server.
# The user wants the local timezone of the server.
$self
->
{
timezone
}
=
Bugzilla
->
local_timezone
;
$self
->
{
timezone
}
=
Bugzilla
->
local_timezone
;
...
@@ -2241,6 +2246,10 @@ value - the value of this setting for this user. Will be the same
...
@@ -2241,6 +2246,10 @@ value - the value of this setting for this user. Will be the same
is_default - a boolean to indicate whether the user has chosen to make
is_default - a boolean to indicate whether the user has chosen to make
a preference for themself or use the site default.
a preference for themself or use the site default.
=item C<setting(name)>
Returns the value for the specified setting.
=item C<timezone>
=item C<timezone>
Returns the timezone used to display dates and times to the user,
Returns the timezone used to display dates and times to the user,
...
...
extensions/Voting/Extension.pm
View file @
037942d0
...
@@ -806,7 +806,7 @@ sub _remove_votes {
...
@@ -806,7 +806,7 @@ sub _remove_votes {
};
};
my
$voter
=
new
Bugzilla::
User
(
$userid
);
my
$voter
=
new
Bugzilla::
User
(
$userid
);
my
$template
=
Bugzilla
->
template_inner
(
$voter
->
setting
s
->
{
'lang'
}
->
{
'value'
}
);
my
$template
=
Bugzilla
->
template_inner
(
$voter
->
setting
(
'lang'
)
);
my
$msg
;
my
$msg
;
$template
->
process
(
"voting/votes-removed.txt.tmpl"
,
$vars
,
\
$msg
);
$template
->
process
(
"voting/votes-removed.txt.tmpl"
,
$vars
,
\
$msg
);
...
...
process_bug.cgi
View file @
037942d0
...
@@ -189,7 +189,7 @@ $vars->{'title_tag'} = "bug_processed";
...
@@ -189,7 +189,7 @@ $vars->{'title_tag'} = "bug_processed";
my
$action
;
my
$action
;
if
(
defined
$cgi
->
param
(
'id'
))
{
if
(
defined
$cgi
->
param
(
'id'
))
{
$action
=
$user
->
setting
s
->
{
'post_bug_submit_action'
}
->
{
'value'
}
;
$action
=
$user
->
setting
(
'post_bug_submit_action'
)
;
if
(
$action
eq
'next_bug'
)
{
if
(
$action
eq
'next_bug'
)
{
my
$bug_list_obj
=
$user
->
recent_search_for
(
$first_bug
);
my
$bug_list_obj
=
$user
->
recent_search_for
(
$first_bug
);
...
...
relogin.cgi
View file @
037942d0
...
@@ -164,7 +164,7 @@ elsif ($action eq 'begin-sudo') {
...
@@ -164,7 +164,7 @@ elsif ($action eq 'begin-sudo') {
# Go ahead and send out the message now
# Go ahead and send out the message now
my
$message
;
my
$message
;
my
$mail_template
=
Bugzilla
->
template_inner
(
$target_user
->
setting
s
->
{
'lang'
}
->
{
'value'
}
);
my
$mail_template
=
Bugzilla
->
template_inner
(
$target_user
->
setting
(
'lang'
)
);
$mail_template
->
process
(
'email/sudo.txt.tmpl'
,
{
reason
=>
$reason
},
\
$message
);
$mail_template
->
process
(
'email/sudo.txt.tmpl'
,
{
reason
=>
$reason
},
\
$message
);
MessageToMTA
(
$message
);
MessageToMTA
(
$message
);
...
...
sanitycheck.cgi
View file @
037942d0
...
@@ -76,7 +76,7 @@ my $dbh = Bugzilla->dbh;
...
@@ -76,7 +76,7 @@ my $dbh = Bugzilla->dbh;
# take the user prefs into account rather than querying the web browser.
# take the user prefs into account rather than querying the web browser.
my
$template
;
my
$template
;
if
(
Bugzilla
->
usage_mode
==
USAGE_MODE_CMDLINE
)
{
if
(
Bugzilla
->
usage_mode
==
USAGE_MODE_CMDLINE
)
{
$template
=
Bugzilla
->
template_inner
(
$user
->
setting
s
->
{
'lang'
}
->
{
'value'
}
);
$template
=
Bugzilla
->
template_inner
(
$user
->
setting
(
'lang'
)
);
}
}
else
{
else
{
$template
=
Bugzilla
->
template
;
$template
=
Bugzilla
->
template
;
...
...
template/en/default/global/setting-descs.none.tmpl
View file @
037942d0
...
@@ -49,6 +49,9 @@
...
@@ -49,6 +49,9 @@
"timezone" => "Timezone used to display dates and times",
"timezone" => "Timezone used to display dates and times",
"local" => "Same as the server",
"local" => "Same as the server",
"quicksearch_fulltext" => "Include comments when performing quick searches (slower)",
"quicksearch_fulltext" => "Include comments when performing quick searches (slower)",
"email_format" => "Preferred email format",
"html" => "HTML",
"text_only" => "Text Only",
}
}
%]
%]
...
...
whine.pl
View file @
037942d0
...
@@ -367,7 +367,7 @@ sub mail {
...
@@ -367,7 +367,7 @@ sub mail {
# Don't send mail to someone whose bugmail notification is disabled.
# Don't send mail to someone whose bugmail notification is disabled.
return
if
$addressee
->
email_disabled
;
return
if
$addressee
->
email_disabled
;
my
$template
=
Bugzilla
->
template_inner
(
$addressee
->
setting
s
->
{
'lang'
}
->
{
'value'
}
);
my
$template
=
Bugzilla
->
template_inner
(
$addressee
->
setting
(
'lang'
)
);
my
$msg
=
''
;
# it's a temporary variable to hold the template output
my
$msg
=
''
;
# it's a temporary variable to hold the template output
$args
->
{
'alternatives'
}
||=
[]
;
$args
->
{
'alternatives'
}
||=
[]
;
...
...
whineatnews.pl
View file @
037942d0
...
@@ -88,7 +88,7 @@ foreach my $email (sort (keys %bugs)) {
...
@@ -88,7 +88,7 @@ foreach my $email (sort (keys %bugs)) {
$vars
->
{
'bugs'
}
=
\
@bugs
;
$vars
->
{
'bugs'
}
=
\
@bugs
;
my
$msg
;
my
$msg
;
my
$template
=
Bugzilla
->
template_inner
(
$user
->
setting
s
->
{
'lang'
}
->
{
'value'
}
);
my
$template
=
Bugzilla
->
template_inner
(
$user
->
setting
(
'lang'
)
);
$template
->
process
(
"email/whine.txt.tmpl"
,
$vars
,
\
$msg
)
$template
->
process
(
"email/whine.txt.tmpl"
,
$vars
,
\
$msg
)
or
die
(
$template
->
error
());
or
die
(
$template
->
error
());
...
...
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