本文整理汇总了PHP中CTicket::GetResponsibleList方法的典型用法代码示例。如果您正苦于以下问题:PHP CTicket::GetResponsibleList方法的具体用法?PHP CTicket::GetResponsibleList怎么用?PHP CTicket::GetResponsibleList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTicket
的用法示例。
在下文中一共展示了CTicket::GetResponsibleList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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)), ",") : "";
//.........这里部分代码省略.........