To finish the topic I will post the solution I used, maybe it will be useful to somebody.
I just used a switch inside the class.ticket.php that checks the $helptopic variable.
open.ticket.php:
I have changed the code:
$sql= 'INSERT INTO '.TICKET_TABLE.' SET created=NOW() '.
',ticketID='.db_input($extId).
',dept_id='.db_input($deptId).
',topic_id='.db_input($topicId).
',priority_id='.db_input($priorityId).
',email='.db_input($var).
',name='.db_input(Format:($var)).
',subject='.db_input(Format:($var)).
',helptopic='.db_input(Format:($topicDesc)).
',phone="'.db_input($var,false).'"'.
',phone_ext='.db_input($var?$var:'').
',ip_address='.db_input($ipaddress).
',source='.db_input($source);
Into this:
switch ($_REQUEST) {
case "`Form_1":
$sql= 'INSERT INTO '.TICKET_Form1.' SET created=NOW() '.
',ticketID='.db_input($extId).
',dept_id='.db_input($deptId).
',topic_id='.db_input($topicId).
',priority_id='.db_input($priorityId).
',ip_address='.db_input($ipaddress).
',source='.db_input($source).
',name='.db_input(Format:($var)).
',email='.db_input($var)
',ob_number='.db_input($var).
',po_required='.db_input($var).
',supplier_name='.db_input($var);
break;
case "Form_2":
$sql= 'INSERT INTO '.TICKET_Form2.' SET created=NOW() '.
',ticketID='.db_input($extId).
',dept_id='.db_input($deptId).
',topic_id='.db_input($topicId).
',priority_id='.db_input($priorityId).
',ip_address='.db_input($ipaddress).
',source='.db_input($source).
',name='.db_input(Format:($var)).
',email='.db_input($var).
',course_name='.db_input($var).
',course_cost='.db_input($var).
',course_type='.db_input($var).
',business_critical='.db_input($var).
',justification='.db_input($var);
break;
}
I also needed to insert into main.inc.php the new tables:
main.inc.php:
I have changed the code:
define('TICKET_TABLE',TABLE_PREFIX.'ticket');
Into this:
define('TICKET_form1',TABLE_PREFIX.'ticket_form1');
define('TICKET_form2',TABLE_PREFIX.'ticket_form2');
Cheers,
Ricardo