本文整理汇总了PHP中CTicket::GetAdminEmails方法的典型用法代码示例。如果您正苦于以下问题:PHP CTicket::GetAdminEmails方法的具体用法?PHP CTicket::GetAdminEmails怎么用?PHP CTicket::GetAdminEmails使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTicket
的用法示例。
在下文中一共展示了CTicket::GetAdminEmails方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Set_sendMails
function Set_sendMails($nf, $v, $arFields)
{
$I_Email = null;
$U_Email = null;
if (!$v->isNew) {
$U_Email = "Y";
} else {
$I_Email = "Y";
}
IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/support/classes/general/messages.php", $v->arrSite["LANGUAGE_ID"]);
$mf = self::GetCSupportTableFields("EventFields");
$mf->ADMIN_EDIT_URL = "/bitrix/admin/ticket_edit.php";
$mf->LANGUAGE = $v->arrSite["LANGUAGE_ID"];
$mf->LANGUAGE_ID = $v->arrSite["LANGUAGE_ID"];
$arrSet = array("ID" => "ID", "DATE_CREATE" => "DATE_CREATE", "TIMESTAMP" => "TIMESTAMP_X", "DATE_CLOSE" => "DATE_CLOSE", "TITLE" => "TITLE", "CATEGORY" => "CATEGORY_NAME", "CRITICALITY" => "CRITICALITY_NAME", "DIFFICULTY" => "DIFFICULTY_NAME", "STATUS" => "STATUS_NAME", "SLA" => "SLA_NAME", "OWNER_USER_ID" => "OWNER_USER_ID", "OWNER_GUEST_ID" => "OWNER_GUEST_ID", "OWNER_SID" => "OWNER_SID", "OWNER_USER_NAME" => "OWNER_NAME", "OWNER_USER_LOGIN" => "OWNER_LOGIN", "OWNER_USER_EMAIL" => "OWNER_EMAIL", "RESPONSIBLE_USER_ID" => "RESPONSIBLE_USER_ID", "RESPONSIBLE_USER_NAME" => "RESPONSIBLE_NAME", "RESPONSIBLE_USER_LOGIN" => "RESPONSIBLE_LOGIN", "RESPONSIBLE_USER_EMAIL" => "RESPONSIBLE_EMAIL", "CREATED_USER_ID" => "CREATED_USER_ID", "CREATED_GUEST_ID" => "CREATED_GUEST_ID", "CREATED_USER_LOGIN" => "CREATED_LOGIN", "CREATED_USER_EMAIL" => "CREATED_EMAIL", "CREATED_USER_NAME" => "CREATED_NAME");
if (!$v->isNew) {
$arrSet["MODIFIED_USER_ID"] = "MODIFIED_USER_ID";
$arrSet["MODIFIED_GUEST_ID"] = "MODIFIED_GUEST_ID";
$arrSet["MODIFIED_USER_LOGIN"] = "MODIFIED_LOGIN";
$arrSet["MODIFIED_USER_EMAIL"] = "MODIFIED_EMAIL";
$arrSet["MODIFIED_USER_NAME"] = "MODIFIED_NAME";
$arrSet["RATE"] = "MARK_NAME";
$arrSet["MESSAGES_AMOUNT"] = "MESSAGES";
}
$mf->FromArray((array) $nf, $arrSet);
$arUserIDs = array($mf->OWNER_USER_ID, $mf->CREATED_USER_ID, $mf->MODIFIED_USER_ID, $mf->RESPONSIBLE_USER_ID);
$arGuestIDs = array($mf->OWNER_GUEST_ID, $mf->CREATED_GUEST_ID, $mf->MODIFIED_GUEST_ID);
$arStrUsers = CTicket::GetUsersPropertiesArray($arUserIDs, $arGuestIDs);
// set name, login, email
$userCategories = array('OWNER', 'RESPONSIBLE', 'CREATED');
if (!$v->isNew) {
$userCategories[] = 'MODIFIED';
}
foreach ($userCategories as $userCategory) {
$propertyId = $userCategory . '_USER_ID';
if ($mf->{$propertyId} > 0 && isset($arStrUsers['arUsers'][$mf->{$propertyId}])) {
$name = CUser::FormatName(CSite::GetNameFormat(), $arStrUsers['arUsers'][$mf->{$propertyId}], true, true);
$propertyName = $userCategory . '_USER_NAME';
$mf->{$propertyName} = $name;
$propertyLogin = $userCategory . '_USER_LOGIN';
$mf->{$propertyLogin} = $arStrUsers['arUsers'][$mf->{$propertyId}]['LOGIN'];
$propertyEmail = $userCategory . '_USER_EMAIL';
$mf->{$propertyEmail} = $arStrUsers['arUsers'][$mf->{$propertyId}]['EMAIL'];
}
}
$mf->FILES_LINKS = self::Set_getFilesLinks($v->arrFILES, $v->arrSite["LANGUAGE_ID"]);
$mf->IMAGE_LINK = $mf->FILES_LINKS;
$mf->MESSAGE_BODY = PrepareTxtForEmail($arFields["MESSAGE"], $v->arrSite["LANGUAGE_ID"], false, false);
// сформируем email автора
// Событие: "TICKET_CHANGE_BY_AUTHOR_FOR_AUTHOR" - #DEFAULT_EMAIL_FROM# -> #OWNER_EMAIL# (Обращение изменено автором (для автора))
// Событие: "TICKET_CHANGE_BY_SUPPORT_FOR_AUTHOR" - #DEFAULT_EMAIL_FROM# -> #OWNER_EMAIL# (Обращение изменено сотрудником техподдержки (для автора))
// Событие: "TICKET_NEW_FOR_AUTHOR" - #DEFAULT_EMAIL_FROM# -> #OWNER_EMAIL# (Новое обращение (для автора))
$ownerEmail = "";
if ($mf->OWNER_USER_ID > 0 && isset($arStrUsers["arUsers"][$mf->OWNER_USER_ID])) {
$ownerEmail = $arStrUsers["arUsers"][$mf->OWNER_USER_ID]["EMAIL"];
} elseif ($mf->OWNER_GUEST_ID > 0 && isset($arStrUsers["arGuests"][$mf->OWNER_GUEST_ID])) {
$ownerEmail = $arStrUsers["arGuests"][$mf->OWNER_GUEST_ID]["EMAIL"];
}
$arrOwnerEmails = self::EmailsFromStringToArray($mf->OWNER_SID, array($ownerEmail));
if (intval($mf->OWNER_USER_ID) > 0) {
$rs = CTicket::GetResponsibleList($mf->OWNER_USER_ID, $I_Email, $U_Email);
while ($arr0 = $rs->Fetch()) {
if (strlen($arr0['EMAIL']) > 0) {
$arrOwnerEmails[] = $arr0['EMAIL'];
}
}
}
$mf->OWNER_EMAIL = implode(", ", array_unique($arrOwnerEmails));
// выбираем административные email'ы
$arrAdminEMails = CTicket::GetAdminEmails();
if (!is_array($arrAdminEMails)) {
$arrAdminEMails = array();
}
TrimArr($arrAdminEMails);
// сформируем email техподдержки
// Событие: "TICKET_OVERDUE_REMINDER" - #DEFAULT_EMAIL_FROM# -> #SUPPORT_EMAIL# (Напоминание о необходимости ответа (для техподдержки))
// Событие: "TICKET_CHANGE_FOR_TECHSUPPORT" - #DEFAULT_EMAIL_FROM# -> #SUPPORT_EMAIL# (Изменения в обращении (для техподдержки))
// Событие: "TICKET_NEW_FOR_TECHSUPPORT" - #DEFAULT_EMAIL_FROM# -> #SUPPORT_EMAIL# (Новое обращение (для техподдержки))
$arrSupportEmails = array();
if ($mf->RESPONSIBLE_USER_ID > 0 && isset($arStrUsers["arUsers"][$mf->RESPONSIBLE_USER_ID])) {
$arrSupportEmails[] = $arStrUsers["arUsers"][$mf->RESPONSIBLE_USER_ID]["EMAIL"];
// из группы ответсвенного, выбираем всех пользователей кто имеет доступ к рассылке
$rs = CTicket::GetResponsibleList($mf->RESPONSIBLE_USER_ID, $I_Email, $U_Email, "Y");
while ($arr0 = $rs->Fetch()) {
if (strlen($arr0['EMAIL']) > 0) {
$arrSupportEmails[] = $arr0['EMAIL'];
}
}
}
if (count($arrSupportEmails) <= 0) {
$arrSupportEmails = $arrAdminEMails;
}
if (count($arrSupportEmails) <= 0) {
$se = COption::GetOptionString("main", "email_from", "");
if (strlen($se) > 0) {
$arrSupportEmails[] = $se;
}
}
TrimArr($arrSupportEmails);
$mf->SUPPORT_EMAIL = count($arrSupportEmails) > 0 ? TrimEx(implode(",", array_unique($arrSupportEmails)), ",") : "";
//.........这里部分代码省略.........
示例2: 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");
}
//.........这里部分代码省略.........