[Rt-commit] rt branch, 4.4/download-user-info, created. rt-4.4.2-240-g1035e04c8
Craig Kaiser
craig at bestpractical.com
Wed Jun 13 17:02:15 EDT 2018
The branch, 4.4/download-user-info has been created
at 1035e04c84f8541c2f2c11a2ba0d84ea19df5fb1 (commit)
- Log -----------------------------------------------------------------
commit 0837d00cc919ee331cae37ea5938ad70533ecb7e
Author: Maureen E. Mirville <maureen at bestpractical.com>
Date: Thu May 3 09:34:38 2018 -0400
Add option to disable escaping HTML in articles
Fixes: I#32374
diff --git a/share/html/Admin/Articles/Classes/Modify.html b/share/html/Admin/Articles/Classes/Modify.html
index ef3f50317..f69a1601d 100644
--- a/share/html/Admin/Articles/Classes/Modify.html
+++ b/share/html/Admin/Articles/Classes/Modify.html
@@ -92,6 +92,10 @@
<input type="checkbox" id="Include-Summary" name="Include-Summary" value="1" <% $include{Summary} %>>
<label for="Include-Summary"><&|/l&>Include article summary</&></label>
</li>
+<li>
+ <input type="checkbox" id="Include-EscapeHTML" name="Include-EscapeHTML" value="1" <% $include{EscapeHTML} %>>
+ <label for="Include-EscapeHTML"><&|/l&>Escape HTML (Unchecking this box is potentially unsafe)</&></label>
+</li>
% if ( $cfs ) {
% while (my $cf = $cfs->Next) {
<li><&|/l, $cf->Name &>Include custom field '[_1]'</&>
@@ -187,7 +191,7 @@ if ((defined $Enabled && $Enabled == 1) or (not defined $Enabled and $Create)) {
$Disabled = 1;
}
-my %include = (Name => 1, Summary => 1);
+my %include = (Name => 1, Summary => 1, EscapeHTML => 1);
my $subject_cfs = [];
my $subject_cf_labels = {};
diff --git a/share/html/Articles/Article/Elements/Preformatted b/share/html/Articles/Article/Elements/Preformatted
index 74e5af058..997c4cd29 100644
--- a/share/html/Articles/Article/Elements/Preformatted
+++ b/share/html/Articles/Article/Elements/Preformatted
@@ -84,7 +84,7 @@
% }
<%init>
my $class = $Article->ClassObj;
-my %include = (Name => 1, Summary => 1);
+my %include = (Name => 1, Summary => 1, EscapeHTML => 1);
my $cfs = $class->ArticleCustomFields;
$include{"CF-Title-".$_->Id} = $include{"CF-Value-".$_->Id} = 1 while $_ = $cfs->Next;
$include{$_} = not $class->FirstAttribute("Skip-$_") for keys %include;
@@ -102,7 +102,7 @@ my $get_content = sub {
content => \$content,
);
- if ( $content =~ /<.{1,5}>/ ) {
+ if ( $include{'EscapeHTML'} && $content =~ /<.{1,5}>/ ) {
$content = RT::Interface::Email::ConvertHTMLToText( $content );
}
return $content;
commit d933dbc3029ca2d24cdf78798aa907fd0165ca0d
Author: Maureen E. Mirville <maureen at bestpractical.com>
Date: Fri May 4 16:01:13 2018 -0400
Updated Articles docs to include disabling escaped HTML
diff --git a/docs/customizing/articles_introduction.pod b/docs/customizing/articles_introduction.pod
index 363a3859d..09b42d531 100644
--- a/docs/customizing/articles_introduction.pod
+++ b/docs/customizing/articles_introduction.pod
@@ -111,6 +111,27 @@ Articles can be included by searching for them, knowing the Id of the
article, using the Article Hotlist and using the Queue-specific
dropdown.
+=head3 Disabling Escaped HTML
+
+By default, when an article is inserted into the ticket message box,
+as a security measure, HTML tags are escaped and only text is displayed.
+For example, RT will display "Me You Greeting Hello world!" from the
+following XML:
+
+ <?xml version="1.0" encoding="UTF-8"?>
+ <note>
+ <to>Me</to>
+ <from>You</from>
+ <heading>Greeting</heading>
+ <body>Hello world!</body>
+ </note>
+
+In cases as above, where the content is harmless and displaying it on the
+ticket might be necessary, there is an option to disable escaping these
+tags per article class. This can be done by unchecking the "Escape HTML"
+box on the Modify Class page. Please note this is potentially unsafe and
+its use should be limited to trusted administrators.
+
=head2 Queue-Specific List of Articles
You can use Topics to organize a set of Queue-specific Articles.
commit 444232a01079385e6d7d69eeb1582eba2dc174da
Author: Maureen E. Mirville <maureen at bestpractical.com>
Date: Wed Apr 11 10:29:52 2018 -0400
Update article postfix loops from using $_ to a named variable
The previous use of $_ could potentially cause other code to try to
claim $_ resulting in unusual errors. Using a named variable rather
will prevent any confusion.
diff --git a/share/html/Articles/Article/Elements/Preformatted b/share/html/Articles/Article/Elements/Preformatted
index 997c4cd29..4d4f3ed21 100644
--- a/share/html/Articles/Article/Elements/Preformatted
+++ b/share/html/Articles/Article/Elements/Preformatted
@@ -86,8 +86,13 @@
my $class = $Article->ClassObj;
my %include = (Name => 1, Summary => 1, EscapeHTML => 1);
my $cfs = $class->ArticleCustomFields;
-$include{"CF-Title-".$_->Id} = $include{"CF-Value-".$_->Id} = 1 while $_ = $cfs->Next;
-$include{$_} = not $class->FirstAttribute("Skip-$_") for keys %include;
+while ( my $cf = $cfs->Next ) {
+ $include{"CF-Title-" . $cf->Id} = 1;
+ $include{"CF-Value-" . $cf->Id} = 1;
+}
+foreach my $key ( keys %include ) {
+ $include{$key} = not $class->FirstAttribute("Skip-$key");
+}
my $get_content = sub {
my $value = shift;
commit d3f769cb254b482660173b7128b9eaa6c5ba4056
Author: craig Kaiser <craig at bestpractical.com>
Date: Mon Apr 23 09:37:18 2018 -0400
Add keyboard shortcuts for reply and comment
If the user is on a ticket page where the action link for reply or
comment is available, then they should be able to use the keyboard
shortcuts 'r' and 'c'.
diff --git a/share/html/Elements/ShortcutHelp b/share/html/Elements/ShortcutHelp
index d3e18e0cd..12d60f934 100644
--- a/share/html/Elements/ShortcutHelp
+++ b/share/html/Elements/ShortcutHelp
@@ -46,8 +46,10 @@
%#
%# END BPS TAGGED BLOCK }}}
<%args>
-$show_search => 0
-$show_bulk_update => 0
+$show_bulk_update => 0
+$show_search => 0
+$show_ticket_reply => 0
+$show_ticket_comment => 0
</%args>
<div class="keyboard-shortcuts">
@@ -115,4 +117,29 @@ $show_bulk_update => 0
% }
+% if ($show_ticket_reply || $show_ticket_comment) {
+ <div class="titlebox">
+ <div class="titlebox-title">
+ <span class="left"><&|/l&>Ticket</&></span>
+ <span class="right-empty"></span>
+ </div>
+ <div class="titlebox-content">
+ <hr class="clear">
+ <table>
+% if ( $show_ticket_reply ) {
+ <tr>
+ <td class="key-column"><span class="keyboard-shortcuts-key">r</span></td>
+ <td><&|/l&>Reply to current ticket</&></td>
+ </tr>
+% }
+% if ( $show_ticket_comment ) {
+ <tr>
+ <td class="key-column"><span class="keyboard-shortcuts-key">c</span></td>
+ <td><&|/l&>Comment on current ticket</&></td>
+ </tr>
+% }
+ </table>
+ </div>
+ </div>
+% }
</div>
diff --git a/share/html/Helpers/ShortcutHelp b/share/html/Helpers/ShortcutHelp
index 45f4e3e77..1bfad2c78 100644
--- a/share/html/Helpers/ShortcutHelp
+++ b/share/html/Helpers/ShortcutHelp
@@ -46,8 +46,10 @@
%#
%# END BPS TAGGED BLOCK }}}
<%args>
-$show_search => 0
-$show_bulk_update => 0
+$show_search => 0
+$show_bulk_update => 0
+$show_ticket_reply => 0
+$show_ticket_comment => 0
</%args>
<& /Elements/ShortcutHelp, %ARGS &>
% $m->abort;
diff --git a/share/html/SelfService/Helpers/ShortcutHelp b/share/html/SelfService/Helpers/ShortcutHelp
index 45f4e3e77..167c141a2 100644
--- a/share/html/SelfService/Helpers/ShortcutHelp
+++ b/share/html/SelfService/Helpers/ShortcutHelp
@@ -48,6 +48,8 @@
<%args>
$show_search => 0
$show_bulk_update => 0
+$show_ticket_reply => 0
+$show_ticket_comment => 0
</%args>
<& /Elements/ShortcutHelp, %ARGS &>
% $m->abort;
diff --git a/share/static/js/keyboard-shortcuts.js b/share/static/js/keyboard-shortcuts.js
index a7b4cf54f..22dc962bb 100644
--- a/share/static/js/keyboard-shortcuts.js
+++ b/share/static/js/keyboard-shortcuts.js
@@ -34,10 +34,14 @@ jQuery(function() {
var is_search = jQuery('body#comp-Search-Results').length > 0;
var is_bulk_update = jQuery('body#comp-Search-Bulk').length > 0;
+ var is_ticket_reply = jQuery('a#page-actions-reply').length > 0;
+ var is_ticket_comment = jQuery('a#page-actions-comment').length > 0;
var url = RT.Config.WebHomePath + '/Helpers/ShortcutHelp' +
'?show_search=' + ( is_search || is_bulk_update ? '1' : '0' ) +
- '&show_bulk_update=' + ( is_bulk_update ? '1' : '0' );
+ '&show_bulk_update=' + ( is_bulk_update ? '1' : '0' ) +
+ '&show_ticket_reply=' + ( is_ticket_reply ? '1' : '0' ) +
+ '&show_ticket_comment=' + ( is_ticket_comment ? '1' : '0' );
jQuery.ajax({
url: url,
@@ -151,3 +155,22 @@ jQuery(function() {
Mousetrap.bind('x', toggleTicketCheckbox);
});
+jQuery(function() {
+ // Only load these shortcuts if reply or comment action is on page
+ var ticket_reply = jQuery('a#page-actions-reply');
+ var ticket_comment = jQuery('a#page-actions-comment');
+ if (!ticket_reply.length && !ticket_comment.length) return;
+
+ var replyToTicket = function() {
+ if (!ticket_reply.length) return;
+ window.location.href = ticket_reply.attr('href');
+ };
+
+ var commentOnTicket = function() {
+ if (!ticket_comment.length) return;
+ window.location.href = ticket_comment.attr('href');
+ };
+
+ Mousetrap.bind('r', replyToTicket);
+ Mousetrap.bind('c', commentOnTicket);
+});
commit e5e0327b56e80033c4cc77e985b3ff56ada23f93
Author: Maureen E. Mirville <maureen at bestpractical.com>
Date: Mon Apr 9 16:15:29 2018 -0400
Allow rt-setup-fulltext-index to prompt for dba password
diff --git a/sbin/rt-setup-fulltext-index.in b/sbin/rt-setup-fulltext-index.in
index 5cab8f632..76da05dcd 100644
--- a/sbin/rt-setup-fulltext-index.in
+++ b/sbin/rt-setup-fulltext-index.in
@@ -49,6 +49,7 @@
use strict;
use warnings;
no warnings 'once';
+use Term::ReadKey;
# fix lib paths, some may be relative
BEGIN { # BEGIN RT CMD BOILERPLATE
@@ -650,6 +651,17 @@ sub dba_handle {
$ENV{'NLS_NCHAR'} = "AL32UTF8";
}
my $dsn = do { my $h = new RT::Handle; $h->BuildDSN; $h->DSN };
+ my $password;
+ if ( defined $DB{'admin_password'} || defined $ENV{'RT_DBA_PASSWORD'} ) {
+ $password = $DB{'admin_password'} // $ENV{'RT_DBA_PASSWORD'};
+ } else {
+ print "Please enter $DB{'type'} admin password: ";
+ ReadMode('noecho');
+ chomp($password = ReadLine(0));
+ ReadMode('normal');
+ print "\n";
+ }
+ $DB{'admin_password'} = $password;
my $dbh = DBI->connect(
$dsn, $DB{admin}, $DB{admin_password},
{ RaiseError => 1, PrintError => 1 },
commit 72f02a60248dd9a95ac20fe15e157517045b7427
Author: Craig Kaiser <craig at bestpractical.com>
Date: Mon May 21 11:01:48 2018 -0400
Fix typo in POD
diff --git a/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm
index a38b14718..e8a4545de 100644
--- a/lib/RT/Interface/Web.pm
+++ b/lib/RT/Interface/Web.pm
@@ -928,7 +928,7 @@ sub GetWebURLFromRequest {
=head2 Redirect URL
-This routine ells the current user's browser to redirect to URL.
+This routine tells the current user's browser to redirect to URL.
Additionally, it unties the user's currently active session, helping to avoid
A bug in Apache::Session 1.81 and earlier which clobbers sessions if we try to use
a cached DBI statement handle twice at the same time.
commit 17a8d61a254b67e961e5479d79704d56ee654613
Author: Craig Kaiser <craig at bestpractical.com>
Date: Mon May 21 13:38:15 2018 -0400
Add column to transaction column map for content
Column that returns the content of the transaction.
diff --git a/share/html/Elements/RT__Transaction/ColumnMap b/share/html/Elements/RT__Transaction/ColumnMap
index 28a82f1e0..d709a5440 100644
--- a/share/html/Elements/RT__Transaction/ColumnMap
+++ b/share/html/Elements/RT__Transaction/ColumnMap
@@ -105,6 +105,11 @@ my $COLUMN_MAP = {
}
},
},
+ Content => {
+ title => 'Content', # loc
+ Attribute => 'Content', # loc
+ value => sub { return $_[0]->Content },
+ },
};
commit 64dacf4dc86834812e82e84fbc1b1e03e4716219
Author: Craig Kaiser <craig at bestpractical.com>
Date: Mon May 21 13:42:54 2018 -0400
Create portlet for downloading user information
Offer users the option to download their personal
identifying information stored in RT. Allow users to choose to download a TSV file
of relevant user record information, ticket information or transaction
information.
diff --git a/share/html/Elements/MyRelatedInfo b/share/html/Elements/MyRelatedInfo
new file mode 100644
index 000000000..b445e61c2
--- /dev/null
+++ b/share/html/Elements/MyRelatedInfo
@@ -0,0 +1,74 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2018 Best Practical Solutions, LLC
+%# <sales at bestpractical.com>
+%#
+%# (Except where explicitly superseded by other copyright notices)
+%#
+%#
+%# LICENSE:
+%#
+%# This work is made available to you under the terms of Version 2 of
+%# the GNU General Public License. A copy of that license should have
+%# been provided with this software, but in any event can be snarfed
+%# from www.gnu.org.
+%#
+%# This work is distributed in the hope that it will be useful, but
+%# WITHOUT ANY WARRANTY; without even the implied warranty of
+%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+%# General Public License for more details.
+%#
+%# You should have received a copy of the GNU General Public License
+%# along with this program; if not, write to the Free Software
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
+%#
+%#
+%# CONTRIBUTION SUBMISSION POLICY:
+%#
+%# (The following paragraph is not intended to limit the rights granted
+%# to you to modify and distribute this software under the terms of
+%# the GNU General Public License and is only of importance to you if
+%# you choose to contribute your changes and enhancements to the
+%# community by submitting them to Best Practical Solutions, LLC.)
+%#
+%# By intentionally submitting any modifications, corrections or
+%# derivatives to this work, or any other work intended for use with
+%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
+%# you are the copyright holder for those contributions and you grant
+%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable,
+%# royalty-free, perpetual, license to use, copy, create derivative
+%# works based on those contributions, and sublicense and distribute
+%# those contributions and any derivatives thereof.
+%#
+%# END BPS TAGGED BLOCK }}}
+<&|/Widgets/TitleBox,
+ class => 'user-related-info',
+ title => loc("User related info"),
+&>
+% # Only show these options when current user is viewing themselves
+% if ( defined $UserObj->id && defined $user->id && $UserObj->id == $user->id ) {
+<div>
+ <div>
+ <a href="/Helpers/MyRelatedInfo.tsv?Type=User&UserId=<% $UserObj->id %>" class="button">Download My User Info</a>
+ <a href="/Search/Results.tsv?Query=Requestor.id=<% $UserObj->id %>&Format=<% $Format | un %>" class="button">Download My Tickets</a>
+ <a href="/Helpers/MyRelatedInfo.tsv?Type=Transaction&UserId=<% $UserObj->id %>" class="button">Download My Transaction Info</a>
+ </div>
+</div>
+% }
+</&>
+
+<%INIT>
+my $Format = RT->Config->Get('UserDataSearchResultFormat') || RT->Config->Get('DefaultSearchResultFormat');
+
+my $user = RT::User->new($session{CurrentUser});
+my ($ret, $msg) = $user->Load($session{CurrentUser});
+RT::Logger->error($msg) unless $ret;
+</%INIT>
+
+<%ARGS>
+$UserObj
+</%ARGS>
commit aa3803df1736daa72acab1d85c0f3f60e546f61a
Author: Craig Kaiser <craig at bestpractical.com>
Date: Tue Jun 12 16:01:51 2018 -0400
Create helper for exporting user related information
Export transaction and user record information pertaining to the current
user, as a TSV file.
diff --git a/share/html/Helpers/MyRelatedInfo.tsv b/share/html/Helpers/MyRelatedInfo.tsv
new file mode 100644
index 000000000..3f5d09a70
--- /dev/null
+++ b/share/html/Helpers/MyRelatedInfo.tsv
@@ -0,0 +1,80 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2018 Best Practical Solutions, LLC
+%# <sales at bestpractical.com>
+%#
+%# (Except where explicitly superseded by other copyright notices)
+%#
+%#
+%# LICENSE:
+%#
+%# This work is made available to you under the terms of Version 2 of
+%# the GNU General Public License. A copy of that license should have
+%# been provided with this software, but in any event can be snarfed
+%# from www.gnu.org.
+%#
+%# This work is distributed in the hope that it will be useful, but
+%# WITHOUT ANY WARRANTY; without even the implied warranty of
+%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+%# General Public License for more details.
+%#
+%# You should have received a copy of the GNU General Public License
+%# along with this program; if not, write to the Free Software
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
+%#
+%#
+%# CONTRIBUTION SUBMISSION POLICY:
+%#
+%# (The following paragraph is not intended to limit the rights granted
+%# to you to modify and distribute this software under the terms of
+%# the GNU General Public License and is only of importance to you if
+%# you choose to contribute your changes and enhancements to the
+%# community by submitting them to Best Practical Solutions, LLC.)
+%#
+%# By intentionally submitting any modifications, corrections or
+%# derivatives to this work, or any other work intended for use with
+%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
+%# you are the copyright holder for those contributions and you grant
+%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable,
+%# royalty-free, perpetual, license to use, copy, create derivative
+%# works based on those contributions, and sublicense and distribute
+%# those contributions and any derivatives thereof.
+%#
+%# END BPS TAGGED BLOCK }}}
+<%ARGS>
+$Query => ''
+$PreserveNewLines => 0
+$Type => undef
+</%ARGS>
+
+<%INIT>
+my $Collection;
+my $Format;
+
+my $user = RT::User->new($session{'CurrentUser'});
+my ($ret, $msg) = $user->Load($session{'CurrentUser'});
+RT::Logger->error($msg) unless $ret;
+
+if ( defined $Type && $Type eq 'User' ) {
+ $Format = "'__id__', '__Name__', '__EmailAddress__', '__RealName__', '__NickName__', '__Organization__', '__HomePhone__', '__WorkPhone__','__MobilePhone__', '__PagerPhone__', '__Address1__', '__Address2__', '__City__', '__State__','__Zip__', '__Country__', '__Gecos__', '__Lang__', '__FreeFormContactInfo__'";
+
+ $Collection = RT::Users->new($session{'CurrentUser'});
+ $Collection->Limit( FIELD => 'id', VALUE => $user->id );
+
+} elsif ( defined $Type && $Type eq 'Transaction' ) {
+ $Format = "'__ObjectId__', '__id__', '__Created__', '__Description__', '__OldValue__', '__NewValue__', '__Content__'";
+
+ $Collection = RT::Transactions->new($session{'CurrentUser'});
+ $Collection->Limit( FIELD => 'ObjectType', VALUE => 'RT::Ticket' );
+ $Collection->Limit( FIELD => 'Creator', VALUE => $user->Id );
+ $Collection->Limit( FIELD => 'Type', VALUE => 'Create' );
+ $Collection->Limit( FIELD => 'Type', VALUE => 'Correspond' );
+ $Collection->Limit( FIELD => 'Type', VALUE => 'Comment' );
+}
+
+$m->comp( "/Elements/TSVExport", Collection => $Collection, Format => $Format, PreserveNewLines => $PreserveNewLines ) unless !defined $Type;
+</%INIT>
commit 20bdce30dd235df0fdae438dd821510a6c08aa97
Author: Craig Kaiser <craig at bestpractical.com>
Date: Mon May 21 13:43:18 2018 -0400
Add user download portlet to Admin modify page
diff --git a/share/html/Admin/Users/Modify.html b/share/html/Admin/Users/Modify.html
index 3b8bc42fc..ef0c58dc3 100644
--- a/share/html/Admin/Users/Modify.html
+++ b/share/html/Admin/Users/Modify.html
@@ -232,6 +232,8 @@
% }
</form>
+<& /Elements/MyRelatedInfo, UserObj => $UserObj &>
+
<%INIT>
my $UserObj = RT::User->new($session{'CurrentUser'});
commit 2713400376ef80602884c0df27dd021223af87b7
Author: Craig Kaiser <craig at bestpractical.com>
Date: Mon May 21 15:10:53 2018 -0400
Create test for user PII TSV download
Create tests to test the user personal identifying information download
features.
diff --git a/t/web/download_user_info.t b/t/web/download_user_info.t
new file mode 100644
index 000000000..c57f147a0
--- /dev/null
+++ b/t/web/download_user_info.t
@@ -0,0 +1,84 @@
+
+use strict;
+use warnings;
+
+use RT::Test tests => undef;
+
+my ($baseurl, $agent) = RT::Test->started_ok;
+my $url = $agent->rt_base_url;
+
+# Login
+$agent->login('root' => 'password');
+ok $agent->login, 'logged in';
+
+{
+ my $root = RT::Test->load_or_create_user( Name => 'root' );
+ ok $root && $root->id;
+
+ my $queue = RT::Test->load_or_create_queue( Name => 'General' );
+ ok $queue && $queue->id;
+
+ my $ticket = RT::Ticket->new( $root );
+ my ($id) = $ticket->Create( Subject => 'Test', Requestor => 'root', Queue => $queue );
+ ok $id;
+
+ $ticket->LoadById( $id );
+ $ticket->Comment(Content => 'Test - Comment');
+ $ticket->Correspond(Content => 'Test - Reply', CcMessageTo => 'Example at example.com');
+
+ # TSV file for user record information
+ $agent->get_ok( $url . "/Admin/Users/Modify.html?id=" . $root->id );
+ $agent->follow_link_ok({ url_regex => qr/Type=User/i });
+ my @info_user = split "\t", (split "\n", $agent->content)[1];
+
+ # TSV file for Transactions
+ $agent->get_ok( $url . "/Admin/Users/Modify.html?id=" . $root->id );
+ $agent->follow_link_ok({ url_regex => qr/Type=Transaction/i });
+ my @info_transactions = (split "\n", $agent->content);
+
+ my @info_comment = split "\t", $info_transactions[2];
+ my @info_correspond = split "\t", $info_transactions[3];
+
+ # TSV file for user's Tickets
+ $agent->get_ok( $url . "/Admin/Users/Modify.html?id=" . $root->id );
+ $agent->follow_link_ok({ url_regex => qr/\/Search\/Results.tsv/i });
+ my @info_tickets = split "\t", (split "\n", $agent->content)[1];
+
+ my %expected_info = (
+ Id => 1, Name => 'root', EmailAddress => 'root at localhost', RealName =>'Enoch Root',
+ ObjectId_comment => 1, Id_comment => 32, Description_comment => 'Comments added', OldValue_comment =>'', NewValue_comment => '', Content_comment => "Test - Comment",
+ ObjectId_Correspond => 1, Id_Correspond => 33, Description_Correspond => 'Correspondence added', OldValue_Correspond =>'', NewValue_Correspond => '', Content_Correspond => "Test - Reply",
+ Id => 1, Subject => 'Test', Status => 'open', QueueName => 'General', Owner => 'Nobody in particular', Priority => 0, Requestor => 'root (Enoch Root)',
+ );
+
+ is_deeply(
+ \%expected_info,
+ {
+ Id => $info_user[0],
+ Name => $info_user[1],
+ EmailAddress => $info_user[2],
+ RealName => $info_user[3],
+ ObjectId_comment => $info_comment[0],
+ Id_comment => $info_comment[1],
+ Description_comment => $info_comment[3],
+ OldValue_comment => $info_comment[4],
+ NewValue_comment => $info_comment[5],
+ Content_comment => $info_comment[6],
+ ObjectId_Correspond => $info_correspond[0],
+ Id_Correspond => $info_correspond[1],
+ Description_Correspond => $info_correspond[3],
+ OldValue_Correspond => $info_correspond[4],
+ NewValue_Correspond => $info_correspond[5],
+ Content_Correspond => $info_correspond[6],
+ Id => $info_tickets[0],
+ Subject => $info_tickets[1],
+ Status => $info_tickets[2],
+ QueueName => $info_tickets[3],
+ Owner => $info_tickets[4],
+ Priority => $info_tickets[5],
+ Requestor => $info_tickets[6],
+ }
+ );
+}
+
+done_testing();
commit 1035e04c84f8541c2f2c11a2ba0d84ea19df5fb1
Author: Craig Kaiser <craig at bestpractical.com>
Date: Wed Jun 13 13:19:50 2018 -0400
Add 'UserDataSearchResultFormat' config option
diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index 6fe7bc7a2..892fa0ac7 100644
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -4030,6 +4030,14 @@ cut down on page clutter. Once this option is clicked the link will change to
Set($HideOneTimeSuggestions, 0);
+=item C<$UserDataSearchResultFormat>
+
+Set the search result format for user related tickets download.
+
+=cut
+
+Set($UserDataSearchResultFormat, undef);
+
=back
-----------------------------------------------------------------------
More information about the rt-commit
mailing list