Bug 40933 - Remove duplicate *-error-page.html.tmpl, debug BugMail, debug hooks

git-svn-id: svn://svn.office.custis.ru/3rdparty/bugzilla.org/trunk@741 6955db30-a419-402b-8a0d-67ecbb4d7f56
master
vfilippov 2010-05-17 12:11:17 +00:00
parent 02a88828f5
commit 71a0f68a69
10 changed files with 16 additions and 178 deletions

View File

@ -526,7 +526,7 @@ sub _check_bug {
sub _legal_content_type {
my ($content_type) = @_;
my $legal_types = join('|', LEGAL_CONTENT_TYPES);
return $content_type !~ /^($legal_types)\/.+$/;
return $content_type =~ /^($legal_types)\/.+$/;
}
sub _check_content_type {
@ -991,7 +991,7 @@ sub get_content_type {
# specified in the HTTP request headers.
$content_type =
$cgi->uploadInfo($cgi->param('data'))->{'Content-Type'};
if (!_valid_content_type($content_type) && Bugzilla->params->{mime_types_file})
if (!_legal_content_type($content_type) && Bugzilla->params->{mime_types_file})
{
if (!$lwp_read_mime_types)
{
@ -1001,7 +1001,7 @@ sub get_content_type {
my $file = $cgi->param('data');
$content_type = LWP::MediaTypes::guess_media_type("$file");
}
if (!_valid_content_type($content_type))
if (!_legal_content_type($content_type))
{
$content_type = 'application/octet-stream';
}
@ -1030,5 +1030,5 @@ sub get_content_type {
return $content_type;
}
1;
__END__

View File

@ -469,6 +469,7 @@ sub Send {
if ($user->email_enabled && $dep_ok) {
# OK, OK, if we must. Email the user.
$sent_mail = sendMail(
bug => $bug,
user => $user,
headers => \@headerlist,
rels => \%rels_which_want,
@ -503,11 +504,11 @@ sub sendMail
my %arguments = @_;
my ($user, $hlRef, $relRef, $valueRef, $dmhRef, $fdRef,
$diffs, $comments_in, $isnew,
$id, $watchingRef
$id, $watchingRef, $bug
) = @arguments{qw(
user headers rels values defhead fields
diffs newcomm isnew
id watch
id watch bug
)};
my @send_comments = @$comments_in;
@ -575,6 +576,7 @@ sub sendMail
showfieldvalues => \@showfieldvalues,
to => $user->email,
to_user => $user,
bug => $bug,
bugid => $id,
alias => Bugzilla->params->{'usebugaliases'} ? $values{'alias'} : "",
classification => $values{'classification'},

View File

@ -23,7 +23,7 @@
package Bugzilla::Hook;
use strict;
no strict 'subs';
no strict 'refs';
use Bugzilla::Util;
use base 'Exporter';
our @EXPORT = qw(set_hook run_hooks);
@ -73,13 +73,14 @@ sub process
}
elsif (!ref $f && $f =~ /^(.*)::[^:]*$/)
{
my $pk = $1;
my $pk = $1 . '.pm';
if ($pk)
{
eval { require $pk };
if ($@)
{
warn "Error autoloading hook package $pk: $@";
next;
}
}
}

View File

@ -81,7 +81,6 @@ sub _get_hooks {
foreach my $template_dir (@$dir_set) {
my $file = "$template_dir/hook/$extension_template";
if (-e $file) {
warn "-e $file !";
my $template = $self->_context->template($file);
push(@hooks, $template);
# Don't run the hook for more than one language.

View File

@ -131,4 +131,4 @@ table#flags {
white-space: nowrap;
}
#commentt { width: 50em; font-size: medium; font-family: monospace; }
#comment_textarea { width: 50em; font-size: medium; font-family: monospace; }

View File

@ -33,7 +33,7 @@
admindocslinks = admindocslinks
%]
<div style="margin: 20px; padding: 10px; font-size: 130%; float: left; font-family: sans-serif; border: 10px solid red">
<div style="margin: 20px; padding: 10px; font-size: 130%; float: left; font-family: sans-serif; border: 10px solid red; background: white">
<div style="font-size: 150%; background-color: #ffd0d0; padding: 10px">
<p style="margin-top: 0; margin-bottom: 0">[% error_message.replace("\n\n", "</p><p style='margin-bottom: 0'>") FILTER none %]</p>

View File

@ -293,12 +293,12 @@ document.changeform = document.[% cfname %];
show_attachment_flags = bug.show_attachment_flags
%]
[% PROCESS comment_box %]
</td>
<td>
[% PROCESS section_restrict_visibility %]
</td>
</tr></table>
[% PROCESS comment_box %]
[%# *** Additional Comments *** %]
<div id="comments">
@ -1117,8 +1117,7 @@ document.changeform = document.[% cfname %];
id="newcommentprivacy"
onClick="updateCommentTagControl(this, form)">
<label for="newcommentprivacy">
Make comment private (visible only to members of the
<strong>[% Param('insidergroup') FILTER html %]</strong> group)
Make comment private
</label>
<input type="checkbox" name="commentsilent" value="1"
id="commentsilent">

View File

@ -167,13 +167,8 @@ pre { font-family: Consolas, monospace; font-size: 100%; }
[% (comment.author.name || comment.author.login) FILTER html %]</a>
</span>
[% comment.time %]</p>
[% IF comment.already_wrapped %]
[% wrapped_comment = comment.body %]
[% ELSE %]
[% wrapped_comment = comment.body FILTER wrap_comment %]
[% END %]
<pre style="white-space: pre-wrap; word-wrap: break-word; _white-space: pre;">
[%- wrapped_comment FILTER quoteUrls(bugid) FILTER absolute_uris -%]
[%- comment.body_full({ wrap => 1 }) FILTER quoteUrls(bug, comment) FILTER absolute_uris -%]
</pre>
<hr color="#A0A0A0" size="1" />
[% END %]

View File

@ -1,83 +0,0 @@
[%# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is the Bugzilla Bug Tracking System.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s): Gervase Markham <gerv@gerv.net>
# Vitaliy Filippov <vitalif@mail.ru>
#%]
[%# We only want HTML error messages for ERROR_MODE_WEBPAGE %]
[% USE Bugzilla %]
[% IF Bugzilla.error_mode != constants.ERROR_MODE_WEBPAGE %]
[% IF Bugzilla.usage_mode == constants.USAGE_MODE_BROWSER %]
[% error_message FILTER none %]
[% ELSE %]
[% error_message FILTER txt %]
[% END %]
[% RETURN %]
[% END %]
[%# Template errors are special in the sense of possibility to
# raise a second error when trying to process other templates.
# So don't try to do it. %]
[% IF error != "template_error" %]
[% UNLESS header_done %]
[% PROCESS global/header.html.tmpl %]
[% END %]
[% PROCESS global/docslinks.html.tmpl
docslinks = docslinks
admindocslinks = admindocslinks
%]
[% END %]
<div style="padding: 20px; background-color: #ff8080; font-size: 130%">
<p style="margin: 0">
Sorry! [% terms.Bugzilla %] has suffered an internal error.<br>
[% IF Param('report_code_errors_to_maintainer') %]
Error was reported automatically to instance maintainer <tt><a href="mailto:[% Param('maintainer') %]">[% Param('maintainer') %]</a></tt>.
So he probably knows about it and is already on charge.
[% ELSE %]
Please save this page and send it to <tt><a href="mailto:[% Param('maintainer') %]">[% Param('maintainer') %]</a></tt> with details
of what you were doing at the time this message appeared.
[% END %]
</p>
<p style="font-size: 150%; margin: 0.5em 0 0 0">[% error_message.replace("\n\n", "</p><p>") FILTER none %]</p>
<p style="margin-bottom: 0px">We apologize for your inconvenience.</p>
</div>
<tt>
<script type="text/javascript"> <!--
document.write("<p>URL: " +
document.location.href.replace(/&/g,"&amp;")
.replace(/</g,"&lt;")
.replace(/>/g,"&gt;") + "</p>");
// -->
</script>
</tt>
[% IF variables %]
<pre>
Variables:
[% FOREACH key = variables.keys %]
[%+ key FILTER html %]: [%+ variables.$key FILTER html %]
[% END %]
</pre>
[% END %]
[% IF error != "template_error" %]
[% PROCESS global/footer.html.tmpl %]
[% END %]

View File

@ -1,75 +0,0 @@
[%# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is the Bugzilla Bug Tracking System.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s): Gervase Markham <gerv@gerv.net>
# Frédéric Buclin <LpSolit@gmail.com>
# Vitaliy Filippov <vitalif@mail.ru>
#%]
[%# We only want HTML error messages for ERROR_MODE_WEBPAGE %]
[% USE Bugzilla %]
[% IF Bugzilla.error_mode != constants.ERROR_MODE_WEBPAGE %]
[% IF Bugzilla.usage_mode == constants.USAGE_MODE_BROWSER %]
[% error_message FILTER none %]
[% ELSE %]
[% error_message FILTER txt %]
[% END %]
[% RETURN %]
[% END %]
[% UNLESS header_done %]
[% PROCESS global/header.html.tmpl %]
[% END %]
[% PROCESS global/docslinks.html.tmpl
docslinks = docslinks
admindocslinks = admindocslinks
%]
<div style="padding: 20px; background-color: #ff8080; font-size: 130%">
<p style="margin-top: 0; margin-bottom: 0">[% error_message.replace("\n\n", "</p><p style='margin-bottom: 0'>") FILTER none %]</p>
</div>
<p>
Please press <b><a href="javascript:history.back()">Back</a></b> and try again.
</p>
[%# If a saved search fails, people want the ability to edit or delete it.
# This is the best way of getting information about that possible saved
# search from any error call location. %]
[% namedcmd = Bugzilla.cgi.param("namedcmd") %]
[% sharer_id = Bugzilla.cgi.param("sharer_id") %]
[% IF namedcmd AND error != "missing_query"
AND error != "saved_search_used_by_whines"
AND !sharer_id %]
<p>
Alternatively, you can
<a href="buglist.cgi?cmdtype=dorem&amp;remaction=forget&amp;namedcmd=
[% namedcmd FILTER url_quote %]">forget</a>
[% FOREACH q = Bugzilla.user.queries %]
[% IF q.name == namedcmd %]
or <a href="query.cgi?[% q.url FILTER html %]">edit</a>
[% END %]
[% END %]
the saved search '[% namedcmd FILTER html %]'.
</p>
[% END %]
[% PROCESS global/footer.html.tmpl %]