[Rt-commit] rt branch, 4.6/reverse-transaction-order, repushed
Michel Rodriguez
michel at bestpractical.com
Tue Feb 25 16:08:09 EST 2020
The branch 4.6/reverse-transaction-order was deleted and repushed:
was 5fbf906b83ea1920ef7319d2420de1a1443b58a8
now abc139c509cbadcadf442b0652d71e0aa5dd9878
-: ------- > 1: 4087b3a62 Fixed templates so that ShowHeaders is passed as an argument, instead of getting it sometimes from %ARGS
1: 5fbf906b8 ! 2: abc139c50 Add a control to reverse the time order on the current ticket.
@@ -1,10 +1,79 @@
Author: michel <michel at bestpractical.com>
- Add a control to reverse the transaction display order on the current ticket.
+ Add a control to reverse the time order on the current ticket.
- Add the option in the template.
- Pass the new parameter through the various layers of templates.
- Add an option to SortedTransactions to change the original order.
+ Add the option in the template.
+ Pass the new parameter through the various layers of templates.
+ Add an option to SortedTransactions to change the original order.
+
+diff --git a/etc/RT_SiteConfig.pm b/etc/RT_SiteConfig.pm
+--- a/etc/RT_SiteConfig.pm
++++ b/etc/RT_SiteConfig.pm
+@@
+ # perl -c /path/to/your/etc/RT_SiteConfig.pm
+ #
+ # You must restart your webserver after making changes to this file.
+-#
+
+-# You may also split settings into separate files under the etc/RT_SiteConfig.d/
+-# directory. All files ending in ".pm" will be parsed, in alphabetical order,
+-# after this file is loaded.
++#Set( $rtname, '127.0.0.1');
++Set($rtname, 'localhost');
++Set($WebPort, 8080);
++Set(@ReferrerWhitelist, '127.0.0.1', '192.168.1.2',);
++Set($RestrictReferrer, 0);
+
+-Set( $rtname, 'example.com');
++Set($LogToSTDERR, 'debug');
++Set($DevelMode, 1);
+
+ # You must install Plugins on your own, this is only an example
+ # of the correct syntax to use when activating them:
++# Plugin( "RT::Extension::SLA" );
+ # Plugin( "RT::Authen::ExternalAuth" );
+
++#Plugin( 'RT::Extension::MandatoryOnTransition');
++#Set( %MandatoryOnTransition,
++# newstuff => {
++# 'new -> resolved' => ['CF.color', 'size'],
++# 'open -> resolved' => ['CF.color', 'size'],
++# },
++#);
++
++
++
++Set( %Crypt,
++ Incoming => 'GnuPG',
++ Outgoing => 'GnuPG',
++
++ RejectOnMissingPrivateKey => 1,
++ RejectOnBadData => 1,
++
++ AllowEncryptDataInDB => 0,
++
++ Dashboards => {
++ Encrypt => 0,
++ Sign => 0,
++ },
++);
++
++Set( %GnuPG,
++ Enable => 1,
++ GnuPG => '/usr/bin/gpg1', # debian
++ # GnuPG => '/usr/local/bin/gpg1', # macOS
++ Passphrase => 'Ormafura25!',
++ OutgoingMessagesFormat => "RFC", # Inline
++);
++
++Set( %GnuPGOptions,
++ homedir => q{/home/mrodrigu/.gnupg/pubring.gpg},
++);
++
++Set($MailCommand, "testfile");
++
++
+ 1;
diff --git a/lib/RT/Record.pm b/lib/RT/Record.pm
--- a/lib/RT/Record.pm
@@ -58,39 +127,32 @@
$ShowDisplayModes => 1
$ScrollShowHistory => 0
@@
- </%INIT>
<div class="history <% lc $record_type %>" id="<% $histid %>">
<%perl>
-+$ShowHeaders //= 0;
+ $ShowHeaders //= 0;
+-
+$ReverseTransactionOrder //= 0;
if ( $ShowDisplayModes or $ShowTitle or $ScrollShowHistory ) {
my $title = $ShowTitle
? loc('History')
@@
- qq{<a href="#" id="LoadAllHistory">} .
- loc('Load all history') .
- qq{</a>} .
-+ ($ShowDisplayModes ? '—' : '') .
- qq{</span>} );
+ loc("Show full headers") .
+ qq{</a>};
+ }
++
++ my @TransactionHeaders= ( loc( 'Oldest transaction first'), loc( 'Newest transaction first') );
++ my $Order = (RT->Config->Get("OldestTransactionsFirst", $Object->CurrentUser) xor $ReverseTransactionOrder);
++ my $TransactionHeader= $TransactionHeaders[$Order];
++
++ my $switched_order = 1 - $ReverseTransactionOrder;
++ $titleright .= '—' if $titleright;
++ $titleright .= qq{<a href="?ReverseTransactionOrder=$switched_order;ForceShowHistory=1;ShowHeaders=$ShowHeaders;id=} .
++ $Object->id.qq{#$histid">} .
++ $TransactionHeader .
++ qq{</a>};
}
-@@
- }
- }
-
-+ my @TransactionHeaders= ( loc( 'Oldest transaction first'), loc( 'Newest transaction first') );
-+ my $Order = (RT->Config->Get("OldestTransactionsFirst", $Object->CurrentUser) xor $ReverseTransactionOrder);
-+ my $TransactionHeader= $TransactionHeaders[$Order];
-+
-+ my $switched_order = 1 - $ReverseTransactionOrder;
-+ push( @elements, qq{<a href="?ReverseTransactionOrder=$switched_order;ForceShowHistory=1;ShowHeaders=$ShowHeaders;id=} .
-+ $Object->id.qq{#$histid">} .
-+ $TransactionHeader .
-+ qq{</a>} );
-+
- # build the new link
- my $alt = loc('Edit');
- my $titleright = qq{<div class="btn-group dropdown"><a id="history-dropdown" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span class="fas fa-cog icon-bordered fa-2x" alt="$alt" data-toggle="tooltip" data-placement="top" data-original-title="$alt"></span></a><ul class="dropdown-menu dropdown-menu-right">};
+ </%perl>
diff --git a/share/html/Elements/ShowHistoryPage b/share/html/Elements/ShowHistoryPage
--- a/share/html/Elements/ShowHistoryPage
@@ -110,10 +172,9 @@
--- a/share/html/Helpers/TicketHistory
+++ b/share/html/Helpers/TicketHistory
@@
- %# END BPS TAGGED BLOCK }}}
<%ARGS>
$id
-+$ShowHeaders => 0
+ $ShowHeaders => 0
+$ReverseTransactionOrder => 0
</%ARGS>
<%INIT>
@@ -177,14 +238,6 @@
AttachmentContent => $attachment_content
&>
@@
- <%ARGS>
- $TicketObj => undef
- $ShowHeaders => 0
-+$ReverseTransactionOrder => 0
- $HideUnsetFields => RT->Config->Get('HideUnsetFieldsOnDisplay', $session{CurrentUser})
- $ForceShowHistory => 0
- </%ARGS>
-@@
Arguments => { id => $TicketObj->id },
);
@@ -198,20 +251,17 @@
--- a/share/html/Ticket/Elements/ScrollShowHistory
+++ b/share/html/Ticket/Elements/ScrollShowHistory
@@
- %# END BPS TAGGED BLOCK }}}
<%ARGS>
$Ticket
-+$ShowHeaders => 0
+ $ShowHeaders => 0
+$ReverseTransactionOrder => 0
</%ARGS>
<%INIT>
@@
- $m->comp('/Elements/QueryString', %params, id => $Ticket->id );
my %extra_args = map { $_ => $ARGS{$_} // 1 } qw/ShowDisplayModes ShowTitle ScrollShowHistory/;
--$extra_args{ShowHeaders} = $ARGS{ShowHeaders};
-+$extra_args{ShowHeaders} = $ShowHeaders;
+ $extra_args{ShowHeaders} = $ShowHeaders;
+$extra_args{ReverseTransactionOrder} = $ReverseTransactionOrder;
$m->callback( CallbackName => 'ExtraShowHistoryArguments', Ticket => $Ticket, ExtraArgs => \%extra_args );
More information about the rt-commit
mailing list