diff options
| -rw-r--r-- | httemplate/misc/xmlhttp-ticket-update.html | 8 | 
1 files changed, 7 insertions, 1 deletions
diff --git a/httemplate/misc/xmlhttp-ticket-update.html b/httemplate/misc/xmlhttp-ticket-update.html index e81e353c5..8735eecab 100644 --- a/httemplate/misc/xmlhttp-ticket-update.html +++ b/httemplate/misc/xmlhttp-ticket-update.html @@ -13,7 +13,13 @@ my $ticket = FS::TicketSystem->get_ticket_object( \%session, ticket_id=>$id );  my $return;  if ( $ticket ) { -  my($orv, $omsg) = $ticket->SetOwner( $username ); +  my $curowner = $ticket->OwnerObj->Name; +  my($orv, $omsg); +  if (( $curowner eq $FS::CurrentUser::CurrentUser->username ) or ( $curowner eq 'nobody' )) { +    ($orv, $omsg) = $ticket->SetOwner( $username ); +  } else { +    ($orv, $omsg) = $ticket->SetOwner( $username, 'Steal' ); +  }    $orv = 1 if ! $orv && $omsg =~ /already own/i;    if ( $orv ) {  | 
