I am trying to add a field from the staff new ticket menu to the non-staff new ticket menu and vice versa.
Basically, I want to copy the department field so that it will show up on both the users and staff pages new ticket forms. I also want to copy Help Topic to show on both these pages as well.
The code from include/client/open.inc.php:
Department:
Select Department
<?
$services= db_query('SELECT dept_id,dept_name FROM '.DEPT_TABLE.' ORDER BY dept_name');
while (list($deptId,$dept) = db_fetch_row($services)){
$selected = ($info==$deptId)?'selected':''; ?>
"<?=$selected?>><?=$dept?>
<?
}?>
* <?=$errors?>
This works fine but two little problems.
1. If the user has any errors on form validation, the returned select menu is reset to the default value. It is never retained like it is on the original page.
2. The value is required but you can submit it with a NULL value anyway.
The same thing happens when I use the code from include/staff/newticket.php to add the topic field to the user form.
I am sure the problem is somewhere in class.ticket.php but I can not find it. I did change topic and department to required but still no joy.
$fields = array('type'=>'int', 'required'=>1, 'error'=>'Dept. required');
$fields = array('type'=>'int', 'required'=>1, 'error'=>'Topic required');
Any ideas? Thanks in advance for any help.