DEpartement/Helptopic
Parent Topic
Topic:
where I can find an extension that allows categorization as aid topics as a dynamic combo.Currently, the system provides a list of all help topics when creating a new ticket, I think it would be better to have a list pop up with a search where a staff can easily find and select the subject rather than scrolling to the correct topic.
Same for the statistics page!
...
I did something similar for my company. If you alter the /include/client/open.inc.php file, you can customize how the fields are pulled.
For our use, I have a Department dropdown, and upon selecting, it changes the display property of two independently defined dropdowns (we currently only have two departments).
For us, we have Department -> Location -> Topic. The departments are a stock osTicket feature so I just used a PHP MySQL query to populate it. For the locations, I actually just made a team for each location needed and did another query to populate that.
For the Topic, I replaced their stock field with two fields that alternate display between block and none. I then have a hidden field that their selection is written to for the topicID that osTicket uses in submission.
I wrote some custom javascript that controls everything based on the onchange property of the Department and Location selections.
It has worked very handily thus far.
<tr>
<td class="required">Department:</td>
<td>
<select id="deptId" name="deptId" onchange="<?php echo $deptFunc; ?>">
<option value="" selected="selected" disabled="disabled">— Select a Department —</option>
<?php
$server = mysql_connect("xxxxx", "xxxxx", "xxxxxx");
if (!$server) die(mysql_error());
mysql_select_db("xxxxxxx");
$queryDept = "SELECT dept_id,dept_name from ost_department where ispublic=1";
$resultDept = mysql_query($queryDept);
$numDept = mysql_num_rows($resultDept);
for ($i=0; $i<$numDept; $i++)
{
$entry = mysql_fetch_array($resultDept);
?>
<option value="<?php echo $entry; ?>" name="<?php echo $entry; ?>"><?php echo $entry; ?></option>
<?php } ?>
?>
</select>
<font class="error">* <?php echo $errors; ?></font>
</td>
</tr>
<tr>
<td class="required">Location:</td>
<td>
<select id="area" name="area" onchange="<?php echo $areaFunc; ?>" disabled="disabled">
<option value="" selected="selected" disabled="disabled">— Select a Location —</option>
<?php
$server = mysql_connect("xxxxxxx", "xxxxxxxx", "xxxxxxx");
if (!$server) die(mysql_error());
mysql_select_db("xxxxxxxx");
$queryDept = "SELECT team_id,name from ost_team where team_id>2 order by name asc";
$resultDept = mysql_query($queryDept);
$numDept = mysql_num_rows($resultDept);
for ($i=0; $i<$numDept; $i++)
{
$entry = mysql_fetch_array($resultDept);
?>
<option value="<?php echo $entry; ?>" name="<?php echo $entry; ?>"><?php echo $entry; ?></option>
<?php } ?>
?>
</select>
<font class="error">* <?php echo $errors; ?></font>
</td>
</tr>
<tr>
<td class="required">Help Topic:</td>
<td>
<select id="mainId" name="mainId" onchange="addTopic(this);" style="display" disabled="disabled">
<option value="" selected="selected" disabled="disabled">— Select a Help Topic —</option>
<?php
$server = mysql_connect("xxxxxxxx", "xxxxxxxxx", "xxxxxxxx");
if (!$server) die(mysql_error());
mysql_select_db("xxxxxxx");
$queryDept = "SELECT topic_id,topic from ost_help_topic where dept_id=3 order by topic asc";
$resultDept = mysql_query($queryDept);
$numDept = mysql_num_rows($resultDept);
for ($i=0; $i<$numDept; $i++)
{
$entry = mysql_fetch_array($resultDept);
?>
<option value="<?php echo $entry; ?>" name="<?php echo $entry; ?>"><?php echo $entry; ?></option>
<?php } ?>
?>
</select>
<select id="techId" name="techId" onchange="addTopic(this);" disabled="disabled">
<option value="" selected="selected" disabled="disabled">— Select a Help Topic —</option>
<?php
$server = mysql_connect("xxxxxxx", "xxxxxxxx", "xxxxxxx");
if (!$server) die(mysql_error());
mysql_select_db("xxxxxxxx");
$queryDept = "SELECT topic_id,topic from ost_help_topic where dept_id=1 order by topic asc";
$resultDept = mysql_query($queryDept);
$numDept = mysql_num_rows($resultDept);
for ($i=0; $i<$numDept; $i++)
{
$entry = mysql_fetch_array($resultDept);
?>
<option value="<?php echo $entry; ?>" name="<?php echo $entry; ?>"><?php echo $entry; ?></option>
<?php } ?>
?>
</select>
<font class="error">* <?php echo $errors; ?></font>
<input type="<?php echo $topicType; ?>" id="topicId" name="topicId" size="10" value="" hidden="hidden" />
</td>
</tr>
We actually used the same javascript to force the Subject line to be populated by their selections. Then the ticket is routed based on the subject lines contents.