Its done here i think:
function create_by_staff($var,&$errors) {
global $_FILES,$thisuser,$cfg;
//check if the staff is allowed to create tickets.
if(!$thisuser || !$thisuser->getId() || !$thisuser->isStaff() || !$thisuser->canCreateTickets())
$errors='Permission denied';
if(!$var)
$errors='Message Required';
if($var && !in_array(strtolower($var),array('email','phone','other')))
$errors='Invalid source - '.Format:($var);
$var=0;//clean crap.
$var='Ticket created by Staff';
if(($ticket=Ticket:($var,$errors,'staff',false,(!$var)))){ //Staff are alerted only IF the ticket is not being assigned.
//post issue as a response...
$msgId=$ticket->getLastMsgId();
$issue=$ticket->replaceTemplateVars($var);
if(($respId=$ticket->postResponse($msgId,$issue,'none',null,false))) { //Note that we're overwriting alerts.
//Mark the ticket unanswered - postResponse marks it answered which is not the desired state.
$ticket->markUnAnswered();
//Send Notice to user --- if requested AND enabled!!
if($cfg->notifyONNewStaffTicket() && isset($var)) {
$dept=$ticket->getDept();
if(!$dept || !($tplId=$dept->getTemplateId()))
$tplId=$cfg->getDefaultTemplateId();
$sql='SELECT ticket_notice_subj,ticket_notice_body FROM '.EMAIL_TEMPLATE_TABLE.
' WHERE cfg_id='.db_input($cfg->getId()).' AND tpl_id='.db_input($tplId);
if(($resp=db_query($sql)) && db_num_rows($resp) && list($subj,$body)=db_fetch_row($resp)){
$body=$ticket->replaceTemplateVars($body);
$subj=$ticket->replaceTemplateVars($subj);
$body = str_replace('%message',$var,$body);
//Figure out the signature to use...if any.
switch(strtolower($var)):
case 'mine';
$signature=$thisuser->getSignature();
break;
case 'dept':
$signature=($dept && $dept->isPublic())?$dept->getSignature():''; //make sure it is public
break;
case 'none';
default:
$signature='';
break;
endswitch;
$body = str_replace("%signature",$signature,$body);
//Email attachment when attached AND if emailed attachments are allowed!
$file=null;
$attachment=$_FILES;
if(($attachment && is_file($attachment)) && $cfg->emailAttachments()) {
$file=array('file'=>$attachment, 'name'=>$attachment, 'type'=>$attachment);
}
if($cfg->stripQuotedReply() && ($tag=trim($cfg->getReplySeparator())))
$body ="\n$tag\n\n".$body;
if(!$dept || !($email=$dept->getEmail()))
$email =$cfg->getDefaultEmail();
if($email && $email->getId()) {
$email->send($ticket->getEmail(),$subj,$body,$file);
}
}else{
//We have a big problem...alert admin...
$msg='Problems fetching response template for ticket#'.$ticket->getId().' Possible config error - template #'.$tplId;
Sys:('System Error',$msg);
}
} //Send send alert.
//Upload attachment if any...
if($_FILES && $_FILES){
$ticket->uploadAttachment($_FILES,$respId,'R');
}
}else{//end post response
$errors='Internal error - message/response post error.';
}
//post create actions
if($var) { //Assign ticket to staff if any. (internal note as message)
$ticket->assignStaff($var,$var,(isset($var)));
}elseif($var){ //Not assigned...save optional note if any
$ticket->postNote('New Ticket',$var,false);
}else{ //Not assignment and no internal note - log activity
$ticket->logActivity('New Ticket by Staff','Ticket created by Staff -'.$thisuser->getName());
}
}else{
$errors=$errors?$errors:'Unable to create the ticket. Correct the error(s) and try again';
}
return $ticket;
}
Can anyone see how to get rid of the created by staff