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


PHP CTicket::IsSupportTeam方法代码示例

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


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

示例1: 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")) {
开发者ID:nycmic,项目名称:bittest,代码行数:31,代码来源:component.php

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

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

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

 function IsResponsible($userID = false)
 {
     return CTicket::IsSupportTeam($userID);
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:4,代码来源:support.php

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

示例7: isset

             echo $arStrUsersM["arUsers"][$oUID]["HTML_NAME_S"];
             //echo "[" . $arM["OWNER_USER_ID"] . "] (" . $arM["OWNER_LOGIN"] . ") " . $arM["OWNER_USER_NAME"] . " " . $arrSUPPORT_TEAM[$arM["OWNER_USER_ID"]] . "";
         }
     }
 } else {
     $cUID = isset($arM["CREATED_USER_ID"]) ? intval($arM["CREATED_USER_ID"]) : 0;
     $cGID = isset($arM["CREATED_GUEST_ID"]) ? intval($arM["CREATED_GUEST_ID"]) : 0;
     if ($cUID > 0) {
         //Support_GetUserInfo($arM["CREATED_USER_ID"], $arM["CREATED_LOGIN"], $arM["CREATED_USER_NAME"]);
         if (!in_array($cUID, array_keys($arrSUPPORT_TEAM))) {
             if ($arM["MESSAGE_BY_SUPPORT_TEAM"] == "Y") {
                 $arrSUPPORT_TEAM[$cUID] = "(<span class=\"supportrequired\">" . GetMessage("SUP_TECHSUPPORT") . "</span>)";
             } elseif ($arM["MESSAGE_BY_SUPPORT_TEAM"] == "N") {
                 $arrSUPPORT_TEAM[$cUID] = "";
             } else {
                 $arrSUPPORT_TEAM[$cUID] = CTicket::IsSupportTeam($cUID) || CTicket::IsAdmin($cUID) ? "(<span class=\"supportrequired\">" . GetMessage("SUP_TECHSUPPORT") . ")</span>" : "";
             }
         }
     }
     if (strlen($arM["CREATED_MODULE_NAME"]) <= 0 || $arM["CREATED_MODULE_NAME"] == "support") {
         /*?>[<a title="<?=GetMessage("SUP_USER_PROFILE")?>" href="/bitrix/admin/user_edit.php?lang=<?=LANGUAGE_ID?>&ID=<? echo $arM["CREATED_USER_ID"]; ?>"><? echo $arM["CREATED_USER_ID"]; ?></a>] (<? echo $arM["CREATED_LOGIN"]; ?>) <? echo $arM["CREATED_USER_NAME"]; ?> <? echo $arrSUPPORT_TEAM[$arM["CREATED_USER_ID"]]; ?><?*/
         if ($cUID <= 0 && $cGID > 0 && CModule::IncludeModule("statistic")) {
             echo $arStrUsersM["arGuests"][$cGID]["HTML_NAME"];
             echo $cUID > 0 ? " " . $arrSUPPORT_TEAM[$cUID] : "";
             /*echo " [<a title='".GetMessage("SUP_GUEST_ID")."'  href='/bitrix/admin/guest_list.php?lang=".LANG."&find_id=". $arM["CREATED_GUEST_ID"]."&find_id_exact_match=Y&set_filter=Y'>".$arM["CREATED_GUEST_ID"]."</a>]";*/
         } elseif ($cUID > 0) {
             echo $arStrUsersM["arUsers"][$cUID]["HTML_NAME"];
             echo " " . $arrSUPPORT_TEAM[$cUID];
         }
     } else {
         echo $arM["CREATED_MODULE_NAME"];
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:ticket_edit.php

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

示例9: 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");
     }
//.........这里部分代码省略.........
开发者ID:rasuldev,项目名称:torino,代码行数:101,代码来源:reminder.php

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


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