OTRS二次开发文档

一、概述

OTRS系统是一个自动化流程管理系统,可以把零碎的工作记录下来,有利于企业流程化,标准化,制度化,自动化管理。

OTRS安装包及插件的官方下载地址:

https://portal.otrs.com/otrs/customer.pl?Action=CustomerDownloads#

二、源码重写

主要是触发器和主配置模块需要大幅调整,原有webservice接口,要正常调用标准webservice,需要修改SOAP模块,公司开发部门提供的webservice接口是.net写,不确定是否符合标准,调用后提示-3600格式解析错误。

 

SAOP模块重写:

#\\\\\\\\\\\\\\\\\\\\\\\\\query the TicketNumber from database//////////////////////
my @row_ticket,@row_article,@row_sla;
my $sql_ticket_number,$sql_ticket_content;
my $dbname="otrs";
my $username="root";
my $password="geek_100";

my $dbObject = DBI->connect("dbi:mysql:$dbname", $username, $password) or die "Cannot conenct db: $DBI::errstr\n";
$dbObject->do("SET character_set_client         = 'utf8'");
$dbObject->do("SET character_set_connection     = 'utf8'");
$dbObject->do("SET character_set_results        = 'utf8'");

#\\\\\\\\\\\\\\\\\\\\\\\\\query the ticket number and sla_id from database//////////////////////

$sql_ticket_number = $dbObject->prepare(" select * from ticket where id=($Param{Data}->{TicketID}) " );
$sql_ticket_number->execute();
@row_ticket = $sql_ticket_number->fetchrow_array();
$Param{Data}->{TicketNumber} = $row_ticket[1];
$Param{Data}->{sla_id} = $row_ticket[7];

#\\\\\\\\\\\\\\\\\\\\\\\\\query the ticket content from database//////////////////////
$sla_name = $dbObject->prepare(" select * from sla where id=($Param{Data}->{sla_id}) " );
$sla_name->execute();
@row_sla = $sla_name->fetchrow_array();
$Param{Data}->{sla_name} = @row_sla[1];

#\\\\\\\\\\\\\\\\\\\\\\\\\query the ticket content from database//////////////////////
#\\\\\\\\\\\\\\\\\\\\\\\\\select a_body from article where ticket_id='1045';///////////
#$sql_ticket_number = $dbObject->prepare("set names 'utf-8'");

$sql_ticket_content = $dbObject->prepare(" select * from article where ticket_id=($Param{Data}->{TicketID}) " );
$sql_ticket_content->execute();
@row_article = $sql_ticket_content->fetchrow_array();


$Param{Data}->{TicketFrom}              = $row_article[4];
$Param{Data}->{TickeTo}                 = $row_article[6];
$Param{Data}->{TicketSubject}           = $row_article[8];
$Param{Data}->{TicketContent}           = $row_article[14];
$Param{Data}->{TicketCreatetime}        = $r