[Rt-commit] r17314 - in rt/3.8/trunk/share/html: Elements
elacour at bestpractical.com
elacour at bestpractical.com
Tue Dec 23 11:24:21 EST 2008
Author: elacour
Date: Tue Dec 23 11:24:21 2008
New Revision: 17314
Modified:
rt/3.8/trunk/share/html/Elements/QueueSummary
rt/3.8/trunk/share/html/Ticket/Elements/ShowRequestor
Log:
Fix my poorly written code that don't works :(
Modified: rt/3.8/trunk/share/html/Elements/QueueSummary
==============================================================================
--- rt/3.8/trunk/share/html/Elements/QueueSummary (original)
+++ rt/3.8/trunk/share/html/Elements/QueueSummary Tue Dec 23 11:24:21 2008
@@ -69,11 +69,10 @@
% }
</table>
<%INIT>
-
-unless ( $conditions ) {
- foreach my $status (RT::Queue->ActiveStatusArray()) {
- $conditions->{$status}->{cond} = "Status = $status";
- $conditions->{$status}->{name} = "$status";
+# Ensure sane default
+unless ( @$conditions ) {
+ foreach (RT::Queue->ActiveStatusArray()) {
+ push @$conditions, { cond => "Status = '$_'", name => loc($_) };
}
}
Modified: rt/3.8/trunk/share/html/Ticket/Elements/ShowRequestor
==============================================================================
--- rt/3.8/trunk/share/html/Ticket/Elements/ShowRequestor (original)
+++ rt/3.8/trunk/share/html/Ticket/Elements/ShowRequestor Tue Dec 23 11:24:21 2008
@@ -46,6 +46,12 @@
%#
%# END BPS TAGGED BLOCK }}}
<%PERL>
+# Unsure sane default
+unless ( @$conditions ) {
+ foreach (RT::Queue->ActiveStatusArray()) {
+ push @$conditions, { cond => "Status = '$_'", name => loc($_) };
+ }
+}
my $rows = 10;
my $has_right_adminusers = $session{'CurrentUser'}->HasRight(Object => $RT::System, Right => 'AdminUsers');
my $people = $Ticket->Requestors->UserMembersObj;
@@ -54,7 +60,7 @@
my $name = $m->scomp('/Elements/ShowUser', User => $requestor);
my $tickets = RT::Tickets->new( $session{'CurrentUser'} );
- $tickets->FromSQL( "Requestor.id = ". $requestor->id ." AND (".join( " OR ", @$conditions).")" );
+ $tickets->FromSQL( "Requestor.id = ". $requestor->id ." AND (".join( " OR ", map $_->{cond}, @$conditions).")" );
$tickets->RowsPerPage( $rows );
$tickets->OrderBy( FIELD => 'Priority', ORDER => 'DESC' );
</%PERL>
@@ -88,5 +94,5 @@
<%ARGS>
$Ticket=>undef
$DisplayPath => "/Ticket/Display.html"
-$conditions => [ map "Status = '$_'", RT::Queue->ActiveStatusArray() ]
+$conditions => []
</%ARGS>
More information about the Rt-commit
mailing list