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
bfcc230e
Commit
bfcc230e
authored
Aug 22, 2008
by
mkanat%bugzilla.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 287334: Ability to add custom "Bug ID" fields
Patch By Elliotte Martin <elliotte_martin@yahoo.com> r=mkanat, a=mkanat
parent
fed8e66b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
1 deletion
+39
-1
Bug.pm
Bugzilla/Bug.pm
+9
-0
Constants.pm
Bugzilla/Constants.pm
+2
-0
Field.pm
Bugzilla/Field.pm
+2
-1
field.html.tmpl
template/en/default/bug/field.html.tmpl
+24
-0
field-descs.none.tmpl
template/en/default/global/field-descs.none.tmpl
+2
-0
No files found.
Bugzilla/Bug.pm
View file @
bfcc230e
...
...
@@ -150,6 +150,9 @@ sub VALIDATORS {
elsif
(
$field
->
type
==
FIELD_TYPE_FREETEXT
)
{
$validator
=
\&
_check_freetext_field
;
}
elsif
(
$field
->
type
==
FIELD_TYPE_BUG_ID
)
{
$validator
=
\&
_check_bugid_field
;
}
else
{
$validator
=
\&
_check_default_field
;
}
...
...
@@ -1643,6 +1646,12 @@ sub _check_select_field {
return
$value
;
}
sub
_check_bugid_field
{
my
(
$invocant
,
$value
,
$field
)
=
@_
;
return
undef
if
!
$value
;
return
$invocant
->
check
(
$value
,
$field
)
->
id
;
}
#####################################################################
# Class Accessors
#####################################################################
...
...
Bugzilla/Constants.pm
View file @
bfcc230e
...
...
@@ -121,6 +121,7 @@ use File::Basename;
FIELD_TYPE_MULTI_SELECT
FIELD_TYPE_TEXTAREA
FIELD_TYPE_DATETIME
FIELD_TYPE_BUG_ID
USAGE_MODE_BROWSER
USAGE_MODE_CMDLINE
...
...
@@ -348,6 +349,7 @@ use constant FIELD_TYPE_SINGLE_SELECT => 2;
use
constant
FIELD_TYPE_MULTI_SELECT
=>
3
;
use
constant
FIELD_TYPE_TEXTAREA
=>
4
;
use
constant
FIELD_TYPE_DATETIME
=>
5
;
use
constant
FIELD_TYPE_BUG_ID
=>
6
;
# The maximum number of days a token will remain valid.
use
constant
MAX_TOKEN_AGE
=>
3
;
...
...
Bugzilla/Field.pm
View file @
bfcc230e
...
...
@@ -125,6 +125,7 @@ use constant SQL_DEFINITIONS => {
DEFAULT
=>
"'---'"
},
FIELD_TYPE_TEXTAREA
,
{
TYPE
=>
'MEDIUMTEXT'
},
FIELD_TYPE_DATETIME
,
{
TYPE
=>
'DATETIME'
},
FIELD_TYPE_BUG_ID
,
{
TYPE
=>
'INT3'
},
};
# Field definitions for the fields that ship with Bugzilla.
...
...
@@ -253,7 +254,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_
DATETIME
)
(
detaint_natural
(
$type
)
&&
$type
<=
FIELD_TYPE_
BUG_ID
)
||
ThrowCodeError
(
'invalid_customfield_type'
,
{
type
=>
$saved_type
});
return
$type
;
}
...
...
template/en/default/bug/field.html.tmpl
View file @
bfcc230e
...
...
@@ -17,6 +17,7 @@
#
# Contributor(s): Myk Melez <myk@mozilla.org>
# Max Kanat-Alexander <mkanat@bugzilla.org>
# Elliotte Martin <elliotte_martin@yahoo.com>
#%]
[%# INTERFACE:
...
...
@@ -61,6 +62,25 @@
<script type="text/javascript">
createCalendar('[% field.name FILTER js %]')
</script>
[% CASE constants.FIELD_TYPE_BUG_ID %]
<span id="[% field.name FILTER html %]_input_area">
<input name="[% field.name FILTER html %]" id="[% field.name FILTER html %]"
value="[% value FILTER html %]" size="7">
</span>
[% IF bug.${field.name} %]
[% bug.${field.name} FILTER bug_link(bug.${field.name}) FILTER none %]
[% END %]
<span id="[% field.name FILTER html %]_edit_container" class="edit_me bz_default_hidden">
(<a href="#" id="[% field.name FILTER html %]_edit_action">edit</a>)
</span>
<script type="text/javascript">
hideEditableField('[% field.name FILTER html %]_edit_container',
'[% field.name FILTER html %]_input_area',
'[% field.name FILTER html %]_edit_action',
'[% field.name FILTER html %]',
"[% bug.${field.name} %]");
</script>
[% CASE [ constants.FIELD_TYPE_SINGLE_SELECT
constants.FIELD_TYPE_MULTI_SELECT ] %]
<select id="[% field.name FILTER html %]"
...
...
@@ -103,6 +123,10 @@
[% ELSIF field.type == constants.FIELD_TYPE_TEXTAREA %]
<div class="uneditable_textarea">[% value FILTER wrap_comment(60)
FILTER html %]</div>
[% ELSIF field.type == constants.FIELD_TYPE_BUG_ID %]
[% IF bug.${field.name} %]
[% bug.${field.name} FILTER bug_link(bug.${field.name}) FILTER none %]
[% END %]
[% ELSE %]
[% value.join(', ') FILTER html %]
[% END %]
...
...
template/en/default/global/field-descs.none.tmpl
View file @
bfcc230e
...
...
@@ -16,6 +16,7 @@
# Rights Reserved.
#
# Contributor(s): Gervase Markham <gerv@gerv.net>
# Elliotte Martin <elliotte_martin@yahoo.com>
#%]
[%# Remember to PROCESS rather than INCLUDE this template. %]
...
...
@@ -102,6 +103,7 @@
${constants.FIELD_TYPE_MULTI_SELECT} => "Multiple-Selection Box",
${constants.FIELD_TYPE_TEXTAREA} => "Large Text Box",
${constants.FIELD_TYPE_DATETIME} => "Date/Time",
${constants.FIELD_TYPE_BUG_ID} => "Bug ID",
} %]
[% 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