[Bps-public-commit] RT-BugTracker branch, 4.2-4.4-compatibility, updated. 5.2-12-g2136b95
Shawn Moore
shawn at bestpractical.com
Wed Mar 29 17:03:17 EDT 2017
The branch, 4.2-4.4-compatibility has been updated
via 2136b95d57c461a825b30e94db4d91737b574e08 (commit)
via 3eeaef3a50ca914fe6ebe9e38397ce6f1c6a149e (commit)
from 81a04c3d4ec68419d1e5933922e7984545bb33dc (commit)
Summary of changes:
etc/BugTracker_Config.pm | 12 +++++++
.../BugTracker/Ticket/Update.html/AfterWorked | 21 +++++++++---
html/Dist/Elements/ShowBugs | 11 +-----
lib/RT/BugTracker.pm | 39 ++++++++++++++++++----
4 files changed, 61 insertions(+), 22 deletions(-)
- Log -----------------------------------------------------------------
commit 3eeaef3a50ca914fe6ebe9e38397ce6f1c6a149e
Author: Shawn M Moore <shawn at bestpractical.com>
Date: Wed Mar 29 21:02:49 2017 +0000
Make BugTracker_CustomFieldsOnUpdate configurable
diff --git a/etc/BugTracker_Config.pm b/etc/BugTracker_Config.pm
index afe2cfd..23a040d 100644
--- a/etc/BugTracker_Config.pm
+++ b/etc/BugTracker_Config.pm
@@ -22,4 +22,6 @@ Set(%CustomFieldGroupings,
],
);
+Set(@BugTracker_CustomFieldsOnUpdate, 'Fixed in');
+
1;
diff --git a/html/Callbacks/BugTracker/Ticket/Update.html/AfterWorked b/html/Callbacks/BugTracker/Ticket/Update.html/AfterWorked
index 9346914..4dfe9b2 100644
--- a/html/Callbacks/BugTracker/Ticket/Update.html/AfterWorked
+++ b/html/Callbacks/BugTracker/Ticket/Update.html/AfterWorked
@@ -45,13 +45,24 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<%args>
+<%ARGS>
$Ticket
-</%args>
-<& /Ticket/Elements/EditCustomFields,
+</%ARGS>
+<%INIT>
+my @CFs = @{ RT->Config->Get('BugTracker_CustomFieldsOnUpdate') || [] };
+my $CFs = $Ticket->CustomFields;
+$CFs->Limit(
+ FIELD => 'Name',
+ OPERATOR => 'IN',
+ CASESENSITIVE => 0,
+ VALUE => \@CFs,
+) if @CFs;
+
+</%INIT>
+<& /Elements/EditCustomFields,
%ARGS,
- TicketObj => $Ticket,
+ Object => $Ticket,
InTable => 1,
# Handled by our MassageCustomFields callback in the called component
- Named => ["Fixed in"],
+ CustomFields => $CFs,
&>
diff --git a/lib/RT/BugTracker.pm b/lib/RT/BugTracker.pm
index 447694d..30796b5 100644
--- a/lib/RT/BugTracker.pm
+++ b/lib/RT/BugTracker.pm
@@ -275,6 +275,10 @@ May need root permissions
=item C<make initdb>
+RT::BugTracker creates several custom fields for tracking bugs; you may skip
+this step if you intend to use different custom fields. See the section below
+on L<Custom Fields>.
+
Only run this the first time you install this module.
If you run this twice, you may end up with duplicate data
@@ -335,29 +339,44 @@ s/::/-/g
The values above translate Perl module names into their email-friendly
counterpart queue names.
-=head2 Custom Fields: Severity, Broken in, Fixed in
+=head2 BugTracker_CustomFieldsOnUpdate
+
+Use this config variable to specify a list of custom field names to
+display on the ticket reply page for privileged users. By default it
+displays "Fixed in" to help maintainers quickly close out issues as the
+fixes are released.
+
+=head2 Custom Fields
+
+By default, when you run C<make initdb>, RT::BugTracker creates three
+custom fields on queues, globally, with empty values.
-RT::BugTracker creates three custom fields on queues, globally, with
-empty values. The BugTracker administrator must populate the values of
-each of these custom fields.
+=over 4
-=head3 Severity
+=item Severity
Bug severity levels, like 'Low', 'Medium', and 'High'.
-=head3 Broken in
+=item Broken in
The distribution version where the bug in the ticket first
appeared. Since each distribution will have different release
versions, the BugTracker admin will need top populate these values for
each distribution.
-=head3 Fixed in
+=item Fixed in
The distribution version where the bug in the ticket was fixed. Since
each distribution will have different release versions, the BugTracker
admin will need top populate these values for each distribution.
+=back
+
+You may choose to skip creation of these custom fields by skipping the
+C<make initdb> step. If you would like to use your own custom fields,
+you should investigate setting the C<BugTracker_CustomFieldsOnUpdate>
+config option documented above.
+
=head1 SEE ALSO
L<RT::BugTracker::Public>, L<RT::Extension::rt_cpan_org>
commit 2136b95d57c461a825b30e94db4d91737b574e08
Author: Shawn M Moore <shawn at bestpractical.com>
Date: Wed Mar 29 21:03:06 2017 +0000
Make BugTracker_SearchResultFormat configurable
Fixes: T#182766
diff --git a/etc/BugTracker_Config.pm b/etc/BugTracker_Config.pm
index 23a040d..2ceb5b6 100644
--- a/etc/BugTracker_Config.pm
+++ b/etc/BugTracker_Config.pm
@@ -24,4 +24,14 @@ Set(%CustomFieldGroupings,
Set(@BugTracker_CustomFieldsOnUpdate, 'Fixed in');
+Set($BugTracker_SearchResultFormat, <<EOF);
+ '<a href="__WebPath__/Ticket/Display.html?id=__id__">__id__</a>/TITLE:ID',
+ '<b><a href="__WebPath__/Ticket/Display.html?id=__id__">__Subject__</a></b>/TITLE:Subject',
+ '__Status__',
+ '__CustomField.{Severity}__',
+ '<small>__LastUpdatedRelative__</small>',
+ '__CustomField.{Broken in}__',
+ '__CustomField.{Fixed in}__'
+EOF
+
1;
diff --git a/html/Dist/Elements/ShowBugs b/html/Dist/Elements/ShowBugs
index 3bab239..9f06b2a 100644
--- a/html/Dist/Elements/ShowBugs
+++ b/html/Dist/Elements/ShowBugs
@@ -81,15 +81,6 @@ else {
my $RSSFeedURL = $m->comp('SELF:RSS', Query => $Query );
-$Format ||= <<EOF;
-'<a href="$RT::WebPath/Ticket/Display.html?id=__id__">__id__</a>/TITLE:ID',
-'<b><a href="$RT::WebPath/Ticket/Display.html?id=__id__">__Subject__</a></b>/TITLE:Subject',
-'__Status__',
-'__CustomField.{Severity}__',
-'<small>__LastUpdatedRelative__</small>',
-'__CustomField.{Broken in}__',
-'__CustomField.{Fixed in}__'
-EOF
</%INIT>
<%ARGS>
# object
@@ -97,7 +88,7 @@ $Queue
$Status
$ShowRSSLink => 1
-$Format => undef
+$Format => RT->Config->Get('BugTracker_SearchResultFormat')
$OrderBy => 'LastUpdated'
$Order => 'DESC'
$Rows => undef
diff --git a/lib/RT/BugTracker.pm b/lib/RT/BugTracker.pm
index 30796b5..324dc98 100644
--- a/lib/RT/BugTracker.pm
+++ b/lib/RT/BugTracker.pm
@@ -346,6 +346,12 @@ display on the ticket reply page for privileged users. By default it
displays "Fixed in" to help maintainers quickly close out issues as the
fixes are released.
+=head2 BugTracker_SearchResultFormat
+
+Use this config variable to specify the search result format for a
+distribution's list of tickets, much like C<DefaultSearchResultFormat>
+in core RT.
+
=head2 Custom Fields
By default, when you run C<make initdb>, RT::BugTracker creates three
@@ -375,7 +381,7 @@ admin will need top populate these values for each distribution.
You may choose to skip creation of these custom fields by skipping the
C<make initdb> step. If you would like to use your own custom fields,
you should investigate setting the C<BugTracker_CustomFieldsOnUpdate>
-config option documented above.
+and C<BugTracker_SearchResultFormat> config options documented above.
=head1 SEE ALSO
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list