Skip to content

Commit

Permalink
Allow to limit how many transactions are listed
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Meyer committed Mar 13, 2018
1 parent 97c72b5 commit 1d17482
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ INSTALLATION

Restart your webserver

CONFIGURATION
$RT_Extension_UpdateHistory_MaxEntries
The maximum number of history entries to list. If not set, everything is listed.

AUTHOR
NETWAYS GmbH <info@netways.de>

Expand Down
23 changes: 23 additions & 0 deletions html/Ticket/Elements/RT-Extension-UpdateHistory
Original file line number Diff line number Diff line change
@@ -1,11 +1,34 @@
<div class="rt-extension-update-history-box">
<& /Elements/ShowHistory,
Object => $Ticket,
Transactions => $Transactions,
ShowHeaders => $ARGS{'ShowHeaders'},
DisplayPath => $URI,
ShowDisplayModes => 0
&>

<div class="rt-extension-update-history-info">
% my $totalCount = $Transactions->CountAll();
% if ($totalCount > $maxEntries) {
<p>Showing <i><% $maxEntries %></i> out of <i><% $totalCount %></i> transactions (Most recent first)</p>
% } else {
<p>Showing <i>all</i> transactions (Most recent first)</p>
% }
</div>

</div>
<%init>
my $Transactions = $Ticket->Transactions();
$Transactions->OrderByCols(
{ FIELD => 'Created', ORDER => 'DESC' },
{ FIELD => 'id', ORDER => 'DESC' },
);

my $maxEntries = RT->Config->Get('RT_Extension_UpdateHistory_MaxEntries');
if ($maxEntries) {
$Transactions->RowsPerPage($maxEntries);
}
</%init>
<%args>
$Ticket
$URI => 'Update.html'
Expand Down
14 changes: 14 additions & 0 deletions html/static/css/updatehistory.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@

}

.rt-extension-update-history-info {
padding: 1em;
}

.rt-extension-update-history-info p {
margin: 0;
padding: 1em;
color: white;
font-size: 1.1em;
font-weight: bold;
text-align: center;
background-color: cornflowerblue;
}

#ticket-update-message {
min-width: 600px;
}

0 comments on commit 1d17482

Please sign in to comment.