X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Ftimeworked.html;h=24a0f5d40fe9f48f42820ec24c80b8c903c32ec8;hb=bb7e827141c9ed68f30765c9ca2ddcd1d760ad2d;hp=f85a62835f9c9e2a3406e1d5fc7fc40b7a76da5c;hpb=b22e443f60965aa415b3b190b3ec6875e034dafb;p=freeside.git diff --git a/httemplate/misc/timeworked.html b/httemplate/misc/timeworked.html index f85a62835..24a0f5d40 100755 --- a/httemplate/misc/timeworked.html +++ b/httemplate/misc/timeworked.html @@ -1,75 +1,95 @@ <% include('/elements/header.html', $title, '' ) %> -% if ( $cgi->param('error') ) { - Error: <% $cgi->param('error') %> -

-% } +<% include('/elements/error.html') %>
- - - - - - - - - - - - - - - - - - - - -% foreach ( keys %ticketmap ) { -% my (@customers) = @{$customers{$ticketmap{$_}}}; -% next unless @customers; -% my $multiplier = sprintf("%.2f", 1/@customers); -% my ($custnum, $name) = split(':', pop @customers, 2); - - - - - - - - - - - -% my $tr_id = $_; -% foreach ( @customers ) { -% ($custnum, $name) = split(':', $_, 2); - - - - - - - -% } -% } + + + + + + + + + + + +% foreach my $tr_id ( keys %ticketmap ) { +% my (@customers) = @{$customers{$ticketmap{$tr_id}}}; +% next unless @customers; +% my $default_multiplier = sprintf("%.2f", 1/@customers); +% my ($custnum, $name) = split(':', pop @customers, 2); +% my $link = $p. 'rt/Ticket/Display.html?id='. $ticketmap{$tr_id}. +% '#txn-'. $tr_id; +% my $clink = $p. 'view/cust_main.cgi?'. $custnum; + + + + + +% my $seconds = 0; +% if ( $cgi->param("seconds$tr_id") =~ /^(\d+)$/ ) { +% $seconds = $1; +% } + + + + + + + +% foreach ( @customers ) { +% ($custnum, $name) = split(':', $_, 2); +% $clink = $p. 'view/cust_main.cgi?'. $custnum; + + + + + + + + +% } +% } + +
TransTicketTimeCustomerMultiplier
##Subjecthours#Name
<% $_ %><% $ticketmap{$_} %><% $ticket{$_} %><% sprintf("%0.2f", $cgi->param("seconds$_")/3600) %><% $custnum %><% $name %> - - " > - param("multiplier${_}_$custnum") : $multiplier %>" > -
<% $custnum %><% $name %> - param("multiplier${tr_id}_$custnum") : $multiplier %>" > -
TicketHoursCustomerMultiplier
<% $ticketmap{$tr_id} %><% $ticket{$ticketmap{$tr_id}} |h %><% sprintf("%0.2f", $seconds/3600) %><% $custnum %><% $name %> + + + +% my $multiplier = $default_multiplier; +% my $mult_paramname = "multiplier${tr_id}_$custnum"; +% if ( $cgi->param($mult_paramname) =~ /^\s*([\d\.]+)\s*$/ ) { +% $multiplier = $1; +% } + + +
<% $custnum %><% $name %> + +% $multiplier = $default_multiplier; +% $mult_paramname = "multiplier${tr_id}_$custnum"; +% if ( $cgi->param($mult_paramname) =~ /^\s*([\d\.]+)\s*$/ ) { +% $multiplier = $1; +% } + + + +
+
+ + + + +
- - + +<% include('/elements/footer.html') %> <%init> @@ -78,8 +98,7 @@ die "access denied" my(%ticketmap, %ticket, %customers); my $title = 'Assign Time Worked'; - -RT::Init(); +tie %ticketmap, 'Tie::IxHash'; my $CurrentUser = RT::CurrentUser->new(); $CurrentUser->LoadByName($FS::CurrentUser::CurrentUser->username); @@ -94,12 +113,15 @@ foreach my $id ( map { /^transactionid(\d+)$/; $1; } $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 } - ]; + [ map { $_->Resolver->AsString } + grep { $_->Resolver->{'fstable'} eq 'cust_main' } + grep { $_->Scheme eq 'freeside' } + map { $_->TargetURI } + grep { $_->BaseURI->Scheme eq 'fsck.com-rt' + && $_->BaseURI->Resolver->ObjectType eq 'ticket' + } + @{ $ticket->_Links('Base')->ItemsArrayRef } + ]; } }