diff options
| author | Ivan Kohler <ivan@freeside.biz> | 2015-07-09 22:32:26 -0700 |
|---|---|---|
| committer | Ivan Kohler <ivan@freeside.biz> | 2015-07-09 22:32:26 -0700 |
| commit | 026dc7ad72ba972f230b6709e31fa64397d75ad4 (patch) | |
| tree | c5af1a7ac9154744afc3660e9a9405892f2bb50b /rt/share/html/Elements/SelectStatus | |
| parent | 07b4bc84d1078f7390221d766cdb3142513db4b0 (diff) | |
| parent | 1c538bfabc2cd31f27067505f0c3d1a46cba6ef0 (diff) | |
merge RT 4.2.11 and Header changes to disable RT javascript, RT#34237
Diffstat (limited to 'rt/share/html/Elements/SelectStatus')
| -rwxr-xr-x | rt/share/html/Elements/SelectStatus | 58 |
1 files changed, 27 insertions, 31 deletions
diff --git a/rt/share/html/Elements/SelectStatus b/rt/share/html/Elements/SelectStatus index 3c833d85c..faae3dc3d 100755 --- a/rt/share/html/Elements/SelectStatus +++ b/rt/share/html/Elements/SelectStatus @@ -70,39 +70,35 @@ my %statuses_by_lifecycle; if ( @Statuses ) { $statuses_by_lifecycle{''} = \@Statuses; -} -elsif ( $TicketObj ) { - my @status; - my $current = $TicketObj->Status; - push @status, $current; - - my $lifecycle = $TicketObj->QueueObj->Lifecycle; +} else { + if ( $Object ) { + my $lifecycle = $Object->LifecycleObj; + if ($Object->_Accessible("Status", "read")) { + my $current = $Object->Status; + my @status; + push @status, $current; - 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 }; + my %has = (); + foreach my $next ( $lifecycle->Transitions( $current ) ) { + my $check = $lifecycle->CheckRight( $current => $next ); + $has{ $check } = $Object->CurrentUserHasRight( $check ) + unless exists $has{ $check }; + push @status, $next if $has{ $check }; + } + $statuses_by_lifecycle{$lifecycle->Name} = \@status; + } else { + $statuses_by_lifecycle{$lifecycle->Name} = [ $lifecycle->Transitions('') ]; + } } - $statuses_by_lifecycle{$lifecycle->Name} = \@status; -} -elsif ( $QueueObj ) { - my $lifecycle = $QueueObj->Lifecycle; - $statuses_by_lifecycle{$lifecycle->Name} = [ $lifecycle->Transitions('') ]; -} elsif ( %Queues ) { - for my $id (keys %Queues) { - my $queue = RT::Queue->new($session{'CurrentUser'}); - $queue->Load($id); - if ($queue->id) { - my $lifecycle = $queue->Lifecycle; + for my $lifecycle ( @Lifecycles ) { + $statuses_by_lifecycle{$lifecycle->Name} ||= [ $lifecycle->Valid ]; + } + + if (not keys %statuses_by_lifecycle) { + for my $lifecycle (map { RT::Lifecycle->Load($_) } RT::Lifecycle->List($Type)) { $statuses_by_lifecycle{$lifecycle->Name} = [ $lifecycle->Valid ]; } } -} else { - for my $lifecycle (map { RT::Lifecycle->Load($_) } RT::Lifecycle->List) { - $statuses_by_lifecycle{$lifecycle->Name} = [ $lifecycle->Valid ]; - } } if (keys %statuses_by_lifecycle) { @@ -132,11 +128,11 @@ my $group_by_lifecycle = keys %statuses_by_lifecycle > 1; </%INIT> <%ARGS> $Name => undef +$Type => undef, @Statuses => () -$TicketObj => undef -$QueueObj => undef -%Queues => () +$Object => undef, +@Lifecycles => (), $Default => '' $SkipDeleted => 0 |
