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


PHP CTicket::IsOwner方法代码示例

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


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

示例1: 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

示例2: array

            $arrSLA[$ar["ID"]] = array("NAME" => $ar["NAME"], "DESCRIPTION" => $ar["DESCRIPTION"]);
        }
        if ($safe_for_html) {
            $name = htmlspecialcharsbx($name);
            $description = htmlspecialcharsbx($description);
        }
    }
}
/***************************************************************************
							Work with GET | POST
***************************************************************************/
$ID = intval($ID);
if ($ID <= 0) {
    $bOwner = "Y";
} else {
    $bOwner = CTicket::IsOwner($ID) ? "Y" : "N";
}
if ($bDemo == "Y" && $bOwner == "Y") {
    $bSupportClient = "Y";
    $bDemo = "N";
}
$TICKET_LIST_URL = strlen($TICKET_LIST_URL) > 0 ? CUtil::AddSlashes(htmlspecialcharsbx((substr($TICKET_LIST_URL, 0, 4) == 'http' ? '' : '/') . $TICKET_LIST_URL)) : "ticket_list.php";
$TICKET_EDIT_URL = strlen($TICKET_EDIT_URL) > 0 ? CUtil::AddSlashes(htmlspecialcharsbx((substr($TICKET_EDIT_URL, 0, 4) == 'http' ? '' : '/') . $TICKET_EDIT_URL)) : "ticket_edit.php";
$TICKET_MESSAGE_EDIT_URL = strlen($TICKET_MESSAGE_EDIT_URL) > 0 ? CUtil::AddSlashes(htmlspecialcharsbx((substr($TICKET_MESSAGE_EDIT_URL, 0, 4) == 'http' ? '' : '/') . $TICKET_MESSAGE_EDIT_URL)) : "ticket_message_edit.php";
if (intval($mdel_id) > 0 && check_bitrix_sessid()) {
    CTicket::DeleteMessage($mdel_id, "Y");
    LocalRedirect($TICKET_EDIT_URL . "?ID=" . $ID . "&lang=" . LANGUAGE_ID);
}
if (strlen($action) > 0 && check_bitrix_sessid()) {
    switch ($action) {
        case "close":
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:ticket_edit.php


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