[Bps-public-commit] r13243 - RT-BugTracker-Public/html/Public/Dist
ruz at bestpractical.com
ruz at bestpractical.com
Thu Jun 12 19:16:10 EDT 2008
Author: ruz
Date: Thu Jun 12 19:16:10 2008
New Revision: 13243
Modified:
RT-BugTracker-Public/html/Public/Dist/Display.html
Log:
* sync RT-BugTracker-Public's Dist/Display.html with RT-BugTracker's
before merging them
Modified: RT-BugTracker-Public/html/Public/Dist/Display.html
==============================================================================
--- RT-BugTracker-Public/html/Public/Dist/Display.html (original)
+++ RT-BugTracker-Public/html/Public/Dist/Display.html Thu Jun 12 19:16:10 2008
@@ -45,52 +45,56 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<& /Elements/Header, Title => $Status . ' bugs for ' . $Name &>
+<& /Elements/Header, Title => $title &>
<& /Public/Elements/Tabs,
- Title => loc( "$Status bugs for [_1]", $Name ),
+ Title => $title,
queue => $Name,
current_tab => '/Public/Browse.html',
current_subtab => $current_subtab,
&>
-<& /Dist/Elements/ShowMaintainers, Queue => $queue &>
+<& /Dist/Elements/ShowMaintainers, Queue => $QueueObj &>
<h3>Bugs</h3>
-<%perl>
-if ($Status eq 'Active') {
- $m->comp('/Elements/TicketList',
- OrderBy => $OrderBy,
- Order => $Order,
- Query => "Queue = '$Name' "
- . "AND ( Status = 'new' OR Status = 'open' "
- . "OR Status = 'stalled' )",
- Format => $Format,
- Rows => $Rows,
- Page => $Page,
- Name => $Name,
- AllowSorting => 1,
- BaseURL => $base_url,
- );
+<& /Elements/TicketList,
+ OrderBy => $OrderBy,
+ Order => $Order,
+ Query => $Query,
+ Format => $Format,
+ Rows => $Rows,
+ Page => $Page,
+ Name => $Name,
+ AllowSorting => 1,
+ BaseURL => $base_url,
+&>
+
+<%INIT>
+$Name =~ s/::/-/g;
+my $QueueObj = RT::Queue->new( $session{CurrentUser} );
+$QueueObj->Load($Name);
+unless ( $QueueObj->id ) {
+ $m->comp('/Public/Elements/ErrorNoDist', Queue => $Name, %ARGS);
+ $m->abort();
+}
+$ARGS{'Name'} = $Name = $QueueObj->Name;
+
+unless ( ($Status||'') eq 'Active' || $QueueObj->IsValidStatus( $Status ) ) {
+ $m->comp('/Elements/Error', Why => q{no such status as '} . $Status . q{'});
+ $m->abort();
+}
+
+my $Query = "Queue = '$Name'";
+if ( $Status eq 'Active' ) {
+ $Query .= " AND ( "
+ .join( ' OR ', map "Status = '$_'", $QueueObj->ActiveStatusArray )
+ ." )";
}
else {
- $m->comp('/Elements/TicketList',
- OrderBy => $OrderBy,
- Order => $Order,
- Query => "Queue = '$Name' "
- . "AND Status = '" . $Status . q{'},
- Format => $Format,
- Rows => $Rows,
- Page => $Page,
- Name => $Name,
- AllowSorting => 1,
- BaseURL => $base_url,
- );
+ $Query .= " AND Status = '$Status'";
}
-</%perl>
-<%init>
-$Name =~ s/::/-/g;
+my $title = loc( "$Status bugs for [_1]", $Name );
my $Format = <<EOF;
'<a href="$RT::WebPath/Ticket/Display.html?id=__id__">__id__</a>/TITLE:ID',
@@ -102,32 +106,19 @@
'__CustomField.{Fixed in}__'
EOF
-my $queue = RT::Queue->new($session{CurrentUser});
-$queue->Load($Name);
-
-if (not $queue->Id) {
- $m->comp('/Public/Elements/ErrorNoDist', Queue => $Name, %ARGS);
- $m->abort();
-}
-
-if ($Status !~ /\w/) {
- $m->comp('/Elements/Error', Why => q{no such status as '} . $Status . q{'});
- $m->abort();
-}
-
my $current_subtab = "Public/Dist/Display.html?Status="
. $m->interp->apply_escapes($Status, 'u') . "&Name="
- . $m->interp->apply_escapes($queue->Name, 'u');
+ . $m->interp->apply_escapes($QueueObj->Name, 'u');
my ($base_url) = ($current_subtab =~ m|^Public/Dist/(.+)$|);
$base_url .= '&';
-</%init>
-<%args>
+</%INIT>
+<%ARGS>
$Name => undef
$Order => 'DESC'
$OrderBy => 'LastUpdated'
$Rows => undef
$Page => 1
$Status => 'Active'
-</%args>
+</%ARGS>
More information about the Bps-public-commit
mailing list