[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.8.8-450-g8f397a3

Thomas Sibley trs at bestpractical.com
Tue Aug 17 21:24:43 EDT 2010


The branch, 3.9-trunk has been updated
       via  8f397a39ea874de48ac78d1e1cf659342a070070 (commit)
      from  d4f347b9668db94e11b2d1d9d12d07a67dc364e2 (commit)

Summary of changes:
 etc/RT_Config.pm.in                                |   10 ++++++
 lib/RT/Config.pm                                   |   13 +++++++-
 share/html/Ticket/Elements/ShowRequestor           |   11 ++++--
 share/html/Ticket/Elements/ShowRequestorTickets    |   35 +++++++++++++++----
 .../Ticket/Elements/ShowRequestorTicketsActive     |    3 ++
 share/html/Ticket/Elements/ShowRequestorTicketsAll |    3 ++
 .../Ticket/Elements/ShowRequestorTicketsInactive   |    3 ++
 .../html/Ticket/Elements/ShowRequestorTicketsNone  |    3 ++
 8 files changed, 69 insertions(+), 12 deletions(-)

- Log -----------------------------------------------------------------
commit 8f397a39ea874de48ac78d1e1cf659342a070070
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Tue Aug 17 21:24:12 2010 -0400

    Option to show a search link instead of a list for requestors' tickets
    
    Often it may be desirable to display a link to a ticket search for the
    requestors' tickets rather than inline ticket lists which take up lots
    of space.  The link honors the "what type of tickets to show" preference
    added earlier.

diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index 015d02a..e748ed9 100755
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -871,6 +871,16 @@ shown for Privileged Users.
 
 Set($ShowMoreAboutPrivilegedUsers, 0);
 
+=item C<$MoreAboutRequestorTicketsLink>
+
+Determines if a search link or ticket list is shown for for each 'More about
+requestor' box on the ticket display page.  The default is to show a short
+ticket list.
+
+=cut
+
+Set($MoreAboutRequestorTicketsLink, 0);
+
 =item C<$MoreAboutRequestorTicketList>
 
 This can be set to Active, Inactive, All or None.  It controls what ticket
diff --git a/lib/RT/Config.pm b/lib/RT/Config.pm
index f515f62..7f0578c 100644
--- a/lib/RT/Config.pm
+++ b/lib/RT/Config.pm
@@ -368,10 +368,21 @@ our %META = (
             Hints => 'Use css rules to display text monospaced and with formatting preserved, but wrap as needed.  This does not work well with IE6 and you should use the previous option', #loc
         },
     },
