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
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
42 additions
and
21 deletions
+42
-21
Bug.pm
Bugzilla/Bug.pm
+1
-1
BugMail.pm
Bugzilla/BugMail.pm
+13
-7
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 {
my
@comments
=
@
{
$self
->
{
'comments'
}
};
my
$order
=
$params
->
{
order
}
||
Bugzilla
->
user
->
setting
s
->
{
'comment_sort_order'
}
->
{
'value'
}
;
||
Bugzilla
->
user
->
setting
(
'comment_sort_order'
)
;
if
(
$order
ne
'oldest_to_newest'
)
{
@comments
=
reverse
@comments
;
if
(
$order
eq
'newest_to_oldest_desc_first'
)
{
...
...
Bugzilla/BugMail.pm
View file @
037942d0
...
...
@@ -374,15 +374,13 @@ sub sendMail {
sub
_generate_bugmail
{
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
);
$template
->
process
(
"email/bugmail-header.txt.tmpl"
,
$vars
,
\
$msg_header
)
||
ThrowTemplateError
(
$template
->
error
());
$template
->
process
(
"email/bugmail.txt.tmpl"
,
$vars
,
\
$msg_text
)
||
ThrowTemplateError
(
$template
->
error
());
$template
->
process
(
"email/bugmail.html.tmpl"
,
$vars
,
\
$msg_html
)
||
ThrowTemplateError
(
$template
->
error
());
my
@parts
=
(
Email::
MIME
->
create
(
...
...
@@ -390,19 +388,27 @@ sub _generate_bugmail {
content_type
=>
"text/plain"
,
},
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
=>
{
content_type
=>
"text/html"
,
},
body
=>
$msg_html
,
),
);
}
# TT trims the trailing newline, and threadingmarker may be ignored.
my
$email
=
new
Email::
MIME
(
"$msg_header\n"
);
$email
->
parts_set
(
\
@parts
);
if
(
scalar
(
@parts
)
==
1
)
{
$email
->
content_type_set
(
$parts
[
0
]
->
content_type
);
}
else
{
$email
->
content_type_set
(
'multipart/alternative'
);
}
$email
->
parts_set
(
\
@parts
);
return
$email
;
}
...
...
Bugzilla/Flag.pm
View file @
037942d0
...
...
@@ -970,7 +970,7 @@ sub notify {
# use the default language for email notifications.
my
$default_lang
;
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
)
{
...
...
@@ -987,7 +987,7 @@ sub notify {
'threadingmarker'
=>
build_thread_marker
(
$bug
->
id
,
$thread_user_id
)
};
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
$message
;
...
...
Bugzilla/Install.pm
View file @
037942d0
...
...
@@ -90,6 +90,9 @@ sub SETTINGS {
timezone
=>
{
subclass
=>
'Timezone'
,
default
=>
'local'
},
# 2011-02-07 dkl@mozilla.com -- Bug 580490
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 {
$searchstring
=~
s/(^[\s,]+|[\s,]+$)//g
;
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]*$/
)
{
_bug_numbers_only
(
$searchstring
);
...
...
Bugzilla/Token.pm
View file @
037942d0
...
...
@@ -101,7 +101,7 @@ sub IssueEmailChangeToken {
# 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
=
{};
$vars
->
{
'oldemailaddress'
}
=
$old_email
.
$email_suffix
;
...
...
@@ -144,7 +144,7 @@ sub IssuePasswordToken {
my
(
$token
,
$token_ts
)
=
_create_token
(
$user
->
id
,
'password'
,
remote_ip
());
# 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
=
{};
$vars
->
{
'token'
}
=
$token
;
...
...
@@ -292,7 +292,7 @@ sub Cancel {
$vars
->
{
'cancelaction'
}
=
$cancelaction
;
# 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
;
$template
->
process
(
"account/cancel-token.txt.tmpl"
,
$vars
,
\
$message
)
...
...
Bugzilla/User.pm
View file @
037942d0
...
...
@@ -593,11 +593,16 @@ sub settings {
return
$self
->
{
'settings'
};
}
sub
setting
{
my
(
$self
,
$name
)
=
@_
;
return
$self
->
settings
->
{
$name
}
->
{
'value'
};
}
sub
timezone
{
my
$self
=
shift
;
if
(
!
defined
$self
->
{
timezone
})
{
my
$tz
=
$self
->
setting
s
->
{
timezone
}
->
{
value
}
;
my
$tz
=
$self
->
setting
(
'timezone'
)
;
if
(
$tz
eq
'local'
)
{
# The user wants the local timezone of the server.
$self
->
{
timezone
}
=
Bugzilla
->
local_timezone
;
...
...
@@ -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
a preference for themself or use the site default.
=item C<setting(name)>
Returns the value for the specified setting.
=item C<timezone>
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 {
};
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
;
$template
->
process
(
"voting/votes-removed.txt.tmpl"
,
$vars
,
\
$msg
);
...
...
process_bug.cgi
View file @
037942d0
...
...
@@ -189,7 +189,7 @@ $vars->{'title_tag'} = "bug_processed";
my
$action
;
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'
)
{
my
$bug_list_obj
=
$user
->
recent_search_for
(
$first_bug
);
...
...
relogin.cgi
View file @
037942d0
...
...
@@ -164,7 +164,7 @@ elsif ($action eq 'begin-sudo') {
# Go ahead and send out the message now
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
);
MessageToMTA
(
$message
);
...
...
sanitycheck.cgi
View file @
037942d0
...
...
@@ -76,7 +76,7 @@ my $dbh = Bugzilla->dbh;
# take the user prefs into account rather than querying the web browser.
my
$template
;
if
(
Bugzilla
->
usage_mode
==
USAGE_MODE_CMDLINE
)
{
$template
=
Bugzilla
->
template_inner
(
$user
->
setting
s
->
{
'lang'
}
->
{
'value'
}
);
$template
=
Bugzilla
->
template_inner
(
$user
->
setting
(
'lang'
)
);
}
else
{
$template
=
Bugzilla
->
template
;
...
...
template/en/default/global/setting-descs.none.tmpl
View file @
037942d0
...
...
@@ -49,6 +49,9 @@
"timezone" => "Timezone used to display dates and times",
"local" => "Same as the server",
"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 {
# Don't send mail to someone whose bugmail notification is 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
$args
->
{
'alternatives'
}
||=
[]
;
...
...
whineatnews.pl
View file @
037942d0
...
...
@@ -88,7 +88,7 @@ foreach my $email (sort (keys %bugs)) {
$vars
->
{
'bugs'
}
=
\
@bugs
;
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
)
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