[Rt-commit] rt branch, 4.4/download-user-info, repushed
Maureen Mirville
maureen at bestpractical.com
Tue Nov 6 15:01:33 EST 2018
The branch 4.4/download-user-info was deleted and repushed:
was 06bb852074d091b7066269e9fca7b203d9869308
now 08c9ee0047c20974b30570e032536a949b33393e
1: 7e03a7e76 = 1: 7e03a7e76 Add column to transaction column map for content
2: d2908a723 ! 2: 8c8225627 Add config options for download user data result formats
@@ -24,20 +24,7 @@
+
+=cut
+
-+Set($UserTicketDataResultFormat, qq{
-+ '<B><A HREF="__WebPath__/Ticket/Display.html?id=__id__">__id__</a></B>/TITLE:#',
-+ '<B><A HREF="__WebPath__/Ticket/Display.html?id=__id__">__Subject__</a></B>/TITLE:Subject',
-+ Status,
-+ QueueName,
-+ Owner,
-+ Priority,
-+ '__NEWLINE__',
-+ '__NBSP__',
-+ '<small>__Requestors__</small>',
-+ '<small>__CreatedRelative__</small>',
-+ '<small>__ToldRelative__</small>',
-+ '<small>__LastUpdatedRelative__</small>',
-+ '<small>__TimeLeft__</small>'});
++Set($UserTicketDataResultFormat, undef );
+
+=item C<$UserDataResultFormat>
+
3: 70d08fc22 ! 3: 138e2dc5b Create helper for exporting user related information
@@ -5,10 +5,10 @@
Export transaction and user record information pertaining to the
provided user id, as a TSV file.
-diff --git a/share/html/Helpers/UserRelatedData.tsv b/share/html/Helpers/UserRelatedData.tsv
+diff --git a/share/html/User/RelatedData.tsv b/share/html/User/RelatedData.tsv
new file mode 100644
--- /dev/null
-+++ b/share/html/Helpers/UserRelatedData.tsv
++++ b/share/html/User/RelatedData.tsv
@@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
@@ -69,16 +69,15 @@
+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;
-+
-+
-+ 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');
-+ }
+
+ $Collection = RT::Users->new( $session{'CurrentUser'} );
+ $Collection->Limit( FIELD => 'id', VALUE => $id );
4: e8f527766 ! 4: ad2ba60d0 Create portlet for downloading user information
@@ -7,10 +7,10 @@
User transaction data
User ticket data
-diff --git a/share/html/Elements/UserRelatedData b/share/html/Elements/UserRelatedData
+diff --git a/share/html/User/Elements/RelatedData b/share/html/User/Elements/RelatedData
new file mode 100644
--- /dev/null
-+++ b/share/html/Elements/UserRelatedData
++++ b/share/html/User/Elements/RelatedData
@@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
@@ -65,11 +65,9 @@
+&>
+
+<div>
-+ <a href="/Helpers/UserRelatedData.tsv?Type=User&id=<% $UserObj->id %>" class="button"><% loc($UserDataButton) %></a>
-+ <a href="/Search/Results.tsv?Query=Requestor.id=<% $UserObj->id %>&Format=<% $Format | un %>" class="button"><% loc($UserTicketsButton) %></a>
-+% if ( $SeeUserTxn ) {
-+ <a href="/Helpers/UserRelatedData.tsv?Type=Transaction&id=<% $UserObj->id %>" class="button"><% loc($UserTxnButton) %></a>
-+% }
++ <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>
+</&>
+
@@ -79,9 +77,8 @@
+
+<%ARGS>
+$UserObj
-+$UserDataButton => 'Download User Data'
-+$UserTicketsButton => 'Download User Tickets'
-+$UserTxnButton => 'Download User Transaction Data'
-+$SeeUserTxn => $session{'CurrentUser'}->HasRight( Right => 'AdminUsers', Object => $RT::System )
++$UserDataButton => loc( 'Download User Data' )
++$UserTicketsButton => loc( 'Download User Tickets' )
++$UserTxnButton => loc( 'Download User Transaction Data' )
+</%ARGS>
5: d13bb7254 ! 5: 76aebc3c4 Add user data download portlet to admin user modify page
@@ -9,7 +9,7 @@
% }
</form>
-+<& /Elements/UserRelatedData, UserObj => $UserObj &>
++<& /User/Elements/RelatedData, UserObj => $UserObj &>
<%INIT>
my $UserObj = RT::User->new($session{'CurrentUser'});
6: 54f2745f5 ! 6: d35da5e18 Add download user data portlet to AboutMe.html page
@@ -9,11 +9,10 @@
</form>
-+<& /Elements/UserRelatedData, UserObj => $UserObj,
++<& /User/Elements/RelatedData, UserObj => $UserObj,
+ UserDataButton => 'Download My Data',
+ UserTicketsButton => 'Download My Tickets',
+ UserTxnButton => 'Download My Transaction Data',
-+ SeeUserTxn => 1,
+&>
<%INIT>
7: 06bb85207 ! 7: cb22e5cbc Create test for user information TSV download
@@ -95,3 +95,4 @@
+}
+
+done_testing();
+
-: ------- > 8: 08c9ee004 Add new config to allow Self Service users to download their RT data
More information about the rt-commit
mailing list