Skip to content
Snippets Groups Projects
Commit 37b657bd authored by Jared Hancock's avatar Jared Hancock
Browse files

Add help topic selection to filter actions

parent cbcd02b0
No related branches found
No related tags found
No related merge requests found
......@@ -123,6 +123,10 @@ class Filter {
return $this->ht['canned_response_id'];
}
function getHelpTopic() {
return $this->ht['topic_id'];
}
function stopOnMatch() {
return ($this->ht['stop_on_match']);
}
......@@ -309,6 +313,10 @@ class Filter {
# Use canned response.
if ($this->getCannedResponse())
$ticket['cannedResponseId'] = $this->getCannedResponse();
# Apply help topic
if ($this->getHelpTopic())
$ticket['topicId'] = $this->getHelpTopic();
}
/* static */ function getSupportedMatches() {
foreach (static::$match_types as $k=>&$v) {
......@@ -498,6 +506,7 @@ class Filter {
.',dept_id='.db_input($vars['dept_id'])
.',priority_id='.db_input($vars['priority_id'])
.',sla_id='.db_input($vars['sla_id'])
.',topic_id='.db_input($vars['topic_id'])
.',match_all_rules='.db_input($vars['match_all_rules'])
.',stop_onmatch='.db_input(isset($vars['stop_onmatch'])?1:0)
.',reject_ticket='.db_input(isset($vars['reject_ticket'])?1:0)
......
......@@ -318,6 +318,26 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
&nbsp;<span class="error">&nbsp;<?php echo $errors['assign']; ?></span>
</td>
</tr>
<tr>
<td width="180">
Help Topic
</td>
<td>
<select name="topic_id">
<option value="0" selected="selected">&mdash; Unchanged &mdash;</option>
<?php
$sql='SELECT topic_id, topic FROM '.TOPIC_TABLE.' T ORDER by topic';
if(($res=db_query($sql)) && db_num_rows($res)){
while(list($id,$name)=db_fetch_row($res)){
$selected=($info['topic_id'] && $id==$info['topic_id'])?'selected="selected"':'';
echo sprintf('<option value="%d" %s>%s</option>',$id,$selected,$name);
}
}
?>
</select>
&nbsp;<span class="error"><?php echo $errors['topic_id']; ?></span>
</td>
</tr>
<tr>
<th colspan="2">
<em><strong>Admin Notes</strong>: Internal notes.&nbsp;</em>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment