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

Внимание! Если размещение файла нарушает Ваши авторские права, то обязательно сообщите нам
96
],
);
# get ticket id
my $TicketID = $Self->TicketIDLookup(
TicketNumber => $Param{TN},
UserID => $Param{UserID},
);
# add history entry
$Self->HistoryAdd(
TicketID => $TicketID,
QueueID => $Param{QueueID},
HistoryType => 'NewTicket',
Name => "\%\%$Param{TN}\%\%$Param{Queue}\%\%$Param{Prior-
ity}\%\%$Param{State}\%\%$TicketID",
CreateUserID => $Param{UserID},
);
if ( $Kernel::OM->Get('Kernel::Config')->Get('Ticket::Service') ) {
# history insert for service so that initial values can be seen
my $HistoryService = $Param{Service} || 'NULL';
my $HistoryServiceID = $Param{ServiceID} || '';
$Self->HistoryAdd(
TicketID => $TicketID,
HistoryType => 'ServiceUpdate',
Name => "\%\%$HistoryService\%\%$HistoryS-
erviceID\%\%NULL\%\%",
CreateUserID => $Param{UserID},
97
);
# history insert for SLA
my $HistorySLA = $Param{SLA} || 'NULL';
my $HistorySLAID = $Param{SLAID} || '';
$Self->HistoryAdd(
TicketID => $TicketID,
HistoryType => 'SLAUpdate',
Name => "\%\%$HistorySLA\%\%$HistorySLAID\%\%NULL\%\%",
CreateUserID => $Param{UserID},
);
}
if ( $Kernel::OM->Get('Kernel::Config')->Get('Ticket::Type') ) {
# Insert history record for ticket type, so that initial value can be seen.
# Please see bug#12702 for more information.
$Self->HistoryAdd(
TicketID => $TicketID,
HistoryType => 'TypeUpdate',
Name => "\%\%$Param{Type}\%\%$Param{TypeID}",
CreateUserID => $Param{UserID},
);
}
# set customer data if given
if ( $Param{CustomerNo} || $Param{CustomerID} || $Param{CustomerUser} ) {
$Self->TicketCustomerSet(
TicketID => $TicketID,
No => $Param{CustomerNo} || $Param{CustomerID} || '',
98
User => $Param{CustomerUser} || '',
UserID => $Param{UserID},
);
}
# update ticket view index
$Self->TicketAcceleratorAdd( TicketID => $TicketID );
# log ticket creation
$Kernel::OM->Get('Kernel::System::Log')->Log(
Priority => 'info',
Message => "New Ticket [$Param{TN}/" . substr( $Param{Title}, 0, 15 ) . "]
created "
. "(TicketID=$TicketID,Queue=$Param{Queue},Priority=$Param{Prior-
ity},State=$Param{State})",
);
# trigger event
$Self->EventHandler(
Event => 'TicketCreate',
Data => {
TicketID => $TicketID,
},
UserID => $Param{UserID},
);
return $TicketID;
}
=head2 TicketDelete()
99
deletes a ticket with articles from storage
my $Success = $TicketObject->TicketDelete(
TicketID => 123,
UserID => 123,
);
Events:
TicketDelete
=cut
sub TicketDelete {
my ( $Self, %Param ) = @_;
# check needed stuff
for my $Needed (qw(TicketID UserID)) {
if ( !$Param{$Needed} ) {
$Kernel::OM->Get('Kernel::System::Log')->Log(
Priority => 'error',
Message => "Need $Needed!",
);
return;
}
}
# Delete dynamic field values for this ticket.
$Kernel::OM->Get('Kernel::System::DynamicFieldValue')->ObjectValuesDelete(
ObjectType => 'Ticket',
100
ObjectID => $Param{TicketID},
UserID => $Param{UserID},
);
# clear ticket cache
$Self->_TicketCacheClear( TicketID => $Param{TicketID} );
# delete ticket links
$Kernel::OM->Get('Kernel::System::LinkObject')->LinkDeleteAll(
Object => 'Ticket',
Key => $Param{TicketID},
UserID => $Param{UserID},
);
# update ticket index
return if !$Self->TicketAcceleratorDelete(%Param);
my $ArticleObject = $Kernel::OM->Get('Kernel::System::Ticket::Article');
# delete ticket entries from article search index.
return if !$ArticleObject->ArticleSearchIndexDelete(
TicketID => $Param{TicketID},
UserID => $Param{UserID},
);
# get database object
my $DBObject = $Kernel::OM->Get('Kernel::System::DB');
# remove ticket watcher
return if !$DBObject->Do(
101
SQL => 'DELETE FROM ticket_watcher WHERE ticket_id = ?',
Bind => [ \$Param{TicketID} ],
);
# delete ticket flags
return if !$DBObject->Do(
SQL => 'DELETE FROM ticket_flag WHERE ticket_id = ?',
Bind => [ \$Param{TicketID} ],
);
# delete ticket flag cache
$Kernel::OM->Get('Kernel::System::Cache')->Delete(
Type => $Self->{CacheType},
Key => 'TicketFlag::' . $Param{TicketID},
);
# Delete calendar appointments linked to this ticket.
# Please see bug#13642 for more information.
return if !$Kernel::OM->Get('Kernel::System::Calendar')->TicketAppoint-
mentDelete(
TicketID => $Param{TicketID},
);
# delete ticket_history
return if !$Self->HistoryDelete(
TicketID => $Param{TicketID},
UserID => $Param{UserID},
);
# Delete all articles and associated data.
102
my @Articles = $ArticleObject->ArticleList( TicketID => $Param{TicketID} );
for my $MetaArticle (@Articles) {
return if !$ArticleObject->BackendForArticle( %{$MetaArticle} )->ArticleDe-
lete(
ArticleID => $MetaArticle->{ArticleID},
%Param,
);
}
# delete ticket
return if !$DBObject->Do(
SQL => 'DELETE FROM ticket WHERE id = ?',
Bind => [ \$Param{TicketID} ],
);
# trigger event
$Self->EventHandler(
Event => 'TicketDelete',
Data => {
TicketID => $Param{TicketID},
},
UserID => $Param{UserID},
);
# Clear ticket cache again, in case it was rebuilt in the meantime.
$Self->_TicketCacheClear( TicketID => $Param{TicketID} );
return 1;
}

Смотрите также:

"Автоматизация обработки заявок ООО "Проектно-Строительная Компания"
"Автоматизация процесса аттестации персонала для ООО "Нэт Бай Нэт Холдинг"
"Анализ интернет-активности конкурентов ( на примере конкурентов "Газпром нефть")
"Бухгалтерский учёт и аудит расчётов с подотчётними лицами в организации на примере ООО "ЛОЦ 10""
«Психологическое сопровождение персонала в организации на примере ООО «Крокус»
Cовершенствование деловой оценки персонала в организации (на примере ООО "Даймонд кейтеринг развитие")
IPO - инструмент финансирования деятельности организации. На примере ПАО «Нефтяная компания «Лукойл»
PR как средство продвижения организации (на примере ПАО "Тамбовский завод "Комсомолец им. Н.С. Артемова")
PR-коммуникации в сфере общественного питания (на примере кафе-кондитерской «Cream Cheese»)
SMM как средство повышения эффективности работы учреждений социокультурной сферы (на примере Малого театра)