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
61ac61f0
Commit
61ac61f0
authored
Sep 17, 2007
by
mkanat%bugzilla.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 357315: Add the ability to create <textarea> fields
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit
parent
e2ced369
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
26 additions
and
4 deletions
+26
-4
Constants.pm
Bugzilla/Constants.pm
+2
-0
Field.pm
Bugzilla/Field.pm
+2
-1
Template.pm
Bugzilla/Template.pm
+5
-1
Util.pm
Bugzilla/Util.pm
+3
-2
global.css
skins/standard/global.css
+6
-0
field.html.tmpl
template/en/default/bug/field.html.tmpl
+7
-0
field-descs.none.tmpl
template/en/default/global/field-descs.none.tmpl
+1
-0
No files found.
Bugzilla/Constants.pm
View file @
61ac61f0
...
...
@@ -120,6 +120,7 @@ use File::Basename;
FIELD_TYPE_FREETEXT
FIELD_TYPE_SINGLE_SELECT
FIELD_TYPE_MULTI_SELECT
FIELD_TYPE_TEXTAREA
USAGE_MODE_BROWSER
USAGE_MODE_CMDLINE
...
...
@@ -342,6 +343,7 @@ use constant FIELD_TYPE_UNKNOWN => 0;
use
constant
FIELD_TYPE_FREETEXT
=>
1
;
use
constant
FIELD_TYPE_SINGLE_SELECT
=>
2
;
use
constant
FIELD_TYPE_MULTI_SELECT
=>
3
;
use
constant
FIELD_TYPE_TEXTAREA
=>
4
;
# The maximum number of days a token will remain valid.
use
constant
MAX_TOKEN_AGE
=>
3
;
...
...
Bugzilla/Field.pm
View file @
61ac61f0
...
...
@@ -126,6 +126,7 @@ use constant SQL_DEFINITIONS => {
FIELD_TYPE_FREETEXT
,
{
TYPE
=>
'varchar(255)'
},
FIELD_TYPE_SINGLE_SELECT
,
{
TYPE
=>
'varchar(64)'
,
NOTNULL
=>
1
,
DEFAULT
=>
"'---'"
},
FIELD_TYPE_TEXTAREA
,
{
TYPE
=>
'MEDIUMTEXT'
},
};
# Field definitions for the fields that ship with Bugzilla.
...
...
@@ -254,7 +255,7 @@ sub _check_type {
my
$saved_type
=
$type
;
# The constant here should be updated every time a new,
# higher field type is added.
(
detaint_natural
(
$type
)
&&
$type
<=
FIELD_TYPE_
MULTI_SELECT
)
(
detaint_natural
(
$type
)
&&
$type
<=
FIELD_TYPE_
TEXTAREA
)
||
ThrowCodeError
(
'invalid_customfield_type'
,
{
type
=>
$saved_type
});
return
$type
;
}
...
...
Bugzilla/Template.pm
View file @
61ac61f0
...
...
@@ -665,7 +665,11 @@ sub create {
},
# Wrap a displayed comment to the appropriate length
wrap_comment
=>
\&
Bugzilla::Util::
wrap_comment
,
wrap_comment
=>
[
sub
{
my
(
$context
,
$cols
)
=
@_
;
return
sub
{
wrap_comment
(
$_
[
0
],
$cols
)
}
},
1
],
# We force filtering of every variable in key security-critical
# places; we have a none filter for people to use when they
...
...
Bugzilla/Util.pm
View file @
61ac61f0
...
...
@@ -312,11 +312,11 @@ sub diff_strings {
}
sub
wrap_comment
{
my
(
$comment
)
=
@_
;
my
(
$comment
,
$cols
)
=
@_
;
my
$wrappedcomment
=
""
;
# Use 'local', as recommended by Text::Wrap's perldoc.
local
$
Text::Wrap::
columns
=
COMMENT_COLS
;
local
$
Text::Wrap::
columns
=
$cols
||
COMMENT_COLS
;
# Make words that are longer than COMMENT_COLS not wrap.
local
$
Text::Wrap::
huge
=
'overflow'
;
# Don't mess with tabs.
...
...
@@ -332,6 +332,7 @@ sub wrap_comment {
}
}
chomp
(
$wrappedcomment
);
# Text::Wrap adds an extra newline at the end.
return
$wrappedcomment
;
}
...
...
skins/standard/global.css
View file @
61ac61f0
...
...
@@ -317,6 +317,12 @@ dl dl > dt {
padding-left
:
1em
;
}
/* For bug fields */
.uneditable_textarea
{
white-space
:
pre
;
font-family
:
monospace
;
}
div
.user_match
{
margin-bottom
:
1em
;
}
...
...
template/en/default/bug/field.html.tmpl
View file @
61ac61f0
...
...
@@ -76,7 +76,14 @@
[% IF field.type == constants.FIELD_TYPE_MULTI_SELECT %]
<input type="hidden" name="defined_[% field.name FILTER html %]">
[% END %]
[% CASE constants.FIELD_TYPE_TEXTAREA %]
[% INCLUDE global/textarea.html.tmpl
id = field.name name = field.name minrows = 4 maxrows = 8
cols = 60 defaultcontent = value %]
[% END %]
[% ELSIF field.type == constants.FIELD_TYPE_TEXTAREA %]
<div class="uneditable_textarea">[% value FILTER wrap_comment(60)
FILTER html %]</div>
[% ELSE %]
[% value.join(', ') FILTER html %]
[% END %]
...
...
template/en/default/global/field-descs.none.tmpl
View file @
61ac61f0
...
...
@@ -82,6 +82,7 @@
${constants.FIELD_TYPE_FREETEXT} => "Free Text",
${constants.FIELD_TYPE_SINGLE_SELECT} => "Drop Down",
${constants.FIELD_TYPE_MULTI_SELECT} => "Multiple-Selection Box",
${constants.FIELD_TYPE_TEXTAREA} => "Large Text Box",
} %]
[% status_descs = { "UNCONFIRMED" => "UNCONFIRMED",
...
...
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