default department
By default if a department is not selected then the dept_id value is zero. To achieve what you want you would insert an if statement when setting up the string for the sql statement (located in class.ticket.php about line 1385). You will need to find the department value from your sql table, in the example below I'm using '2'.
For example the original 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);
would become:
$sql= 'INSERT INTO '.TICKET_TABLE.' SET created=NOW() '.
',ticketID='.db_input($extId);
if (!db_input($deptId)) {
$sql.=',dept_id=2';
} else {
$sql.=',dept_id='.db_input($deptId);
}
$sql.=',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);