I've done some small scale testing with this, so if you have any problems let me know. This will automatically assign the ticket when reopening like you want.
Ok, lets start with when replying to a ticket and checking the reopen. In scp/tickets.php ~ 93 AFTER
if(isset($_POST) && $_POST)
$ticket->setStatus($_POST);
ADD
if(isset($_POST) && $_POST=="Reopen") {
$assign_message = "Ticket reopened by ".$thisuser->getUsername();
if(!$thisuser->isadmin() && !$thisuser->isManager() && $thisuser->getId()!=$ticket->getStaffId() && !$thisuser->isStaff()){
$errors='Ticket already assigned. You do not have permission to re-assign assigned tickets';
}
if(!$errors && $ticket->assignStaff($thisuser->getId(),$assign_message)){
$msg='Ticket Assigned to staff';
$ticket->reload();//Reload ticket info following post processing
}else{
$errors=$errors?$errors:'Unable to assign the ticket';
}
}
For the reopen on the notes in scp/tickets.php ~ line 150 REPLACE
$msg='Internal note posted';
if(isset($_POST) && $_POST)
$ticket->setStatus($_POST);
WITH
$msg='Internal note posted';
if(isset($_POST) && $_POST) {
$ticket->setStatus($_POST);
if($_POST=="Reopen") {
$assign_message = "Ticket reopened by ".$thisuser->getUsername();
if(!$thisuser->isadmin() && !$thisuser->isManager() && $thisuser->getId()!=$ticket->getStaffId() && !$thisuser->isStaff()){
$errors='Ticket already assigned. You do not have permission to re-assign assigned tickets';
}
if(!$errors && $ticket->assignStaff($thisuser->getId(),$assign_message)){
$msg='Ticket Assigned to staff';
$ticket->reload();//Reload ticket info following post processing
}else{
$errors=$errors?$errors:'Unable to assign the ticket';
}
}
}
Next is the processing allowed when viewing individual tickets. In scp/tickets.php ~ line 221 REPLACE
$msg='Ticket status set to OPEN';
WITH
$assign_message = "Ticket reopened by ".$thisuser->getUsername();
if($ticket->assignStaff($thisuser->getId(),$assign_message)){
$msg='Ticket status set to OPEN';
}else{
$errors='Problems reopening the ticket. Try again';
}
Last is mass processing of tickets via the main tickets page. In scp/tickets.php ~ line 317 REPLACE
if($t && @$t->reopen()) $i++;
WITH
if($t && @$t->reopen()) {
$assign_message = "Ticket reopened by ".$thisuser->getUsername();
if(@$t->assignStaff($thisuser->getId(),$assign_message))
$i++;
}