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


PHP CSearch::KillTags方法代码示例

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


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

示例1: __prepareText

 function __prepareText($text)
 {
     $res = array();
     if ($this->bSearch) {
         $res = stemming(CSearch::KillTags($text), $this->__lang);
     } else {
         $res = array();
     }
     return $res;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:10,代码来源:seo_page_checker.php

示例2: UpdateSearch

 function UpdateSearch($ID, $bOverWrite = false)
 {
     if (!CModule::IncludeModule("search")) {
         return;
     }
     global $DB;
     $ID = Intval($ID);
     static $arGroups = array();
     static $arSITE = array();
     $strSql = "\n\t\t\tSELECT BS.ID, BS.NAME, BS.DESCRIPTION_TYPE, BS.DESCRIPTION, BS.XML_ID as EXTERNAL_ID,\n\t\t\t\tBS.CODE, BS.IBLOCK_ID, B.IBLOCK_TYPE_ID,\n\t\t\t\t" . $DB->DateToCharFunction("BS.TIMESTAMP_X") . " as LAST_MODIFIED,\n\t\t\t\tB.CODE as IBLOCK_CODE, B.XML_ID as IBLOCK_EXTERNAL_ID, B.SECTION_PAGE_URL,\n\t\t\t\tB.ACTIVE as ACTIVE1,\n\t\t\t\tBS.GLOBAL_ACTIVE as ACTIVE2,\n\t\t\t\tB.INDEX_SECTION, B.RIGHTS_MODE\n\t\t\tFROM b_iblock_section BS, b_iblock B\n\t\t\tWHERE BS.IBLOCK_ID=B.ID\n\t\t\t\tAND BS.ID=" . $ID;
     $dbrIBlockSection = $DB->Query($strSql);
     if ($arIBlockSection = $dbrIBlockSection->Fetch()) {
         $IBLOCK_ID = $arIBlockSection["IBLOCK_ID"];
         $SECTION_URL = "=ID=" . $arIBlockSection["ID"] . "&EXTERNAL_ID=" . $arIBlockSection["EXTERNAL_ID"] . "&IBLOCK_TYPE_ID=" . $arIBlockSection["IBLOCK_TYPE_ID"] . "&IBLOCK_ID=" . $arIBlockSection["IBLOCK_ID"] . "&IBLOCK_CODE=" . $arIBlockSection["IBLOCK_CODE"] . "&IBLOCK_EXTERNAL_ID=" . $arIBlockSection["IBLOCK_EXTERNAL_ID"] . "&CODE=" . $arIBlockSection["CODE"];
         if ($arIBlockSection["ACTIVE1"] != "Y" || $arIBlockSection["ACTIVE2"] != "Y" || $arIBlockSection["INDEX_SECTION"] != "Y") {
             CSearch::DeleteIndex("iblock", "S" . $arIBlockSection["ID"]);
             return;
         }
         if (!array_key_exists($IBLOCK_ID, $arGroups)) {
             $arGroups[$IBLOCK_ID] = array();
             $strSql = "SELECT GROUP_ID " . "FROM b_iblock_group " . "WHERE IBLOCK_ID= " . $IBLOCK_ID . " " . "\tAND PERMISSION>='R' " . "ORDER BY GROUP_ID";
             $dbrIBlockGroup = $DB->Query($strSql);
             while ($arIBlockGroup = $dbrIBlockGroup->Fetch()) {
                 $arGroups[$IBLOCK_ID][] = $arIBlockGroup["GROUP_ID"];
                 if ($arIBlockGroup["GROUP_ID"] == 2) {
                     break;
                 }
             }
         }
         if (!array_key_exists($IBLOCK_ID, $arSITE)) {
             $arSITE[$IBLOCK_ID] = array();
             $strSql = "SELECT SITE_ID " . "FROM b_iblock_site " . "WHERE IBLOCK_ID= " . $IBLOCK_ID;
             $dbrIBlockSite = $DB->Query($strSql);
             while ($arIBlockSite = $dbrIBlockSite->Fetch()) {
                 $arSITE[$IBLOCK_ID][] = $arIBlockSite["SITE_ID"];
             }
         }
         $BODY = $arIBlockSection["DESCRIPTION_TYPE"] == "html" ? CSearch::KillTags($arIBlockSection["DESCRIPTION"]) : $arIBlockSection["DESCRIPTION"];
         $BODY .= $GLOBALS["USER_FIELD_MANAGER"]->OnSearchIndex("IBLOCK_" . $arIBlockSection["IBLOCK_ID"] . "_SECTION", $arIBlockSection["ID"]);
         if ($arIBlockSection["RIGHTS_MODE"] !== "E") {
             $arPermissions = $arGroups[$IBLOCK_ID];
         } else {
             $obSectionRights = new CIBlockSectionRights($IBLOCK_ID, $arIBlockSection["ID"]);
             $arPermissions = $obSectionRights->GetGroups(array("section_read"));
         }
         CSearch::Index("iblock", "S" . $ID, array("LAST_MODIFIED" => $arIBlockSection["LAST_MODIFIED"], "TITLE" => $arIBlockSection["NAME"], "PARAM1" => $arIBlockSection["IBLOCK_TYPE_ID"], "PARAM2" => $IBLOCK_ID, "SITE_ID" => $arSITE[$IBLOCK_ID], "PERMISSIONS" => $arPermissions, "URL" => $SECTION_URL, "BODY" => $BODY), $bOverWrite);
     }
 }
开发者ID:,项目名称:,代码行数:48,代码来源:

示例3: UpdateSearch

 function UpdateSearch($ID, $bOverWrite = false)
 {
     if (!CModule::IncludeModule("search")) {
         return;
     }
     global $DB;
     $ID = Intval($ID);
     static $strElementSql = false;
     if (!$strElementSql) {
         $strElementSql = "\n\t\t\t\tSELECT BE.ID, BE.NAME, BE.XML_ID as EXTERNAL_ID,\n\t\t\t\t\tBE.PREVIEW_TEXT_TYPE, BE.PREVIEW_TEXT, BE.CODE,\n\t\t\t\t\tBE.TAGS,\n\t\t\t\t\tBE.DETAIL_TEXT_TYPE, BE.DETAIL_TEXT, BE.IBLOCK_ID, B.IBLOCK_TYPE_ID,\n\t\t\t\t\t" . $DB->DateToCharFunction("BE.TIMESTAMP_X") . " as LAST_MODIFIED,\n\t\t\t\t\t" . $DB->DateToCharFunction("BE.ACTIVE_FROM") . " as DATE_FROM,\n\t\t\t\t\t" . $DB->DateToCharFunction("BE.ACTIVE_TO") . " as DATE_TO,\n\t\t\t\t\tBE.IBLOCK_SECTION_ID,\n\t\t\t\t\tB.CODE as IBLOCK_CODE, B.XML_ID as IBLOCK_EXTERNAL_ID, B.DETAIL_PAGE_URL,\n\t\t\t\t\tB.VERSION, B.RIGHTS_MODE, B.SOCNET_GROUP_ID\n\t\t\t\tFROM b_iblock_element BE, b_iblock B\n\t\t\t\tWHERE BE.IBLOCK_ID=B.ID\n\t\t\t\t\tAND B.ACTIVE='Y'\n\t\t\t\t\tAND BE.ACTIVE='Y'\n\t\t\t\t\tAND B.INDEX_ELEMENT='Y'\n\t\t\t\t\t" . CIBlockElement::WF_GetSqlLimit("BE.", "N") . "\n\t\t\t\t\tAND BE.ID=";
     }
     $dbrIBlockElement = $DB->Query($strElementSql . $ID);
     if ($arIBlockElement = $dbrIBlockElement->Fetch()) {
         $IBLOCK_ID = $arIBlockElement["IBLOCK_ID"];
         $DETAIL_URL = "=ID=" . urlencode($arIBlockElement["ID"]) . "&EXTERNAL_ID=" . urlencode($arIBlockElement["EXTERNAL_ID"]) . "&IBLOCK_SECTION_ID=" . urlencode($arIBlockElement["IBLOCK_SECTION_ID"]) . "&IBLOCK_TYPE_ID=" . urlencode($arIBlockElement["IBLOCK_TYPE_ID"]) . "&IBLOCK_ID=" . urlencode($arIBlockElement["IBLOCK_ID"]) . "&IBLOCK_CODE=" . urlencode($arIBlockElement["IBLOCK_CODE"]) . "&IBLOCK_EXTERNAL_ID=" . urlencode($arIBlockElement["IBLOCK_EXTERNAL_ID"]) . "&CODE=" . urlencode($arIBlockElement["CODE"]);
         static $arGroups = array();
         if (!array_key_exists($IBLOCK_ID, $arGroups)) {
             $arGroups[$IBLOCK_ID] = array();
             $strSql = "SELECT GROUP_ID " . "FROM b_iblock_group " . "WHERE IBLOCK_ID= " . $IBLOCK_ID . " " . "\tAND PERMISSION>='R' " . "ORDER BY GROUP_ID";
             $dbrIBlockGroup = $DB->Query($strSql);
             while ($arIBlockGroup = $dbrIBlockGroup->Fetch()) {
                 $arGroups[$IBLOCK_ID][] = $arIBlockGroup["GROUP_ID"];
                 if ($arIBlockGroup["GROUP_ID"] == 2) {
                     break;
                 }
             }
         }
         static $arSITE = array();
         if (!array_key_exists($IBLOCK_ID, $arSITE)) {
             $arSITE[$IBLOCK_ID] = array();
             $strSql = "SELECT SITE_ID " . "FROM b_iblock_site " . "WHERE IBLOCK_ID= " . $IBLOCK_ID;
             $dbrIBlockSite = $DB->Query($strSql);
             while ($arIBlockSite = $dbrIBlockSite->Fetch()) {
                 $arSITE[$IBLOCK_ID][] = $arIBlockSite["SITE_ID"];
             }
         }
         $BODY = ($arIBlockElement["PREVIEW_TEXT_TYPE"] == "html" ? CSearch::KillTags($arIBlockElement["PREVIEW_TEXT"]) : $arIBlockElement["PREVIEW_TEXT"]) . "\r\n" . ($arIBlockElement["DETAIL_TEXT_TYPE"] == "html" ? CSearch::KillTags($arIBlockElement["DETAIL_TEXT"]) : $arIBlockElement["DETAIL_TEXT"]);
         static $arProperties = array();
         if (!array_key_exists($IBLOCK_ID, $arProperties)) {
             $arProperties[$IBLOCK_ID] = array();
             $rsProperties = CIBlockProperty::GetList(array("sort" => "asc", "id" => "asc"), array("IBLOCK_ID" => $IBLOCK_ID, "ACTIVE" => "Y", "SEARCHABLE" => "Y", "CHECK_PERMISSIONS" => "N"));
             while ($ar = $rsProperties->Fetch()) {
                 if (strlen($ar["USER_TYPE"]) > 0) {
                     $arUT = CIBlockProperty::GetUserType($ar["USER_TYPE"]);
                     if (array_key_exists("GetSearchContent", $arUT)) {
                         $ar["GetSearchContent"] = $arUT["GetSearchContent"];
                     } elseif (array_key_exists("GetPublicViewHTML", $arUT)) {
                         $ar["GetSearchContent"] = $arUT["GetPublicViewHTML"];
                     }
                 }
                 $arProperties[$IBLOCK_ID][$ar["ID"]] = $ar;
             }
         }
         //Read current property values from database
         $strProperties = "";
         if (count($arProperties[$IBLOCK_ID]) > 0) {
             if ($arIBlockElement["VERSION"] == 1) {
                 $rs = $DB->Query("\n\t\t\t\t\t\tselect *\n\t\t\t\t\t\tfrom b_iblock_element_property\n\t\t\t\t\t\twhere IBLOCK_ELEMENT_ID=" . $arIBlockElement["ID"] . "\n\t\t\t\t\t\tAND IBLOCK_PROPERTY_ID in (" . implode(", ", array_keys($arProperties[$IBLOCK_ID])) . ")\n\t\t\t\t\t");
                 while ($ar = $rs->Fetch()) {
                     $strProperties .= "\r\n";
                     $arProperty = $arProperties[$IBLOCK_ID][$ar["IBLOCK_PROPERTY_ID"]];
                     if ($arProperty["GetSearchContent"]) {
                         $strProperties .= CSearch::KillTags(call_user_func_array($arProperty["GetSearchContent"], array($arProperty, array("VALUE" => $ar["VALUE"]), array())));
                     } elseif ($arProperty["PROPERTY_TYPE"] == 'L') {
                         $arEnum = CIBlockPropertyEnum::GetByID($ar["VALUE"]);
                         if ($arEnum !== false) {
                             $strProperties .= $arEnum["VALUE"];
                         }
                     } elseif ($arProperty["PROPERTY_TYPE"] == 'F') {
                         $arFile = CIBlockElement::__GetFileContent($ar["VALUE"]);
                         if (is_array($arFile)) {
                             $strProperties .= $arFile["CONTENT"];
                             $arIBlockElement["TAGS"] .= "," . $arFile["PROPERTIES"][COption::GetOptionString("search", "page_tag_property")];
                         }
                     } else {
                         $strProperties .= $ar["VALUE"];
                     }
                 }
             } else {
                 $rs = $DB->Query("\n\t\t\t\t\t\tselect *\n\t\t\t\t\t\tfrom b_iblock_element_prop_m" . $IBLOCK_ID . "\n\t\t\t\t\t\twhere IBLOCK_ELEMENT_ID=" . $arIBlockElement["ID"] . "\n\t\t\t\t\t\tAND IBLOCK_PROPERTY_ID in (" . implode(", ", array_keys($arProperties[$IBLOCK_ID])) . ")\n\t\t\t\t\t");
                 while ($ar = $rs->Fetch()) {
                     $strProperties .= "\r\n";
                     $arProperty = $arProperties[$IBLOCK_ID][$ar["IBLOCK_PROPERTY_ID"]];
                     if ($arProperty["GetSearchContent"]) {
                         $strProperties .= CSearch::KillTags(call_user_func_array($arProperty["GetSearchContent"], array($arProperty, array("VALUE" => $ar["VALUE"]), array())));
                     } elseif ($arProperty["PROPERTY_TYPE"] == 'L') {
                         $arEnum = CIBlockPropertyEnum::GetByID($ar["VALUE"]);
                         if ($arEnum !== false) {
                             $strProperties .= $arEnum["VALUE"];
                         }
                     } elseif ($arProperty["PROPERTY_TYPE"] == 'F') {
                         $arFile = CIBlockElement::__GetFileContent($ar["VALUE"]);
                         if (is_array($arFile)) {
                             $strProperties .= $arFile["CONTENT"];
                             $arIBlockElement["TAGS"] .= "," . $arFile["PROPERTIES"][COption::GetOptionString("search", "page_tag_property")];
                         }
                     } else {
                         $strProperties .= $ar["VALUE"];
                     }
                 }
//.........这里部分代码省略.........
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:101,代码来源:iblockelement.php

示例4: ReindexFile

	function ReindexFile($path, $SEARCH_SESS_ID="")
	{
		global $APPLICATION;
		$io = CBXVirtualIo::GetInstance();
		$DB = CDatabase::GetModuleConnection('search');

		if(!is_array($path))
			return 0;

		$file_doc_root = CSite::GetSiteDocRoot($path[0]);
		$file_rel_path = $path[1];
		$file_abs_path = preg_replace("#[\\\\\\/]+#", "/", $file_doc_root."/".$file_rel_path);
		$f = $io->GetFile($file_abs_path);

		if(!$f->IsExists() || !$f->IsReadable())
			return 0;

		if(!CSearch::CheckPath($file_rel_path))
			return 0;

		$max_file_size = COption::GetOptionInt("search", "max_file_size", 0);
		if(
			$max_file_size > 0
			&& $f->GetFileSize() > ($max_file_size*1024)
		)
			return 0;

		$file_site = "";
		$rsSites = CSite::GetList($by = "lendir", $order = "desc");
		while($arSite = $rsSites->Fetch())
		{
			$site_path = preg_replace("#[\\\\\\/]+#", "/", $arSite["ABS_DOC_ROOT"]."/".$arSite["DIR"]."/");
			if(strpos($file_abs_path, $site_path) === 0)
			{
				$file_site = $arSite["ID"];
				break;
			}
		}

		if($file_site == "")
			return 0;

		$item_id = $file_site."|".$file_rel_path;
		if (strlen($item_id) > 255)
			return 0;

		if(strlen($SEARCH_SESS_ID) > 0)
		{
			$DATE_CHANGE = $DB->CharToDateFunction(
				FormatDate(
					$DB->DateFormatToPHP(CLang::GetDateFormat("FULL")), $f->GetModificationTime() + CTimeZone::GetOffset()
				)
			);
			$strSql = "
				SELECT ID
				FROM b_search_content
				WHERE MODULE_ID = 'main'
					AND ITEM_ID = '".$DB->ForSQL($item_id)."'
					AND DATE_CHANGE = ".$DATE_CHANGE."
			";

			$r = $DB->Query($strSql, false, "File: ".__FILE__."<br>Line: ".__LINE__);
			if($arR = $r->Fetch())
			{
				$strSql = "UPDATE b_search_content SET UPD='".$DB->ForSQL($SEARCH_SESS_ID)."' WHERE ID = ".$arR["ID"];
				$DB->Query($strSql, false, "File: ".__FILE__."<br>Line: ".__LINE__);
				return $arR["ID"];
			}
		}

		$arrFile = false;
		foreach(GetModuleEvents("search", "OnSearchGetFileContent", true) as $arEvent)
		{
			if($arrFile = ExecuteModuleEventEx($arEvent, array($file_abs_path, $SEARCH_SESS_ID)))
				break;
		}
		if(!is_array($arrFile))
		{
			$sFile = $APPLICATION->GetFileContent($file_abs_path);
			$sHeadEndPos = strpos($sFile, "</head>");
			if($sHeadEndPos===false)
				$sHeadEndPos = strpos($sFile, "</HEAD>");
			if($sHeadEndPos!==false)
			{
				//html header detected try to get document charset
				$arMetaMatch = array();
				if(preg_match("/<(meta)\\s+([^>]*)(content)\\s*=\\s*(['\"]).*?(charset)\\s*=\\s*(.*?)(\\4)/is", substr($sFile, 0, $sHeadEndPos), $arMetaMatch))
				{
					$doc_charset = $arMetaMatch[6];
					if(defined("BX_UTF"))
					{
						if(strtoupper($doc_charset) != "UTF-8")
							$sFile = $APPLICATION->ConvertCharset($sFile, $doc_charset, "UTF-8");
					}
				}
			}
			$arrFile = ParseFileContent($sFile);
		}

		$title = CSearch::KillTags(trim($arrFile["TITLE"]));
//.........这里部分代码省略.........
开发者ID:nycmic,项目名称:bittest,代码行数:101,代码来源:search.php

示例5: OnSearchReindex

 public static function OnSearchReindex($NS = array(), $oCallback = NULL, $callback_method = "")
 {
     /** @global CUserTypeManager $USER_FIELD_MANAGER */
     global $USER_FIELD_MANAGER;
     /** $global CDatabase $DB */
     global $DB;
     $strNSJoin1 = "";
     $strNSFilter1 = "";
     $strNSFilter2 = "";
     $strNSFilter3 = "";
     $arResult = array();
     if ($NS["MODULE"] == "iblock" && strlen($NS["ID"]) > 0) {
         $arrTmp = explode(".", $NS["ID"]);
         $strNSFilter1 = " AND B.ID>=" . IntVal($arrTmp[0]) . " ";
         if (substr($arrTmp[1], 0, 1) != 'S') {
             $strNSFilter2 = " AND BE.ID>" . IntVal($arrTmp[1]) . " ";
         } else {
             $strNSFilter2 = false;
             $strNSFilter3 = " AND BS.ID>" . IntVal(substr($arrTmp[1], 1)) . " ";
         }
     }
     if ($NS["SITE_ID"] != "") {
         $strNSJoin1 .= " INNER JOIN b_iblock_site BS ON BS.IBLOCK_ID=B.ID ";
         $strNSFilter1 .= " AND BS.SITE_ID='" . $DB->ForSQL($NS["SITE_ID"]) . "' ";
     }
     $strSql = "\n\t\t\tSELECT B.ID, B.IBLOCK_TYPE_ID, B.INDEX_ELEMENT, B.INDEX_SECTION, B.RIGHTS_MODE,\n\t\t\t\tB.IBLOCK_TYPE_ID, B.CODE as IBLOCK_CODE, B.XML_ID as IBLOCK_EXTERNAL_ID\n\t\t\tFROM b_iblock B\n\t\t\t" . $strNSJoin1 . "\n\t\t\tWHERE B.ACTIVE = 'Y'\n\t\t\t\tAND (B.INDEX_ELEMENT='Y' OR B.INDEX_SECTION='Y')\n\t\t\t\t" . $strNSFilter1 . "\n\t\t\tORDER BY B.ID\n\t\t";
     $dbrIBlock = $DB->Query($strSql);
     while ($arIBlock = $dbrIBlock->Fetch()) {
         $IBLOCK_ID = $arIBlock["ID"];
         $arGroups = array();
         $strSql = "SELECT GROUP_ID " . "FROM b_iblock_group " . "WHERE IBLOCK_ID= " . $IBLOCK_ID . " " . "\tAND PERMISSION>='R' " . "\tAND GROUP_ID>1 " . "ORDER BY GROUP_ID";
         $dbrIBlockGroup = $DB->Query($strSql);
         while ($arIBlockGroup = $dbrIBlockGroup->Fetch()) {
             $arGroups[] = $arIBlockGroup["GROUP_ID"];
             if ($arIBlockGroup["GROUP_ID"] == 2) {
                 break;
             }
         }
         $arSITE = array();
         $strSql = "SELECT SITE_ID " . "FROM b_iblock_site " . "WHERE IBLOCK_ID= " . $IBLOCK_ID;
         $dbrIBlockSite = $DB->Query($strSql);
         while ($arIBlockSite = $dbrIBlockSite->Fetch()) {
             $arSITE[] = $arIBlockSite["SITE_ID"];
         }
         if ($arIBlock["INDEX_ELEMENT"] == 'Y' && $strNSFilter2 !== false) {
             $strSql = "SELECT BE.ID, BE.NAME, BE.TAGS, " . "\t" . $DB->DateToCharFunction("BE.ACTIVE_FROM") . " as DATE_FROM, " . "\t" . $DB->DateToCharFunction("BE.ACTIVE_TO") . " as DATE_TO, " . "\t" . $DB->DateToCharFunction("BE.TIMESTAMP_X") . " as LAST_MODIFIED, " . "\tBE.PREVIEW_TEXT_TYPE, BE.PREVIEW_TEXT, " . "\tBE.DETAIL_TEXT_TYPE, BE.DETAIL_TEXT, " . "\tBE.XML_ID as EXTERNAL_ID, BE.CODE, " . "\tBE.IBLOCK_SECTION_ID " . "FROM b_iblock_element BE " . "WHERE BE.IBLOCK_ID=" . $IBLOCK_ID . " " . "\tAND BE.ACTIVE='Y' " . CIBlockElement::WF_GetSqlLimit("BE.", "N") . $strNSFilter2 . "ORDER BY BE.ID ";
             //For MySQL we have to solve client out of memory
             //problem by limiting the query
             if ($DB->type == "MYSQL") {
                 $limit = 1000;
                 $strSql .= " LIMIT " . $limit;
             } else {
                 $limit = false;
             }
             $dbrIBlockElement = $DB->Query($strSql);
             while ($arIBlockElement = $dbrIBlockElement->Fetch()) {
                 $DETAIL_URL = "=ID=" . $arIBlockElement["ID"] . "&EXTERNAL_ID=" . $arIBlockElement["EXTERNAL_ID"] . "&CODE=" . $arIBlockElement["CODE"] . "&IBLOCK_SECTION_ID=" . $arIBlockElement["IBLOCK_SECTION_ID"] . "&IBLOCK_TYPE_ID=" . $arIBlock["IBLOCK_TYPE_ID"] . "&IBLOCK_ID=" . $IBLOCK_ID . "&IBLOCK_CODE=" . $arIBlock["IBLOCK_CODE"] . "&IBLOCK_EXTERNAL_ID=" . $arIBlock["IBLOCK_EXTERNAL_ID"];
                 $BODY = ($arIBlockElement["PREVIEW_TEXT_TYPE"] == "html" ? CSearch::KillTags($arIBlockElement["PREVIEW_TEXT"]) : $arIBlockElement["PREVIEW_TEXT"]) . "\r\n" . ($arIBlockElement["DETAIL_TEXT_TYPE"] == "html" ? CSearch::KillTags($arIBlockElement["DETAIL_TEXT"]) : $arIBlockElement["DETAIL_TEXT"]);
                 $dbrProperties = CIBlockElement::GetProperty($IBLOCK_ID, $arIBlockElement["ID"], "sort", "asc", array("ACTIVE" => "Y", "SEARCHABLE" => "Y"));
                 while ($arProperties = $dbrProperties->Fetch()) {
                     $BODY .= "\r\n";
                     if (strlen($arProperties["USER_TYPE"]) > 0) {
                         $UserType = CIBlockProperty::GetUserType($arProperties["USER_TYPE"]);
                     } else {
                         $UserType = array();
                     }
                     if (array_key_exists("GetSearchContent", $UserType)) {
                         $BODY .= CSearch::KillTags(call_user_func_array($UserType["GetSearchContent"], array($arProperties['ID'], array("VALUE" => $arProperties["VALUE"]), array())));
                     } elseif (array_key_exists("GetPublicViewHTML", $UserType)) {
                         $BODY .= CSearch::KillTags(call_user_func_array($UserType["GetPublicViewHTML"], array($arProperties['ID'], array("VALUE" => $arProperties["VALUE"]), array())));
                     } elseif ($arProperties["PROPERTY_TYPE"] == 'L') {
                         $BODY .= $arProperties["VALUE_ENUM"];
                     } elseif ($arProperties["PROPERTY_TYPE"] == 'F') {
                         $arFile = CIBlockElement::__GetFileContent($arProperties["VALUE"]);
                         if (is_array($arFile)) {
                             $BODY .= $arFile["CONTENT"];
                             $arIBlockElement["TAGS"] .= "," . $arFile["PROPERTIES"][COption::GetOptionString("search", "page_tag_property")];
                         }
                     } else {
                         $BODY .= $arProperties["VALUE"];
                     }
                 }
                 if ($arIBlock["RIGHTS_MODE"] !== "E") {
                     $arPermissions = $arGroups;
                 } else {
                     $obElementRights = new CIBlockElementRights($IBLOCK_ID, $arIBlockElement["ID"]);
                     $arPermissions = $obElementRights->GetGroups(array("element_read"));
                 }
                 $Result = array("ID" => $arIBlockElement["ID"], "LAST_MODIFIED" => strlen($arIBlockElement["DATE_FROM"]) > 0 ? $arIBlockElement["DATE_FROM"] : $arIBlockElement["LAST_MODIFIED"], "TITLE" => $arIBlockElement["NAME"], "BODY" => $BODY, "TAGS" => $arIBlockElement["TAGS"], "SITE_ID" => $arSITE, "PARAM1" => $arIBlock["IBLOCK_TYPE_ID"], "PARAM2" => $IBLOCK_ID, "DATE_FROM" => strlen($arIBlockElement["DATE_FROM"]) > 0 ? $arIBlockElement["DATE_FROM"] : false, "DATE_TO" => strlen($arIBlockElement["DATE_TO"]) > 0 ? $arIBlockElement["DATE_TO"] : false, "PERMISSIONS" => $arPermissions, "URL" => $DETAIL_URL);
                 if ($oCallback) {
                     $res = call_user_func(array($oCallback, $callback_method), $Result);
                     if (!$res) {
                         return $IBLOCK_ID . "." . $arIBlockElement["ID"];
                     }
                 } else {
                     $arResult[] = $Result;
                 }
                 if ($limit !== false) {
                     $limit--;
                     if ($limit <= 0) {
//.........这里部分代码省略.........
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:101,代码来源:iblock.php

示例6: BuildSearchCard

 public static function BuildSearchCard($arQuote, $bReindex = false)
 {
     $arStatuses = array();
     $arSite = array();
     $sEntityType = 'QUOTE';
     $sTitle = 'TITLE';
     $sNumber = 'QUOTE_NUMBER';
     $arSearchableFields = array('DATE_CREATE' => GetMessage('CRM_QUOTE_SEARCH_FIELD_DATE_CREATE'), 'STATUS_ID' => GetMessage('CRM_QUOTE_SEARCH_FIELD_STATUS_ID'), 'BEGINDATE' => GetMessage('CRM_QUOTE_SEARCH_FIELD_BEGINDATE'), 'CLOSEDATE' => GetMessage('CRM_QUOTE_SEARCH_FIELD_CLOSEDATE'), 'OPPORTUNITY' => GetMessage('CRM_QUOTE_SEARCH_FIELD_OPPORTUNITY'), 'COMMENTS' => GetMessage('CRM_QUOTE_SEARCH_FIELD_COMMENTS'), 'CLIENT_TITLE' => GetMessage('CRM_QUOTE_SEARCH_FIELD_CLIENT_TITLE'), 'CLIENT_ADDR' => GetMessage('CRM_QUOTE_SEARCH_FIELD_CLIENT_ADDR'), 'CLIENT_CONTACT' => GetMessage('CRM_QUOTE_SEARCH_FIELD_CLIENT_CONTACT'), 'CLIENT_EMAIL' => GetMessage('CRM_QUOTE_SEARCH_FIELD_CLIENT_EMAIL'), 'CLIENT_PHONE' => GetMessage('CRM_QUOTE_SEARCH_FIELD_CLIENT_PHONE'), 'CLIENT_TP_ID' => GetMessage('CRM_QUOTE_SEARCH_FIELD_TP_ID'), 'CLIENT_TPA_ID' => GetMessage('CRM_QUOTE_SEARCH_FIELD_TPA_ID'));
     $sBody = $arQuote[$sNumber] . ', ' . $arQuote[$sTitle] . "\n";
     $arField2status = array('STATUS_ID' => 'QUOTE_STATUS');
     $site = new CSite();
     foreach (array_keys($arSearchableFields) as $k) {
         if (!isset($arQuote[$k])) {
             continue;
         }
         $v = $arQuote[$k];
         if ($k === 'COMMENTS') {
             $v = CSearch::KillTags($v);
         }
         $v = trim($v);
         if ($k === 'DATE_CREATE' || $k === 'BEGINDATE' || $k === 'CLOSEDATE') {
             $dateFormatShort = $site->GetDateFormat('SHORT');
             if (!CheckDateTime($v, $dateFormatShort)) {
                 $v = ConvertTimeStamp(strtotime($v), 'SHORT');
             }
             if (CheckDateTime($v, $dateFormatShort)) {
                 $v = FormatDate('SHORT', MakeTimeStamp($v, $dateFormatShort));
             } else {
                 $v = null;
             }
         }
         if (isset($arField2status[$k])) {
             if (!isset($arStatuses[$k])) {
                 $arStatuses[$k] = CCrmStatus::GetStatusList($arField2status[$k]);
             }
             $v = $arStatuses[$k][$v];
         }
         if ($k === 'OPPORTUNITY') {
             $v = number_format(doubleval($v), 2, '.', '');
         }
         if (!empty($v) && (!is_numeric($v) || $k === 'OPPORTUNITY') && $v != 'N' && $v != 'Y') {
             $sBody .= $arSearchableFields[$k] . ": {$v}\n";
         }
     }
     if (isset($arQuote['ASSIGNED_BY_NAME']) && !empty($arQuote['ASSIGNED_BY_NAME']) || isset($arQuote['ASSIGNED_BY_LAST_NAME']) && !empty($arQuote['ASSIGNED_BY_LAST_NAME']) || isset($arQuote['ASSIGNED_BY_SECOND_NAME']) && !empty($arQuote['ASSIGNED_BY_SECOND_NAME'])) {
         $responsibleInfo = CUser::FormatName($site->GetNameFormat(null, $arQuote['LID']), array('LOGIN' => '', 'NAME' => isset($arQuote['ASSIGNED_BY_NAME']) ? $arQuote['ASSIGNED_BY_NAME'] : '', 'LAST_NAME' => isset($arQuote['ASSIGNED_BY_LAST_NAME']) ? $arQuote['ASSIGNED_BY_LAST_NAME'] : '', 'SECOND_NAME' => isset($arQuote['ASSIGNED_BY_SECOND_NAME']) ? $arQuote['ASSIGNED_BY_SECOND_NAME'] : ''), false, false);
         if (isset($arQuote['ASSIGNED_BY_EMAIL']) && !empty($arQuote['ASSIGNED_BY_EMAIL'])) {
             $responsibleInfo .= ', ' . $arQuote['ASSIGNED_BY_EMAIL'];
         }
         if (isset($arQuote['ASSIGNED_BY_WORK_POSITION']) && !empty($arQuote['ASSIGNED_BY_WORK_POSITION'])) {
             $responsibleInfo .= ', ' . $arQuote['ASSIGNED_BY_WORK_POSITION'];
         }
         if (!empty($responsibleInfo) && !is_numeric($responsibleInfo) && $responsibleInfo != 'N' && $responsibleInfo != 'Y') {
             $sBody .= GetMessage('CRM_QUOTE_SEARCH_FIELD_ASSIGNED_BY_INFO') . ": {$responsibleInfo}\n";
         }
     }
     $sDetailURL = CComponentEngine::MakePathFromTemplate(COption::GetOptionString('crm', 'path_to_' . strtolower($sEntityType) . '_show'), array(strtolower($sEntityType) . '_id' => $arQuote['ID']));
     $_arAttr = CCrmPerms::GetEntityAttr($sEntityType, $arQuote['ID']);
     if (empty($arSite)) {
         $by = "sort";
         $order = "asc";
         $rsSite = $site->GetList($by, $order);
         while ($_arSite = $rsSite->Fetch()) {
             $arSite[] = $_arSite['ID'];
         }
     }
     unset($site);
     $sattr_d = '';
     $sattr_s = '';
     $sattr_u = '';
     $sattr_o = '';
     $sattr2 = '';
     $arAttr = array();
     if (!isset($_arAttr[$arQuote['ID']])) {
         $_arAttr[$arQuote['ID']] = array();
     }
     $arAttr[] = $sEntityType;
     // for perm X
     foreach ($_arAttr[$arQuote['ID']] as $_s) {
         if ($_s[0] == 'U') {
             $sattr_u = $_s;
         } else {
             if ($_s[0] == 'D') {
                 $sattr_d = $_s;
             } else {
                 if ($_s[0] == 'S') {
                     $sattr_s = $_s;
                 } else {
                     if ($_s[0] == 'O') {
                         $sattr_o = $_s;
                     }
                 }
             }
         }
         $arAttr[] = $sEntityType . '_' . $_s;
     }
     $sattr = $sEntityType . '_' . $sattr_u;
     if (!empty($sattr_d)) {
         $sattr .= '_' . $sattr_d;
         $arAttr[] = $sattr;
//.........这里部分代码省略.........
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:101,代码来源:crm_quote.php

示例7: OnSearchReindex

 public static function OnSearchReindex($NS = array(), $oCallback = null, $callback_method = '')
 {
     global $DB;
     static $arCourseToSiteCache = array();
     $arResult = array();
     $arAllSitesPathes = array();
     $elementStartId = 0;
     $indexElementType = 'C';
     // start reindex from courses
     $by = $order = '';
     $sites = CLang::GetList($by, $order, array('TYPE' => 'C'));
     while ($site = $sites->Fetch()) {
         $arAllSitesPathes[$site['LID']] = array('C' => CCourse::GetSitePathes($site['LID'], 'C'), 'H' => CCourse::GetSitePathes($site['LID'], 'H'), 'L' => CCourse::GetSitePathes($site['LID'], 'L'));
     }
     $arCoursesFilter = array();
     $arLessonsFilter = array('LINKED_LESSON_ID' => '');
     if ($NS['MODULE'] === 'learning' && strlen($NS['ID']) > 0) {
         $indexElementType = substr($NS['ID'], 0, 1);
         $elementStartId = (int) substr($NS['ID'], 1);
         if (strlen($NS['SITE_ID']) > 0) {
             $arCoursesFilter['SITE_ID'] = $NS['SITE_ID'];
         }
     }
     $arCoursesFilter['>ID'] = $elementStartId;
     if ($indexElementType === 'C') {
         $rsCourse = CCourse::GetList(array('ID' => 'ASC'), $arCoursesFilter);
         while ($arCourse = $rsCourse->Fetch()) {
             try {
                 $arCourse["SITE_ID"] = CCourse::GetSiteId($arCourse['ID']);
                 $arPathes = $arAllSitesPathes[$arCourse['SITE_ID']]['C'];
                 $linkedLessonId = CCourse::CourseGetLinkedLesson($arCourse['ID']);
                 if ($linkedLessonId === false) {
                     continue;
                 }
                 $arGroupPermissions = CLearnAccess::GetSymbolsAccessibleToLesson($linkedLessonId, CLearnAccess::OP_LESSON_READ);
             } catch (LearnException $e) {
                 continue;
                 // skip indexation of this item
             }
             $arSiteIds = array();
             foreach ($arPathes as $k => $path) {
                 $arCourse["PATH"] = $path;
                 $Url = str_replace("#COURSE_ID#", $arCourse["ID"], $arCourse["PATH"]);
                 $arSiteIds[$arCourse['SITE_ID']] = $Url;
             }
             if ($arCourse["DETAIL_TEXT_TYPE"] !== 'text') {
                 $detailText = CSearch::KillTags($arCourse['DETAIL_TEXT']);
             } else {
                 $detailText = strip_tags($arCourse['DETAIL_TEXT']);
             }
             if (strlen($detailText) > 0) {
                 $dataBody = $detailText;
             } else {
                 $dataBody = $arCourse['NAME'];
             }
             $Result = array("ID" => "C" . $arCourse["ID"], "LAST_MODIFIED" => $arCourse["TIMESTAMP_X"], "TITLE" => $arCourse["NAME"], "BODY" => $dataBody, "SITE_ID" => $arSiteIds, "PERMISSIONS" => $arGroupPermissions, "COURSE_ID" => "C" . $arCourse["ID"]);
             if ($oCallback) {
                 $res = call_user_func(array($oCallback, $callback_method), $Result);
                 if (!$res) {
                     return "C" . $arCourse["ID"];
                 }
             } else {
                 $arResult[] = $Result;
             }
         }
         // Reindex of courses finished. Let's reindex lessons now.
         $indexElementType = 'U';
         $elementStartId = 0;
     }
     $arLessonsFilter['>LESSON_ID'] = $elementStartId;
     if ($indexElementType === 'U') {
         $rsLessons = CLearnLesson::GetList(array('LESSON_ID' => 'ASC'), $arLessonsFilter);
         while ($arLessonFromDb = $rsLessons->Fetch()) {
             $arLessonsWithCourse = array();
             // list of lessons in context of some course
             $arOParentPathes = CLearnLesson::GetListOfParentPathes($arLessonFromDb['LESSON_ID']);
             foreach ($arOParentPathes as $oParentPath) {
                 $arParentLessons = $oParentPath->GetPathAsArray();
                 foreach ($arParentLessons as $lessonId) {
                     $linkedCourseId = CLearnLesson::GetLinkedCourse($lessonId);
                     if ($linkedCourseId !== false && $linkedCourseId > 0) {
                         $arLessonsWithCourse[] = array_merge($arLessonFromDb, array('PARENT_COURSE_ID' => $linkedCourseId));
                     }
                 }
             }
             foreach ($arLessonsWithCourse as $arLesson) {
                 try {
                     $arGroupPermissions = CLearnAccess::GetSymbolsAccessibleToLesson($arLesson['LESSON_ID'], CLearnAccess::OP_LESSON_READ);
                     $courseId = $arLesson['PARENT_COURSE_ID'];
                     if (!isset($arCourseToSiteCache[$courseId])) {
                         $strSql = "SELECT SITE_ID FROM b_learn_course_site WHERE COURSE_ID=" . (int) $courseId;
                         $rc = $DB->Query($strSql, true);
                         if ($rc === false) {
                             continue;
                         }
                         $arCourseToSiteCache[$courseId] = array();
                         while ($arCourseSite = $rc->fetch()) {
                             $arCourseToSiteCache[$courseId][] = $arCourseSite['SITE_ID'];
                         }
                     }
//.........这里部分代码省略.........
开发者ID:rasuldev,项目名称:torino,代码行数:101,代码来源:course.php

示例8: _buildEntityCard

 protected static function _buildEntityCard($arEntity, $sTitle, $ENTITY_TYPE, $arOptions = null)
 {
     static $arEntityGroup = array();
     static $arStatuses = array();
     static $arSite = array();
     $sBody = $arEntity[$sTitle] . "\n";
     $arField2status = array('STATUS_ID' => 'STATUS', 'SOURCE_ID' => 'SOURCE', 'CURRENCY_ID' => 'CURRENCY', 'PRODUCT_ID' => 'PRODUCT', 'TYPE_ID' => 'CONTACT_TYPE', 'STAGE_ID' => 'DEAL_STAGE', 'EVENT_ID' => 'EVENT_TYPE', 'COMPANY_TYPE' => 'COMPANY_TYPE', 'EMPLOYEES' => 'EMPLOYEES', 'INDUSTRY' => 'INDUSTRY');
     foreach ($arEntity as $_k => $_v) {
         if ($_k == $sTitle || strpos($_k, '_BY_') !== false || strpos($_k, 'DATE_') === 0 || strpos($_k, 'UF_') === 0) {
             continue;
         }
         if ($ENTITY_TYPE === 'CONTACT' && ($_k === 'NAME' || $_k === 'SECOND_NAME' || $_k === 'LAST_NAME')) {
             //Already added as title
             continue;
         }
         if (is_array($_v)) {
             continue;
         }
         if ($_k === 'COMMENTS') {
             $_v = CSearch::KillTags($_v);
         }
         $_v = trim($_v);
         if (isset($arField2status[$_k])) {
             if (!isset($arStatuses[$_k])) {
                 $arStatuses[$_k] = CCrmStatus::GetStatusList($arField2status[$_k]);
             }
             $_v = $arStatuses[$_k][$_v];
         }
         if (!empty($_v) && !is_numeric($_v) && $_v != 'N' && $_v != 'Y') {
             $sBody .= self::$arMess[$ENTITY_TYPE]['CRM_FIELD_' . $_k] . ": {$_v}\n";
         }
     }
     if ($ENTITY_TYPE === 'CONTACT' || $ENTITY_TYPE === 'COMPANY' || $ENTITY_TYPE === 'LEAD') {
         $multiFields = is_array($arOptions) && isset($arOptions['FM']) ? $arOptions['FM'] : null;
         if (is_array($multiFields)) {
             foreach ($multiFields as $typeID => $multiFieldItems) {
                 if ($typeID === 'PHONE') {
                     $sBody .= GetMessage('CRM_PHONES') . ': ' . implode(', ', $multiFieldItems) . "\n";
                 } elseif ($typeID === 'EMAIL') {
                     $sBody .= GetMessage('CRM_EMAILS') . ': ' . implode(', ', $multiFieldItems) . "\n";
                 }
             }
         }
     }
     $sDetailURL = CComponentEngine::MakePathFromTemplate(COption::GetOptionString('crm', 'path_to_' . strtolower($ENTITY_TYPE) . '_show'), array(strtolower($ENTITY_TYPE) . '_id' => $arEntity['ID']));
     $_arAttr = CCrmPerms::GetEntityAttr($ENTITY_TYPE, $arEntity['ID']);
     if (empty($arSite)) {
         $by = "sort";
         $order = "asc";
         $rsSite = CSite::GetList($by, $order);
         while ($_arSite = $rsSite->Fetch()) {
             $arSite[] = $_arSite['ID'];
         }
     }
     $sattr_d = '';
     $sattr_s = '';
     $sattr_u = '';
     $sattr_o = '';
     $arAttr = array();
     if (!isset($_arAttr[$arEntity['ID']])) {
         $_arAttr[$arEntity['ID']] = array();
     }
     $arAttr[] = $ENTITY_TYPE;
     // for perm X
     foreach ($_arAttr[$arEntity['ID']] as $_s) {
         if (preg_match('/^U/', $_s)) {
             $sattr_u = $_s;
         } elseif (preg_match('/^D/', $_s)) {
             $sattr_d = $_s;
         } elseif (preg_match('/^S/', $_s)) {
             $sattr_s = $_s;
         } elseif (preg_match('/^O/', $_s)) {
             $sattr_o = $_s;
         }
         $arAttr[] = "{$ENTITY_TYPE}_{$_s}";
     }
     if (!empty($sattr_s)) {
         $arAttr[] = "{$ENTITY_TYPE}_{$sattr_s}";
         // for perm X in status
         if (!empty($sattr_u)) {
             $arAttr[] = "{$ENTITY_TYPE}_{$sattr_u}_{$sattr_s}";
         }
         if (!empty($sattr_d)) {
             $arAttr[] = "{$ENTITY_TYPE}_{$sattr_d}_{$sattr_s}";
         }
         if (!empty($sattr_o)) {
             $arAttr[] = "{$ENTITY_TYPE}_{$sattr_o}_{$sattr_s}";
         }
     }
     $arSitePath = array();
     foreach ($arSite as $sSite) {
         $arSitePath[$sSite] = $sDetailURL;
     }
     $arResult = array('LAST_MODIFIED' => $arEntity['DATE_MODIFY'], 'DATE_FROM' => $arEntity['DATE_CREATE'], 'TITLE' => GetMessage('CRM_' . $ENTITY_TYPE) . ': ' . $arEntity[$sTitle], 'PARAM1' => $ENTITY_TYPE, 'PARAM2' => $arEntity['ID'], 'SITE_ID' => $arSitePath, 'PERMISSIONS' => $arAttr, 'BODY' => $sBody, 'TAGS' => 'crm,' . strtolower($ENTITY_TYPE) . ',' . GetMessage('CRM_' . $ENTITY_TYPE));
     if (self::$bReIndex) {
         $arResult['ID'] = $ENTITY_TYPE . '.' . $arEntity['ID'];
     }
     return $arResult;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:99,代码来源:crm_search.php

示例9: BuildSearchCard

 public static function BuildSearchCard($arInvoice, $bReindex = false)
 {
     $arStatuses = array();
     $arSite = array();
     $sEntityType = 'INVOICE';
     $sTitle = 'ORDER_TOPIC';
     $sNumber = 'ACCOUNT_NUMBER';
     $arSearchableFields = array('STATUS_ID' => GetMessage('CRM_INVOICE_SEARCH_FIELD_STATUS_ID'), 'DATE_BILL' => GetMessage('CRM_INVOICE_SEARCH_FIELD_DATE_BILL'), 'DATE_PAY_BEFORE' => GetMessage('CRM_INVOICE_SEARCH_FIELD_DATE_PAY_BEFORE'), 'PRICE' => GetMessage('CRM_INVOICE_SEARCH_FIELD_PRICE'), 'PAY_VOUCHER_NUM' => GetMessage('CRM_INVOICE_SEARCH_FIELD_PAY_VOUCHER_NUM'), 'USER_DESCRIPTION' => GetMessage('CRM_INVOICE_SEARCH_FIELD_USER_DESCRIPTION'), 'COMMENTS' => GetMessage('CRM_INVOICE_SEARCH_FIELD_COMMENTS'), 'REASON_MARKED' => GetMessage('CRM_INVOICE_SEARCH_FIELD_REASON_MARKED'));
     $sBody = $arInvoice[$sNumber] . ', ' . $arInvoice[$sTitle] . "\n";
     $arField2status = array('STATUS_ID' => 'INVOICE_STATUS');
     $site = new CSite();
     foreach (array_keys($arSearchableFields) as $k) {
         if (!isset($arInvoice[$k])) {
             continue;
         }
         $v = $arInvoice[$k];
         if ($k === 'COMMENTS' || $k === 'USER_DESCRIPTION') {
             $v = CSearch::KillTags($v);
         }
         $v = trim($v);
         if ($k === 'DATE_BILL' || $k === 'DATE_PAY_BEFORE') {
             $dateFormatShort = $site->GetDateFormat('SHORT');
             if (!CheckDateTime($v, $dateFormatShort)) {
                 $v = ConvertTimeStamp(strtotime($v), 'SHORT');
             }
             if (CheckDateTime($v, $dateFormatShort)) {
                 $v = FormatDate('SHORT', MakeTimeStamp($v, $dateFormatShort));
             } else {
                 $v = null;
             }
         }
         if (isset($arField2status[$k])) {
             if (!isset($arStatuses[$k])) {
                 $arStatuses[$k] = CCrmStatus::GetStatusList($arField2status[$k]);
             }
             $v = $arStatuses[$k][$v];
         }
         if (!empty($v) && (!is_numeric($v) || $k === 'PRICE') && $v != 'N' && $v != 'Y') {
             $sBody .= $arSearchableFields[$k] . ": {$v}\n";
         }
     }
     if (isset($arInvoice['RESPONSIBLE_NAME']) && !empty($arInvoice['RESPONSIBLE_NAME']) || isset($arInvoice['RESPONSIBLE_LAST_NAME']) && !empty($arInvoice['RESPONSIBLE_LAST_NAME']) || isset($arInvoice['RESPONSIBLE_SECOND_NAME']) && !empty($arInvoice['RESPONSIBLE_SECOND_NAME'])) {
         $responsibleInfo = CUser::FormatName($site->GetNameFormat(null, $arInvoice['LID']), array('LOGIN' => '', 'NAME' => isset($arInvoice['RESPONSIBLE_NAME']) ? $arInvoice['RESPONSIBLE_NAME'] : '', 'LAST_NAME' => isset($arInvoice['RESPONSIBLE_LAST_NAME']) ? $arInvoice['RESPONSIBLE_LAST_NAME'] : '', 'SECOND_NAME' => isset($arInvoice['RESPONSIBLE_SECOND_NAME']) ? $arInvoice['RESPONSIBLE_SECOND_NAME'] : ''), false, false);
         if (isset($arInvoice['RESPONSIBLE_EMAIL']) && !empty($arInvoice['RESPONSIBLE_EMAIL'])) {
             $responsibleInfo .= ', ' . $arInvoice['RESPONSIBLE_EMAIL'];
         }
         if (isset($arInvoice['RESPONSIBLE_WORK_POSITION']) && !empty($arInvoice['RESPONSIBLE_WORK_POSITION'])) {
             $responsibleInfo .= ', ' . $arInvoice['RESPONSIBLE_WORK_POSITION'];
         }
         if (!empty($responsibleInfo) && !is_numeric($responsibleInfo) && $responsibleInfo != 'N' && $responsibleInfo != 'Y') {
             $sBody .= GetMessage('CRM_INVOICE_SEARCH_FIELD_RESPONSIBLE_INFO') . ": {$responsibleInfo}\n";
         }
     }
     if (intval($arInvoice['PERSON_TYPE_ID']) > 0) {
         $arSearchableProperties = self::_getAllowedPropertiesInfo();
         $arSearchableProperties = $arSearchableProperties[$arInvoice['PERSON_TYPE_ID']];
         $arInvoiceProps = self::GetProperties($arInvoice['ID'], $arInvoice['PERSON_TYPE_ID']);
         foreach ($arInvoiceProps as $prop) {
             $propCode = $prop['FIELDS']['CODE'];
             if (array_key_exists($propCode, $arSearchableProperties)) {
                 $v = $prop['VALUE'];
                 if (!empty($v) && !is_numeric($v) && $v != 'N' && $v != 'Y') {
                     $sBody .= $arSearchableProperties[$propCode] . ": {$v}\n";
                 }
             }
         }
     }
     $sDetailURL = CComponentEngine::MakePathFromTemplate(COption::GetOptionString('crm', 'path_to_' . strtolower($sEntityType) . '_show'), array(strtolower($sEntityType) . '_id' => $arInvoice['ID']));
     $_arAttr = CCrmPerms::GetEntityAttr($sEntityType, $arInvoice['ID']);
     if (empty($arSite)) {
         $by = "sort";
         $order = "asc";
         $rsSite = $site->GetList($by, $order);
         while ($_arSite = $rsSite->Fetch()) {
             $arSite[] = $_arSite['ID'];
         }
     }
     unset($site);
     $sattr_d = '';
     $sattr_s = '';
     $sattr_u = '';
     $sattr_o = '';
     $sattr2 = '';
     $arAttr = array();
     if (!isset($_arAttr[$arInvoice['ID']])) {
         $_arAttr[$arInvoice['ID']] = array();
     }
     $arAttr[] = $sEntityType;
     // for perm X
     foreach ($_arAttr[$arInvoice['ID']] as $_s) {
         if ($_s[0] == 'U') {
             $sattr_u = $_s;
         } else {
             if ($_s[0] == 'D') {
                 $sattr_d = $_s;
             } else {
                 if ($_s[0] == 'S') {
                     $sattr_s = $_s;
                 } else {
                     if ($_s[0] == 'O') {
//.........这里部分代码省略.........
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:101,代码来源:crm_invoice.php

示例10: OnSearchIndex

 function OnSearchIndex($arUserField)
 {
     $res = '';
     if (is_array($arUserField["VALUE"])) {
         $val = $arUserField["VALUE"];
     } else {
         $val = array($arUserField["VALUE"]);
     }
     $val = array_filter($val, "intval");
     if (count($val)) {
         foreach ($val as $v) {
             $rs = CUser::GetList($by = "", $order = "", array("ID" => $v));
             while ($ar = $rs->Fetch()) {
                 $res .= CSearch::KillTags(CUser::FormatName(CSite::GetNameFormat(), $ar)) . "\r\n";
             }
         }
     }
     return $res;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:19,代码来源:properties.php


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