本文整理汇总了PHP中CTicket::Set方法的典型用法代码示例。如果您正苦于以下问题:PHP CTicket::Set方法的具体用法?PHP CTicket::Set怎么用?PHP CTicket::Set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTicket
的用法示例。
在下文中一共展示了CTicket::Set方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: EMailMessageAdd
//.........这里部分代码省略.........
$bEMailOK = false;
if ($TICKET_SOURCE_ID == $ar_ticket["SOURCE_ID"]) {
$ticket_email = strtolower(CMailUtil::ExtractMailAddress($ar_ticket["OWNER_SID"]));
if ($W_SUPPORT_SEC == "domain") {
$ticket_email = substr($ticket_email, strpos($ticket_email, "@"));
}
if (strpos($message_email_addr, $ticket_email) !== false) {
$bEMailOK = true;
}
}
if (!$bEMailOK && $ar_ticket["OWNER_USER_ID"] > 0) {
$db_user = CUser::GetByID($ar_ticket["OWNER_USER_ID"]);
if ($arUser = $db_user->Fetch()) {
$ticket_email = strtolower(CMailUtil::ExtractMailAddress($arUser["EMAIL"]));
if ($check_type == "domain") {
$ticket_email = substr($ticket_email, strpos($ticket_email, "@"));
}
if (strpos($message_email_addr, $ticket_email) !== false) {
$bEMailOK = true;
}
}
}
if (!$bEMailOK) {
$TID = 0;
}
}
} else {
$TID = 0;
}
}
//when message subject is empty - generate it from message body
$title = trim($arMessageFields["SUBJECT"]);
if (strlen($title) <= 0) {
$title = trim($arMessageFields["BODY"]);
$title = preg_replace("/[\n\r\t ]+/s" . BX_UTF_PCRE_MODIFIER, " ", $title);
$title = substr($title, 0, 50);
}
$arFieldsTicket = array("CLOSE" => "N", "TITLE" => $title, "MESSAGE" => $arMessageFields["BODY"], "MESSAGE_AUTHOR_SID" => $message_email, "MESSAGE_SOURCE_SID" => "email", "MODIFIED_MODULE_NAME" => "mail", "EXTERNAL_ID" => $ID, "EXTERNAL_FIELD_1" => $arMessageFields["HEADER"]);
if ($W_SUPPORT_USER_FIND == "Y") {
$o = "LAST_LOGIN";
$b = "DESC";
$res = CUser::GetList($o, $b, array("ACTIVE" => "Y", "=EMAIL" => $message_email_addr));
if (($arr = $res->Fetch()) && strtolower(CMailUtil::ExtractMailAddress($arr["EMAIL"])) == $message_email_addr) {
$AUTHOR_USER_ID = $arr["ID"];
}
}
// process attach files
$arFILES = array();
$rsAttach = CMailAttachment::GetList(array(), array("MESSAGE_ID" => $ID));
while ($arAttach = $rsAttach->Fetch()) {
// save from db to hdd
$filename = CTempFile::GetFileName(md5(uniqid("")) . ".tmp");
CheckDirPath($filename);
if (file_put_contents($filename, $arAttach["FILE_DATA"]) !== false) {
$arFILES[] = array("name" => $arAttach["FILE_NAME"], "type" => $arAttach["CONTENT_TYPE"], "size" => filesize($filename), "tmp_name" => $filename, "MODULE_ID" => "support");
}
}
if (count($arFILES) > 0) {
$arFieldsTicket["FILES"] = $arFILES;
}
$arFieldsTicket["CURRENT_USER_ID"] = null;
if (intval($AUTHOR_USER_ID) > 0) {
$resU = CUser::GetByID(intval($AUTHOR_USER_ID));
if ($arU = $resU->Fetch()) {
$arFieldsTicket["CURRENT_USER_ID"] = $arU["ID"];
}
}
if ($TID > 0) {
$arFieldsTicket["MESSAGE_AUTHOR_USER_ID"] = $AUTHOR_USER_ID;
if ($W_SUPPORT_ADD_MESSAGE_AS_HIDDEN == "Y") {
$arFieldsTicket["HIDDEN"] = "Y";
}
if ($arMessageFields["SPAM"] == "Y") {
$arFieldsTicket["IS_SPAM"] = "Y";
}
$TID = CTicket::Set($arFieldsTicket, $MESSAGE_ID, $TID, "N");
} else {
$arFieldsTicket["SITE_ID"] = $SITE_ID;
$arFieldsTicket["OWNER_USER_ID"] = $AUTHOR_USER_ID;
$arFieldsTicket["OWNER_SID"] = $message_email;
$arFieldsTicket["CREATED_MODULE_NAME"] = "mail";
$arFieldsTicket["SOURCE_SID"] = "email";
if ($arMessageFields["SPAM"] == "Y") {
$arFieldsTicket["IS_SPAM"] = "Y";
}
if ($W_SUPPORT_CATEGORY > 0) {
$arFieldsTicket["CATEGORY_ID"] = $W_SUPPORT_CATEGORY;
}
if ($W_SUPPORT_CRITICALITY > 0) {
$arFieldsTicket["CRITICALITY_ID"] = $W_SUPPORT_CRITICALITY;
}
if (strlen(trim($arFieldsTicket["TITLE"])) <= 0) {
$arFieldsTicket["TITLE"] = " ";
}
if (strlen(trim($arFieldsTicket["MESSAGE"])) <= 0) {
$arFieldsTicket["MESSAGE"] = " ";
}
$TID = CTicket::Set($arFieldsTicket, $MESSAGE_ID, "", "N");
}
}
示例2: SetTicket
function SetTicket($arFields, $ticketID = "", $checkRights = "Y", $sendEmailToAuthor = "Y", $sendEmailToTechsupport = "Y")
{
//global $DB;
//$DB->DebugToFile = true;
$messageID = null;
$x = CTicket::Set($arFields, $messageID, $ticketID, $checkRights, $sendEmailToAuthor, $sendEmailToTechsupport);
//$DB->DebugToFile = false;
return $x;
}