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


PHP CTicket::IsDemo方法代码示例

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


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

示例1: Copyright

<?php

/*
##############################################
# Bitrix: SiteManager                        #
# Copyright (c) 2004 Bitrix                  #
# http://www.bitrix.ru                       #
# mailto:admin@bitrix.ru                     #
##############################################
*/
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_before.php";
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/support/include.php";
$bDemo = CTicket::IsDemo() ? "Y" : "N";
$bAdmin = CTicket::IsAdmin() ? "Y" : "N";
$bSupportTeam = CTicket::IsSupportTeam() ? "Y" : "N";
if ($bAdmin != "Y" && $bSupportTeam != "Y" && $bDemo != "Y") {
    $APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
}
include $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/support/colors.php";
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/img.php";
$diameter = intval($diameter) > 0 ? intval($diameter) : 180;
InitBVar($find_responsible_exact_match);
$arFilter = array("SITE" => $find_site, "DATE_CREATE_1" => $find_date1, "DATE_CREATE_2" => $find_date2, "RESPONSIBLE_ID" => $find_responsible_id, "RESPONSIBLE" => $find_responsible, "RESPONSIBLE_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);
$CHECK_RIGHTS = $bDemo == "Y" ? "N" : "Y";
$rsTickets = CTicket::GetList($by, $order, $arFilter, $is_filtered, $CHECK_RIGHTS, "N", "N");
$arrMess = array();
$arrMess["2_m"] = 0;
$arrMess["3_m"] = 0;
$arrMess["4_m"] = 0;
$arrMess["5_m"] = 0;
$arrMess["6_m"] = 0;
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:ticket_diagram_mess.php

示例2: 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;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:93,代码来源:support.php

示例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);
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:89,代码来源:support.php

示例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>";
        }
    }
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php

示例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();
开发者ID:ASDAFF,项目名称:bitrix-5,代码行数:31,代码来源:ticket_list.php

示例6: 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 
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:ticket_online.php

示例7: 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)) {
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:ticket_group_list.php


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