当前位置: 首页>>代码示例>>PHP>>正文


PHP CTicket::GetMessageByID方法代码示例

本文整理汇总了PHP中CTicket::GetMessageByID方法的典型用法代码示例。如果您正苦于以下问题:PHP CTicket::GetMessageByID方法的具体用法?PHP CTicket::GetMessageByID怎么用?PHP CTicket::GetMessageByID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CTicket的用法示例。


在下文中一共展示了CTicket::GetMessageByID方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: UpdateMessage

 function UpdateMessage($MESSAGE_ID, $arFields, $checkRights = "Y")
 {
     $err_mess = CTicket::err_mess() . "<br>Function: UpdateMessage<br>Line: ";
     global $DB, $USER;
     $MESSAGE_ID = intval($MESSAGE_ID);
     $bAdmin = "N";
     $bSupportTeam = "N";
     if ($checkRights == "Y") {
         $bAdmin = CTicket::IsAdmin() ? "Y" : "N";
         $bSupportTeam = CTicket::IsSupportTeam() ? "Y" : "N";
         $uid = $USER->GetID();
     } else {
         $bAdmin = "Y";
         $bSupportTeam = "Y";
         $uid = 0;
     }
     if ($bAdmin == "Y") {
         $ownerSid = $arFields["OWNER_SID"];
         $ownerUserID = $arFields["OWNER_USER_ID"];
         $arFields_u = array("TIMESTAMP_X" => $DB->GetNowFunction(), "C_NUMBER" => intval($arFields["C_NUMBER"]), "MESSAGE" => "'" . $DB->ForSql($arFields["MESSAGE"]) . "'", "MESSAGE_SEARCH" => "'" . ToUpper($DB->ForSql($arFields["MESSAGE"])) . "'", "SOURCE_ID" => intval($arFields["SOURCE_ID"]) > 0 ? intval($arFields["SOURCE_ID"]) : "null", "OWNER_SID" => "'" . $DB->ForSql($ownerSid, 255) . "'", "OWNER_USER_ID" => intval($ownerUserID) > 0 ? intval($ownerUserID) : "null", "MODIFIED_USER_ID" => intval($uid) > 0 ? intval($uid) : "null", "MODIFIED_GUEST_ID" => intval($_SESSION["SESS_GUEST_ID"]) > 0 ? intval($_SESSION["SESS_GUEST_ID"]) : "null", "EXTERNAL_ID" => intval($arFields["EXTERNAL_ID"]) > 0 ? intval($arFields["EXTERNAL_ID"]) : "null", "TASK_TIME" => intval($arFields["TASK_TIME"]) > 0 ? intval($arFields["TASK_TIME"]) : "null", "EXTERNAL_FIELD_1" => "'" . $DB->ForSql($arFields["EXTERNAL_FIELD_1"]) . "'", "IS_SPAM" => strlen($arFields["IS_SPAM"]) > 0 ? "'" . $arFields["IS_SPAM"] . "'" : "null", "IS_HIDDEN" => $arFields["IS_HIDDEN"] == "Y" ? "'Y'" : "'N'", "IS_LOG" => $arFields["IS_LOG"] == "Y" ? "'Y'" : "'N'", "IS_OVERDUE" => $arFields["IS_OVERDUE"] == "Y" ? "'Y'" : "'N'", "NOT_CHANGE_STATUS" => $arFields["NOT_CHANGE_STATUS"] == "Y" ? "'Y'" : "'N'");
         $notChangeStatus = is_set($arFields, "NOT_CHANGE_STATUS") && $arFields["NOT_CHANGE_STATUS"] == "Y" ? "Y" : "N";
         $rows = $DB->Update("b_ticket_message", $arFields_u, "WHERE ID='" . $MESSAGE_ID . "'", $err_mess . __LINE__);
         if (intval($rows) > 0) {
             $rsMessage = CTicket::GetMessageByID($MESSAGE_ID, $checkRights);
             if ($arMessage = $rsMessage->Fetch()) {
                 $ticketID = $arMessage["TICKET_ID"];
                 // обновим прикрепленные файлы
                 $not_image_extension_suffix = COption::GetOptionString("support", "NOT_IMAGE_EXTENSION_SUFFIX");
                 $not_image_upload_dir = COption::GetOptionString("support", "NOT_IMAGE_UPLOAD_DIR");
                 $max_size = COption::GetOptionString("support", "SUPPORT_MAX_FILESIZE");
                 $arrFiles = $arFields["FILES"];
                 if (is_array($arrFiles) && count($arrFiles) > 0) {
                     foreach ($arrFiles as $arFile) {
                         if (strlen($arFile["name"]) > 0 || $arFile["del"] == "Y") {
                             if ($bSupportTeam != "Y" && $bAdmin != "Y") {
                                 $max_file_size = intval($max_size) * 1024;
                             }
                             $fes = "";
                             $upload_dir = "support";
                             if (!CFile::IsImage($arFile["name"], $arFile["type"])) {
                                 $fes = $not_image_extension_suffix;
                                 $arFile["name"] .= $fes;
                                 $upload_dir = $not_image_upload_dir;
                             }
                             if (!array_key_exists("MODULE_ID", $arFile) || strlen($arFile["MODULE_ID"]) <= 0) {
                                 $arFile["MODULE_ID"] = "support";
                             }
                             $fid = intval(CFile::SaveFile($arFile, $upload_dir, $max_file_size));
                             // если стоял флаг "Удалить" то
                             if ($arFile["del"] == "Y") {
                                 // удалим связку
                                 $strSql = "\n\t\t\t\t\t\t\t\t\t\tDELETE FROM\n\t\t\t\t\t\t\t\t\t\t\tb_ticket_message_2_file\n\t\t\t\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t\t\t\tFILE_ID=" . intval($arFile["old_file"]) . "\n\t\t\t\t\t\t\t\t\t\t";
                                 $DB->Query($strSql, false, $err_mess . __LINE__);
                             }
                             // если успешно загрузили файл то
                             if ($fid > 0) {
                                 // если это был новый файл то
                                 if (intval($arFile["old_file"]) <= 0) {
                                     // добавим связку
                                     $md5 = md5(uniqid(mt_rand(), true) . time());
                                     $arFields_fi = array("HASH" => "'" . $DB->ForSql($md5, 255) . "'", "MESSAGE_ID" => $MESSAGE_ID, "FILE_ID" => $fid, "TICKET_ID" => $ticketID, "EXTENSION_SUFFIX" => strlen($fes) > 0 ? "'" . $DB->ForSql($fes, 255) . "'" : "null");
                                     $DB->Insert("b_ticket_message_2_file", $arFields_fi, $err_mess . __LINE__);
                                 } else {
                                     // обновим связку
                                     $arFields_fu = array("FILE_ID" => $fid, "EXTENSION_SUFFIX" => strlen($fes) > 0 ? "'" . $DB->ForSql($fes, 255) . "'" : "null");
                                     $DB->Update("b_ticket_message_2_file", $arFields_fu, "WHERE FILE_ID = " . intval($arFile["old_file"]), $err_mess . __LINE__);
                                 }
                             }
                         }
                     }
                 }
                 if ($arFields["IS_SPAM"] == "Y") {
                     CTicket::MarkMessageAsSpam($MESSAGE_ID, "Y", $checkRights);
                 } elseif ($arFields["IS_SPAM"] == "N") {
                     CTicket::MarkMessageAsSpam($MESSAGE_ID, "N", $checkRights);
                 } elseif ($arFields["IS_SPAM"] != "Y" && $arFields["IS_SPAM"] != "N") {
                     CTicket::UnMarkMessageAsSpam($MESSAGE_ID, $checkRights);
                 }
                 //if ($notChangeStatus != "Y")
                 CTicket::UpdateLastParams($ticketID);
                 //if ($notChangeStatus!="Y" && $hidden!="Y" && $log!="Y")
                 //{
                 //CTicketReminder::Update($ticketID);
                 //}
                 if ($log != "Y") {
                     $strSql = "SELECT SITE_ID, TITLE FROM b_ticket T WHERE ID='{$ticketID}'";
                     $rsTicket = $DB->Query($strSql, false, $err_mess . __LINE__);
                     $arTicket = $rsTicket->Fetch();
                     CSupportSearch::writeWordsInTable($MESSAGE_ID, $arTicket["SITE_ID"], $arTicket["TITLE"] . " " . $arFields["MESSAGE"]);
                 }
             }
         }
     }
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:94,代码来源:support.php

示例2: UnMarkMessageAsSpam

 function UnMarkMessageAsSpam($messageID, $checkRights = "Y")
 {
     $err_mess = CAllTicket::err_mess() . "<br>Function: UnMarkMessageAsSpam<br>Line: ";
     global $DB, $USER;
     $messageID = intval($messageID);
     if ($messageID <= 0) {
         return;
     }
     $bAdmin = "N";
     $bSupportTeam = "N";
     if ($checkRights == "Y") {
         $bAdmin = CTicket::IsAdmin() ? "Y" : "N";
         $bSupportTeam = CTicket::IsSupportTeam() ? "Y" : "N";
     } else {
         $bAdmin = "Y";
         $bSupportTeam = "Y";
     }
     if (($bAdmin == "Y" || $bSupportTeam == "Y") && CModule::IncludeModule("mail")) {
         $rsMessage = CTicket::GetMessageByID($messageID, $checkRights);
         if ($arMessage = $rsMessage->Fetch()) {
             $arFields = array("IS_SPAM" => "null");
             $DB->Update("b_ticket_message", $arFields, "WHERE ID=" . $messageID, $err_mess . __LINE__);
             $email_id = intval($arMessage["EXTERNAL_ID"]);
             $header = $arMessage["EXTERNAL_FIELD_1"];
             $rsEmail = CMailMessage::GetByID($email_id);
             if ($rsEmail->Fetch()) {
                 CMailMessage::MarkAsSpam($email_id, false);
             } else {
                 CmailFilter::DeleteFromSpamBase($header . " \n\r " . $arMessage["MESSAGE"], true);
                 CmailFilter::MarkAsSpam($header . " \n\r " . $arMessage["MESSAGE"], false);
             }
         }
     }
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:34,代码来源:support.php

示例3: IntVal

								SPLIT MESSAGE
****************************************************************************/
if (isset($_GET['TICKET_ID']) && isset($_GET['MESSAGE_ID'])) {
    $_SESSION["TICKET_ID"] = IntVal($_GET['TICKET_ID']);
    $_SESSION["MESSAGE_ID"] = IntVal($_GET['MESSAGE_ID']);
    $ticket = CTicket::GetByID($_SESSION['TICKET_ID'], $site_id, "Y", $get_user_name, $get_extra_names);
    if ($ticket && $ticket->ExtractFields()) {
        $obUserTiket = $USER->GetByID($str_OWNER_USER_ID);
        $arUserTiket = $obUserTiket->Fetch();
        $str_OWNER_LOGIN = htmlspecialcharsbx($arUserTiket['LOGIN']);
        $str_OWNER_NAME = htmlspecialcharsbx($arUserTiket['NAME']) . ' ' . htmlspecialcharsbx($arUserTiket['LAST_NAME']);
        $str_lang = $TICKET_SITE = $str_SITE_ID;
        $TICKET_SLA = $str_SLA_ID = CTicketSLA::GetForUser($str_SITE_ID, $str_OWNER_USER_ID);
        $str_DIFFICULTY_ID = '';
        $str_CRITICALITY_ID = '';
        $obTicketMessage = CTicket::GetMessageByID($_SESSION['MESSAGE_ID']);
        $arTicketMessage = $obTicketMessage->Fetch();
        $MESSAGE = $arTicketMessage['MESSAGE'];
        $_SESSION['MESSAGE_NUM'] = IntVal($arTicketMessage['C_NUMBER']);
        $_SESSION['MESSAGE_DATE'] = $arTicketMessage['DATE_CREATE'];
        $_SESSION["TICKET_TITLE"] = $str_TITLE;
        $str_TITLE = '';
        $str_DATE_CLOSE = null;
        $arFiles = array();
        if ($rsFiles = CTicket::GetFileList($v1 = "s_id", $v2 = "asc", array("MESSAGE_ID" => $_SESSION['MESSAGE_ID']))) {
            while ($arFile = $rsFiles->Fetch()) {
                $name = $arFile["ORIGINAL_NAME"];
                if (strlen($arFile["EXTENSION_SUFFIX"]) > 0) {
                    $suffix_length = strlen($arFile["EXTENSION_SUFFIX"]);
                    $name = substr($name, 0, strlen($name) - $suffix_length);
                }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:ticket_edit.php

示例4: LocalRedirect

         //echo "<pre>"; print_r($arFields); echo "</pre>";
         CTicket::UpdateMessage($ID, $arFields);
         if (!$strError) {
             if (strlen($save) > 0) {
                 LocalRedirect($TICKET_EDIT_URL . "?lang=" . LANGUAGE_ID . "&ID=" . $TICKET_ID);
             } elseif (strlen($apply) > 0) {
                 LocalRedirect($TICKET_MESSAGE_EDIT_URL . "?ID=" . $ID . "&TICKET_ID=" . $TICKET_ID . "&lang=" . LANGUAGE_ID);
             }
         }
     } else {
         if ($e = $APPLICATION->GetException()) {
             $strError = new CAdminMessage(GetMessage("SUP_ERROR"), $e);
         }
     }
 }
 $message = CTicket::GetMessageByID($ID);
 if (!$message->ExtractFields()) {
     //$strError .= GetMessage("SUP_MESSAGE_NOT_FOUND")."<br>";
     $e = $APPLICATION->GetException();
     $strError = new CAdminMessage(GetMessage("SUP_MESSAGE_NOT_FOUND"), $e);
 } else {
     $arFiles = array();
     if ($rsFiles = CTicket::GetFileList($v1 = "s_id", $v2 = "asc", array("MESSAGE_ID" => $ID))) {
         while ($arFile = $rsFiles->Fetch()) {
             $name = $arFile["ORIGINAL_NAME"];
             if (strlen($arFile["EXTENSION_SUFFIX"]) > 0) {
                 $suffix_length = strlen($arFile["EXTENSION_SUFFIX"]);
                 $name = substr($name, 0, strlen($name) - $suffix_length);
             }
             $arFile["NAME"] = $name;
             $arFiles[] = $arFile;
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:ticket_message_edit.php

示例5: SupportDeadlineNotify

 public static function SupportDeadlineNotify($arrTicket0)
 {
     //SUPPORT_DEADLINE_NOTIFY
     //SUPPORT_DEADLINE			= EXPIRATION_DATE
     //SUPPORT_DEADLINE_STMP		= EXPIRATION_DATE_STMP
     $err_mess = CAllTicketReminder::err_mess() . "<br>Function: SupportDeadlineNotify<br>Line: ";
     $rs = CTicket::GetByID($arrTicket0["ID"], false, "N");
     if (!($arTicket = $rs->Fetch())) {
         return false;
     }
     $rsMessage = CTicket::GetMessageByID(intval($arTicket["ID_1_USER_M_AFTER_SUP_M"]), "N", "N");
     if (!($arMessage = $rsMessage->Fetch())) {
         return false;
     }
     $arMessage["EXPIRATION_DATE"] = $arrTicket0["SUPPORT_DEADLINE"];
     $arMessage["EXPIRATION_DATE_STMP"] = MakeTimeStamp($arMessage["EXPIRATION_DATE"]);
     //$SUPPORT_DEADLINE_STMP = MakeTimeStamp($arrTicket0["SUPPORT_DEADLINE"]);
     $rsSite = CSite::GetByID($arTicket["SITE_ID"]);
     $arSite = $rsSite->Fetch();
     global $MESS, $DB;
     //$oldMess = $MESS;
     IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/support/classes/general/messages.php", $arSite["LANGUAGE_ID"]);
     $sourceName = strlen($arTicket["SOURCE_NAME"]) <= 0 ? "" : "[" . $arTicket["SOURCE_NAME"] . "] ";
     if (intval($arTicket["OWNER_USER_ID"]) > 0 || strlen(trim($arTicket["OWNER_LOGIN"])) > 0) {
         $ownerText = "[" . $arTicket["OWNER_USER_ID"] . "] (" . $arTicket["OWNER_LOGIN"] . ") " . $arTicket["OWNER_NAME"];
         //if(strlen(trim($OWNER_SID)) > 0 && $OWNER_SID != "null") $ownerText = " / " . $ownerText;
     }
     if (intval($arTicket["RESPONSIBLE_USER_ID"]) > 0) {
         $responsibleText = "[" . $arTicket["RESPONSIBLE_USER_ID"] . "] (" . $arTicket["RESPONSIBLE_LOGIN"] . ") " . $arTicket["RESPONSIBLE_NAME"];
         if (CTicket::IsSupportTeam($arTicket["RESPONSIBLE_USER_ID"]) || CTicket::IsAdmin($arTicket["RESPONSIBLE_USER_ID"])) {
             $responsibleText .= " " . GetMessage("SUP_TECHSUPPORT_HINT");
         }
     }
     $arAdminEMails = CTicket::GetAdminEmails();
     if (count($arAdminEMails) > 0) {
         $support_admin_email = implode(",", $arAdminEMails);
     }
     // prepare email to author
     $arrOwnerEMail = array($arTicket["OWNER_EMAIL"]);
     $arrEmails = explode(",", $arTicket["OWNER_SID"]);
     if (is_array($arrEmails) && count($arrEmails) > 0) {
         foreach ($arrEmails as $email) {
             $email = trim($email);
             if (strlen($email) > 0) {
                 preg_match_all("#[<\\[\\(](.*?)[>\\]\\)]#i" . BX_UTF_PCRE_MODIFIER, $email, $arr);
                 if (is_array($arr[1]) && count($arr[1]) > 0) {
                     foreach ($arr[1] as $email) {
                         $email = trim($email);
                         if (strlen($email) > 0 && !in_array($email, $arrOwnerEMail) && check_email($email)) {
                             $arrOwnerEMail[] = $email;
                         }
                     }
                 } elseif (!in_array($email, $arrOwnerEMail) && check_email($email)) {
                     $arrOwnerEMail[] = $email;
                 }
             }
         }
     }
     TrimArr($arrOwnerEMail);
     $ownerEmail = implode(", ", $arrOwnerEMail);
     // prepare email to support
     $support_email = $arTicket["RESPONSIBLE_EMAIL"];
     if (strlen($support_email) <= 0) {
         $support_email = $support_admin_email;
     }
     if (strlen($support_email) <= 0) {
         $support_email = COption::GetOptionString("main", "email_from", "");
     }
     $arr = explode(",", $support_email);
     $arr = array_unique($arr);
     $support_email = implode(",", $arr);
     if (is_array($arr) && count($arr) > 0) {
         foreach ($arr as $email) {
             unset($arAdminEMails[$email]);
         }
     }
     $support_admin_email = implode(",", $arAdminEMails);
     $createdModuleName = "";
     if ($arTicket["CREATED_MODULE_NAME"] == "support" || !strlen($arTicket["CREATED_MODULE_NAME"])) {
         if (intval($arTicket["CREATED_USER_ID"]) > 0) {
             $createdText = "[" . $arTicket["CREATED_USER_ID"] . "] (" . $arTicket["CREATED_LOGIN"] . ") " . $arTicket["CREATED_NAME"];
             if (CTicket::IsSupportTeam($arTicket["CREATED_USER_ID"]) || CTicket::IsAdmin($arTicket["CREATED_USER_ID"])) {
                 $createdText .= " " . GetMessage("SUP_TECHSUPPORT_HINT");
             }
         }
     } else {
         $createdModuleName = "[" . $arTicket["CREATED_MODULE_NAME"] . "]";
     }
     $MESSAGE = PrepareTxtForEmail($arMessage["MESSAGE"], $arSite["LANGUAGE_ID"], false, false);
     $remainedTime = $arMessage["EXPIRATION_DATE_STMP"] - time();
     if ($remainedTime > 0) {
         $strRemainedTime = "";
         $hours = intval($remainedTime / 3600);
         if ($hours > 0) {
             $strRemainedTime .= $hours . " " . GetMessage("SUP_HOUR") . " ";
             $remainedTime = $remainedTime - $hours * 3600;
         }
         $strRemainedTime .= intval($remainedTime / 60) . " " . GetMessage("SUP_MIN") . " ";
         $strRemainedTime .= $remainedTime % 60 . " " . GetMessage("SUP_SEC");
     }
//.........这里部分代码省略.........
开发者ID:rasuldev,项目名称:torino,代码行数:101,代码来源:reminder.php


注:本文中的CTicket::GetMessageByID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。