Дипломная работа: Автоматизация учета и обработки заявок пользователей на техническую поддержку (Help Desk) в ООО "Сфера ИТ"

Внимание! Если размещение файла нарушает Ваши авторские права, то обязательно сообщите нам
91
elsif ( $Param{TypeID} && !$Param{Type} ) {
$Param{Type} = $TypeObject->TypeLookup( TypeID => $Param{TypeID} );
}
if ( !$Param{TypeID} ) {
$Kernel::OM->Get('Kernel::System::Log')->Log(
Priority => 'error',
Message => "No TypeID for '$Param{Type}'!",
);
return;
}
# get queue object
my $QueueObject = $Kernel::OM->Get('Kernel::System::Queue');
# QueueID/Queue lookup!
if ( !$Param{QueueID} && $Param{Queue} ) {
$Param{QueueID} = $QueueObject->QueueLookup( Queue =>
$Param{Queue} );
}
elsif ( !$Param{Queue} ) {
$Param{Queue} = $QueueObject->QueueLookup( QueueID =>
$Param{QueueID} );
}
if ( !$Param{QueueID} ) {
$Kernel::OM->Get('Kernel::System::Log')->Log(
Priority => 'error',
Message => "No QueueID for '$Param{Queue}'!",
);
return;
}
92
# get state object
my $StateObject = $Kernel::OM->Get('Kernel::System::State');
# StateID/State lookup!
if ( !$Param{StateID} ) {
my %State = $StateObject->StateGet( Name => $Param{State} );
$Param{StateID} = $State{ID};
}
elsif ( !$Param{State} ) {
my %State = $StateObject->StateGet( ID => $Param{StateID} );
$Param{State} = $State{Name};
}
if ( !$Param{StateID} ) {
$Kernel::OM->Get('Kernel::System::Log')->Log(
Priority => 'error',
Message => "No StateID for '$Param{State}'!",
);
return;
}
# LockID lookup!
if ( !$Param{LockID} && $Param{Lock} ) {
$Param{LockID} = $Kernel::OM->Get('Kernel::System::Lock')->LockLookup(
Lock => $Param{Lock},
);
}
if ( !$Param{LockID} && !$Param{Lock} ) {
93
$Kernel::OM->Get('Kernel::System::Log')->Log(
Priority => 'error',
Message => 'No LockID and no LockType!',
);
return;
}
# get priority object
my $PriorityObject = $Kernel::OM->Get('Kernel::System::Priority');
# PriorityID/Priority lookup!
if ( !$Param{PriorityID} && $Param{Priority} ) {
$Param{PriorityID} = $PriorityObject->PriorityLookup(
Priority => $Param{Priority},
);
}
elsif ( $Param{PriorityID} && !$Param{Priority} ) {
$Param{Priority} = $PriorityObject->PriorityLookup(
PriorityID => $Param{PriorityID},
);
}
if ( !$Param{PriorityID} ) {
$Kernel::OM->Get('Kernel::System::Log')->Log(
Priority => 'error',
Message => 'No PriorityID (invalid Priority Name?)!',
);
return;
}
# get service object
94
my $ServiceObject = $Kernel::OM->Get('Kernel::System::Service');
# ServiceID/Service lookup!
if ( !$Param{ServiceID} && $Param{Service} ) {
$Param{ServiceID} = $ServiceObject->ServiceLookup(
Name => $Param{Service},
);
}
elsif ( $Param{ServiceID} && !$Param{Service} ) {
$Param{Service} = $ServiceObject->ServiceLookup(
ServiceID => $Param{ServiceID},
);
}
# get sla object
my $SLAObject = $Kernel::OM->Get('Kernel::System::SLA');
# SLAID/SLA lookup!
if ( !$Param{SLAID} && $Param{SLA} ) {
$Param{SLAID} = $SLAObject->SLALookup( Name => $Param{SLA} );
}
elsif ( $Param{SLAID} && !$Param{SLA} ) {
$Param{SLA} = $SLAObject->SLALookup( SLAID => $Param{SLAID} );
}
# create ticket number if none is given
if ( !$Param{TN} ) {
$Param{TN} = $Self->TicketCreateNumber();
}
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},
Источник: https://baza.diplomsite.ru/previewfile/2374