Remove bug/create/user-message.html.tmpl template, add entryheaderhtml param and product property

hinted-selects
Vitaliy Filippov 2014-08-20 18:13:13 +04:00
parent c005274130
commit 8e99b96c7c
11 changed files with 50 additions and 67 deletions

View File

@ -60,15 +60,19 @@ use constant get_param_list => (
},
{
name => 'shutdownhtml',
name => 'announcehtml',
type => 'l',
default => ''
},
{
name => 'announcehtml',
name => 'entryheaderhtml',
type => 'l',
default => ''
default =>
'<p>Before reporting a bug, please read the <a href="page.cgi?id=bug-writing.html">
bug writing guidelines</a>, please look at the list of
<a href="duplicates.cgi">most frequently reported bugs</a>, and please
<a href="query.cgi">search</a> for the bug.</p><hr />'
},
{
@ -91,6 +95,12 @@ use constant get_param_list => (
type => 't',
default => POSIX::strftime "%Y-%m-%d %H:%M:%S", localtime
},
{
name => 'shutdownhtml',
type => 'l',
default => ''
},
);
1;

View File

@ -1038,6 +1038,7 @@ use constant ABSTRACT_SCHEMA => {
maxvotesperbug => {TYPE => 'INT2', NOTNULL => 1, DEFAULT => '10000'},
votestoconfirm => {TYPE => 'INT2', NOTNULL => 1, DEFAULT => 0},
allows_unconfirmed => {TYPE => 'BOOLEAN', NOTNULL => 1, DEFAULT => 'FALSE'},
entryheaderhtml => {TYPE => 'MEDIUMTEXT', NOTNULL => 1, DEFAULT => "''"},
wiki_url => {TYPE => 'varchar(255)', NOTNULL => 1, DEFAULT => "''"},
# CustIS Bug 59357 - Prefer no time-tracking in some products
notimetracking => {TYPE => 'BOOLEAN', NOTNULL => 1, DEFAULT => 0},

View File

@ -619,6 +619,7 @@ sub update_table_definitions
# New product fields
$dbh->bz_add_column('products', 'wiki_url');
$dbh->bz_add_column('products', 'entryheaderhtml');
$dbh->bz_add_column('products', 'notimetracking');
$dbh->bz_add_column('products', 'extproduct');
$dbh->bz_add_column('products', 'cc_group');

View File

@ -61,6 +61,7 @@ use constant DB_COLUMNS => qw(
votestoconfirm
allows_unconfirmed
cc_group
entryheaderhtml
);
use constant REQUIRED_CREATE_FIELDS => qw(
@ -69,20 +70,8 @@ use constant REQUIRED_CREATE_FIELDS => qw(
version
);
use constant UPDATE_COLUMNS => qw(
name
wiki_url
notimetracking
extproduct
classification_id
description
isactive
votesperuser
maxvotesperbug
votestoconfirm
allows_unconfirmed
cc_group
);
# Allow to update every valid DB column
*UPDATE_COLUMNS = *DB_COLUMNS;
use constant VALIDATORS => {
allows_unconfirmed => \&Bugzilla::Object::check_boolean,
@ -692,6 +681,7 @@ sub set_votes_per_bug { $_[0]->set('maxvotesperbug', $_[1]); }
sub set_votes_to_confirm { $_[0]->set('votestoconfirm', $_[1]); }
sub set_allows_unconfirmed { $_[0]->set('allows_unconfirmed', $_[1]); }
sub set_classification { $_[0]->set('classification_id', $_[1]); }
sub set_entryheaderhtml { $_[0]->set('entryheaderhtml', $_[1]); }
sub set_cc_group
{
@ -1030,6 +1020,7 @@ sub wiki_url { return $_[0]->{wiki_url}; }
sub notimetracking { return $_[0]->{notimetracking}; }
sub extproduct { return $_[0]->{extproduct}; }
sub cc_group { return $_[0]->{cc_group}; }
sub entryheaderhtml { return $_[0]->{entryheaderhtml}; }
###############################
#### Subroutines ######

View File

@ -184,8 +184,8 @@ sub html_light_quote {
my ($text) = @_;
# List of allowed HTML elements having no attributes.
my @allow = qw(
a b big blockquote strong em i u p br abbr acronym ins del cite code var
dfn samp kbd q small span sub sup tt dd dt dl ul li ol fieldset legend
a abbr acronym b big blockquote br cite code dd del dfn dl dt em fieldset hr i ins
kbd legend li ol p q samp small span strong sub sup tt u ul var
);
my $safe = join('|', @allow);
$text =~ s{(<(/?(?:$safe))(\s+(?:[^>"']+|"[^"]*"|'[^']*')*)?>)|(<)|(>)}{($1 ? _skip_attrs($2, $3) : ($4 ? '&lt;' : '&gt;'))}egiso;

View File

@ -175,6 +175,7 @@ if ($action eq 'new')
classification => $classification_name,
name => $product_name,
description => scalar $cgi->param('description'),
entryheaderhtml => scalar $cgi->param('entryheaderhtml'),
version => scalar $cgi->param('version'),
isactive => scalar $cgi->param('is_active'),
create_series => scalar $cgi->param('createseries'),
@ -310,6 +311,7 @@ if ($action eq 'update')
$product->set_extproduct(scalar $cgi->param('extproduct'));
$product->set_cc_group(scalar $cgi->param('cc_group') || '');
$product->set_description(scalar $cgi->param('description'));
$product->set_entryheaderhtml(scalar $cgi->param('entryheaderhtml'));
$product->set_is_active(scalar $cgi->param('is_active'));
if (Bugzilla->get_field('votes')->enabled)
{

View File

@ -19,17 +19,17 @@
# Frédéric Buclin <LpSolit@gmail.com>
#%]
[%
[%
title = "General"
desc = "Miscellaneous general settings that are not required."
desc = "Miscellaneous general settings that are not required."
%]
[% param_descs = {
maintainer =>
maintainer =>
"The email address of the person who maintains this installation "
_ " of ${terms.Bugzilla}.",
docs_urlbase =>
docs_urlbase =>
"The URL that is the common initial leading part of all"
_ " $terms.Bugzilla documentation URLs. It may be an absolute URL,"
_ " or a URL relative to the <tt>urlbase</tt> parameter. Leave this"
@ -37,7 +37,7 @@
_ "'%lang%' will be replaced by user's preferred language (if"
_ " documentation is available in that language).",
utf8 =>
utf8 =>
"Use UTF-8 (Unicode) encoding for all text in ${terms.Bugzilla}. New"
_ " installations should set this to true to avoid character encoding"
_ " problems. <strong>Existing databases should set this to true"
@ -48,12 +48,12 @@
_ " &quot;on&quot;, you must re-run checksetup.pl immediately"
_ " afterward.</p>",
shutdownhtml =>
shutdownhtml =>
"If this field is non-empty, then $terms.Bugzilla will be completely"
_ " disabled and this text will be displayed instead of all the"
_ " $terms.Bugzilla pages.",
announcehtml =>
announcehtml =>
"If this field is non-empty, then $terms.Bugzilla will"
_ " display whatever is in this field at the top of every"
_ " HTML page. The HTML you put in this field is not wrapped or"
@ -65,7 +65,11 @@
_ " will work. To get centered text, use <em>style=\"text-align: "
_ " center;\"</em>.",
upgrade_notification =>
entryheaderhtml =>
"This parameter specifies HTML code to be displayed above the bug entry form"
_ " in the case when it is not overridden by product settings.",
upgrade_notification =>
"$terms.Bugzilla can inform you when a new release is available."
_ " The notification will appear on the $terms.Bugzilla homepage,"
_ " for administrators only."

View File

@ -42,6 +42,11 @@
<td><textarea rows="4" cols="64" wrap="virtual" name="description" id="description">[% product.description | html %]</textarea></td>
</tr>
<tr>
<th align="left"><label for="entryheaderhtml">HTML code to display<br /> above the bug form:</label></th>
<td><textarea rows="4" cols="64" wrap="virtual" name="entryheaderhtml" id="entryheaderhtml">[% product.entryheaderhtml | html %]</textarea></td>
</tr>
<tr>
<th align="left"><label for="is_active">Open for [% terms.bug %] entry:</label></th>
<td><input type="checkbox" name="is_active" id="is_active" value="1" [% ' checked="checked"' IF product.is_active %] /></td>

View File

@ -60,6 +60,13 @@
<p style="margin: 1em 3em 1em 3em">[% product.description FILTER html_light %]</p>
[% END %]
[% IF changes.entryheaderhtml.defined %]
<p>
Updated bug entry header HTML to:
</p>
<p style="margin: 1em 3em 1em 3em">[% product.entryheaderhtml FILTER html_light %]</p>
[% END %]
[% IF changes.isactive.defined %]
<p>
Product is now [% product.is_active ? 'open' : 'closed' %] for new [% terms.bugs %].

View File

@ -74,12 +74,8 @@ var close_status_array = [
<input type="hidden" name="cloned_bug_id" value="[% cloned_bug_id | html %]" />
<input type="hidden" name="cloned_comment" value="[% cloned_comment | html %]" />
<p>
[%# Migration note: The following file corresponds to the old Param
# 'entryheaderhtml'
#%]
[% INCLUDE 'bug/create/user-message.html.tmpl' %]
</p>
[%# Note: in original Bugzilla, this was customised by editing 'bug/create/user-message.html.tmpl' template %]
[% product.entryheaderhtml || Param('entryheaderhtml') | html_light %]
<table width="100%"><tr><td width="100%">

View File

@ -1,34 +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): Matthew Tuck <matty@chariot.net.au>
#%]
[%# Migration note: this file corresponds to the old Param
# 'entryheaderhtml'
#%]
[%# You can make the output of this template product-specific by using
# Template Toolkit IF statements. The current product name is stored in
# the 'product' variable.
#%]
Before reporting [% terms.abug %], please read the
<a href="page.cgi?id=bug-writing.html">
[% terms.bug %] writing guidelines</a>, please look at the list of
<a href="duplicates.cgi">most frequently reported [% terms.bugs %]</a>, and please
<a href="query.cgi">search</a> for the [% terms.bug %].