+    MoreAboutRequestorTicketsLink => {
+        Section         => 'Ticket display',    #loc
+        Overridable     => 1,
+        SortOrder       => 6,
+        Widget          => '/Widgets/Form/Boolean',
+        WidgetArguments => {
+            Description => q|Display a link to requestors' tickets?|,  #loc
+            Hints       => 'If yes, the link will replace the inline ticket list.  '
+                          .'The search conditions are still determined by the option below.',
+        },
+    },
     MoreAboutRequestorTicketList => {
         Section         => 'Ticket display',                       #loc
         Overridable     => 1,
-        SortOrder       => 6,
+        SortOrder       => 7,
         Widget          => '/Widgets/Form/Select',
         WidgetArguments => {
             Description => q|What tickets to display in the 'More about requestor' box|,                #loc
diff --git a/share/html/Ticket/Elements/ShowRequestor b/share/html/Ticket/Elements/ShowRequestor
index e8e455f..fbb49f8 100755
--- a/share/html/Ticket/Elements/ShowRequestor
+++ b/share/html/Ticket/Elements/ShowRequestor
@@ -66,13 +66,13 @@ while ( my $requestor = $people->Next ) {
 <span class="label commentsaboutuser"><&|/l&>Comments about this user</&>:</span><br />
 <b class="value commentsaboutuser"><% ($requestor->Comments || loc("No comment entered about this user")) %></b><br />
 
-<& $TicketTemplate, Requestor => $requestor &>
+<& $TicketTemplate, AsLink => $TicketsAsLink, Requestor => $requestor &>
 
-<span class="moreaboutusergroups">
+<div class="moreaboutusergroups">
 <&|/l&>Groups this user belongs to</&>:<br />
 
 <& /Elements/ShowMemberships, UserObj => $requestor &>
-</span>
+</div>
 
 </&>
 
@@ -89,8 +89,13 @@ my $show_privileged = RT->Config->Get('ShowMoreAboutPrivilegedUsers');
 
 $TicketTemplate ||= "ShowRequestorTickets".(RT->Config->Get('MoreAboutRequestorTicketList', $session{CurrentUser})||'Active');
 $TicketTemplate = "ShowRequestorTicketsActive" unless $m->comp_exists($TicketTemplate);
+
+$TicketsAsLink = RT->Config->Get('MoreAboutRequestorTicketsLink',
+                                 $session{'CurrentUser'})
+    unless defined $TicketsAsLink;
 </%INIT>
 <%ARGS>
 $Ticket=>undef
 $TicketTemplate=>undef
+$TicketsAsLink => undef
 </%ARGS>
diff --git a/share/html/Ticket/Elements/ShowRequestorTickets b/share/html/Ticket/Elements/ShowRequestorTickets
index 3d162da..39fa252 100644
--- a/share/html/Ticket/Elements/ShowRequestorTickets
+++ b/share/html/Ticket/Elements/ShowRequestorTickets
@@ -45,25 +45,44 @@
 %# those contributions and any derivatives thereof.
 %# 
 %# END BPS TAGGED BLOCK }}}
+% if ( $AsLink ) {
+<%perl>
+    my $url  = RT->Config->Get('WebPath') . '/Search/Results.html?';
+       $url .= $m->comp('/Elements/QueryString',
+                        Query       => $sql,
+                        RowsPerPage => $Rows,
+                        OrderBy     => $OrderBy,
+                        Order       => $Order );
+</%perl>
+<a href="<%$url%>"><&|/l&>Show tickets</&></a>
+% } else {
 <ul>
-%while (my $w=$tickets->Next) {
-%my $uri = RT::URI->new( $session{'CurrentUser'} );
-%$uri->FromObject($w);
+<%perl>
+    my $tickets = RT::Tickets->new( $session{'CurrentUser'} );
+    $tickets->FromSQL( $sql );
+    $tickets->RowsPerPage( $Rows );
+    $tickets->OrderBy( FIELD => $OrderBy, ORDER => $Order );
+
+    while (my $w=$tickets->Next) {
+        my $uri = RT::URI->new( $session{'CurrentUser'} );
+        $uri->FromObject($w);
+</%perl>
 <li class="value"><& /Elements/ShowLink, URI => $uri &></li>
-%}
+%   }
 </ul>
+% }
 <%INIT>
+my $OrderBy = 'Priority';
+my $Order   = 'DESC';
+
 my $sql = "Requestor.id = ". $Requestor->id;
 if (@$conditions) {
     $sql .= " AND (".join( " OR ", map $_->{cond}, @$conditions).")";
 }
-my $tickets = RT::Tickets->new( $session{'CurrentUser'} );
-$tickets->FromSQL( $sql );
-$tickets->RowsPerPage( $Rows );
-$tickets->OrderBy( FIELD => 'Priority', ORDER => 'DESC' );
 </%INIT>
 <%ARGS>
 $Requestor => undef
 $conditions
 $Rows => 10
+$AsLink
 </%ARGS>
diff --git a/share/html/Ticket/Elements/ShowRequestorTicketsActive b/share/html/Ticket/Elements/ShowRequestorTicketsActive
index 9c397e9..122ce17 100644
--- a/share/html/Ticket/Elements/ShowRequestorTicketsActive
+++ b/share/html/Ticket/Elements/ShowRequestorTicketsActive
@@ -46,8 +46,10 @@
 %# 
 %# END BPS TAGGED BLOCK }}}
 <span id="more-about-requestor-<%$Requestor->Id%>">
+% unless ( $AsLink ) {
 <span class="label"><&|/l, $Rows &>This user's [_1] highest priority active tickets</&>:</span>
 <& ShowRequestorToggleLinks, %ARGS, Status => 'Active' &>
+% }
 <& ShowRequestorTickets, %ARGS, conditions => $conditions, Rows => $Rows  &>
 </span>
 <%INIT>
@@ -61,4 +63,5 @@ unless ( @$conditions ) {
 $Requestor => undef
 $conditions => []
 $Rows => 10
+$AsLink
 </%ARGS>
diff --git a/share/html/Ticket/Elements/ShowRequestorTicketsAll b/share/html/Ticket/Elements/ShowRequestorTicketsAll
index 0c93577..88fe019 100644
--- a/share/html/Ticket/Elements/ShowRequestorTicketsAll
+++ b/share/html/Ticket/Elements/ShowRequestorTicketsAll
@@ -46,12 +46,15 @@
 %# 
 %# END BPS TAGGED BLOCK }}}
 <span id="more-about-requestor-<%$Requestor->Id%>">
+% unless ( $AsLink ) {
 <span class="label"><&|/l, $Rows &>This user's [_1] highest priority tickets</&>:</span>
 <& ShowRequestorToggleLinks, %ARGS, Status => 'All' &>
+% }
 <& ShowRequestorTickets, %ARGS, conditions => $conditions, Rows => $Rows  &>
 </span>
 <%ARGS>
 $Requestor => undef
 $conditions => []
 $Rows => 10
+$AsLink
 </%ARGS>
diff --git a/share/html/Ticket/Elements/ShowRequestorTicketsInactive b/share/html/Ticket/Elements/ShowRequestorTicketsInactive
index 1be0eb3..50007bb 100644
--- a/share/html/Ticket/Elements/ShowRequestorTicketsInactive
+++ b/share/html/Ticket/Elements/ShowRequestorTicketsInactive
@@ -46,8 +46,10 @@
 %# 
 %# END BPS TAGGED BLOCK }}}
 <span id="more-about-requestor-<%$Requestor->Id%>">
+% unless ( $AsLink ) {
 <span class="label"><&|/l, $Rows &>This user's [_1] highest priority inactive tickets</&>:</span>
 <& ShowRequestorToggleLinks, %ARGS, Status => 'Inactive' &>
+% }
 <& ShowRequestorTickets, %ARGS, conditions => $conditions, Rows => $Rows  &>
 </span>
 <%INIT>
@@ -61,4 +63,5 @@ unless ( @$conditions ) {
 $Requestor => undef
 $conditions => []
 $Rows => 10
+$AsLink
 </%ARGS>
diff --git a/share/html/Ticket/Elements/ShowRequestorTicketsNone b/share/html/Ticket/Elements/ShowRequestorTicketsNone
index e4688d7..efc93aa 100644
--- a/share/html/Ticket/Elements/ShowRequestorTicketsNone
+++ b/share/html/Ticket/Elements/ShowRequestorTicketsNone
@@ -47,10 +47,13 @@
 %# END BPS TAGGED BLOCK }}}
 <span id="more-about-requestor-<%$Requestor->Id%>">
 %# showing no tickets means doing no work
+% unless ( $AsLink ) {
 <& ShowRequestorToggleLinks, %ARGS, Status => 'Inactive' &>
+% }
 </span>
 <%ARGS>
 $Requestor => undef
 $conditions => []
 $Rows => 10
+$AsLink
 </%ARGS>

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


More information about the Rt-commit mailing list