From 43a06151e47d2c59b833cbd8c26d97865ee850b6 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Thu, 7 Jun 2012 00:56:06 -0700 Subject: starting to work... --- rt/share/html/Elements/SelectStatus | 57 +++++++++++++++++++++++++++++-------- 1 file changed, 45 insertions(+), 12 deletions(-) (limited to 'rt/share/html/Elements/SelectStatus') diff --git a/rt/share/html/Elements/SelectStatus b/rt/share/html/Elements/SelectStatus index 5718a2a9d..e571baf63 100755 --- a/rt/share/html/Elements/SelectStatus +++ b/rt/share/html/Elements/SelectStatus @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -46,24 +46,57 @@ %# %# END BPS TAGGED BLOCK }}} % my $onchange_attr = $onchange ? " onchange=\"$onchange\"" : ''; - <% $onchange_attr |n%>> +% if ( $DefaultValue ) { + +% } +% foreach my $status (@status) { +% next if ($SkipDeleted && $status eq 'deleted'); +% my $selected = defined $Default && $status eq $Default ? 'selected="selected"' : ''; + % } -<%ONCE> -my $queue = new RT::Queue($session{'CurrentUser'}); -my @status = $queue->StatusArray(); - +<%INIT> +### XXX: no cover for Tools/MyDay.html + + +my @status; +if ( @Statuses ) { + @status = @Statuses; +} +elsif ( $TicketObj ) { + my $current = $TicketObj->Status; + my $lifecycle = $TicketObj->QueueObj->Lifecycle; + + my %has = (); + foreach my $next ( $lifecycle->Transitions( $current ) ) { + my $check = $lifecycle->CheckRight( $current => $next ); + $has{ $check } = $TicketObj->CurrentUserHasRight( $check ) + unless exists $has{ $check }; + push @status, $next if $has{ $check }; + } +} +elsif ( $QueueObj ) { + @status = $QueueObj->Lifecycle->Transitions(''); +} +else { + @status = RT::Queue->Lifecycle->Valid; +} + <%ARGS> $Name => undef + +@Statuses => () +$TicketObj => undef +$QueueObj => undef + $Default => '' $SkipDeleted => 0 $DefaultValue => 1 $DefaultLabel => "-" + +$Multiple => 0 +$Size => 6 + $onchange => '' -- cgit v1.2.1