% include('/elements/header.html', $title, '' ) %> <% include('/elements/error.html') %>
<% include('/elements/footer.html') %> <%init> die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Time queue'); my(%ticketmap, %ticket, %customers); my $title = 'Assign Time Worked'; tie %ticketmap, 'Tie::IxHash'; RT::Init(); my $CurrentUser = RT::CurrentUser->new(); $CurrentUser->LoadByName($FS::CurrentUser::CurrentUser->username); foreach my $id ( map { /^transactionid(\d+)$/; $1; } grep /^transactionid\d+$/, $cgi->param) { my $transaction = new RT::Transaction($CurrentUser); $transaction->Load($id); $ticketmap{$id} = $transaction->ObjectId; unless(exists($ticket{$ticketmap{$id}})) { my $ticket = new RT::Ticket($CurrentUser); $ticket->Load($ticketmap{$id}); $ticket{$ticketmap{$id}} = $ticket->Subject; $customers{$ticketmap{$id}} = [ map { $_->Resolver->AsString } grep { $_->Resolver->{'fstable'} eq 'cust_main' } grep { $_->Scheme eq 'freeside' } map { $_->TargetURI } @{ $ticket->_Links('Base')->ItemsArrayRef } ]; } } %init>