[Rt-commit] rt branch, expand-history, updated. rt-3.8.8-107-g9c850f3

Shawn Moore sartak at bestpractical.com
Mon Jul 5 23:37:14 EDT 2010


The branch, expand-history has been updated
       via  9c850f37efad2f744abb3594ac9e0589885861c8 (commit)
       via  f887842604e32173216951da7a5a07ab12a93c06 (commit)
       via  8fb5931c5b3c8344d9265d0c525618c1d0f940b0 (commit)
       via  6936d3403005a6004b8a9dff5c1d8574224800a0 (commit)
      from  138640897857177bd38cb75c5a9cb83d3f12158f (commit)

Summary of changes:
 etc/RT_Config.pm.in                                |   10 +++++++++
 lib/RT/Config.pm                                   |   13 ++++++++++-
 .../{Toggle/TicketBookmark => TicketHistory.html}  |   15 ++++++++++++-
 share/html/Ticket/Display.html                     |   22 ++++++++++++-------
 .../Elements/ClickToShowHistory}                   |   16 +++++++-------
 5 files changed, 57 insertions(+), 19 deletions(-)
 copy share/html/Helpers/{Toggle/TicketBookmark => TicketHistory.html} (80%)
 copy share/html/{Admin/Elements/SelectModifyQueue => Ticket/Elements/ClickToShowHistory} (88%)
 mode change 100755 => 100644

- Log -----------------------------------------------------------------
commit 6936d3403005a6004b8a9dff5c1d8574224800a0
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Mon Jul 5 23:29:24 2010 -0400

    Fragment for displaying a ticket's history

diff --git a/share/html/Helpers/TicketHistory.html b/share/html/Helpers/TicketHistory.html
new file mode 100644
index 0000000..a2531aa
--- /dev/null
+++ b/share/html/Helpers/TicketHistory.html
@@ -0,0 +1,67 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%# 
+%# COPYRIGHT:
+%# 
+%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC
+%#                                          <jesse 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>
+$id
+</%ARGS>
+<%INIT>
+my $TicketObj = RT::Ticket->new($session{'CurrentUser'});
+$TicketObj->Load($id);
+
+my $attachments = $m->comp('/Ticket/Elements/FindAttachments', Ticket => $TicketObj);
+my $attachment_content = $m->comp('/Ticket/Elements/LoadTextAttachments', Ticket => $TicketObj);
+
+$m->comp('/Ticket/Elements/ShowHistory',
+    Ticket => $TicketObj, 
+    Collapsed => $ARGS{'Collapsed'}, 
+    ShowHeaders => $ARGS{'ShowHeaders'},
+    Attachments => $attachments,
+    AttachmentContent => $attachment_content
+);
+
+$m->abort();
+</%INIT>

commit 8fb5931c5b3c8344d9265d0c525618c1d0f940b0
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Mon Jul 5 23:29:58 2010 -0400

    A helper component to defer loading ticket history

diff --git a/share/html/Ticket/Elements/ClickToShowHistory b/share/html/Ticket/Elements/ClickToShowHistory
new file mode 100644
index 0000000..e0e7d5c
--- /dev/null
+++ b/share/html/Ticket/Elements/ClickToShowHistory
@@ -0,0 +1,57 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%# 
+%# COPYRIGHT:
+%# 
+%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC
+%#                                          <jesse 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 }}}
+<div id="deferred_ticket_history">
+    <a href="<% $url %>" onclick="ahah('<% $url |n %>', 'deferred_ticket_history'); return false;" >Show ticket history</a>
+</div>
+<%ARGS>
+$Ticket
+</%ARGS>
+<%INIT>
+my $id = $Ticket->id;
+my $url = RT->Config->Get('WebPath') ."/Helpers/TicketHistory.html?id=". $id;
+</%INIT>

commit f887842604e32173216951da7a5a07ab12a93c06
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Mon Jul 5 23:35:23 2010 -0400

    Add DeferTransactionLoading config variable

diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index c148c25..0cd1a5f 100755
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -1297,6 +1297,16 @@ option can be overridden by users in their preferences.
 
 Set($OldestTransactionsFirst, '1');
 
+=item C<$DeferTransactionLoading>
+
+When set, defers loading ticket history until the user clicks a link.
+This should end up serving pages to users quicker, since generating
+all the HTML for transaction history can be slow for long tickets.
+
+=cut
+
+#Set($DeferTransactionLoading, '1');
+
 =item C<$ShowTransactionImages>
 
 By default, RT shows images attached to incoming (and outgoing) ticket updates
diff --git a/share/html/Ticket/Display.html b/share/html/Ticket/Display.html
index 549ba93..b4d23f4 100755
--- a/share/html/Ticket/Display.html
+++ b/share/html/Ticket/Display.html
@@ -68,14 +68,20 @@
 
 % $m->callback( Ticket => $TicketObj, %ARGS, CallbackName => 'BeforeShowHistory' );
 
-<& /Ticket/Elements/ShowHistory , 
-      Ticket => $TicketObj, 
-      Tickets => $Tickets, 
-      Collapsed => $ARGS{'Collapsed'}, 
-      ShowHeaders => $ARGS{'ShowHeaders'},
-      Attachments => $attachments,
-      AttachmentContent => $attachment_content
-&> 
+% if (RT->Config->Get( 'DeferTransactionLoading', $session{'CurrentUser'} )) {
+    <& /Ticket/Elements/ClickToShowHistory,
+        Ticket => $TicketObj,
+    &>
+% } else {
+    <& /Ticket/Elements/ShowHistory ,
+          Ticket => $TicketObj,
+          Tickets => $Tickets,
+          Collapsed => $ARGS{'Collapsed'},
+          ShowHeaders => $ARGS{'ShowHeaders'},
+          Attachments => $attachments,
+          AttachmentContent => $attachment_content
+    &>
+% }
 
 % $m->callback( %ARGS,
 %     Ticket       => $TicketObj,

commit 9c850f37efad2f744abb3594ac9e0589885861c8
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Mon Jul 5 23:38:32 2010 -0400

    Add DeferTransactionLoading as a user preference

diff --git a/lib/RT/Config.pm b/lib/RT/Config.pm
index 9de441f..ce6d5b2 100644
--- a/lib/RT/Config.pm
+++ b/lib/RT/Config.pm
@@ -306,12 +306,21 @@ our %META = (
             Description => 'Show oldest history first',    #loc
         },
     },
-    ShowUnreadMessageNotifications => { 
+    DeferTransactionLoading => {
         Section         => 'Ticket display',
         Overridable     => 1,
         SortOrder       => 3,
         Widget          => '/Widgets/Form/Boolean',
         WidgetArguments => {
+            Description => 'Hide ticket history by default',    #loc
+        },
+    },
+    ShowUnreadMessageNotifications => { 
+        Section         => 'Ticket display',
+        Overridable     => 1,
+        SortOrder       => 4,
+        Widget          => '/Widgets/Form/Boolean',
+        WidgetArguments => {
             Description => 'Notify me of unread messages',    #loc
         },
 
@@ -319,7 +328,7 @@ our %META = (
     PlainTextPre => {
         Section         => 'Ticket display',
         Overridable     => 1,
-        SortOrder       => 4,
+        SortOrder       => 5,
         Widget          => '/Widgets/Form/Boolean',
         WidgetArguments => {
             Description => 'add <pre> tag around plain text attachments', #loc

-----------------------------------------------------------------------


More information about the Rt-commit mailing list