Yikes, I didn't have the forum settings correct, and it didn't notify me of this post. Apologies for the delay.
I didn't comment my changes too well..... hopefully I've captured them all.
Here goes:
in scp/tickets.php, around line 225, before case 'close': add the following block:
case 'change_help_topic':
if(!$thisuser->canManageTickets() && !$thisuser->isManager()){
$errors='Perm. Denied. You are not allowed to change ticket\'s help topic';
}elseif(!$_POST or !is_numeric($_POST)){
$errors='You must select help topic';
}
if(!$errors){
if($ticket->setHelpTopic($_POST)){
$msg='Help Topic Changed Successfully';
$ticket->reload();
$note='Ticket help topic set to '.$ticket->getHelpTopic().' by '.$thisuser->getName();
$ticket->logActivity('Help Topic Changed',$note);
}else{
$errors='Problems changing Help Topic. Try again';
}
}
break;
in include/staff/viewticket.inc.php, around line 160, modify the line beginning onChange="this.form.ticket_priority.disabled to be
onChange="this.form.ticket_priority.disabled=strcmp(this.options.value,'change_priority','reopen','overdue')?false;this.form.help_topic.disabled=strcmp(this.options.value,'change_help_topic')?false;"
in the same file, around line 206, insert the following code
<span for="help_topic">Help Topic:</span>
<select id="help_topic" name="help_topic" <?=!$info?'disabled':''?> >
<option value="0" selected="selected">-Unchanged-</option>
<?
$topicId=$ticket->getTopicId();
$resp=db_query('SELECT topic_id,topic,isactive FROM '.TOPIC_TABLE.' ORDER BY topic');
while($row=db_fetch_array($resp)){ ?>
<option value="<?=$row?>" <?=$topicId==$row?'disabled':''?> ><?=$row?></option>
<?}?>
</select>
and finally, in include/class.ticket.php, around line 345 before the line with comment //DeptId can NOT be 0. No orphans please, add a new function:
function setHelpTopic($topic_id){
if(!$topic_id)
return false;
$sql='UPDATE '.TICKET_TABLE.' SET topic_id='.db_input($topic_id).',updated=NOW() WHERE ticket_id='.db_input($this->getId());
if(db_query($sql) && db_affected_rows($res)){
//TODO: escalate the ticket params??
return true;
}
return false;
}
I think that's everything you need. YMMV. Let me know if it works.
BB