本文整理汇总了PHP中CTicket::IsSupportClient方法的典型用法代码示例。如果您正苦于以下问题:PHP CTicket::IsSupportClient方法的具体用法?PHP CTicket::IsSupportClient怎么用?PHP CTicket::IsSupportClient使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTicket
的用法示例。
在下文中一共展示了CTicket::IsSupportClient方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetMessageList
function GetMessageList(&$by, &$order, $arFilter = array(), &$isFiltered, $checkRights = "Y", $getUserName = "Y")
{
$err_mess = CTicket::err_mess() . "<br>Function: GetMessageList<br>Line: ";
global $DB, $USER, $APPLICATION;
$bAdmin = "N";
$bSupportTeam = "N";
$bSupportClient = "N";
$bDemo = "N";
if ($checkRights == "Y") {
$bAdmin = CTicket::IsAdmin() ? "Y" : "N";
$bSupportTeam = CTicket::IsSupportTeam() ? "Y" : "N";
$bSupportClient = CTicket::IsSupportClient() ? "Y" : "N";
$bDemo = CTicket::IsDemo() ? "Y" : "N";
$uid = intval($USER->GetID());
} else {
$bAdmin = "Y";
$bSupportTeam = "Y";
$bSupportClient = "Y";
$bDemo = "Y";
$uid = 0;
}
if ($bAdmin != "Y" && $bSupportTeam != "Y" && $bSupportClient != "Y" && $bDemo != "Y") {
return false;
}
$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 "ID":
$match = $arFilter[$key . "_EXACT_MATCH"] == "N" && $matchValueSet ? "Y" : "N";
$arSqlSearch[] = GetFilterQuery("M.ID", $val, $match);
break;
case "TICKET_ID":
$arSqlSearch[] = "M.TICKET_ID = " . intval($val);
break;
case "TICKET":
$match = $arFilter[$key . "_EXACT_MATCH"] == "N" && $matchValueSet ? "Y" : "N";
$arSqlSearch[] = GetFilterQuery("M.TICKET_ID", $val, $match);
break;
case "IS_MESSAGE":
$arSqlSearch[] = $val == "Y" ? "(M.IS_HIDDEN = 'N' and M.IS_LOG='N' and M.IS_OVERDUE='N')" : "(M.IS_HIDDEN = 'Y' or M.IS_LOG='Y' or M.IS_OVERDUE='Y')";
break;
case "IS_HIDDEN":
case "IS_LOG":
case "IS_OVERDUE":
case "NOT_CHANGE_STATUS":
case "MESSAGE_BY_SUPPORT_TEAM":
$arSqlSearch[] = $val == "Y" ? "M." . $key . "='Y'" : "M." . $key . "='N'";
break;
case "EXTERNAL_FIELD_1":
$match = $arFilter[$key . "_EXACT_MATCH"] == "Y" && $matchValueSet ? "N" : "Y";
$arSqlSearch[] = GetFilterQuery("M.EXTERNAL_FIELD_1", $val, $match);
break;
}
}
}
if ($getUserName == "Y") {
$u_select = "\n\t\t\t\t,\n\t\t\t\tUO.EMAIL\t\t\t\t\t\t\t\t\t\t\t\tOWNER_EMAIL,\n\t\t\t\tUO.LOGIN\t\t\t\t\t\t\t\t\t\t\t\tOWNER_LOGIN,\n\t\t\t\tconcat(ifnull(UO.NAME,''),' ',ifnull(UO.LAST_NAME,''))\tOWNER_NAME,\n\t\t\t\tUO.LOGIN\t\t\t\t\t\t\t\t\t\t\t\tLOGIN,\n\t\t\t\tconcat(ifnull(UO.NAME,''),' ',ifnull(UO.LAST_NAME,''))\tNAME,\n\t\t\t\tUC.EMAIL\t\t\t\t\t\t\t\t\t\t\t\tCREATED_EMAIL,\n\t\t\t\tUC.LOGIN\t\t\t\t\t\t\t\t\t\t\t\tCREATED_LOGIN,\n\t\t\t\tconcat(ifnull(UC.NAME,''),' ',ifnull(UC.LAST_NAME,''))\tCREATED_NAME,\n\t\t\t\tUM.EMAIL\t\t\t\t\t\t\t\t\t\t\t\tMODIFIED_EMAIL,\n\t\t\t\tUM.LOGIN\t\t\t\t\t\t\t\t\t\t\t\tMODIFIED_LOGIN,\n\t\t\t\tconcat(ifnull(UM.NAME,''),' ',ifnull(UM.LAST_NAME,''))\tMODIFIED_NAME\n\t\t\t\t";
$u_join = "\n\t\t\tLEFT JOIN b_user UO ON (UO.ID = M.OWNER_USER_ID)\n\t\t\tLEFT JOIN b_user UC ON (UC.ID = M.CREATED_USER_ID)\n\t\t\tLEFT JOIN b_user UM ON (UM.ID = M.MODIFIED_USER_ID)\n\t\t\t";
}
if ($bSupportTeam != "Y" && $bAdmin != "Y") {
$arSqlSearch[] = "M.IS_HIDDEN='N'";
$arSqlSearch[] = "M.IS_LOG='N'";
}
$strSqlSearch = GetFilterSqlSearch($arSqlSearch);
if ($by == "s_id") {
$strSqlOrder = "ORDER BY M.ID";
} elseif ($by == "s_number") {
$strSqlOrder = "ORDER BY M.C_NUMBER";
} else {
$by = "s_number";
$strSqlOrder = "ORDER BY M.C_NUMBER";
}
if ($order == "desc") {
$strSqlOrder .= " desc ";
$order = "desc";
} else {
$strSqlOrder .= " asc ";
$order = "asc";
}
$strSql = "\n\t\t\tSELECT\n\t\t\t\tM.*,\n\t\t\t\tT.SLA_ID,\n\t\t\t\t" . $DB->DateToCharFunction("M.DATE_CREATE") . "\t\t\tDATE_CREATE,\n\t\t\t\t" . $DB->DateToCharFunction("M.TIMESTAMP_X") . "\t\t\tTIMESTAMP_X,\n\t\t\t\tDS.NAME\t\t\t\t\t\t\t\t\t\t\t\t\tSOURCE_NAME\n\t\t\t\t{$u_select}\n\t\t\tFROM\n\t\t\t\tb_ticket_message M\n\t\t\tINNER JOIN b_ticket T ON (T.ID = M.TICKET_ID)\n\t\t\tLEFT JOIN b_ticket_dictionary DS ON (DS.ID = M.SOURCE_ID)\n\t\t\t{$u_join}\n\t\t\tWHERE\n\t\t\t\t{$strSqlSearch}\n\t\t\t{$strSqlOrder}\n\t\t\t";
$res = $DB->Query($strSql, false, $err_mess . __LINE__);
return $res;
}
示例2: 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")) {
示例3: Set_InitVar
function Set_InitVar(&$arFields, $id, $checkRights, $sendEmailToAuthor, $sendEmailToTechsupport)
{
global $APPLICATION, $USER, $DB;
$f = self::GetCSupportTableFields("b_ticket");
$v = (object) array();
if (!is_object($USER)) {
$USER = new CUser();
}
$uid = $USER->GetID();
if (isset($arFields["CURRENT_USER_ID"]) && intval($arFields["CURRENT_USER_ID"]) > 0) {
$uid = intval($arFields["CURRENT_USER_ID"]);
}
$f->ID = intval($id);
$v->isNew = $f->ID <= 0;
$v->CHECK_RIGHTS = $checkRights == "Y" ? "Y" : "N";
$v->SEND_EMAIL_TO_AUTHOR = $sendEmailToAuthor == "Y" ? "Y" : "N";
$v->SEND_EMAIL_TO_TECHSUPPORT = $sendEmailToTechsupport == "Y" ? "Y" : "N";
$v->newSLA = false;
// заголовок и сообщение - обязательные поля для нового обращения
if ($v->isNew) {
if (strlen($arFields["TITLE"]) <= 0) {
$APPLICATION->ThrowException(GetMessage('SUP_ERROR_EMPTY_TITLE'));
return false;
}
if (strlen($arFields["MESSAGE"]) <= 0) {
$APPLICATION->ThrowException(GetMessage('SUP_ERROR_EMPTY_MESSAGE'));
return false;
}
}
if (is_object($APPLICATION)) {
$APPLICATION->ResetException();
}
if (!$GLOBALS["USER_FIELD_MANAGER"]->CheckFields("SUPPORT", $f->ID, $arFields)) {
if (is_object($APPLICATION) && $APPLICATION->GetException()) {
return false;
} else {
$APPLICATION->ThrowException("Unknown error. ");
return false;
}
}
// установка прав
$v->bAdmin = $v->bSupportTeam = $v->bSupportClient = $v->bDemo = $v->bOwner = false;
if ($v->CHECK_RIGHTS == "Y") {
$v->uid = $uid;
$v->bAdmin = CTicket::IsAdmin($uid);
$v->bSupportTeam = CTicket::IsSupportTeam($uid);
$v->bSupportClient = CTicket::IsSupportClient($uid);
$v->bDemo = CTicket::IsDemo($uid);
if ($v->isNew) {
$v->bOwner = true;
} else {
$v->bOwner = CTicket::IsOwner($f->ID, $v->uid);
}
} else {
$v->bAdmin = $v->bSupportTeam = $v->bSupportClient = $v->bDemo = $v->bOwner = true;
$v->uid = 0;
}
if (!$v->bAdmin && !$v->bSupportTeam && !$v->bSupportClient) {
return false;
}
if (!$v->bAdmin && !$v->bSupportTeam && ($v->bDemo && !$v->bOwner)) {
return false;
}
// Это спам?
$f->FromArray($arFields, "IS_SPAM");
$v->bActiveCoupon = false;
$f->FromArray($_SESSION, array("MODIFIED_GUEST_ID" => "SESS_GUEST_ID"), array(CSupportTableFields::MORE0));
$f->FromArray($arFields, "OWNER_USER_ID,OWNER_SID,HOLD_ON", array(CSupportTableFields::MORE0, CSupportTableFields::NOT_EMTY_STR));
// получим SITE_ID
if (strlen($arFields["SITE_ID"]) > 0) {
$f->SITE_ID = $arFields["SITE_ID"];
} elseif (strlen($arFields["SITE"]) > 0) {
$f->SITE_ID = $arFields["SITE"];
} elseif (strlen($arFields["LANG"]) > 0) {
$f->SITE_ID = $arFields["LANG"];
} else {
$f->SITE_ID = SITE_ID;
}
// получаем ID записей справочника по SID
$arr = array("CATEGORY" => "C", "CRITICALITY" => "K", "STATUS" => "S", "MARK" => "M", "SOURCE" => "SR", "MESSAGE_SOURCE" => "SR", "DIFFICULTY" => "D");
foreach ($arr as $key => $value) {
if ((array_key_exists($key . "_ID", $arFields) || intval($arFields[$key . "_ID"]) <= 0) && array_key_exists($key . "_SID", $arFields) && strlen($arFields[$key . "_SID"]) > 0) {
$z = CTicketDictionary::GetBySID($arFields[$key . "_SID"], $value, $f->SITE_ID);
$zr = $z->Fetch();
$arFields[$key . "_ID"] = $zr["ID"];
}
}
return array("v" => $v, "f" => $f);
}
示例4: ShowError
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
require_once $_SERVER["DOCUMENT_ROOT"] . $componentPath . "/functions.php";
if (!CModule::IncludeModule("support")) {
ShowError(GetMessage("MODULE_NOT_INSTALL"));
return;
}
//Permissions
if (!($USER->IsAuthorized() && (CTicket::IsSupportClient() || CTicket::IsAdmin() || CTicket::IsSupportTeam() || CTicket::IsDemo()))) {
$APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
}
global $USER_FIELD_MANAGER;
$arrUF = $USER_FIELD_MANAGER->GetUserFields("SUPPORT", 0, LANGUAGE_ID);
//Post
$strError = "";
$arParams["TICKET_EDIT_TEMPLATE"] = trim($arParams["TICKET_EDIT_TEMPLATE"]);
$arParams["TICKET_EDIT_TEMPLATE"] = strlen($arParams["TICKET_EDIT_TEMPLATE"]) > 0 ? htmlspecialcharsbx($arParams["TICKET_EDIT_TEMPLATE"]) : "ticket_edit.php?ID=#ID#";
$arParams['SHOW_COUPON_FIELD'] = array_key_exists('SHOW_COUPON_FIELD', $arParams) && $arParams['SHOW_COUPON_FIELD'] == 'Y' ? 'Y' : 'N';
if ((strlen($_REQUEST["save"]) > 0 || strlen($_REQUEST["apply"]) > 0) && $_SERVER["REQUEST_METHOD"] == "POST" && check_bitrix_sessid()) {
$ID = intval($_REQUEST["ID"]);
if ($ID <= 0) {
if (strlen(trim($_REQUEST["TITLE"])) <= 0) {
$strError .= GetMessage("SUP_FORGOT_TITLE") . "<br>";
}
if (strlen(trim($_REQUEST["MESSAGE"])) <= 0) {
$strError .= GetMessage("SUP_FORGOT_MESSAGE") . "<br>";
}
}
示例5: require_once
<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_admin_before.php");
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/support/prolog.php");
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/support/include.php");
$bDemo = (CTicket::IsDemo()) ? "Y" : "N";
$bAdmin = (CTicket::IsAdmin()) ? "Y" : "N";
$bSupportClient = (CTicket::IsSupportClient()) ? "Y" : "N";
$bSupportTeam = (CTicket::IsSupportTeam()) ? "Y" : "N";
$message = null;
$entity_id = $PROPERTY_ID = "SUPPORT";
$bADS = $bDemo == 'Y' || $bAdmin == 'Y' || $bSupportTeam == 'Y';
if($bAdmin!="Y" && $bSupportTeam!="Y" && $bDemo!="Y" && $bSupportClient!="Y") $APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/support/include.php");
IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/support/admin/ticket_list.php");
$err_mess = "File: ".__FILE__."<br>Line: ";
/***************************************************************************
Функции
***************************************************************************/
function CheckFilter() // проверка введенных полей
{
global $strError, $arFilterFields;
reset($arFilterFields); foreach ($arFilterFields as $f) global $$f;
$str = "";
$arMsg = Array();
示例6: array
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"))
continue;
if ($gadget["ABSENCE_ONLY"] == true && !CBXFeatures::IsFeatureEnabled("StaffAbsence"))
continue;
示例7: 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;
}