[Rt-commit] rt branch, 4.4/download-user-info, created. rt-4.4.2-248-g08c9ee004
Maureen Mirville
maureen at bestpractical.com
Tue Nov 6 15:01:30 EST 2018
The branch, 4.4/download-user-info has been created
at 08c9ee0047c20974b30570e032536a949b33393e (commit)
- Log -----------------------------------------------------------------
commit 7e03a7e7699f6509812690fbd34ab2bc030a07be
Author: Craig Kaiser <craig at bestpractical.com>
Date: Thu Jun 14 15:51:40 2018 -0400
Add column to transaction column map for content
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 8c82256277b750d4a91dc871687d8ca019398c5a
Author: Craig Kaiser <craig at bestpractical.com>
Date: Thu Jun 14 15:52:38 2018 -0400
Add config options for download user data result formats
Need three new config options that allow admins to specify the search
result formats for the user data downloads.
$UserTicketDataResultFormat
$UserDataResultFormat
$UserTransactionDataResultFormat
diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index 6fe7bc7a2..eb6f7bc81 100644
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -1382,6 +1382,38 @@ Set ($DefaultSearchResultFormat, qq{
'<small>__LastUpdatedRelative__</small>',
'<small>__TimeLeft__</small>'});
+
+=item C<$UserTicketDataResultFormat>
+
+This is the format of ticket search result for "Download User Tickets" links. It
+defaults to C<DefaultSearchResultFormat> if it's not set.
+
+=cut
+
+Set($UserTicketDataResultFormat, undef );
+
+=item C<$UserDataResultFormat>
+
+This is the format of the user search result for "Download User Data" links.
+
+=cut
+
+Set($UserDataResultFormat, "'__id__', '__Name__', '__EmailAddress__', '__RealName__',\
+ '__NickName__', '__Organization__', '__HomePhone__', '__WorkPhone__',\
+ '__MobilePhone__', '__PagerPhone__', '__Address1__', '__Address2__',\
+ '__City__', '__State__','__Zip__', '__Country__', '__Gecos__', '__Lang__',\
+ '__FreeFormContactInfo__'");
+
+=item C<$UserTransactionDataResultFormat>
+
+This is the format of the user transaction search result for "Download User Transaction Data" links.
+
+=cut
+
+Set($UserTransactionDataResultFormat, "'__ObjectId__', '__id__', '__Created__', '__Description__',\
+ '__OldValue__', '__NewValue__', '__Content__'");
+
+
=item C<$DefaultSearchResultOrderBy>
What Tickets column should we order by for RT Ticket search results.
commit 138e2dc5ba3aac60fe64cca4d21a3095e8fa38d9
Author: Craig Kaiser <craig at bestpractical.com>
Date: Thu Jun 14 15:53:14 2018 -0400
Create helper for exporting user related information
Export transaction and user record information pertaining to the
provided user id, as a TSV file.
diff --git a/share/html/User/RelatedData.tsv b/share/html/User/RelatedData.tsv
new file mode 100644
index 000000000..25804686d
--- /dev/null
+++ b/share/html/User/RelatedData.tsv
@@ -0,0 +1,85 @@
+%# 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>
+$PreserveNewLines => 0
+$Type => 'User'
+$Format => undef
+$id
+</%ARGS>
+
+<%INIT>
+# Abort unless supported type for export found
+Abort('Incorrect value passed for Type') unless
+ $Type && ( $Type eq 'User' || $Type eq 'Transaction');
+
+if ( $session{'CurrentUser'}->id ne $id ) {
+ Abort('User does not have the right to view other users') unless
+ $session{'CurrentUser'}->UserObj->HasRight( Object => $RT::System, Right =>'AdminUsers');
+}
+
+my $Collection;
+
+if ( $Type eq 'User' ) {
+ $Format = RT->Config->Get('UserDataResultFormat') unless $Format;
+
+ $Collection = RT::Users->new( $session{'CurrentUser'} );
+ $Collection->Limit( FIELD => 'id', VALUE => $id );
+
+} elsif ( $Type eq 'Transaction' ) {
+ $Format = RT->Config->Get('UserTransactionDataResultFormat') unless $Format;
+
+ $Collection = RT::Transactions->new( $session{'CurrentUser'} );
+ $Collection->Limit( FIELD => 'ObjectType', VALUE => 'RT::Ticket' );
+ $Collection->Limit( FIELD => 'Creator', VALUE => $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 );
+</%INIT>
commit ad2ba60d0ccb73f0be807e9a324d4850b1af4b7d
Author: Craig Kaiser <craig at bestpractical.com>
Date: Thu Jun 14 15:53:45 2018 -0400
Create portlet for downloading user information
Provide three links for downloading user information as a tsv file:
User record data
User transaction data
User ticket data
diff --git a/share/html/User/Elements/RelatedData b/share/html/User/Elements/RelatedData
new file mode 100644
index 000000000..73e62687b
--- /dev/null
+++ b/share/html/User/Elements/RelatedData
@@ -0,0 +1,69 @@
+%# 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"),
+&>
+
+<div>
+ <a href="/User/RelatedData.tsv?Type=User&id=<% $UserObj->id %>" class="button"><% $UserDataButton %></a>
+ <a href="/Search/Results.tsv?Query=Requestor.id=<% $UserObj->id %>&Format=<% $Format | un %>" class="button"><% $UserTicketsButton %></a>
+ <a href="/User/RelatedData.tsv?Type=Transaction&id=<% $UserObj->id %>" class="button"><% $UserTxnButton %></a>
+</div>
+</&>
+
+<%INIT>
+my $Format = RT->Config->Get('UserTicketDataResultFormat') || RT->Config->Get('DefaultSearchResultFormat');
+</%INIT>
+
+<%ARGS>
+$UserObj
+$UserDataButton => loc( 'Download User Data' )
+$UserTicketsButton => loc( 'Download User Tickets' )
+$UserTxnButton => loc( 'Download User Transaction Data' )
+</%ARGS>
commit 76aebc3c4ef22774551126dafd09c9e1226564e4
Author: Craig Kaiser <craig at bestpractical.com>
Date: Thu Jun 14 15:55:26 2018 -0400
Add user data download portlet to admin user modify page
diff --git a/share/html/Admin/Users/Modify.html b/share/html/Admin/Users/Modify.html
index 3b8bc42fc..5b3222d8a 100644
--- a/share/html/Admin/Users/Modify.html
+++ b/share/html/Admin/Users/Modify.html
@@ -232,6 +232,7 @@
% }
</form>
+<& /User/Elements/RelatedData, UserObj => $UserObj &>
<%INIT>
my $UserObj = RT::User->new($session{'CurrentUser'});
commit d35da5e1856e2bf477f66544f9b142059a498978
Author: Craig Kaiser <craig at bestpractical.com>
Date: Thu Jun 21 16:58:16 2018 -0400
Add download user data portlet to AboutMe.html page
diff --git a/share/html/Prefs/AboutMe.html b/share/html/Prefs/AboutMe.html
index 7eaf36755..bd95d82e3 100644
--- a/share/html/Prefs/AboutMe.html
+++ b/share/html/Prefs/AboutMe.html
@@ -201,6 +201,11 @@
</form>
+<& /User/Elements/RelatedData, UserObj => $UserObj,
+ UserDataButton => 'Download My Data',
+ UserTicketsButton => 'Download My Tickets',
+ UserTxnButton => 'Download My Transaction Data',
+&>
<%INIT>
commit cb22e5cbc9accd5fd9e938f16d9727087548c725
Author: Craig Kaiser <craig at bestpractical.com>
Date: Thu Jun 14 15:56:19 2018 -0400
Create test for user information 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..cc100d686
--- /dev/null
+++ b/t/web/download_user_info.t
@@ -0,0 +1,85 @@
+
+use strict;
+use warnings;
+
+use RT::Test tests => undef;
+
+RT->Config->Set( UserTicketDataResultFormat =>
+ "'__id__', '__Subject__', '__Status__', '__QueueName__', '__Owner__', '__Priority__', '__Requestors__'"
+);
+
+my ( $baseurl, $agent ) = RT::Test->started_ok;
+my $url = $agent->rt_base_url;
+
+# Login
+$agent->login( 'root' => 'password' );
+
+{
+ my $root = RT::Test->load_or_create_user( Name => 'root' );
+ ok $root && $root->id;
+
+# We want transactions attached to our user, so not using test method for ticket create
+ my $ticket = RT::Ticket->new($root);
+ $ticket->Create(
+ Subject => 'Test',
+ Requestor => 'root',
+ Queue => 'General'
+ );
+ my $id = $ticket->id;
+ ok $id;
+
+ $ticket->Comment( Content => 'Test - Comment' );
+ $ticket->Correspond( Content => 'Test - Reply' );
+
+ my @dates;
+ my $trans = $ticket->Transactions;
+
+ while ( my $tran = $trans->Next ) {
+ if ( $tran->Type =~ /Create|Comment|Correspond/ ) {
+ push @dates, $tran->CreatedObj->AsString;
+ }
+ }
+ my ( $date_created, $date_commented, $date_correspondence ) = @dates;
+
+ # Make sure we have the expected amount of transactions
+ is scalar @dates, 3;
+
+ # TSV file for user record information
+ $agent->get_ok( $url . "Admin/Users/Modify.html?id=" . $root->id );
+ $agent->follow_link_ok( { text => 'Download User Data' } );
+
+ my $user_info_tsv = <<EOF;
+id\tName\tEmailAddress\tRealName\tNickName\tOrganization\tHomePhone\tWorkPhone\tMobilePhone\tPagerPhone\tAddress1\tAddress2\tCity\tState\tZip\tCountry\tGecos\tLang\tFreeFormContactInfo
+14\troot\troot\@localhost\tEnoch Root\t\t\t\t\t\t\t\t\t\t\t\t\troot\t\t
+EOF
+
+ is $agent->content, $user_info_tsv,
+ "User record information downloaded correctly";
+
+ # TSV file for Transactions
+ $agent->get_ok( $url . "Admin/Users/Modify.html?id=" . $root->id );
+ $agent->follow_link_ok( { text => 'Download User Transaction Data' } );
+
+ my $transaction_info_tsv = <<EOF;
+ObjectId\tid\tCreated\tDescription\tOldValue\tNewValue\tContent
+1\t30\t$date_created\tTicket created\t\t\tThis transaction appears to have no content
+1\t32\t$date_commented\tComments added\t\t\tTest - Comment
+1\t33\t$date_correspondence\tCorrespondence added\t\t\tTest - Reply
+EOF
+
+ is $agent->content, $transaction_info_tsv,
+ "User transaction information downloaded correctly";
+
+ # TSV file for user's Tickets
+ $agent->get_ok( $url . "Admin/Users/Modify.html?id=" . $root->id );
+ $agent->follow_link_ok( { text => 'Download User Tickets' } );
+
+ my $ticket_info_tsv = <<EOF;
+id\tSubject\tStatus\tQueueName\tOwner\tPriority\tRequestors
+1\tTest\topen\tGeneral\tNobody in particular\t0\troot (Enoch Root)
+EOF
+
+ is $agent->content, $ticket_info_tsv, "User tickets downloaded correctly";
+}
+
+done_testing();
commit 08c9ee0047c20974b30570e032536a949b33393e
Author: Maureen E. Mirville <maureen at bestpractical.com>
Date: Tue Nov 6 14:48:09 2018 -0500
Add new config to allow Self Service users to download their RT data
diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index eb6f7bc81..3a19e9072 100644
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -1830,6 +1830,16 @@ access ticked displays.
Set($SelfServiceRegex, qr!^(?:/+SelfService/)!x );
+=item C<$SelfServiceDownloadData>
+
+Allow Self Service users to download their user information, ticket data
+and transaction data as a .tsv file. When enabled, these three options
+will appear on the /SelfService/Prefs.html page.
+
+=cut
+
+Set( $SelfServiceDownloadData, 0 );
+
=back
=head2 Articles
diff --git a/share/html/SelfService/Elements/RelatedData b/share/html/SelfService/Elements/RelatedData
new file mode 100644
index 000000000..d469d05ae
--- /dev/null
+++ b/share/html/SelfService/Elements/RelatedData
@@ -0,0 +1,69 @@
+%# 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"),
+&>
+
+<div>
+ <a href="/SelfService/RelatedData.tsv?Type=User&id=<% $UserObj->id %>" class="button"><% $UserDataButton %></a>
+ <a href="/SelfService/Results.tsv?Query=Requestor.id=<% $UserObj->id %>&Format=<% $Format | un %>" class="button"><% $UserTicketsButton %></a>
+ <a href="/SelfService/RelatedData.tsv?Type=Transaction&id=<% $UserObj->id %>" class="button"><% $UserTxnButton %></a>
+</div>
+</&>
+
+<%INIT>
+my $Format = RT->Config->Get('DefaultSelfServiceSearchResultFormat') || RT->Config->Get('DefaultSearchResultFormat');
+</%INIT>
+
+<%ARGS>
+$UserObj
+$UserDataButton => loc( 'Download My Data' )
+$UserTicketsButton => loc( 'Download My Tickets' )
+$UserTxnButton => loc( 'Download My Transaction Data' )
+</%ARGS>
diff --git a/share/html/SelfService/Prefs.html b/share/html/SelfService/Prefs.html
index b4c57c0fc..315c1f375 100644
--- a/share/html/SelfService/Prefs.html
+++ b/share/html/SelfService/Prefs.html
@@ -81,6 +81,10 @@
<& /Elements/Submit, Label => loc('Save Changes') &>
</form>
+% if( $SelfServiceDownloadData ) {
+<& /SelfService/Elements/RelatedData, UserObj => $user,
+&>
+% }
<%INIT>
my @results;
@@ -127,6 +131,8 @@ if ($Signature) {
}
}
+my $SelfServiceDownloadData = RT->Config->Get( 'SelfServiceDownloadData' );
+
#A hack to make sure that session gets rewritten.
$session{'i'}++;
</%INIT>
diff --git a/share/html/SelfService/RelatedData.tsv b/share/html/SelfService/RelatedData.tsv
new file mode 100644
index 000000000..25804686d
--- /dev/null
+++ b/share/html/SelfService/RelatedData.tsv
@@ -0,0 +1,85 @@
+%# 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>
+$PreserveNewLines => 0
+$Type => 'User'
+$Format => undef
+$id
+</%ARGS>
+
+<%INIT>
+# Abort unless supported type for export found
+Abort('Incorrect value passed for Type') unless
+ $Type && ( $Type eq 'User' || $Type eq 'Transaction');
+
+if ( $session{'CurrentUser'}->id ne $id ) {
+ Abort('User does not have the right to view other users') unless
+ $session{'CurrentUser'}->UserObj->HasRight( Object => $RT::System, Right =>'AdminUsers');
+}
+
+my $Collection;
+
+if ( $Type eq 'User' ) {
+ $Format = RT->Config->Get('UserDataResultFormat') unless $Format;
+
+ $Collection = RT::Users->new( $session{'CurrentUser'} );
+ $Collection->Limit( FIELD => 'id', VALUE => $id );
+
+} elsif ( $Type eq 'Transaction' ) {
+ $Format = RT->Config->Get('UserTransactionDataResultFormat') unless $Format;
+
+ $Collection = RT::Transactions->new( $session{'CurrentUser'} );
+ $Collection->Limit( FIELD => 'ObjectType', VALUE => 'RT::Ticket' );
+ $Collection->Limit( FIELD => 'Creator', VALUE => $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 );
+</%INIT>
diff --git a/share/html/SelfService/Results.tsv b/share/html/SelfService/Results.tsv
new file mode 100644
index 000000000..1bbdded74
--- /dev/null
+++ b/share/html/SelfService/Results.tsv
@@ -0,0 +1,72 @@
+%# 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>
+$Format => undef
+$Query => ''
+$OrderBy => 'id'
+$Order => 'ASC'
+$PreserveNewLines => 0
+</%ARGS>
+<%INIT>
+my $Tickets = RT::Tickets->new( $session{'CurrentUser'} );
+$Tickets->FromSQL( $Query );
+if ( $OrderBy =~ /\|/ ) {
+ # Multiple Sorts
+ my @OrderBy = split /\|/, $OrderBy;
+ my @Order = split /\|/, $Order;
+ $Tickets->OrderByCols(
+ map { { FIELD => $OrderBy[$_], ORDER => $Order[$_] } }
+ ( 0 .. $#OrderBy )
+ );
+}
+else {
+ $Tickets->OrderBy( FIELD => $OrderBy, ORDER => $Order );
+}
+
+$m->comp( "/Elements/TSVExport", Collection => $Tickets, Format => $Format, PreserveNewLines => $PreserveNewLines );
+</%INIT>
-----------------------------------------------------------------------
More information about the rt-commit
mailing list