本文整理汇总了PHP中CTicket类的典型用法代码示例。如果您正苦于以下问题:PHP CTicket类的具体用法?PHP CTicket怎么用?PHP CTicket使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CTicket类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CheckFields
function CheckFields(&$arFields, $groupID = 0, $userID = 0)
{
global $APPLICATION, $DB, $USER;
$groupID = intval($groupID);
$userID = intval($userID);
if (!is_array($arFields)) {
$arFields = array();
}
//if update
if ($userID > 0 || $groupID > 0) {
if ($userID <= 0) {
$APPLICATION->ThrowException(GetMessage('SUP_ERROR_USER_ID_EMPTY'));
return false;
}
if ($groupID <= 0) {
$APPLICATION->ThrowException(GetMessage('SUP_ERROR_GROUP_ID_EMPTY'));
return false;
}
if (array_key_exists('GROUP_ID', $arFields)) {
unset($arFields['GROUP_ID']);
}
if (array_key_exists('USER_ID', $arFields)) {
unset($arFields['USER_ID']);
}
}
//if add
if ($userID <= 0 && $groupID <= 0) {
$arFields['GROUP_ID'] = array_key_exists('GROUP_ID', $arFields) ? intval($arFields['GROUP_ID']) : 0;
$arFields['USER_ID'] = array_key_exists('USER_ID', $arFields) ? intval($arFields['USER_ID']) : 0;
if ($arFields['USER_ID'] <= 0) {
$APPLICATION->ThrowException(GetMessage('SUP_ERROR_USER_ID_EMPTY'));
return false;
}
if ($arFields['GROUP_ID'] <= 0) {
$APPLICATION->ThrowException(GetMessage('SUP_ERROR_GROUP_ID_EMPTY'));
return false;
}
$rs = $USER->GetByID($arFields['USER_ID']);
if (!$rs->Fetch()) {
$APPLICATION->ThrowException(GetMessage('SUP_ERROR_NO_USER'));
return false;
}
$rs = CSupportUserGroup::GetList(false, array('ID' => $arFields['GROUP_ID']));
if (!($arGroup = $rs->Fetch())) {
$APPLICATION->ThrowException(GetMessage('SUP_ERROR_NO_GROUP'));
return false;
}
if (CTicket::IsAdmin($arFields['USER_ID']) || CTicket::IsSupportTeam($arFields['USER_ID'])) {
if ($arGroup['IS_TEAM_GROUP'] != 'Y') {
$APPLICATION->ThrowException(GetMessage('SUP_ERROR_USER_NO_CLIENT'));
return false;
}
} elseif (CTicket::IsSupportClient($arFields['USER_ID'])) {
if ($arGroup['IS_TEAM_GROUP'] == 'Y') {
$APPLICATION->ThrowException(GetMessage('SUP_ERROR_USER_NO_TEAM'));
return false;
}
} else {
$APPLICATION->ThrowException(GetMessage('SUP_ERROR_NO_SUPPORT_USER'));
return false;
}
$rs = CSupportUser2UserGroup::GetList(false, array('GROUP_ID' => $arFields['GROUP_ID'], 'USER_ID' => $arFields['USER_ID']));
if ($rs->Fetch()) {
$APPLICATION->ThrowException(GetMessage('SUP_ERROR_USERGROUP_EXISTS'));
return false;
}
}
if (array_key_exists('CAN_VIEW_GROUP_MESSAGES', $arFields)) {
$arFields['CAN_VIEW_GROUP_MESSAGES'] = $arFields['CAN_VIEW_GROUP_MESSAGES'] == 'Y' ? 'Y' : 'N';
} elseif ($userID <= 0 && $groupID <= 0) {
$arFields['CAN_VIEW_GROUP_MESSAGES'] = 'N';
}
if (array_key_exists('CAN_MAIL_GROUP_MESSAGES', $arFields)) {
$arFields['CAN_MAIL_GROUP_MESSAGES'] = $arFields['CAN_MAIL_GROUP_MESSAGES'] == 'Y' ? 'Y' : 'N';
} elseif ($userID <= 0 && $groupID <= 0) {
$arFields['CAN_MAIL_GROUP_MESSAGES'] = 'N';
}
return true;
}
示例2: GetMessageDynamicList
function GetMessageDynamicList(&$by, &$order, $arFilter = array())
{
$err_mess = CTicket::err_mess() . "<br>Function: GetMessageDynamicList<br>Line: ";
global $DB;
$arSqlSearch = array();
$strSqlSearch = "";
if (is_array($arFilter)) {
$filterKeys = array_keys($arFilter);
for ($i = 0; $i < count($filterKeys); $i++) {
$key = $filterKeys[$i];
$val = $arFilter[$filterKeys[$i]];
if (is_array($val) && count($val) <= 0 || !is_array($val) && (strlen($val) <= 0 || $val === 'NOT_REF')) {
continue;
}
$matchValueSet = in_array($key . "_EXACT_MATCH", $filterKeys) ? true : false;
$key = strtoupper($key);
switch ($key) {
case "SITE":
case "SITE_ID":
if (is_array($val)) {
$val = implode(" | ", $val);
}
$match = $arFilter[$key . "_EXACT_MATCH"] == "N" && $matchValueSet ? "Y" : "N";
$arSqlSearch[] = GetFilterQuery("T.SITE_ID", $val, $match);
break;
case "DATE_CREATE_1":
if (CheckDateTime($val)) {
$arSqlSearch[] = "M.DATE_CREATE>=" . $DB->CharToDateFunction($val, "SHORT");
}
break;
case "DATE_CREATE_2":
if (CheckDateTime($val)) {
$arSqlSearch[] = "M.DATE_CREATE<" . $DB->CharToDateFunction($val, "SHORT") . " + INTERVAL 1 DAY";
}
break;
case "OWNER":
$match = $arFilter[$key . "_EXACT_MATCH"] == "Y" && $matchValueSet ? "N" : "Y";
$arSqlSearch[] = GetFilterQuery("M.OWNER_USER_ID, U.LOGIN, U.LAST_NAME, U.NAME", $val, $match);
break;
case "OWNER_ID":
if (intval($val) > 0) {
$arSqlSearch[] = "M.OWNER_USER_ID = '" . intval($val) . "'";
} elseif ($val == 0) {
$arSqlSearch[] = "(M.OWNER_USER_ID is null or M.OWNER_USER_ID=0)";
}
break;
case "IS_HIDDEN":
case "IS_LOG":
case "IS_OVERDUE":
$arSqlSearch[] = $val == "Y" ? "M." . $key . "='Y'" : "M." . $key . "='N'";
break;
case "SLA_ID":
case "SLA":
$match = $arFilter[$key . "_EXACT_MATCH"] == "N" && $matchValueSet ? "Y" : "N";
$arSqlSearch[] = GetFilterQuery("T.SLA_ID", $val, $match);
break;
case "CATEGORY_ID":
case "CATEGORY":
if (intval($val) > 0) {
$arSqlSearch[] = "T.CATEGORY_ID = '" . intval($val) . "'";
} elseif ($val == 0) {
$arSqlSearch[] = "(T.CATEGORY_ID is null or T.CATEGORY_ID=0)";
}
break;
case "CRITICALITY_ID":
case "CRITICALITY":
if (intval($val) > 0) {
$arSqlSearch[] = "T.CRITICALITY_ID = '" . intval($val) . "'";
} elseif ($val == 0) {
$arSqlSearch[] = "(T.CRITICALITY_ID is null or T.CRITICALITY_ID=0)";
}
break;
case "STATUS_ID":
case "STATUS":
if (intval($val) > 0) {
$arSqlSearch[] = "T.STATUS_ID = '" . intval($val) . "'";
} elseif ($val == 0) {
$arSqlSearch[] = "(T.STATUS_ID is null or T.STATUS_ID=0)";
}
break;
case "MARK_ID":
case "MARK":
if (intval($val) > 0) {
$arSqlSearch[] = "T.MARK_ID = '" . intval($val) . "'";
} elseif ($val == 0) {
$arSqlSearch[] = "(T.MARK_ID is null or T.MARK_ID=0)";
}
break;
case "SOURCE_ID":
case "SOURCE":
if (intval($val) > 0) {
$arSqlSearch[] = "T.SOURCE_ID = '" . intval($val) . "'";
} elseif ($val == 0) {
$arSqlSearch[] = "(T.SOURCE_ID is null or T.SOURCE_ID=0)";
}
break;
case "DIFFICULTY_ID":
case "DIFFICULTY":
if (intval($val) > 0) {
$arSqlSearch[] = "T.DIFFICULTY_ID = '" . intval($val) . "'";
//.........这里部分代码省略.........
示例3: array
}
if ($gadget["SECURITY_ONLY"] == true) {
$aGlobalOpt = CUserOptions::GetOption("global", "settings", array());
$bShowSecurity = file_exists($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/security/install/index.php") && $aGlobalOpt['messages']['security'] != 'N';
if (!$bShowSecurity) {
continue;
}
}
if ($gadget["PERFMON_ONLY"] == true) {
$aGlobalOpt = CUserOptions::GetOption("global", "settings", array());
$bShowPerfmon = file_exists($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/perfmon/install/index.php") && $aGlobalOpt['messages']['perfmon'] != 'N';
if (!$bShowPerfmon) {
continue;
}
}
if ($gadget["SUPPORT_ONLY"] == true && (!CModule::IncludeModule("support") || !$USER->IsAuthorized() || !CTicket::IsSupportClient() && !CTicket::IsAdmin() && !CTicket::IsSupportTeam())) {
continue;
}
if ($gadget["WIKI_ONLY"] == true && !IsModuleInstalled("wiki")) {
continue;
}
if ($gadget["CRM_ONLY"] == true && !IsModuleInstalled("crm")) {
continue;
}
if ($gadget["VOTE_ONLY"] == true && (!IsModuleInstalled("vote") || !CBXFeatures::IsFeatureEnabled("Vote"))) {
continue;
}
if ($gadget["TASKS_ONLY"] == true && !CBXFeatures::IsFeatureEnabled("Tasks")) {
continue;
}
if ($gadget["MESSENGER_ONLY"] == true && !CBXFeatures::IsFeatureEnabled("WebMessenger")) {
示例4: Delete
function Delete($id, $checkRights = true)
{
$err_mess = self::err_mess() . "<br>Function: Delete<br>Line: ";
global $DB, $USER, $APPLICATION;
$id = intval($id);
$table = self::TABLE;
$tableShedule = self::TABLE_SHEDULE;
if ($id <= 0) {
return false;
}
$isDemo = null;
$isSupportClient = null;
$isSupportTeam = null;
$isAdmin = null;
$isAccess = null;
$userID = null;
CTicket::GetRoles($isDemo, $isSupportClient, $isSupportTeam, $isAdmin, $isAccess, $userID, $checkRights);
if (!$isAdmin) {
$arMsg = array();
$arMsg[] = array("id" => "PERMISSION", "text" => GetMessage("SUP_ERROR_ACCESS_DENIED"));
$e = new CAdminException($arMsg);
$APPLICATION->ThrowException($e);
return false;
}
$strSql = "SELECT DISTINCT 'x' FROM b_ticket_sla WHERE TIMETABLE_ID = {$id}";
$rs = $DB->Query($strSql, false, $err_mess . __LINE__);
if (!$rs->Fetch()) {
$DB->Query("DELETE FROM {$table} WHERE ID = {$id}", false, $err_mess . __LINE__);
$DB->Query("DELETE FROM {$tableShedule} WHERE TIMETABLE_ID = {$id}", false, $err_mess . __LINE__);
return true;
} else {
$APPLICATION->ThrowException(str_replace("#ID#", "{$id}", GetMessage("SUP_ERROR_TIMETABLE_HAS_SLA")));
}
return false;
}
示例5: GetMessage
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
$bDemo = CTicket::IsDemo() ? "Y" : "N";
$bAdmin = CTicket::IsAdmin() ? "Y" : "N";
$bSupportTeam = CTicket::IsSupportTeam() ? "Y" : "N";
$bADS = $bDemo == 'Y' || $bAdmin == 'Y' || $bSupportTeam == 'Y';
?>
<form method="post" action="<?php
echo $arResult["NEW_TICKET_PAGE"];
?>
">
<input type="submit" name="edit" value="<?php
echo GetMessage("SUP_ASK");
?>
">
</form>
<br />
<?php
$APPLICATION->IncludeComponent("bitrix:main.interface.grid", "", array("GRID_ID" => $arResult["GRID_ID"], "HEADERS" => array(array("id" => "LAMP", "name" => GetMessage('SUP_LAMP'), "sort" => "s_lamp", "default" => true), array("id" => "ID", "name" => GetMessage('SUP_ID'), "sort" => "s_id", "default" => true), array("id" => "TITLE", "name" => GetMessage('SUP_TITLE'), "default" => true), array("id" => "TIMESTAMP_X", "name" => GetMessage('SUP_TIMESTAMP'), "sort" => "s_timestamp_x", "default" => true), array("id" => "MODIFIED_BY", "name" => GetMessage('SUP_MODIFIED_BY'), "default" => true), array("id" => "MESSAGES", "name" => GetMessage('SUP_MESSAGES'), "default" => true), array("id" => "STATUS_NAME", "name" => GetMessage('SUP_STATUS'), "default" => true)), "SORT" => $arResult["SORT"], "SORT_VARS" => $arResult["SORT_VARS"], "ROWS" => $arResult["ROWS"], "FOOTER" => array(array("title" => GetMessage('SUP_TOTAL'), "value" => $arResult["ROWS_COUNT"])), "ACTION_ALL_ROWS" => true, "EDITABLE" => false, "NAV_OBJECT" => $arResult["NAV_OBJECT"], "AJAX_ID" => $arParams["AJAX_ID"], "FILTER" => $arResult["FILTER"]), $component);
?>
<br />
<br />
<table class="support-ticket-hint">
示例6: while
$rsMessage = CTicket::GetMessageList($by, $order, $arFilter, $is_filtered, $check_rights = "Y", $get_user_name = "N");
$rsMessage->NavStart($arParams["MESSAGES_PER_PAGE"]);
$arResult["NAV_STRING"] = $rsMessage->GetPageNavString(GetMessage("SUP_PAGES"));
$arResult["NAV_RESULT"] = $rsMessage;
while ($arMessage = $rsMessage->GetNext()) {
if (array_key_exists($arMessage["ID"], $arMessagesFiles)) {
$arFiles["FILES"] = $arMessagesFiles[$arMessage["ID"]];
} else {
$arFiles["FILES"] = array();
}
$arMessage["MESSAGE"] = TxtToHTML($arMessage["~MESSAGE"], $bMakeUrls = true, $iMaxStringLen = $arParams["MESSAGE_MAX_LENGTH"], $QUOTE_ENABLED = "Y", $NOT_CONVERT_AMPERSAND = "N", $CODE_ENABLED = "Y", $BIU_ENABLED = "Y", $quote_table_class = "support-quote-table", $quote_head_class = "support-quote-head", $quote_body_class = "support-quote-body", $code_table_class = "support-code-table", $code_head_class = "support-code-head", $code_body_class = "support-code-body", $code_textarea_class = "support-code-textarea", $link_class = "");
$arResult["MESSAGES"][] = $arMessage + $arFiles + _GetUserInfo($arMessage["OWNER_USER_ID"], "OWNER") + _GetUserInfo($arMessage["CREATED_USER_ID"], "CREATED") + _GetUserInfo($arMessage["MODIFIED_USER_ID"], "MODIFIED_BY");
}
//Online
CTicket::UpdateOnline($arParams["ID"], $USER->GetID());
$rsOnline = CTicket::GetOnline($arParams["ID"]);
while ($arOnline = $rsOnline->GetNext()) {
$arResult["ONLINE"][] = $arOnline;
}
$ticketSite = $arTicket["SITE_ID"];
$ticketSla = $arTicket["SLA_ID"];
} else {
$ticketSite = SITE_ID;
$ticketSla = CTicketSLA::GetForUser();
$arResult["DICTIONARY"]["CRITICALITY_DEFAULT"] = CTicketDictionary::GetDefault("K", $ticketSite);
$arResult["DICTIONARY"]["CATEGORY_DEFAULT"] = CTicketDictionary::GetDefault("C", $ticketSite);
}
//Mark, Category, Criticality dictionary list
$ticketDictionary = CTicketDictionary::GetDropDownArray($ticketSite, $ticketSla);
$arResult["DICTIONARY"]["MARK"] = _GetDropDownDictionary("M", $ticketDictionary);
$arResult["DICTIONARY"]["CRITICALITY"] = _GetDropDownDictionary("K", $ticketDictionary);
示例7: intval
}
if ($find_open == "Y") {
$arrY_open[] = intval($f_OPEN_TICKETS);
}
if ($find_close == "Y") {
$arrY_close[] = intval($f_CLOSE_TICKETS);
}
$prev_date = $date;
}
/******************************************************
‘ормируем ось X
*******************************************************/
$arrayX = GetArrayX($arrX, $MinX, $MaxX);
if ($find_mess == "Y" || $find_overdue_mess == "Y") {
$arFilter = array("SITE" => $find_site, "DATE_CREATE_1" => $find_date1, "DATE_CREATE_2" => $find_date2, "OWNER_ID" => $find_responsible_id, "OWNER" => $find_responsible, "OWNER_EXACT_MATCH" => $find_responsible_exact_match, "SLA" => $find_sla_id, "CATEGORY" => $find_category_id, "CRITICALITY" => $find_criticality_id, "STATUS" => $find_status_id, "MARK" => $find_mark_id, "SOURCE" => $find_source_id, "IS_HIDDEN" => "N", "IS_LOG" => "N", "IS_OVERDUE" => "N");
$rsMess = CTicket::GetMessageDynamicList($v1 = "s_date_create", $v2 = "asc", $arFilter);
while ($arMess = $rsMess->Fetch()) {
$date = mktime(0, 0, 0, $arMess["CREATE_MONTH"], $arMess["CREATE_DAY"], $arMess["CREATE_YEAR"]);
$arrMessages[$date] = $arMess["COUNTER"];
$arrOverdueMessages[$date] = $arMess["COUNTER_OVERDUE"];
}
foreach ($arrX as $t) {
$arrY_mess[] = intval($arrMessages[$t]);
$arrY_overdue_mess[] = intval($arrOverdueMessages[$t]);
}
}
/******************************************************
‘ормируем ось Y
*******************************************************/
$arrY = array();
if ($find_all == "Y") {
示例8: intval
$url = $APPLICATION->GetCurPage() . "?TICKET_ID=" . $TICKET_ID . "&OWNER_USER_ID=" . intval($OWNER_USER_ID) . "&lang=" . LANGUAGE_ID . "&ONLINE_AUTO_REFRESH=" . intval($ONLINE_AUTO_REFRESH);
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_popup_admin.php";
$lamp = CTicket::GetStatus($TICKET_ID);
$ticket = CTicket::GetByID($TICKET_ID);
$arTicket = $ticket->ExtractFields();
?>
<table cellspacing=0 cellpadding=0 class="support-online">
<?php
$mode = strlen($mode) > 0 ? $mode : false;
CTicket::UpdateOnline($TICKET_ID, false, $mode);
$rs = CTicket::GetOnline($TICKET_ID);
while ($ar = $rs->GetNext()) {
$is_support = "";
if (intval($OWNER_USER_ID) == $ar["USER_ID"]) {
$is_support = "N";
} elseif (CTicket::IsSupportTeam($ar["USER_ID"]) || CTicket::IsAdmin($ar["USER_ID"]) || CTicket::IsDemo($ar["USER_ID"])) {
$is_support = "Y";
}
?>
<tr>
<td valign="top" width="16%"><?php
if ($is_support == "Y") {
if ($ar["CURRENT_MODE"] == "edit") {
?>
<img src="/bitrix/images/support/sup_write.gif" width="15" height="13" border="0" alt="<?php
echo GetMessage("SUP_EDIT_MODE_ALT");
?>
"><?php
} else {
?>
<img src="/bitrix/images/support/sup_view.gif" width="17" height="13" border="0" alt="<?php
示例9: GetMessage
if (strSourceValue!="NOT_REF")
{
document.getElementById("OWNER_SID").disabled = false;
document.getElementById("OWNER_SID").style.display = "inline";
}
}
//-->
</SCRIPT>
<tr valign="middle">
<td width="20%" nowrap><?php
echo GetMessage("SUP_SOURCE") . " / " . GetMessage("SUP_FROM");
?>
</td>
<td width="80%" nowrap><?php
echo SelectBox("SOURCE_ID", CTicket::GetRefBookValues("SR", $arTicket["LID"]), "< web >", $str_SOURCE_ID, "OnChange=SelectSource() ");
?>
<input type="text" size="12" name="OWNER_SID" id="OWNER_SID" value="<?php
echo $str_OWNER_SID;
?>
"><?php
echo FindUserID("OWNER_USER_ID", $str_OWNER_USER_ID);
?>
</td>
</tr>
<SCRIPT LANGUAGE="JavaScript">
<!--
SelectSource();
//-->
</SCRIPT>
<tr valign="top">
示例10: IncludeModuleLangFile
<?php
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_before.php";
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/support/prolog.php";
CModule::IncludeModule('support');
IncludeModuleLangFile(__FILE__);
$bDemo = CTicket::IsDemo();
$bAdmin = CTicket::IsAdmin();
if (!$bAdmin && !$bDemo) {
$APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
}
$EDIT_URL = "/bitrix/admin/ticket_group_edit.php";
$LIST_URL = $APPLICATION->GetCurPage();
$sTableID = 't_ugroups_list';
$oSort = new CAdminSorting($sTableID, 'SORT', 'asc');
$lAdmin = new CAdminList($sTableID, $oSort);
$filter = new CAdminFilter($sTableID . '_filter_id', array('ID', GetMessage('SUP_GL_FLT_IS_TEAM_GROUP')));
$arFilterFields = array('FIND_NAME', 'FIND_NAME_EXACT_MATCH', 'FIND_ID', 'FIND_IS_TEAM_GROUP');
$lAdmin->InitFilter($arFilterFields);
$arFilter = array();
foreach ($arFilterFields as $key) {
if (strpos($key, '_EXACT_MATCH') !== false) {
continue;
}
if (array_key_exists($key . '_EXACT_MATCH', $_REQUEST) && $_REQUEST[$key . '_EXACT_MATCH'] == 'Y') {
$op = '=';
} else {
$op = '%';
}
if (array_key_exists($key, $_REQUEST) && strlen($_REQUEST[$key]) > 0) {
if (in_array($key . '_EXACT_MATCH', $arFilterFields)) {
示例11: GetMessage
</tr>
<?php
$tabControl->BeginNextTab();
?>
<tr>
<td align="right" valign="top"><?php
echo GetMessage("SUP_USER_GROUPS");
?>
:</td>
<td><?php
$rs = CGroup::GetList($v1 = "sort", $v2 = "asc", array());
while ($ar = $rs->Fetch()) {
$arRoles = $APPLICATION->GetUserRoles("support", array(intval($ar["ID"])), "Y", "N");
if (in_array(CTicket::GetSupportClientRoleID(), $arRoles) || in_array(CTicket::GetSupportTeamRoleID(), $arRoles) || in_array(CTicket::GetDemoRoleID(), $arRoles) || in_array(CTicket::GetAdminRoleID(), $arRoles)) {
echo InputType("checkbox", "arGROUPS[]", $ar["ID"], $arGROUPS) . " " . htmlspecialchars($ar["NAME"]) . " [<a title=\"" . GetMessage("MAIN_ADMIN_MENU_EDIT") . "\" href=\"/bitrix/admin/group_edit.php?ID=" . intval($ar["ID"]) . "&lang=" . LANGUAGE_ID . "\">" . intval($ar["ID"]) . "</a>]<br>";
}
}
?>
</td>
</tr>
<?php
$tabControl->BeginNextTab();
?>
<script type="text/javascript">
<!--
示例12: 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");
}
//.........这里部分代码省略.........
示例13: ForumMoveMessage2Support
function ForumMoveMessage2Support($MID, &$strErrorMessage, &$strOKMessage, $arAddParams = array())
{
global $USER;
$MID = IntVal($MID);
$sError = array();
$sNote = array();
$arAddParams = !is_array($arAddParams) ? array($arAddParams) : $arAddParams;
$arAddParams["PERMISSION"] = !empty($arAddParams["PERMISSION"]) ? $arAddParams["PERMISSION"] : false;
if ($MID <= 0) {
$arError[] = GetMessage("MOVEMES_NO_MESS_EX");
}
if (!CModule::IncludeModule("support")) {
$arError[] = GetMessage("MOVEMES_NO_SUPPORT");
}
if (empty($arError)) {
$arMessage = CForumMessage::GetByID($MID, array("FILTER" => "N"));
if (!$arMessage) {
$arError[] = GetMessage("MOVEMES_NO_MESS_EX");
} elseif (IntVal($arMessage["AUTHOR_ID"]) <= 0) {
$arError[] = GetMessage("MOVEMES_NO_ANONYM");
} elseif (!CForumMessage::CanUserDeleteMessage($MID, $USER->GetUserGroupArray(), $USER->GetID(), $arAddParams["PERMISSION"])) {
$arError[] = GetMessage("MOVEMES_NO_PERMS2MOVE");
} else {
$arTopic = CForumTopic::GetByID($arMessage["TOPIC_ID"]);
$arFieldsSu = array("CLOSE" => "N", "TITLE" => $arTopic["TITLE"], "MESSAGE" => $arMessage["POST_MESSAGE"], "OWNER_USER_ID" => $arMessage["AUTHOR_ID"], "OWNER_SID" => $arMessage["AUTHOR_NAME"], "SOURCE_SID" => "forum");
$arIMAGE = CFile::MakeFileArray($arMessage["ATTACH_IMG"]);
if (is_array($arIMAGE)) {
$arIMAGE["MODULE_ID"] = "support";
$arFieldsSu["FILES"] = array($arIMAGE);
}
$SuID = CTicket::SetTicket($arFieldsSu);
$SuID = IntVal($SuID);
if ($SuID > 0) {
$sNote[] = GetMessage("MOVEMES_SUCCESS_SMOVE");
} else {
$arError[] = GetMessage("MOVEMES_ERROR_SMOVE");
}
}
}
if (!empty($arError)) {
$strErrorMessage .= implode(".\n", $arError) . ".\n";
}
if (!empty($arNote)) {
$strOKMessage .= implode(".\n", $arNote) . ".\n";
}
if (empty($arError)) {
return $SuID;
} else {
return False;
}
}
示例14: Delete
function Delete($id, $CHECK_RIGHTS = "Y")
{
$err_mess = CAllTicketDictionary::err_mess() . "<br>Function: Delete<br>Line: ";
global $DB, $APPLICATION;
$id = intval($id);
if ($id <= 0) {
return;
}
$bAdmin = "N";
if ($CHECK_RIGHTS == "Y") {
$bAdmin = CTicket::IsAdmin() ? "Y" : "N";
} else {
$bAdmin = "Y";
}
if ($bAdmin == "Y") {
$DB->Query("DELETE FROM b_ticket_dictionary WHERE ID='{$id}'", false, $err_mess . __LINE__);
$DB->Query('DELETE FROM b_ticket_dictionary_2_site WHERE DICTIONARY_ID=' . $id, false, $err_mess . __LINE__);
}
}
示例15: GetList
function GetList(&$arSort, $arFilter = array(), &$isFiltered)
{
$err_mess = CTicketSLA::err_mess() . "<br>Function: GetList<br>Line: ";
global $DB, $USER, $APPLICATION;
$isFiltered = false;
// filter params correct
if (CTicket::CheckFilter($arFilter)) {
$arSqlSearch = array();
if (is_array($arFilter) && count($arFilter) > 0) {
$filterKeys = array_keys($arFilter);
$filterKeysCount = count($filterKeys);
for ($i = 0; $i < $filterKeysCount; $i++) {
$key = $filterKeys[$i];
$val = $arFilter[$filterKeys[$i]];
if (is_array($val) && count($val) <= 0 || !is_array($val) && (strlen($val) <= 0 || $val === 'NOT_REF')) {
continue;
}
$matchValueSet = in_array($key . "_EXACT_MATCH", $filterKeys) ? true : false;
$key = strtoupper($key);
if (is_array($val)) {
$val = implode(" | ", $val);
}
switch ($key) {
case "ID":
case "SLA_ID":
$match = $arFilter[$key . "_EXACT_MATCH"] == "N" && $matchValueSet ? "Y" : "N";
$arSqlSearch[] = GetFilterQuery("S." . $key, $val, $match);
break;
case "NAME":
case "DESCRIPTION":
case "DEADLINE_SOURCE":
$match = $arFilter[$key . "_EXACT_MATCH"] == "Y" && $matchValueSet ? "N" : "Y";
$arSqlSearch[] = GetFilterQuery("S." . $key, $val, $match);
break;
case "SITE":
$val .= " | ALL";
$match = $arFilter[$key . "_EXACT_MATCH"] == "N" && $matchValueSet ? "Y" : "N";
$arSqlSearch[] = GetFilterQuery("SS.SITE_ID", $val, $match);
$left_join_site = "LEFT JOIN b_ticket_sla_2_site SS ON (S.ID = SS.SLA_ID)";
break;
}
}
}
}
$strSqlSearch = GetFilterSqlSearch($arSqlSearch);
$arSort = is_array($arSort) ? $arSort : array();
if (count($arSort) > 0) {
$ar1 = array_merge($DB->GetTableFieldsList("b_ticket_sla"), array());
$ar2 = array_keys($arSort);
$arDiff = array_diff($ar2, $ar1);
if (is_array($arDiff) && count($arDiff) > 0) {
foreach ($arDiff as $value) {
unset($arSort[$value]);
}
}
}
if (count($arSort) <= 0) {
$arSort = array("PRIORITY" => "DESC");
}
while (list($by, $order) = each($arSort)) {
if (strtoupper($order) != "DESC") {
$order = "ASC";
}
if ($by == "RESPONSE_TIME") {
$arSqlOrder[] = "case RESPONSE_TIME_UNIT when 'day' then 3 when 'hour' then 2 when 'minute' then 1 end {$order}";
$arSqlOrder[] = $by . " " . $order;
} else {
$arSqlOrder[] = $by . " " . $order;
}
}
if (is_array($arSqlOrder) && count($arSqlOrder) > 0) {
$strSqlOrder = " ORDER BY " . implode(",", $arSqlOrder);
}
$strSql = "\n\t\t\tSELECT DISTINCT\n\t\t\t\tS.*,\n\t\t\t\tcase S.RESPONSE_TIME_UNIT\n\t\t\t\t\twhen 'day' then S.RESPONSE_TIME*1440\n\t\t\t\t\twhen 'hour' then S.RESPONSE_TIME*60\n\t\t\t\t\twhen 'minute' then S.RESPONSE_TIME\n\t\t\t\t\tend\t\t\t\t\t\t\t\t\t\t\tM_RESPONSE_TIME,\n\t\t\t\tcase S.NOTICE_TIME_UNIT\n\t\t\t\t\twhen 'day' then S.NOTICE_TIME*1440\n\t\t\t\t\twhen 'hour' then S.NOTICE_TIME*60\n\t\t\t\t\twhen 'minute' then S.NOTICE_TIME\n\t\t\t\t\tend\t\t\t\t\t\t\t\t\t\t\tM_NOTICE_TIME,\n\t\t\t\tS.ID\t\t\t\t\t\t\t\t\t\t\tREFERENCE_ID,\n\t\t\t\tS.NAME\t\t\t\t\t\t\t\t\t\t\tREFERENCE,\n\t\t\t\t" . $DB->DateToCharFunction("S.DATE_MODIFY") . "\tDATE_MODIFY_F,\n\t\t\t\t" . $DB->DateToCharFunction("S.DATE_CREATE") . "\tDATE_CREATE_F\n\t\t\tFROM\n\t\t\t\tb_ticket_sla S\n\t\t\t{$left_join_site}\n\t\t\tWHERE\n\t\t\t{$strSqlSearch}\n\t\t\t{$strSqlOrder}\n\t\t\t";
$rs = $DB->Query($strSql, false, $err_mess . __LINE__);
$isFiltered = IsFiltered($strSqlSearch);
return $rs;
}