Hey,
I'm currently doing some mods where we have different required fields depending on which topicId the customers choose.
I also want it to show specific fields in admin viewticket depending on which topicId the customer chose.
This is the working script for the required fields (in class.ticket.php)
if ($var == "9") {
$fields = array('type'=>'string','required'=>1, 'error'=>'Orsakskod krävs');
} else {
$fields = array('type'=>'string','required'=>0, 'error'=>'');
}
This is how I want it to work on admin viewticket.inc.php, but it doesn't work properly.
What can I do to make it work? Seems like it doesn't have any connection to the database so it can check the ticketId.
<? if ($var == "9") { ?>
<tr>
<td><b>Orsakskod:</td>
<td>
<?
// Gör om $ticket->getOrsakskod och gör om till rätt namn från ost_orsakskoder tabellen
$orsakskoder= db_query('SELECT orsakskod FROM ost_orsakskoder WHERE id='.$ticket->getOrsakskod().'');
$orsakskod = db_fetch_row($orsakskoder); ?>
<?=Format:($orsakskod);?>
</td>
</tr>
<?} else { } ?>
Thanks in advance!