[Bps-public-commit] RT-BugTracker-Public branch, master, updated. 70395a9f59ab4d1d85a0497694fdd38faa11699d

Thomas Sibley trs at bestpractical.com
Wed Aug 11 15:43:01 EDT 2010


The branch, master has been updated
       via  70395a9f59ab4d1d85a0497694fdd38faa11699d (commit)
       via  b17cb644089372bf3c9db5e5fe9938bcb3f85f2f (commit)
      from  8815af778ae11a1b0ef58cc1b6ab09c4690e011f (commit)

Summary of changes:
 html/Public/Bug/Display.html         |    2 +-
 html/Public/Bug/Elements/ShowHistory |  171 ++++++++++++++++++++++++++++++++++
 2 files changed, 172 insertions(+), 1 deletions(-)
 create mode 100755 html/Public/Bug/Elements/ShowHistory

- Log -----------------------------------------------------------------
commit b17cb644089372bf3c9db5e5fe9938bcb3f85f2f
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Thu Aug 5 10:54:51 2010 -0400

    Revert "* ShowHistory is absolutly equal to version in RT 3.6"
    
    This reverts commit d11ac4d3b8d9eed1cd468900d339274ea9be41d8.
    
    ShowHistory is exactly the same, except if we don't make a local copy it
    won't use our custom elements.

diff --git a/html/Public/Bug/Display.html b/html/Public/Bug/Display.html
index 0be3b28..6abd740 100755
--- a/html/Public/Bug/Display.html
+++ b/html/Public/Bug/Display.html
@@ -62,7 +62,7 @@
 
 <& /Elements/Callback, _CallbackName => 'BeforeShowHistory', Ticket => $TicketObj, %ARGS &>
 
-<& /Ticket/Elements/ShowHistory , 
+<& /Public/Bug/Elements/ShowHistory , 
       Ticket => $TicketObj, 
       Tickets => $Tickets, 
       Collapsed => $ARGS{'Collapsed'}, 
