[rt-users] SelfService update for "New ticket"

Kenneth Marshall ktm at it.is.rice.edu
Fri Jun 10 08:41:15 EDT 2005


This is a patch to RT-3.4.2 share/html/SelfService/Elements/Tabs
to drop directly to the Create screen if the user only has access
to a single queue. Otherwise the tree of queues will be displayed.

Ken Marshall

-------------------------------------------------------------
diff share/html/SelfService/Elements/Tabs local/html/SelfService/Elements/Tabs 
54a55,66
> my $queues = RT::Queues->new($session{'CurrentUser'});
> $queues->UnLimit;
> 
> my $queue_count = 0;
> my $queue_id = 1;
> 
> while (my $queue = $queues->Next) {
>   next unless $queue->CurrentUserHasRight('CreateTicket');
>   $queue_id = $queue->id;
>   $queue_count++;
>   last if ($queue_count > 1);
> }
68,71c80
<                        },
<              C => { title => loc('New ticket'),
<                     path => 'SelfService/CreateTicketInQueue.html'
<                     }
---
>                        }
72a82,92
> 
> if ($queue_count > 1) {
>         $tabs->{C} = { title => loc('New ticket'),
>                        path => 'SelfService/CreateTicketInQueue.html'
>                        };
> } else { 
>         $tabs->{C} = { title => loc('New ticket'),
>                        path => 'SelfService/Create.html?Queue=' . $queue_id
>                        };
> }
> 
-------------------------------------------------------------



More information about the rt-users mailing list