95
# check ticket title
if ( !defined $Param{Title} ) {
$Param{Title} = '';
}
# substitute title if needed
else {
$Param{Title} = substr( $Param{Title}, 0, 255 );
}
# check database undef/NULL (set value to undef/NULL to prevent database er-
rors)
$Param{ServiceID} ||= undef;
$Param{SLAID} ||= undef;
# create db record
return if !$Kernel::OM->Get('Kernel::System::DB')->Do(
SQL => '
INSERT INTO ticket (tn, title, type_id, queue_id, ticket_lock_id,
user_id, responsible_user_id, ticket_priority_id, ticket_state_id,
escalation_time, escalation_update_time, escalation_response_time,
escalation_solution_time, timeout, service_id, sla_id, until_time,
archive_flag, create_time, create_by, change_time, change_by)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, 0, 0, 0, 0, 0, ?, ?, 0, ?,
current_timestamp, ?, current_timestamp, ?)',
Bind => [
\$Param{TN}, \$Param{Title}, \$Param{TypeID}, \$Param{QueueID},
\$Param{LockID}, \$Param{OwnerID}, \$Param{ResponsibleID},
\$Param{PriorityID}, \$Param{StateID}, \$Param{ServiceID},
\$Param{SLAID}, \$ArchiveFlag, \$Param{UserID}, \$Param{UserID},