Skip to content

Commit 2b8ed3f

Browse files
Merge branch '6.0/rt-page-layout'
2 parents 7f32d7d + ef747fc commit 2b8ed3f

61 files changed

Lines changed: 1874 additions & 3804 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/UPGRADING-6.0

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ features.
4040

4141
=item *
4242

43+
As RTIR has switched to RT 6's flexible page layout, a few RTIR-specific
44+
configurations are updated:
45+
46+
In C<%CustomFieldGroupings> and C<%InlineEditPanelBehavior>, RTIR uses key
47+
"RT::Ticket" just like RT, instead of previous "RTIR::Ticket".
48+
49+
=item *
50+
4351
The Iframe option for adding research tools to the lookup pages in RTIR
4452
previously configured with C<$RTIRIframeResearchToolConfig> has been removed.
4553
Browsers are becoming much more restrictive when loading content in Iframes

etc/RTIR_Config.pm

Lines changed: 195 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,164 @@ Set(%ProcessArticleMapping, (
665665
},
666666
));
667667

668+
=item C<%PageLayouts>
669+
670+
RTIR specific page layouts.
671+
672+
=cut
673+
674+
Set(%PageLayouts,
675+
'RT::Ticket' => {
676+
'Display' => {
677+
Incidents => [
678+
{ Layout => 'col-md-6',
679+
Title => 'Ticket metadata',
680+
Elements => [
681+
[ 'Basics', 'Times', 'CustomFieldCustomGroupings', 'Dates', 'Attachments', 'Requestors' ],
682+
[ 'Articles', 'LinkedQueues', 'Assets', 'LinkedArticles', 'CVEDetails' ],
683+
],
684+
},
685+
{ Layout => 'col-12',
686+
Elements => ['History'],
687+
}
688+
],
689+
'Incident Reports' => [
690+
{ Layout => 'col-md-6',
691+
Title => 'Ticket metadata',
692+
Elements => [
693+
[ 'Basics', 'Times', 'CustomFieldCustomGroupings', 'LinkedArticles', 'CVEDetails', 'Attachments' ],
694+
[ 'People', 'Articles', 'Dates', 'Assets', 'Requestors' ],
695+
],
696+
},
697+
{ Layout => 'col-12',
698+
Elements => ['History'],
699+
}
700+
],
701+
Investigations => [
702+
{ Layout => 'col-md-6',
703+
Title => 'Ticket metadata',
704+
Elements => [
705+
[ 'Basics', 'Times', 'CustomFieldCustomGroupings', 'LinkedArticles', 'CVEDetails', 'Attachments' ],
706+
[ 'People', 'Articles', 'Dates', 'Assets', 'Requestors' ],
707+
],
708+
},
709+
{ Layout => 'col-12',
710+
Elements => ['History'],
711+
}
712+
],
713+
Countermeasures => [
714+
{ Layout => 'col-md-6',
715+
Title => 'Ticket metadata',
716+
Elements => [
717+
[ 'Basics', 'Times', 'CustomFieldCustomGroupings', 'LinkedArticles', 'CVEDetails', 'Attachments' ],
718+
[ 'People', 'Articles', 'Dates', 'Assets', 'Requestors' ],
719+
],
720+
},
721+
{ Layout => 'col-12',
722+
Elements => ['History'],
723+
}
724+
],
725+
},
726+
Create => {
727+
Incidents => [
728+
{ Layout => 'col-md-7,col-md-5',
729+
Elements => [
730+
[ 'Message', 'Submit' ],
731+
[ 'Basics', 'Assets', 'CustomFieldCustomGroupings', 'Dates', 'Times' ],
732+
],
733+
},
734+
],
735+
'Incident Reports' => [
736+
{ Layout => 'col-md-7,col-md-5',
737+
Elements => [
738+
[ 'Message', 'Submit' ],
739+
[ 'Basics', 'Assets', 'CustomFieldCustomGroupings', 'Dates', 'Times' ],
740+
],
741+
},
742+
],
743+
Investigations => [
744+
{ Layout => 'col-md-7,col-md-5',
745+
Elements => [
746+
[ 'Message', 'Submit' ],
747+
[ 'Basics', 'Assets', 'CustomFieldCustomGroupings', 'Dates', 'Times', 'AttachReports' ],
748+
],
749+
},
750+
],
751+
Countermeasures => [
752+
{ Layout => 'col-md-7,col-md-5',
753+
Elements => [
754+
[ 'Message', 'Submit' ],
755+
[ 'Basics', 'Assets', 'CustomFieldCustomGroupings', 'Dates', 'Times' ],
756+
],
757+
},
758+
],
759+
},
760+
Update => {
761+
Incidents => [
762+
{ Layout => 'col-md-7,col-md-5',
763+
Elements => [ [ 'Recipients', 'Message', 'Submit', 'PreviewScrips' ], [ 'Basics', 'Times' ] ],
764+
},
765+
],
766+
'Incident Reports' => [
767+
{ Layout => 'col-md-7,col-md-5',
768+
Elements => [ [ 'Recipients', 'Message', 'Submit', 'PreviewScrips' ], [ 'Basics', 'Times' ] ],
769+
},
770+
],
771+
Investigations => [
772+
{ Layout => 'col-md-7,col-md-5',
773+
Elements => [ [ 'Recipients', 'Message', 'Submit', 'PreviewScrips' ], [ 'Basics', 'Times' ] ],
774+
},
775+
],
776+
Countermeasures => [
777+
{ Layout => 'col-md-7,col-md-5',
778+
Elements => [ [ 'Recipients', 'Message', 'Submit', 'PreviewScrips' ], [ 'Basics', 'Times' ] ],
779+
},
780+
],
781+
},
782+
}
783+
);
784+
785+
=item C<%PageLayoutMapping>
786+
787+
RTIR specific page layout mapping.
788+
789+
=cut
790+
791+
Set(%PageLayoutMapping,
792+
'RT::Ticket' => {
793+
Display => [
794+
{ Type => 'Queue',
795+
Layout => {
796+
'Incidents' => 'Incidents',
797+
'Incident Reports' => 'Incident Reports',
798+
'Investigations' => 'Investigations',
799+
'Countermeasures' => 'Countermeasures',
800+
},
801+
},
802+
],
803+
Create => [
804+
{ Type => 'Queue',
805+
Layout => {
806+
'Incidents' => 'Incidents',
807+
'Incident Reports' => 'Incident Reports',
808+
'Investigations' => 'Investigations',
809+
'Countermeasures' => 'Countermeasures',
810+
},
811+
},
812+
],
813+
Update => [
814+
{ Type => 'Queue',
815+
Layout => {
816+
'Incidents' => 'Incidents',
817+
'Incident Reports' => 'Incident Reports',
818+
'Investigations' => 'Investigations',
819+
'Countermeasures' => 'Countermeasures',
820+
},
821+
},
822+
],
823+
}
824+
);
825+
668826
=back
669827
670828
=head1 Custom Fields
@@ -691,51 +849,49 @@ Set(
691849
All of the configuration rules for RT CustomFieldGroupings apply and you
692850
should review the documentation in F<etc/RT_Config.pm>
693851
694-
RTIR provides a separate 'object' that groupings are applied to,
695-
RTIR::Ticket. Groupings for this object type will only be applied to
696-
Custom Fields on Tickets in RTIR Queues. This allows you to
697-
logically separate your Custom Field configuration between RTIR Queues
698-
and standalone Queues in your RT instance.
699-
700-
We do not provide the Links core grouping because no RTIR tickets display
701-
the Links box. Basics, People and Dates will work as they do in core, but
702-
keep in mind that Incidents do not display a People box, so CFs in the People
703-
group will not render on Incidents. Additionally, People and Dates are not always
704-
available in all screens in RTIR so may not be the best place for Custom Fields.
852+
By default Links widget is not rendered in all RTIR queues, additionally
853+
Incidents do not have a People widget, so if you add a custom field to Links
854+
or People, you also need to update the page layouts.
705855
706856
=cut
707857

708858
Set(%CustomFieldGroupings,
709-
'RTIR::Ticket' => [
710-
'Networking' => ['IP', 'Domain'],
711-
'Details' => ['How Reported','Reporter Type','Customer',
712-
'Description', 'Resolution', 'Function', 'Classification', 'CVE ID',
713-
'Customer',
714-
'Netmask','Port','Where Blocked'],
715-
],
859+
'RT::Ticket' => {
860+
'Incidents' => [
861+
'Networking' => [ 'IP', 'Domain' ],
862+
'Details' => [
863+
'How Reported', 'Reporter Type', 'Customer', 'Description',
864+
'Resolution', 'Function', 'Classification', 'CVE ID',
865+
'Customer', 'Netmask', 'Port', 'Where Blocked'
866+
],
867+
],
868+
'Incident Reports' => [
869+
'Networking' => [ 'IP', 'Domain' ],
870+
'Details' => [
871+
'How Reported', 'Reporter Type', 'Customer', 'Description',
872+
'Resolution', 'Function', 'Classification', 'CVE ID',
873+
'Customer', 'Netmask', 'Port', 'Where Blocked'
874+
],
875+
],
876+
'Investigations' => [
877+
'Networking' => [ 'IP', 'Domain' ],
878+
'Details' => [
879+
'How Reported', 'Reporter Type', 'Customer', 'Description',
880+
'Resolution', 'Function', 'Classification', 'CVE ID',
881+
'Customer', 'Netmask', 'Port', 'Where Blocked'
882+
],
883+
],
884+
'Countermeasures' => [
885+
'Networking' => [ 'IP', 'Domain' ],
886+
'Details' => [
887+
'How Reported', 'Reporter Type', 'Customer', 'Description',
888+
'Resolution', 'Function', 'Classification', 'CVE ID',
889+
'Customer', 'Netmask', 'Port', 'Where Blocked'
890+
],
891+
],
892+
},
716893
);
717894

718-
=item C<%InlineEditPanelBehavior>
719-
720-
This configuration option is a core RT feature which accepts a
721-
custom key for RTIR. The options are the same as those documented
722-
in RT, but the key is C<RTIR::Ticket> as in this example:
723-
724-
Set(%InlineEditPanelBehavior,
725-
'RTIR::Ticket' => {
726-
'_default' => 'click',
727-
728-
'Networking' => 'link',
729-
'Details' => 'click',
730-
'Dates' => 'always',
731-
'People' => 'link',
732-
},
733-
);
734-
735-
If no RTIR settings are defined, the settings for C<RT::Ticket>
736-
are used. See C<etc/RT_Config.pm> for more information about
737-
this configuration option.
738-
739895
=item C<$RTIR_StrictDomainTLD>
740896
741897
If true then RTIR will check if TLD is officially valid on domain

html/Callbacks/RTIR/Admin/Queues/DefaultValues.html/Init

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
%# END BPS TAGGED BLOCK }}}
4848
<%init>
4949
# To display RTIR CF groupings on queue config Default Values tab
50-
unshift @{$Groupings}, RT::CustomField->CustomGroupings('RTIR::Ticket');
50+
unshift @{$Groupings}, RT::CustomField->CustomGroupings('RT::Ticket');
5151
</%init>
5252
<%args>
5353
$Groupings

html/Callbacks/RTIR/Elements/MakeClicky/Default

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,8 @@ my %actions;
119119
my $cf = RT::IR::GetCustomField('IP');
120120
my $tid = $args{'object'}->id;
121121
$result .= qq{ <a class="btn btn-outline-primary rtir-lookup-button" href="}.
122-
RT::IR->HREFTo("Edit.html?id=".$tid
123-
.qq{&Object-RT::Ticket-$tid-CustomField-}. $cf->id .qq{-AddValue=$escaped_host}
124-
.q{&SaveChanges=1})
122+
RT::IR->HREFTo("Display.html?id=".$tid
123+
.qq{&Object-RT::Ticket-$tid-CustomField-}. $cf->id .qq{-AddValue=$escaped_host})
125124
.qq{">}. loc('Add IP') .q{</a>};
126125
}
127126
return $escaper->($args{value}) . qq{ <span class="clickylink">$result</span>};
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
%# BEGIN BPS TAGGED BLOCK {{{
2+
%#
3+
%# COPYRIGHT:
4+
%#
5+
%# This software is Copyright (c) 1996-2025 Best Practical Solutions, LLC
6+
%# <sales@bestpractical.com>
7+
%#
8+
%# (Except where explicitly superseded by other copyright notices)
9+
%#
10+
%#
11+
%# LICENSE:
12+
%#
13+
%# This work is made available to you under the terms of Version 2 of
14+
%# the GNU General Public License. A copy of that license should have
15+
%# been provided with this software, but in any event can be snarfed
16+
%# from www.gnu.org.
17+
%#
18+
%# This work is distributed in the hope that it will be useful, but
19+
%# WITHOUT ANY WARRANTY; without even the implied warranty of
20+
%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21+
%# General Public License for more details.
22+
%#
23+
%# You should have received a copy of the GNU General Public License
24+
%# along with this program; if not, write to the Free Software
25+
%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
26+
%# 02110-1301 or visit their web page on the internet at
27+
%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
28+
%#
29+
%#
30+
%# CONTRIBUTION SUBMISSION POLICY:
31+
%#
32+
%# (The following paragraph is not intended to limit the rights granted
33+
%# to you to modify and distribute this software under the terms of
34+
%# the GNU General Public License and is only of importance to you if
35+
%# you choose to contribute your changes and enhancements to the
36+
%# community by submitting them to Best Practical Solutions, LLC.)
37+
%#
38+
%# By intentionally submitting any modifications, corrections or
39+
%# derivatives to this work, or any other work intended for use with
40+
%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
41+
%# you are the copyright holder for those contributions and you grant
42+
%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable,
43+
%# royalty-free, perpetual, license to use, copy, create derivative
44+
%# works based on those contributions, and sublicense and distribute
45+
%# those contributions and any derivatives thereof.
46+
%#
47+
%# END BPS TAGGED BLOCK }}}
48+
<%INIT>
49+
if ( $Object->isa('RT::Queue') ) {
50+
$ObjectItem->{'RTIR Constituency'} = $Object->FirstCustomFieldValue('RTIR Constituency');
51+
}
52+
</%INIT>
53+
54+
<%ARGS>
55+
$Object
56+
$ObjectItem
57+
$ARGSRef
58+
</%ARGS>

0 commit comments

Comments
 (0)