diff --git a/html/Public/Bug/Elements/ShowHistory b/html/Public/Bug/Elements/ShowHistory
new file mode 100755
index 0000000..45cd512
--- /dev/null
+++ b/html/Public/Bug/Elements/ShowHistory
@@ -0,0 +1,166 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%# 
+%# COPYRIGHT:
+%#  
+%# This software is Copyright (c) 1996-2007 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/copyleft/gpl.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 }}}
+<%doc>
+#   This is (ab)used in Admin/(Users|Groups)/History.html and should probably
+#   be generalized at some point.
+</%doc>
+<%perl>
+if ($ShowDisplayModes or $ShowTitle) {
+    my $title = $ShowTitle
+                    ? loc('History')
+                    : ' ';
+
+    my $titleright;
+
+    if ($ShowDisplayModes) {
+        $titleright = q[<span style="color: black">] . loc('Display mode') . ':</span> ';
+        
+        if ($ShowHeaders) {
+            $titleright .= qq{<a href="$URIFile?id=} .
+                           $Ticket->id.qq{">} .
+                           loc("Brief headers") .
+                           qq{</a> — };
+            $titleright .= q[<span class="selected">] . loc("Full headers") . "</span>";
+        }
+        else {
+            $titleright .= q[<span class="selected">] . loc("Brief headers") . "</span> — ";
+            $titleright .= qq{<a href="$URIFile?ShowHeaders=1;id=} .
+                           $Ticket->id.qq{">} .
+                           loc("Full headers") .
+                           qq{</a>};
+        }
+    }
+</%perl>
+<& /Widgets/TitleBoxStart, title => $title, titleright => $titleright &>
+% }
+
+<div id="ticket-history">
+<%perl>
+my @attachments = @{$Attachments->ItemsArrayRef()};
+my @attachment_content = @{$AttachmentContent->ItemsArrayRef()};
+
+while ( my $Transaction = $Transactions->Next ) {
+    my $skip = 0;
+    $m->comp( '/Elements/Callback',
+              _CallbackName => 'SkipTransaction',
+              Transaction   => $Transaction,
+              skip          => \$skip,
+              %ARGS );
+    next if $skip;
+    $i++;
+
+    my @trans_attachments = grep { $_->TransactionId == $Transaction->Id } @attachments;
+
+    my $trans_content = {};
+    grep { ($_->TransactionId == $Transaction->Id ) && ($trans_content->{$_->Id} = $_)  } @attachment_content;
+
+   
+    #Args is first because we're clobbering the "Attachments" parameter 
+    $m->comp( 'ShowTransaction',
+            %ARGS,
+
+              AttachPath           => $AttachPath,
+              UpdatePath           => $UpdatePath,
+              Ticket               => $Ticket,
+              Transaction          => $Transaction,
+              ShowHeaders          => $ShowHeaders,
+              Collapsed            => $Collapsed,
+              RowNum               => $i,
+              ShowTitleBarCommands => $ShowTitleBarCommands,
+              Attachments          => \@trans_attachments,
+              AttachmentContent    => $trans_content,
+              LastTransaction      => $Transactions->IsLast
+ );
+
+# manually flush the content buffer after each txn, so the user sees
+# some update
+$m->flush_buffer(); 
+}
+
+</%perl>
+</div>
+% if ($ShowDisplayModes or $ShowTitle) {
+<& /Widgets/TitleBoxEnd &>
+% }
+<%INIT>
+my $Transactions = new RT::Transactions($session{'CurrentUser'});
+if ($Tickets) {
+    while (my $t = $Tickets->Next) {
+        $Transactions->LimitToTicket($t->id);
+    }
+} else {
+    $Transactions = $Ticket->Transactions;
+}
+
+
+my $OldestFirst = $RT::OldestTransactionsFirst? 'ASC': 'DESC';
+$Transactions->OrderByCols( { FIELD => 'Created',
+                              ORDER => $OldestFirst },
+                            { FIELD => 'id',
+                              ORDER => $OldestFirst },
+                          );
+
+my $i;
+$Attachments ||=  $m->comp('/Ticket/Elements/FindAttachments', Ticket => $Ticket, Tickets => $Tickets || undef);
+$AttachmentContent ||= $m->comp('/Ticket/Elements/LoadTextAttachments', Ticket => $Ticket);
+
+</%INIT>
+<%ARGS>
+$URIFile => $RT::WebPath."/Ticket/Display.html"
+$Ticket => undef
+$Tickets => undef
+$Attachments => undef
+$AttachmentContent => undef
+$ShowHeaders => undef
+$Collapsed => undef
+$ShowTitle => 1
+$ShowDisplayModes => 1
+$ShowTitleBarCommands => 1
+$AttachPath => $RT::WebPath."/Ticket/Attachment"
+$UpdatePath => $RT::WebPath."/Ticket/Update.html"
+</%ARGS>

commit 70395a9f59ab4d1d85a0497694fdd38faa11699d
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Wed Aug 11 15:44:47 2010 -0400

    Update our local copy of ShowHistory with the latest from 3.8-trunk

diff --git a/html/Public/Bug/Elements/ShowHistory b/html/Public/Bug/Elements/ShowHistory
index 45cd512..06ad3d0 100755
--- a/html/Public/Bug/Elements/ShowHistory
+++ b/html/Public/Bug/Elements/ShowHistory
@@ -1,8 +1,8 @@
 %# BEGIN BPS TAGGED BLOCK {{{
 %# 
 %# COPYRIGHT:
-%#  
-%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC 
+%# 
+%# This software is Copyright (c) 1996-2010 Best Practical Solutions, LLC
 %#                                          <jesse at bestpractical.com>
 %# 
 %# (Except where explicitly superseded by other copyright notices)
@@ -24,7 +24,7 @@
 %# 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/copyleft/gpl.html.
+%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
 %# 
 %# 
 %# CONTRIBUTION SUBMISSION POLICY:
@@ -58,7 +58,7 @@ if ($ShowDisplayModes or $ShowTitle) {
     my $titleright;
 
     if ($ShowDisplayModes) {
-        $titleright = q[<span style="color: black">] . loc('Display mode') . ':</span> ';
+        $titleright = '';
         
         if ($ShowHeaders) {
             $titleright .= qq{<a href="$URIFile?id=} .
@@ -76,7 +76,8 @@ if ($ShowDisplayModes or $ShowTitle) {
         }
     }
 </%perl>
-<& /Widgets/TitleBoxStart, title => $title, titleright => $titleright &>
+<div class="history">
+<& /Widgets/TitleBoxStart, title => $title, titleright_raw => $titleright &>
 % }
 
 <div id="ticket-history">
@@ -86,12 +87,14 @@ my @attachment_content = @{$AttachmentContent->ItemsArrayRef()};
 
 while ( my $Transaction = $Transactions->Next ) {
     my $skip = 0;
-    $m->comp( '/Elements/Callback',
-              _CallbackName => 'SkipTransaction',
-              Transaction   => $Transaction,
-              skip          => \$skip,
-              %ARGS );
+    $m->callback(
+        %ARGS,
+        Transaction   => $Transaction,
+        skip          => \$skip,
+        CallbackName  => 'SkipTransaction',
+    );
     next if $skip;
+
     $i++;
 
     my @trans_attachments = grep { $_->TransactionId == $Transaction->Id } @attachments;
@@ -100,21 +103,24 @@ while ( my $Transaction = $Transactions->Next ) {
     grep { ($_->TransactionId == $Transaction->Id ) && ($trans_content->{$_->Id} = $_)  } @attachment_content;
 
    
+    my $IsLastTransaction = 0;
+    if ( $OldestFirst ) {
+        $IsLastTransaction = $Transactions->IsLast;
+    } else {
+        $IsLastTransaction = 1 if ( $i == 1 );
+    }
+
     #Args is first because we're clobbering the "Attachments" parameter 
     $m->comp( 'ShowTransaction',
             %ARGS,
 
-              AttachPath           => $AttachPath,
-              UpdatePath           => $UpdatePath,
               Ticket               => $Ticket,
               Transaction          => $Transaction,
               ShowHeaders          => $ShowHeaders,
-              Collapsed            => $Collapsed,
               RowNum               => $i,
-              ShowTitleBarCommands => $ShowTitleBarCommands,
               Attachments          => \@trans_attachments,
               AttachmentContent    => $trans_content,
-              LastTransaction      => $Transactions->IsLast
+              LastTransaction      => $IsLastTransaction
  );
 
 # manually flush the content buffer after each txn, so the user sees
@@ -126,6 +132,7 @@ $m->flush_buffer();
 </div>
 % if ($ShowDisplayModes or $ShowTitle) {
 <& /Widgets/TitleBoxEnd &>
+</div>
 % }
 <%INIT>
 my $Transactions = new RT::Transactions($session{'CurrentUser'});
@@ -138,11 +145,12 @@ if ($Tickets) {
 }
 
 
-my $OldestFirst = $RT::OldestTransactionsFirst? 'ASC': 'DESC';
+my $OldestFirst = RT->Config->Get( 'OldestTransactionsFirst', $session{'CurrentUser'} );
+my $SortOrder = $OldestFirst? 'ASC': 'DESC';
 $Transactions->OrderByCols( { FIELD => 'Created',
-                              ORDER => $OldestFirst },
+                              ORDER => $SortOrder },
                             { FIELD => 'id',
-                              ORDER => $OldestFirst },
+                              ORDER => $SortOrder },
                           );
 
 my $i;
@@ -151,16 +159,13 @@ $AttachmentContent ||= $m->comp('/Ticket/Elements/LoadTextAttachments', Ticket =
 
 </%INIT>
 <%ARGS>
-$URIFile => $RT::WebPath."/Ticket/Display.html"
+$URIFile => RT->Config->Get('WebPath')."/Ticket/Display.html"
 $Ticket => undef
 $Tickets => undef
 $Attachments => undef
 $AttachmentContent => undef
 $ShowHeaders => undef
-$Collapsed => undef
 $ShowTitle => 1
 $ShowDisplayModes => 1
-$ShowTitleBarCommands => 1
-$AttachPath => $RT::WebPath."/Ticket/Attachment"
-$UpdatePath => $RT::WebPath."/Ticket/Update.html"
+$WarnUnsigned => undef
 </%ARGS>

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



More information about the Bps-public-commit mailing list