Exemple #1
0
 function SelectBox($sFieldName, $sValue, $sDefaultValue = "", $JavaChangeFunc = "", $sAdditionalParams = "")
 {
     if (empty(self::$arExtraCache)) {
         $rsExtras = CExtra::GetList(array("NAME" => "ASC"));
         while ($arExtra = $rsExtras->Fetch()) {
             $arExtra['ID'] = intval($arExtra['ID']);
             self::$arExtraCache[$arExtra['ID']] = $arExtra;
             if (defined('CATALOG_GLOBAL_VARS') && 'Y' == CATALOG_GLOBAL_VARS) {
                 global $MAIN_EXTRA_LIST_CACHE;
                 $MAIN_EXTRA_LIST_CACHE = self::$arExtraCache;
             }
         }
     }
     $s = '<select name="' . $sFieldName . '"';
     if (!empty($JavaChangeFunc)) {
         $s .= ' onchange="' . $JavaChangeFunc . '"';
     }
     if (!empty($sAdditionalParams)) {
         $s .= ' ' . $sAdditionalParams . ' ';
     }
     $s .= '>';
     $sValue = intval($sValue);
     $boolFound = isset(self::$arExtraCache[$sValue]);
     if (!empty($sDefaultValue)) {
         $s .= '<option value="0"' . ($boolFound ? '' : ' selected') . '>' . htmlspecialcharsex($sDefaultValue) . '</option>';
     }
     foreach (self::$arExtraCache as &$arExtra) {
         $s .= '<option value="' . $arExtra['ID'] . '"' . ($arExtra['ID'] == $sValue ? ' selected' : '') . '>' . htmlspecialcharsex($arExtra['NAME']) . ' (' . htmlspecialcharsex($arExtra['PERCENTAGE']) . '%)</option>';
     }
     if (isset($arExtra)) {
         unset($arExtra);
     }
     return $s . '</select>';
 }
 /** Returns an array, containing information about the product block on its ID.
  * @param $elementId
  * @return array|string
  */
 public static function getProductInfo($elementId)
 {
     $elementId = intval($elementId);
     $result = "";
     if ($elementId <= 0) {
         return $result;
     }
     $dbProduct = CIBlockElement::GetList(array(), array("ID" => $elementId), false, false, array('ID', 'IBLOCK_ID', 'IBLOCK_SECTION_ID', 'DETAIL_PICTURE', 'PREVIEW_PICTURE', 'NAME', 'XML_ID'));
     while ($arProduct = $dbProduct->GetNext()) {
         $imgCode = "";
         if ($arProduct["IBLOCK_ID"] > 0) {
             $arProduct["EDIT_PAGE_URL"] = CIBlock::GetAdminElementEditLink($arProduct["IBLOCK_ID"], $elementId, array("find_section_section" => $arProduct["IBLOCK_SECTION_ID"]));
         }
         if ($arProduct["DETAIL_PICTURE"] > 0) {
             $imgCode = $arProduct["DETAIL_PICTURE"];
         } elseif ($arProduct["PREVIEW_PICTURE"] > 0) {
             $imgCode = $arProduct["PREVIEW_PICTURE"];
         }
         $arProduct["NAME"] = $arProduct["NAME"];
         $arProduct["DETAIL_PAGE_URL"] = htmlspecialcharsex($arProduct["DETAIL_PAGE_URL"]);
         if ($imgCode > 0) {
             $arFile = CFile::GetFileArray($imgCode);
             $arImgProduct = CFile::ResizeImageGet($arFile, array('width' => 80, 'height' => 80), BX_RESIZE_IMAGE_PROPORTIONAL, false, false);
             $arProduct["IMG_URL"] = $arImgProduct['src'];
         }
         return $arProduct;
     }
     return $result;
 }
Exemple #3
0
 public function ListAddFilterFields(&$arFilterFields, &$arFilterLogic, $sFormName = 'form1', $bVarsFromForm = true)
 {
     global $APPLICATION;
     $arUserFields = $this->GetUserFields($this->sEntityID, 0, LANGUAGE_ID);
     foreach ($arUserFields as $FIELD_NAME => $arUserField) {
         if ($arUserField['SHOW_FILTER'] != 'N' && $arUserField['USER_TYPE']['BASE_TYPE'] != 'file') {
             if ($arUserField['USER_TYPE']['USER_TYPE_ID'] === 'employee') {
                 $arFilterFields[] = array('id' => $FIELD_NAME, 'name' => htmlspecialcharsex($arUserField['LIST_FILTER_LABEL']), 'type' => 'user', 'enable_settings' => false);
                 continue;
             }
             if ($arUserField['USER_TYPE']['BASE_TYPE'] == 'enum' || $arUserField['USER_TYPE']['USER_TYPE_ID'] == 'iblock_element' || $arUserField['USER_TYPE']['USER_TYPE_ID'] == 'iblock_section') {
                 // Fix #29649. Allow user to add not multiple fields with height 1 item.
                 if ($arUserField['MULTIPLE'] !== 'Y' && isset($arUserField['SETTINGS']['LIST_HEIGHT']) && intval($arUserField['SETTINGS']['LIST_HEIGHT']) > 1) {
                     $arUserField['MULTIPLE'] = 'Y';
                 }
                 //as the system presets the filter can not work with the field names containing []
                 if ($arUserField['SETTINGS']['DISPLAY'] == 'CHECKBOX') {
                     $arUserField['SETTINGS']['DISPLAY'] = '';
                 }
             }
             ob_start();
             $APPLICATION->IncludeComponent('bitrix:crm.field.filter', $arUserField['USER_TYPE']['USER_TYPE_ID'], array('arUserField' => $arUserField, 'bVarsFromForm' => $bVarsFromForm, 'form_name' => 'filter_' . $sFormName, 'bShowNotSelected' => true), false, array('HIDE_ICONS' => true));
             $sVal = ob_get_contents();
             ob_end_clean();
             $arFilterFields[] = array('id' => $FIELD_NAME, 'name' => htmlspecialcharsex($arUserField['LIST_FILTER_LABEL']), 'type' => 'custom', 'value' => $sVal);
             // Fix issue #49771 - do not treat 'crm' type values as strings. To suppress filtration by LIKE.
             // Fix issue #56844 - do not treat 'crm_status' type values as strings. To suppress filtration by LIKE.
             if ($arUserField['USER_TYPE']['BASE_TYPE'] == 'string' && $arUserField['USER_TYPE']['USER_TYPE_ID'] !== 'crm' && $arUserField['USER_TYPE']['USER_TYPE_ID'] !== 'crm_status') {
                 $arFilterLogic[] = $FIELD_NAME;
             }
         }
     }
 }
 public function getData($bEscape = true)
 {
     if ($this->cachedData === null) {
         // Ensure that we have read access for task
         $this->oTaskItem->getData();
         try {
             $this->cachedData = static::fetchDataFromDb($this->taskId, $this->itemId);
         } catch (Exception $e) {
             throw new TasksException('', TasksException::TE_ITEM_NOT_FOUND_OR_NOT_ACCESSIBLE);
         }
     }
     if ($bEscape) {
         // Prepare escaped data on-demand
         if ($this->cachedEscapedData === null) {
             foreach ($this->cachedData as $field => $value) {
                 $this->cachedEscapedData['~' . $field] = $value;
                 if (is_numeric($value) || !is_string($value)) {
                     $this->cachedEscapedData[$field] = $value;
                 } else {
                     $this->cachedEscapedData[$field] = htmlspecialcharsex($value);
                 }
             }
         }
         return $this->cachedEscapedData;
     } else {
         return $this->cachedData;
     }
 }
function getProductInfo($arData)
{
    $result = "";
    if (!is_array($arData) || count($arData) <= 0) {
        return $result;
    }
    $dbProduct = CIBlockElement::GetList(array(), array("ID" => $arData["ELEMENT_ID"]), false, false, array('ID', 'IBLOCK_ID', 'IBLOCK_SECTION_ID', 'DETAIL_PICTURE', 'PREVIEW_PICTURE', 'IBLOCK_TYPE_ID', 'NAME'));
    while ($arProduct = $dbProduct->GetNext()) {
        $imgCode = "";
        if ($arProduct["IBLOCK_ID"] > 0) {
            $arProduct["EDIT_PAGE_URL"] = "/bitrix/admin/iblock_element_edit.php?ID=" . $arProduct["ID"] . "&type=" . $arProduct["IBLOCK_TYPE_ID"] . "&lang=" . LANG . "&IBLOCK_ID=" . $arProduct["IBLOCK_ID"] . "&find_section_section=" . intval($arProduct["IBLOCK_SECTION_ID"]);
        }
        if ($arProduct["DETAIL_PICTURE"] > 0) {
            $imgCode = $arProduct["DETAIL_PICTURE"];
        } elseif ($arProduct["PREVIEW_PICTURE"] > 0) {
            $imgCode = $arProduct["PREVIEW_PICTURE"];
        }
        $arProduct["NAME"] = htmlspecialcharsex($arProduct["NAME"]);
        $arProduct["DETAIL_PAGE_URL"] = htmlspecialcharsex($arProduct["DETAIL_PAGE_URL"]);
        $arProduct["CURRENCY"] = htmlspecialcharsex($arProduct["CURRENCY"]);
        if ($imgCode > 0) {
            $arFile = CFile::GetFileArray($imgCode);
            $arImgProduct = CFile::ResizeImageGet($arFile, array('width' => 80, 'height' => 80), BX_RESIZE_IMAGE_PROPORTIONAL, false, false);
            $arProduct["IMG_URL"] = $arImgProduct['src'];
        }
        return $arProduct;
    }
}
Exemple #6
0
function InputTags($sName="", $sValue="", $arSites=array(), $sHTML="", $sId="")
{
	if(!$sId)
		$sId = GenerateUniqId($sName);
	TagsShowScript();
	$order = class_exists("cuseroptions")? CUserOptions::GetOption("search_tags", "order", "CNT"): "CNT";
	return '<input name="'.htmlspecialcharsbx($sName).'" id="'.htmlspecialcharsbx($sId).'" type="text" autocomplete="off" value="'.htmlspecialcharsex($sValue).'" onfocus="'.htmlspecialcharsbx('window.oObject[this.id] = new JsTc(this, '.CUtil::PhpToJSObject($arSites).');').'" '.$sHTML.'/><input type="checkbox" id="ck_'.$sId.'" name="ck_'.htmlspecialcharsbx($sName).'" '.($order=="NAME"? "checked": "").' title="'.GetMessage("SEARCH_TAGS_SORTING_TIP").'">';
}
 function GetAdminListViewHTML($arProperty, $value, $strHTMLControlName)
 {
     if (strlen($value["VALUE"]) > 0) {
         if (!CheckDateTime($value["VALUE"])) {
             $value = CIBlockPropertyDateTime::ConvertFromDB($arProperty, $value);
         }
         return str_replace(" ", "&nbsp;", htmlspecialcharsex($value["VALUE"]));
     } else {
         return '&nbsp;';
     }
 }
Exemple #8
0
	public function Fetch()
	{
		$r = parent::Fetch();

		if($r)
		{
			if(strlen($r["SITE_URL"])>0)
				$r["URL"] = $r["SITE_URL"];

			if(substr($r["URL"], 0, 1)=="=")
			{
				$events = GetModuleEvents("search", "OnSearchGetURL");
				while ($arEvent = $events->Fetch())
					$r["URL"] = ExecuteModuleEventEx($arEvent, array($r));
			}

			$r["URL"] = str_replace(
				array("#LANG#", "#SITE_DIR#", "#SERVER_NAME#"),
				array($r["DIR"], $r["DIR"], $r["SERVER_NAME"]),
				$r["URL"]
			);
			$r["URL"] = preg_replace("'(?<!:)/+'s", "/", $r["URL"]);

			$r["NAME"] = htmlspecialcharsex($r["TITLE"]);

			$preg_template = "/(^|[^".$this->_arStemFunc["pcre_letters"]."])(".str_replace("/", "\\/", implode("|", array_map('preg_quote', array_keys($this->_arPhrase)))).")/i".BX_UTF_PCRE_MODIFIER;
			if(preg_match_all($preg_template, ToUpper($r["NAME"]), $arMatches, PREG_OFFSET_CAPTURE))
			{
				$c = count($arMatches[2]);
				if(defined("BX_UTF"))
				{
					for($j = $c-1; $j >= 0; $j--)
					{
						$prefix = mb_substr($r["NAME"], 0, $arMatches[2][$j][1], 'latin1');
						$instr  = mb_substr($r["NAME"], $arMatches[2][$j][1], mb_strlen($arMatches[2][$j][0], 'latin1'), 'latin1');
						$suffix = mb_substr($r["NAME"], $arMatches[2][$j][1] + mb_strlen($arMatches[2][$j][0], 'latin1'), mb_strlen($r["NAME"], 'latin1'), 'latin1');
						$r["NAME"] = $prefix."<b>".$instr."</b>".$suffix;
					}
				}
				else
				{
					for($j = $c-1; $j >= 0; $j--)
					{
						$prefix = substr($r["NAME"], 0, $arMatches[2][$j][1]);
						$instr  = substr($r["NAME"], $arMatches[2][$j][1], strlen($arMatches[2][$j][0]));
						$suffix = substr($r["NAME"], $arMatches[2][$j][1]+strlen($arMatches[2][$j][0]));
						$r["NAME"] = $prefix."<b>".$instr."</b>".$suffix;
					}
				}
			}
		}

		return $r;
	}
 function GetInfoHTML($params = array())
 {
     $html = '';
     if (is_array($this->_file)) {
         $intWidth = $this->_width;
         $intHeight = $this->_height;
         $img_src = '';
         $divId = '';
         if (isset($params['url_template']) && $intWidth > 0 && $intHeight > 0) {
             $img_src = $this->GetImgSrc(array('url_template' => $params['url_template']));
             if ($img_src) {
                 CUtil::InitJSCore(array("viewer"));
                 self::$_counter++;
                 $divId = 'lists-image-info-' . self::$_counter;
             }
         }
         if ($divId) {
             $html .= '<div id="' . $divId . '">';
         } else {
             $html .= '<div>';
         }
         if (isset($params['view']) && $params['view'] == 'short') {
             $info = $this->_file["FILE_NAME"] . ' (';
             if ($intWidth > 0 && $intHeight > 0) {
                 $info .= $intWidth . 'x' . $intHeight . ', ';
             }
             $info .= CFile::FormatSize($this->_file['FILE_SIZE']) . ')';
             if ($divId) {
                 $html .= GetMessage('FILE_TEXT') . ': <span style="cursor:pointer" data-bx-viewer="image" data-bx-src="' . htmlspecialcharsbx($img_src) . '">' . htmlspecialcharsex($info) . '</span>';
             } else {
                 $html .= GetMessage('FILE_TEXT') . ': ' . htmlspecialcharsex($info);
             }
         } else {
             if ($divId) {
                 $html .= GetMessage('FILE_TEXT') . ': <span style="cursor:pointer" data-bx-viewer="image" data-bx-src="' . htmlspecialcharsbx($img_src) . '">' . htmlspecialcharsex($this->_file["FILE_NAME"]) . '</span>';
             } else {
                 $html .= GetMessage('FILE_TEXT') . ': ' . htmlspecialcharsex($this->_file["FILE_NAME"]);
             }
             /*if($intWidth > 0 && $intHeight > 0)
             		{
             			$html .= '<br>'.GetMessage('FILE_WIDTH').': '.$intWidth;
             			$html .= '<br>'.GetMessage('FILE_HEIGHT').': '.$intHeight;
             		}*/
             $html .= '<br>' . GetMessage('FILE_SIZE') . ': ' . CFile::FormatSize($this->_file['FILE_SIZE']);
         }
         if ($divId) {
             $html .= '</div><script>BX.ready(function(){BX.viewElementBind("' . $divId . '");});</script>';
         } else {
             $html .= '</div>';
         }
     }
     return $html;
 }
Exemple #10
0
 public static function GetAdminListViewHTML($arProperty, $value, $strHTMLControlName)
 {
     if (!is_array($value["VALUE"])) {
         $value = CIBlockPropertyHTML::ConvertFromDB($arProperty, $value);
     }
     $ar = $value["VALUE"];
     if ($ar) {
         return htmlspecialcharsex($ar["TYPE"] . ":" . $ar["TEXT"]);
     } else {
         return "&nbsp;";
     }
 }
 function GetPropertyFieldHtml($arProperty, $value, $strHTMLControlName)
 {
     $ar_res = false;
     if (strlen($value["VALUE"])) {
         $db_res = CIBlockElement::GetList(array(), array("=XML_ID" => $value["VALUE"], "SHOW_HISTORY" => "Y"), false, false, array("ID", "IBLOCK_ID", "NAME"));
         $ar_res = $db_res->GetNext();
     }
     if (!$ar_res) {
         $ar_res = array("NAME" => "");
     }
     return '<input name="' . htmlspecialcharsbx($strHTMLControlName["VALUE"]) . '" id="' . htmlspecialcharsbx($strHTMLControlName["VALUE"]) . '" value="' . htmlspecialcharsex($value["VALUE"]) . '" size="20" type="text">' . '<input type="button" value="..." onClick="jsUtils.OpenWindow(\'' . CUtil::JSEscape('/bitrix/admin/iblock_element_search.php?lang=' . LANG . '&n=' . urlencode($strHTMLControlName["VALUE"]) . '&get_xml_id=Y&a=b') . '\', 600, 500);">' . '&nbsp;<span id="sp_' . htmlspecialcharsbx($strHTMLControlName["VALUE"]) . '" >' . $ar_res['NAME'] . '</span>';
 }
Exemple #12
0
 function OnBuildGlobalMenu(&$aGlobalMenu, &$aModuleMenu)
 {
     global $USER;
     if (!CModule::IncludeModule("iblock")) {
         return;
     }
     //When UnRegisterModuleDependences is called from module uninstall
     //cached EventHandlers may be called
     if (defined("BX_CATALOG_UNINSTALLED")) {
         return;
     }
     $aMenu = array("text" => GetMessage("CAT_MENU_ROOT"), "title" => "", "items_id" => "menu_catalog_list", "items" => array());
     $arCatalogs = array();
     $rsCatalog = CCatalog::GetList(array("sort" => "asc"));
     while ($ar = $rsCatalog->Fetch()) {
         if ($ar["PRODUCT_IBLOCK_ID"]) {
             $arCatalogs[$ar["PRODUCT_IBLOCK_ID"]] = 1;
         } else {
             $arCatalogs[$ar["IBLOCK_ID"]] = 1;
         }
     }
     $rsIBlocks = CIBlock::GetList(array("SORT" => "asc", "NAME" => "ASC"), array("MIN_PERMISSION" => "U"));
     while ($arIBlock = $rsIBlocks->Fetch()) {
         if (array_key_exists($arIBlock["ID"], $arCatalogs)) {
             $arItems = array(array("text" => GetMessage("CAT_MENU_PRODUCT_LIST"), "url" => "cat_product_admin.php?lang=" . LANGUAGE_ID . "&IBLOCK_ID=" . $arIBlock["ID"] . "&type=" . urlencode($arIBlock["IBLOCK_TYPE_ID"]), "more_url" => array("cat_product_admin.php?IBLOCK_ID=" . $arIBlock["ID"], "cat_product_edit.php?IBLOCK_ID=" . $arIBlock["ID"]), "title" => "", "page_icon" => "iblock_page_icon_elements", "items_id" => "menu_catalog_goods_" . $arIBlock["ID"], "module_id" => "catalog"), array("text" => htmlspecialcharsex(CIBlock::GetArrayByID($arIBlock["ID"], "SECTIONS_NAME")), "url" => "cat_section_admin.php?lang=" . LANGUAGE_ID . "&type=" . $arIBlock["IBLOCK_TYPE_ID"] . "&IBLOCK_ID=" . $arIBlock["ID"] . "&find_section_section=0", "more_url" => array("cat_section_admin.php?IBLOCK_ID=" . $arIBlock["ID"] . "&find_section_section=0", "cat_section_edit.php?IBLOCK_ID=" . $arIBlock["ID"] . "&find_section_section=0"), "title" => "", "page_icon" => "iblock_page_icon_sections", "items_id" => "menu_catalog_category_" . $arIBlock["ID"], "module_id" => "catalog", "items" => CCatalogAdmin::get_sections_menu($arIBlock["IBLOCK_TYPE_ID"], $arIBlock["ID"], 1, 0)));
             if (CIBlockRights::UserHasRightTo($arIBlock["ID"], $arIBlock["ID"], "iblock_edit")) {
                 $arItems[] = array("text" => GetMessage("CAT_MENU_PRODUCT_PROPERTIES"), "url" => "iblock_property_admin.php?lang=" . LANGUAGE_ID . "&IBLOCK_ID=" . $arIBlock["ID"] . "&admin=N", "more_url" => array("iblock_property_admin.php?IBLOCK_ID=" . $arIBlock["ID"] . "&admin=N", "iblock_edit_property.php?IBLOCK_ID=" . $arIBlock["ID"] . "&admin=N"), "title" => "", "page_icon" => "iblock_page_icon_settings", "items_id" => "menu_catalog_attributes_" . $arIBlock["ID"], "module_id" => "catalog");
             }
             $arCatalog = false;
             if (CModule::IncludeModule("catalog")) {
                 $arCatalog = CCatalog::GetSkuInfoByProductID($arIBlock["ID"]);
             }
             if (is_array($arCatalog) && CIBlockRights::UserHasRightTo($arCatalog["IBLOCK_ID"], $arCatalog["IBLOCK_ID"], "iblock_edit")) {
                 $arItems[] = array("text" => GetMessage("CAT_MENU_SKU_PROPERTIES"), "url" => "iblock_property_admin.php?lang=" . LANGUAGE_ID . "&IBLOCK_ID=" . $arCatalog["IBLOCK_ID"] . "&admin=N", "more_url" => array("iblock_property_admin.php?IBLOCK_ID=" . $arCatalog["IBLOCK_ID"] . "&admin=N", "iblock_edit_property.php?IBLOCK_ID=" . $arCatalog["IBLOCK_ID"] . "&admin=N"), "title" => "", "page_icon" => "iblock_page_icon_settings", "items_id" => "menu_catalog_attributes_" . $arCatalog["IBLOCK_ID"], "module_id" => "catalog");
             }
             if (CIBlockRights::UserHasRightTo($arIBlock["ID"], $arIBlock["ID"], "iblock_edit")) {
                 $arItems[] = array("text" => GetMessage("CAT_MENU_CATALOG_SETTINGS"), "url" => "cat_catalog_edit.php?lang=" . LANGUAGE_ID . "&IBLOCK_ID=" . $arIBlock["ID"], "more_url" => array("cat_catalog_edit.php?IBLOCK_ID=" . $arIBlock["ID"]), "title" => "", "page_icon" => "iblock_page_icon_settings", "items_id" => "menu_catalog_edit_" . $arIBlock["ID"], "module_id" => "catalog");
             }
             $aMenu["items"][] = array("text" => htmlspecialcharsEx($arIBlock["NAME"]), "title" => "", "page_icon" => "iblock_page_icon_sections", "items_id" => "menu_catalog_" . $arIBlock["ID"], "module_id" => "catalog", "items" => $arItems);
         }
     }
     if (!empty($aMenu["items"])) {
         if (count($aMenu["items"]) == 1) {
             $aMenu = $aMenu["items"][0];
         }
         $aMenu["parent_menu"] = "global_menu_store";
         $aMenu["section"] = "catalog_list";
         $aMenu["sort"] = 200;
         $aMenu["icon"] = "iblock_menu_icon_sections";
         $aMenu["page_icon"] = "iblock_page_icon_types";
         $aModuleMenu[] = $aMenu;
     }
 }
Exemple #13
0
function _get_sections_menu($arType, $arIBlock, $DEPTH_LEVEL, $SECTION_ID, $arSectionsChain = false)
{
    //Determine opened sections
    if ($arSectionsChain === false) {
        $arSectionsChain = array();
        if (isset($_REQUEST['admin_mnu_menu_id'])) {
            $menu_id = "menu_iblock_/" . $arType["ID"] . "/" . $arIBlock["ID"] . "/";
            if (strncmp($_REQUEST['admin_mnu_menu_id'], $menu_id, strlen($menu_id)) == 0) {
                $rsSections = CIBlockSection::GetNavChain($arIBlock["ID"], substr($_REQUEST['admin_mnu_menu_id'], strlen($menu_id)), array('ID', 'IBLOCK_ID'));
                while ($arSection = $rsSections->Fetch()) {
                    $arSectionsChain[$arSection["ID"]] = $arSection["ID"];
                }
            }
        }
        if (isset($_REQUEST["find_section_section"]) && (int) $_REQUEST["find_section_section"] > 0 && isset($_REQUEST["IBLOCK_ID"]) && $_REQUEST["IBLOCK_ID"] == $arIBlock["ID"]) {
            $rsSections = CIBlockSection::GetNavChain($arIBlock["ID"], $_REQUEST["find_section_section"], array('ID', 'IBLOCK_ID'));
            while ($arSection = $rsSections->Fetch()) {
                $arSectionsChain[$arSection["ID"]] = $arSection["ID"];
            }
        }
    }
    $urlSectionAdminPage = CIBlock::GetAdminSectionListLink($arIBlock["ID"], array("menu" => null));
    $arSections = array();
    if (CIBlock::GetAdminListMode($arIBlock["ID"]) == 'S') {
        $arSections[] = _get_elements_menu($arType, $arIBlock, $SECTION_ID);
    }
    $rsSections = CIBlockSection::GetList(array("left_margin" => "ASC"), array("IBLOCK_ID" => $arIBlock["ID"], "SECTION_ID" => $SECTION_ID), false, array("ID", "IBLOCK_SECTION_ID", "NAME", "LEFT_MARGIN", "RIGHT_MARGIN"));
    $sectionCount = 0;
    $limit = COption::GetOptionInt("iblock", "iblock_menu_max_sections");
    while ($arSection = $rsSections->Fetch()) {
        if ($limit > 0 && $sectionCount >= $limit) {
            $arSections[] = array("text" => GetMessage("IBLOCK_MENU_ALL_OTH"), "url" => htmlspecialcharsbx($urlSectionAdminPage . "&find_section_section=" . (int) $arSection["IBLOCK_SECTION_ID"]), "more_url" => array($urlSectionAdminPage . "&find_section_section=" . (int) $arSection["IBLOCK_SECTION_ID"], $urlSectionAdminPage, "iblock_section_edit.php?" . $arIBlock["URL_PART"], "iblock_element_edit.php?IBLOCK_ID=" . $arIBlock["ID"] . "&type=" . $arType["ID"], "iblock_history_list.php?IBLOCK_ID=" . $arIBlock["ID"] . "&type=" . $arType["ID"]), "title" => GetMessage("IBLOCK_MENU_ALL_OTH_TITLE"), "icon" => "iblock_menu_icon_sections", "page_icon" => "iblock_page_icon_sections", "skip_chain" => true, "items_id" => "menu_iblock_/" . $arType["ID"] . "/" . $arIBlock["ID"] . "/" . $arSection["ID"], "module_id" => "iblock", "items" => array());
            _get_other_elements_menu($arType, $arIBlock, $arSection, $arSections[0]["more_url"]);
            break;
        }
        $arSectionTmp = array("text" => htmlspecialcharsex($arSection["NAME"]), "url" => htmlspecialcharsbx($urlSectionAdminPage . "&find_section_section=" . $arSection["ID"]), "more_url" => array($urlSectionAdminPage . "&find_section_section=" . $arSection["ID"], "iblock_section_edit.php?" . $arIBlock["URL_PART"] . "&ID=" . $arSection["ID"], "iblock_section_edit.php?" . $arIBlock["URL_PART"] . "&ID=0&find_section_section=" . $arSection["ID"], "iblock_element_edit.php?IBLOCK_ID=" . $arIBlock["ID"] . "&type=" . $arType["ID"] . "&find_section_section=" . $arSection["ID"], "iblock_history_list.php?IBLOCK_ID=" . $arIBlock["ID"] . "&type=" . $arType["ID"] . "&find_section_section=" . $arSection["ID"]), "title" => htmlspecialcharsex($arSection["NAME"]), "icon" => "iblock_menu_icon_sections", "page_icon" => "iblock_page_icon_sections", "skip_chain" => true, "dynamic" => CIBlock::GetAdminListMode($arIBlock["ID"]) == 'S' || $arSection["RIGHT_MARGIN"] - $arSection["LEFT_MARGIN"] > 1, "items_id" => "menu_iblock_/" . $arType["ID"] . "/" . $arIBlock["ID"] . "/" . $arSection["ID"], "module_id" => "iblock", "items" => array());
        if (array_key_exists($arSection["ID"], $arSectionsChain)) {
            $arSectionTmp["items"] = _get_sections_menu($arType, $arIBlock, $DEPTH_LEVEL + 1, $arSection["ID"], $arSectionsChain);
        } elseif (method_exists($GLOBALS["adminMenu"], "IsSectionActive")) {
            if ($GLOBALS["adminMenu"]->IsSectionActive("menu_iblock_/" . $arType["ID"] . "/" . $arIBlock["ID"] . "/" . $arSection["ID"])) {
                $arSectionTmp["items"] = _get_sections_menu($arType, $arIBlock, $DEPTH_LEVEL + 1, $arSection["ID"], $arSectionsChain);
            }
        }
        $arSections[] = $arSectionTmp;
        $sectionCount++;
    }
    while ($arSection = $rsSections->Fetch()) {
        $urlElementAdminPage = CIBlock::GetAdminElementListLink($arIBlock["ID"], array("menu" => null));
        $arSections[0]["more_url"][] = $urlElementAdminPage . "&find_section_section=" . (int) $arSection["ID"];
    }
    return $arSections;
}
 function GetInfoHTML()
 {
     $html = '';
     if (is_array($this->_file)) {
         $html .= GetMessage('FILE_TEXT') . ': ' . htmlspecialcharsex($this->_file["FILE_NAME"]);
         $intWidth = $this->_width;
         $intHeight = $this->_height;
         if ($intWidth > 0 && $intHeight > 0) {
             $html .= '<br>' . GetMessage('FILE_WIDTH') . ': ' . $intWidth;
             $html .= '<br>' . GetMessage('FILE_HEIGHT') . ': ' . $intHeight;
         }
         $html .= '<br>' . GetMessage('FILE_SIZE') . ': ' . CFile::FormatSize($this->_file['FILE_SIZE']);
     }
     return $html;
 }
Exemple #15
0
 private static function UsersArrayToStringInternal($arUsers, $arWorkflowTemplate, $arAllowableUserGroups, $appendId = true)
 {
     if (is_array($arUsers)) {
         $r = array();
         $keys = array_keys($arUsers);
         foreach ($keys as $key) {
             $r[$key] = self::UsersArrayToStringInternal($arUsers[$key], $arWorkflowTemplate, $arAllowableUserGroups, $appendId);
         }
         if (count($r) == 2) {
             $keys = array_keys($r);
             if ($keys[0] == 0 && $keys[1] == 1 && is_string($r[0]) && is_string($r[1])) {
                 if (in_array($r[0], array("Document", "Template", "Variable", "User")) || preg_match('#^A\\d+_\\d+_\\d+_\\d+$#i', $r[0]) || is_array($arWorkflowTemplate) && CBPWorkflowTemplateLoader::FindActivityByName($arWorkflowTemplate, $r[0]) != null) {
                     return "{=" . $r[0] . ":" . $r[1] . "}";
                 }
             }
         }
         return implode(", ", $r);
     } else {
         if (array_key_exists(strtolower($arUsers), $arAllowableUserGroups)) {
             return $arAllowableUserGroups[strtolower($arUsers)];
         }
         $userId = 0;
         if (substr($arUsers, 0, strlen("user_")) == "user_") {
             $userId = intval(substr($arUsers, strlen("user_")));
         }
         if ($userId > 0) {
             $db = CUser::GetList($by = "LAST_NAME", $order = "asc", array("ID_EQUAL_EXACT" => $userId), array("NAV_PARAMS" => false));
             if ($ar = $db->Fetch()) {
                 $str = CUser::FormatName(COption::GetOptionString("bizproc", "name_template", CSite::GetNameFormat(false), SITE_ID), $ar, true, false);
                 if ($appendId) {
                     $str = $str . " [" . $ar["ID"] . "]";
                 }
                 return str_replace(",", " ", $str);
             }
         } else {
             if (strpos($arUsers, 'group_') === 0) {
                 $str = htmlspecialcharsex(self::getExtendedGroupName($arUsers, $appendId));
                 return str_replace(",", " ", $str);
             }
         }
         return str_replace(",", " ", $arUsers);
     }
 }
Exemple #16
0
 function GetUserName($USER_ID, $nameTemplate = "")
 {
     $ar_res = false;
     if (IntVal($USER_ID) > 0) {
         $db_res = CUser::GetByID(IntVal($USER_ID));
         $ar_res = $db_res->Fetch();
     }
     if (!$ar_res) {
         $db_res = CUser::GetByLogin($USER_ID);
         $ar_res = $db_res->Fetch();
     }
     $USER_ID = IntVal($ar_res["ID"]);
     $f_LOGIN = htmlspecialcharsex($ar_res["LOGIN"]);
     $forum_user = CForumUser::GetByUSER_ID($USER_ID);
     if ($forum_user["SHOW_NAME"] == "Y" && (strlen(trim($ar_res["NAME"])) > 0 || strlen(trim($ar_res["LAST_NAME"])) > 0)) {
         $nameTemplate = trim(empty($nameTemplate)) ? CSite::GetNameFormat() : $nameTemplate;
         return trim(CUser::FormatName($nameTemplate, array("NAME" => htmlspecialcharsEx($ar_res["NAME"]), "LAST_NAME" => htmlspecialcharsEx($ar_res["LAST_NAME"]), "SECOND_NAME" => htmlspecialcharsEx($ar_res["SECOND_NAME"]))));
     } else {
         return $f_LOGIN;
     }
 }
Exemple #17
0
 function addPropsCell(&$row, &$arSelectedProps, &$arItems)
 {
     $arProperties = $arItems['PROPERTIES'];
     foreach ($arSelectedProps as $aProp) {
         if (empty($arProperties[$aProp['ID']])) {
             continue;
         }
         $v = '';
         foreach ($arProperties[$aProp['ID']] as $property_value_id => $property_value) {
             $res = '';
             if ($aProp['PROPERTY_TYPE'] == 'F') {
                 $res = getImageField($property_value_id, $property_value);
             } elseif ($aProp['PROPERTY_TYPE'] == 'G') {
                 $res = ProductSearchComponent::getSectionName($property_value);
             } elseif ($aProp['PROPERTY_TYPE'] == 'E') {
                 $res = ProductSearchComponent::getElementName($property_value);
             } else {
                 $res = htmlspecialcharsex($property_value);
             }
             if ($res != "") {
                 $v .= ($v != '' ? ' / ' : '') . $res;
             }
         }
         if ($v != "") {
             $row->AddViewField("PROPERTY_" . $aProp['ID'], $v);
         }
     }
 }
Exemple #18
0
 function GetRSSText($arIBLOCK, $LIMIT_NUM = false, $LIMIT_DAY = false, $yandex = false)
 {
     global $DB;
     $strRes = "";
     $serverName = "";
     if (isset($arIBLOCK["SERVER_NAME"]) && strlen($arIBLOCK["SERVER_NAME"]) > 0) {
         $serverName = $arIBLOCK["SERVER_NAME"];
     }
     if (strlen($serverName) <= 0 && !isset($arIBLOCK["SERVER_NAME"])) {
         $dbSite = CSite::GetList($b = "sort", $o = "asc", array("LID" => $arIBLOCK["LID"]));
         if ($arSite = $dbSite->Fetch()) {
             $serverName = $arSite["SERVER_NAME"];
         }
     }
     if (strlen($serverName) <= 0) {
         if (defined("SITE_SERVER_NAME") && strlen(SITE_SERVER_NAME) > 0) {
             $serverName = SITE_SERVER_NAME;
         } else {
             $serverName = COption::GetOptionString("main", "server_name", "www.bitrixsoft.com");
         }
     }
     $strRes .= "<channel>\n";
     $strRes .= "<title>" . htmlspecialcharsbx($arIBLOCK["NAME"]) . "</title>\n";
     $strRes .= "<link>http://" . $serverName . "</link>\n";
     $strRes .= "<description>" . htmlspecialcharsbx($arIBLOCK["DESCRIPTION"]) . "</description>\n";
     $strRes .= "<lastBuildDate>" . date("r") . "</lastBuildDate>\n";
     $strRes .= "<ttl>" . $arIBLOCK["RSS_TTL"] . "</ttl>\n";
     $db_img_arr = CFile::GetFileArray($arIBLOCK["PICTURE"]);
     if ($db_img_arr) {
         if (substr($db_img_arr["SRC"], 0, 1) == "/") {
             $strImage = "http://" . $serverName . $db_img_arr["SRC"];
         } else {
             $strImage = $db_img_arr["SRC"];
         }
         $strRes .= "<image>\n";
         $strRes .= "<title>" . htmlspecialcharsbx($arIBLOCK["NAME"]) . "</title>\n";
         $strRes .= "<url>" . $strImage . "</url>\n";
         $strRes .= "<link>http://" . $serverName . "</link>\n";
         $strRes .= "<width>" . $db_img_arr["WIDTH"] . "</width>\n";
         $strRes .= "<height>" . $db_img_arr["HEIGHT"] . "</height>\n";
         $strRes .= "</image>\n";
     }
     $arNodes = array();
     $db_res = $DB->Query("SELECT NODE, NODE_VALUE FROM b_iblock_rss WHERE IBLOCK_ID = " . IntVal($arIBLOCK["ID"]));
     while ($db_res_arr = $db_res->Fetch()) {
         $arNodes[$db_res_arr["NODE"]] = $db_res_arr["NODE_VALUE"];
     }
     CTimeZone::Disable();
     $strSql = "SELECT DISTINCT BE.*, " . "\t" . $DB->DateToCharFunction("BE.TIMESTAMP_X") . " as TIMESTAMP_X, " . "\t" . $DB->DateToCharFunction("BE.ACTIVE_FROM", "FULL") . " as ACTIVE_FROM, " . "\t" . $DB->DateToCharFunction("BE.ACTIVE_TO", "FULL") . " as ACTIVE_TO, " . "\tL.DIR as LANG_DIR, B.DETAIL_PAGE_URL, B.LIST_PAGE_URL, B.LID, L.SERVER_NAME " . "FROM b_iblock_element BE, b_lang L, b_iblock B " . "\tLEFT JOIN b_iblock_group IBG ON IBG.IBLOCK_ID=B.ID " . "WHERE BE.IBLOCK_ID = B.ID " . "\tAND B.LID = L.LID " . "\tAND IBG.GROUP_ID IN (2) " . "\tAND BE.WF_STATUS_ID = 1 AND BE.WF_PARENT_ELEMENT_ID is null " . "\tAND IBG.PERMISSION>='R' " . "\tAND (IBG.PERMISSION='X' OR B.ACTIVE='Y') " . "\tAND (BE.IBLOCK_ID = " . IntVal($arIBLOCK["ID"]) . ") " . "\tAND ((BE.ACTIVE_TO >= " . $DB->GetNowFunction() . " OR BE.ACTIVE_TO IS NULL) AND (BE.ACTIVE_FROM <= " . $DB->GetNowFunction() . " OR BE.ACTIVE_FROM IS NULL)) " . "\tAND (BE.ACTIVE = 'Y') ";
     if ($LIMIT_DAY !== false) {
         $strSql .= " AND (BE.ACTIVE_FROM>=" . $DB->CharToDateFunction($DB->ForSql(date($DB->DateFormatToPHP(CLang::GetDateFormat("FULL")), mktime(date("H"), date("i"), date("s"), date("m"), date("d") - IntVal($LIMIT_DAY), date("Y")))), "FULL") . " OR BE.ACTIVE_FROM IS NULL) ";
     }
     $strSql .= "ORDER BY BE.ACTIVE_FROM DESC, BE.SORT ASC ";
     $res = $DB->Query($strSql);
     CTimeZone::Enable();
     $items = new CIBlockResult($res->result);
     if ($LIMIT_NUM !== False && IntVal($LIMIT_NUM) > 0) {
         $items->NavStart($LIMIT_NUM);
     }
     while ($arItem = $items->GetNext()) {
         $props = CIBlockElement::GetProperty($arIBLOCK["ID"], $arItem["ID"], "sort", "asc", array("ACTIVE" => "Y", "NON_EMPTY" => "Y"));
         $arProps = array();
         while ($arProp = $props->Fetch()) {
             if (strlen($arProp["CODE"]) > 0) {
                 $arProps[$arProp["CODE"]] = array("NAME" => htmlspecialcharsbx($arProp["NAME"]), "VALUE" => htmlspecialcharsex($arProp["VALUE"]));
             } else {
                 $arProps[$arProp["ID"]] = array("NAME" => htmlspecialcharsbx($arProp["NAME"]), "VALUE" => htmlspecialcharsex($arProp["VALUE"]));
             }
         }
         $arLinkProp = $arProps["DOC_LINK"];
         $strRes .= "<item>\n";
         if (strlen($arNodes["title"]) > 0) {
             $strRes .= "<title>" . htmlspecialcharsbx(CIBlockRSS::ExtractProperties($arNodes["title"], $arProps, $arItem)) . "</title>\n";
         } else {
             $strRes .= "<title>" . htmlspecialcharsbx($arItem["~NAME"]) . "</title>\n";
         }
         if (strlen($arNodes["link"]) > 0) {
             $strRes .= "<link>" . CIBlockRSS::ExtractProperties($arNodes["link"], $arProps, $arItem) . "</link>\n";
         } else {
             $strRes .= "<link>http://" . $serverName . ($arLinkProp["VALUE"] ? $arLinkProp["VALUE"] : $arItem["DETAIL_PAGE_URL"]) . "</link>\n";
         }
         if (strlen($arNodes["description"]) > 0) {
             $strRes .= "<description>" . htmlspecialcharsbx(CIBlockRSS::ExtractProperties($arNodes["description"], $arProps, $arItem)) . "</description>\n";
         } else {
             $strRes .= "<description>" . ($arItem["PREVIEW_TEXT"] || $yandex ? htmlspecialcharsbx($arItem["PREVIEW_TEXT"]) : htmlspecialcharsbx($arItem["DETAIL_TEXT"])) . "</description>\n";
         }
         if (strlen($arNodes["enclosure"]) > 0) {
             $strRes .= "<enclosure url=\"" . htmlspecialcharsbx(CIBlockRSS::ExtractProperties($arNodes["enclosure"], $arProps, $arItem)) . "\" length=\"" . htmlspecialcharsbx(CIBlockRSS::ExtractProperties($arNodes["enclosure_length"], $arProps, $arItem)) . "\" type=\"" . htmlspecialcharsbx(CIBlockRSS::ExtractProperties($arNodes["enclosure_type"], $arProps, $arItem)) . "\"/>\n";
         } else {
             $db_img_arr = CFile::GetFileArray($arItem["PREVIEW_PICTURE"]);
             if ($db_img_arr) {
                 if (substr($db_img_arr["SRC"], 0, 1) == "/") {
                     $strImage = "http://" . $serverName . $db_img_arr["SRC"];
                 } else {
                     $strImage = $db_img_arr["SRC"];
                 }
                 $strRes .= "<enclosure url=\"" . $strImage . "\" length=\"" . $db_img_arr["FILE_SIZE"] . "\" type=\"" . $db_img_arr["CONTENT_TYPE"] . "\" width=\"" . $db_img_arr["WIDTH"] . "\" height=\"" . $db_img_arr["HEIGHT"] . "\"/>\n";
             }
         }
         if (strlen($arNodes["category"]) > 0) {
             $strRes .= "<category>" . htmlspecialcharsbx(CIBlockRSS::ExtractProperties($arNodes["category"], $arProps, $arItem)) . "</category>\n";
         } else {
             $strPath = "";
             $nav = CIBlockSection::GetNavChain($arIBLOCK["ID"], $arItem["IBLOCK_SECTION_ID"]);
             while ($ar_nav = $nav->GetNext()) {
                 $strPath .= $ar_nav["NAME"] . "/";
             }
             if (strlen($strPath) > 0) {
                 $strRes .= "<category>" . htmlspecialcharsbx($strPath) . "</category>\n";
             }
         }
         if ($yandex) {
             $strRes .= "<yandex:full-text>" . htmlspecialcharsbx($arItem["DETAIL_TEXT"]) . "</yandex:full-text>\n";
         }
         if (strlen($arNodes["pubDate"]) > 0) {
             $strRes .= "<pubDate>" . htmlspecialcharsbx(CIBlockRSS::ExtractProperties($arNodes["pubDate"], $arProps, $arItem)) . "</pubDate>\n";
         } else {
             if (strlen($arItem["ACTIVE_FROM"]) > 0) {
                 $strRes .= "<pubDate>" . date("r", MkDateTime($DB->FormatDate($arItem["ACTIVE_FROM"], Clang::GetDateFormat("FULL"), "DD.MM.YYYY H:I:S"), "d.m.Y H:i:s")) . "</pubDate>\n";
             } else {
                 $strRes .= "<pubDate>" . date("r") . "</pubDate>\n";
             }
         }
         $strRes .= "</item>\n";
     }
     $strRes .= "</channel>\n";
     return $strRes;
 }
Exemple #19
0
	function AddDropDownField($id, $content, $required, $arSelect, $value=false, $arParams=array())
	{
		if($value === false)
			$value = $this->arFieldValues[$id];

		$html = '<select name="'.$id.'"';
		foreach($arParams as $param)
			$html .= ' '.$param;
		$html .= '>';

		foreach($arSelect as $key => $val)
			$html .= '<option value="'.htmlspecialcharsbx($key).'"'.($value == $key? ' selected': '').'>'.htmlspecialcharsex($val).'</option>';
		$html .= '</select>';

		$this->tabs[$this->tabIndex]["FIELDS"][$id] = array(
			"id" => $id,
			"required" => $required,
			"content" => $content,
			"html" => '<td width="40%">'.($required? '<span class="adm-required-field">'.$this->GetCustomLabelHTML($id, $content).'</span>': $this->GetCustomLabelHTML($id, $content)).'</td><td>'.$html.'</td>',
			"hidden" => '<input type="hidden" name="'.$id.'" value="'.htmlspecialcharsbx($value).'">',
		);
	}
Exemple #20
0
<input type="hidden" name="export_from_clouds" id="export_from_clouds_N" value="N"><?php 
    }
    ?>
	<tr class="heading">
		<td colspan="2"><?php 
    echo GetMessage("CATI_DATA_FILE_NAME");
    ?>
</td>
	</tr>
	<tr>
		<td valign="top" width="40%"><?php 
    echo GetMessage("CATI_DATA_FILE_NAME1");
    ?>
:</td>
		<td valign="top" width="60%"><b><?php 
    echo htmlspecialcharsex($strCatalogDefaultFolder);
    ?>
</b>
			<input type="text" class="typeinput" name="SETUP_FILE_NAME" size="40" value="<?php 
    echo htmlspecialcharsbx(strlen($SETUP_FILE_NAME) > 0 ? str_replace($strCatalogDefaultFolder, '', $SETUP_FILE_NAME) : "export_file_" . mt_rand(0, 999999) . ".csv");
    ?>
"><br>
		<small><?php 
    echo GetMessage("CATI_DATA_FILE_NAME1_DESC");
    ?>
</small>
		</td>
	</tr>

	<?php 
    if ($ACTION == "EXPORT_SETUP" || $ACTION == 'EXPORT_EDIT' || $ACTION == 'EXPORT_COPY') {
        if (strlen($apply) <= 0) {
            if ($bSectionPopup) {
                if ($arFields['PROPERTY_TYPE'] == "S" && !$arFields['USER_TYPE']) {
                    $type = GetMessage("IBLOCK_PROP_S");
                } elseif ($arFields['PROPERTY_TYPE'] == "N" && !$arFields['USER_TYPE']) {
                    $type = GetMessage("IBLOCK_PROP_N");
                } elseif ($arFields['PROPERTY_TYPE'] == "L" && !$arFields['USER_TYPE']) {
                    $type = GetMessage("IBLOCK_PROP_L");
                } elseif ($arFields['PROPERTY_TYPE'] == "F" && !$arFields['USER_TYPE']) {
                    $type = GetMessage("IBLOCK_PROP_F");
                } elseif ($arFields['PROPERTY_TYPE'] == "G" && !$arFields['USER_TYPE']) {
                    $type = GetMessage("IBLOCK_PROP_G");
                } elseif ($arFields['PROPERTY_TYPE'] == "E" && !$arFields['USER_TYPE']) {
                    $type = GetMessage("IBLOCK_PROP_E");
                } elseif ($arFields['USER_TYPE'] && is_array($ar = CIBlockProperty::GetUserType($arFields['USER_TYPE']))) {
                    $type = htmlspecialcharsex($ar["DESCRIPTION"]);
                } else {
                    $type = GetMessage("IBLOCK_PROP_S");
                }
                echo '<script type="text/javascript">
						top.createSectionProperty(
							' . intval($str_PROPERTY_ID) . ',
							"' . CUtil::JSEscape($arFields["NAME"]) . '",
							"' . CUtil::JSEscape($type) . '",
							' . intval($arFields["SORT"]) . ',
							"' . CUtil::JSEscape($arFields['PROPERTY_TYPE']) . '",
							"' . CUtil::JSEscape($arFields['USER_TYPE']) . '"
						);
						top.BX.closeWait();
						top.BX.WindowManager.Get().AllowClose();
						top.BX.WindowManager.Get().Close();
Exemple #22
0
 $arResult['ADD_URL_TEMPLATE'] = htmlspecialcharsbx($arResult['~ADD_URL_TEMPLATE']);
 $arResult['~SUBSCRIBE_URL_TEMPLATE'] = $currentPath . $arParams["ACTION_VARIABLE"] . "=SUBSCRIBE_PRODUCT&" . $arParams["PRODUCT_ID_VARIABLE"] . "=#ID#";
 $arResult['SUBSCRIBE_URL_TEMPLATE'] = htmlspecialcharsbx($arResult['~SUBSCRIBE_URL_TEMPLATE']);
 $arResult['~COMPARE_URL_TEMPLATE'] = $comparePath . $arParams["ACTION_VARIABLE"] . "=ADD_TO_COMPARE_LIST&" . $arParams["PRODUCT_ID_VARIABLE"] . "=#ID#";
 $arResult['COMPARE_URL_TEMPLATE'] = htmlspecialcharsbx($arResult['~COMPARE_URL_TEMPLATE']);
 unset($comparePath, $currentPath);
 foreach ($arResult["ITEMS"] as &$arItem) {
     $arItem["PRICES"] = array();
     $arItem["PRICE_MATRIX"] = false;
     $arItem['MIN_PRICE'] = false;
     if ($arParams["USE_PRICE_COUNT"]) {
         if ($bCatalog) {
             $arItem["PRICE_MATRIX"] = CatalogGetPriceTableEx($arItem["ID"], 0, $arPriceTypeID, 'Y', $arConvertParams);
             if (isset($arItem["PRICE_MATRIX"]["COLS"]) && is_array($arItem["PRICE_MATRIX"]["COLS"])) {
                 foreach ($arItem["PRICE_MATRIX"]["COLS"] as $keyColumn => $arColumn) {
                     $arItem["PRICE_MATRIX"]["COLS"][$keyColumn]["NAME_LANG"] = htmlspecialcharsex($arColumn["NAME_LANG"]);
                 }
             }
         }
     } else {
         $arItem["PRICES"] = CIBlockPriceTools::GetItemPrices($arParams["IBLOCK_ID"], $arResult["PRICES"], $arItem, $arParams['PRICE_VAT_INCLUDE'], $arConvertParams);
         if (!empty($arItem["PRICES"])) {
             foreach ($arItem['PRICES'] as &$arOnePrice) {
                 if ('Y' == $arOnePrice['MIN_PRICE']) {
                     $arItem['MIN_PRICE'] = $arOnePrice;
                     break;
                 }
             }
             unset($arOnePrice);
         }
     }
echo GetMessage("LEARNING_ADMIN_GROUPS_ACTIVE_FROM");
?>
:</td>
		<td><?php 
echo CalendarPeriod("filter_active_from_from", htmlspecialcharsex($filter_active_from_from), "filter_active_from_to", htmlspecialcharsex($filter_active_from_to), "filter_active_from");
?>
</td>
	</tr>

	<tr>
		<td><?php 
echo GetMessage("LEARNING_ADMIN_GROUPS_ACTIVE_TO");
?>
:</td>
		<td><?php 
echo CalendarPeriod("filter_active_to_from", htmlspecialcharsex($filter_active_to_from), "filter_active_to_to", htmlspecialcharsex($filter_active_to_to), "filter_active_to");
?>
</td>
	</tr>

<?php 
$filter->Buttons(array("table_id" => $sTableID, "url" => $APPLICATION->GetCurPage() . "?" . GetFilterParams("filter_"), "form" => "form1"));
$filter->End();
?>
</form>


<?php 
$lAdmin->DisplayList();
?>
Exemple #24
0
?>
&amp;n=input_IBLOCK_SECTION', 600, 500);">
                    <?php 
echo GetMessage('STALL_ORDER_EDIT_ADD_CATALOG');
?>
                </a>

            </td>
        </tr>
        <tr>
            <td><?echo GetMessage("STALL_ORDER_EDIT_STATUS")?></td>
            <td>
                <select name="STATUS_ID" style="vertical-align:middle">
                    <?foreach($arOrderStatus as $arItem):?>
                        <option value="<?echo htmlspecialcharsbx($arItem['ID'])?>"
                            <?if($row['STATUS_ID'] == $arItem['ID']) echo "selected"?>><?echo htmlspecialcharsex($arItem['NAME'])?></option>
                    <?endforeach?>
                </select>
            </td>
        </tr>
        <tr>
            <td><?echo GetMessage("STALL_EDIT_ORDER_FIO")?></td>
            <td><input type="text" name="FIO" value="<?echo $row['FIO'];?>" size="30"></td>
        </tr>
        <tr>
            <td><?echo GetMessage("STALL_EDIT_ORDER_PHONE")?></td>
            <td><input type="text" name="PHONE" value="<?echo $row['PHONE'];?>" size="30"></td>
        </tr>
        <tr>
            <td valign="top"><?echo GetMessage("STALL_ORDER_EDIT_COMMENT")?></td>
            <td><textarea class="typearea" name="COMMENT" cols="45" rows="5" wrap="VIRTUAL"><?echo $row['COMMENT']; ?></textarea></td>
Exemple #25
0
                } else {
                    $strClass = 'bx_item_detail_scu';
                    $strWidth = '100%';
                    $strOneWidth = '20%';
                    $strSlideStyle = 'display: none;';
                }
                ?>
                <div class="<?php 
                echo $strClass;
                ?>
" id="#ITEM#_prop_<?php 
                echo $arProp['ID'];
                ?>
_cont">
                    <span class="bx_item_section_name_gray"><?php 
                echo htmlspecialcharsex($arProp['NAME']);
                ?>
</span>
                    <div class="bx_scu_scroller_container">
                        <div class="bx_scu">
                            <ul id="#ITEM#_prop_<?php 
                echo $arProp['ID'];
                ?>
_list" style="width: <?php 
                echo $strWidth;
                ?>
;"><?php 
                foreach ($arProp['VALUES'] as $arOneValue) {
                    ?>
<li
                                        data-treevalue="<?php 
    } else {
        $bVarsFromForm = true;
    }
}
$dbUserCards = CSaleUserCards::GetList(array("DATE_UPDATE" => "DESC"), array("ID" => $ID, "USER_ID" => IntVal($GLOBALS["USER"]->GetID())), false, false, array("ID", "USER_ID", "ACTIVE", "SORT", "PAY_SYSTEM_ACTION_ID", "CURRENCY", "CARD_TYPE", "CARD_NUM", "CARD_CODE", "CARD_EXP_MONTH", "CARD_EXP_YEAR", "DESCRIPTION", "SUM_MIN", "SUM_MAX", "SUM_CURRENCY", "TIMESTAMP_X", "LAST_STATUS", "LAST_STATUS_CODE", "LAST_STATUS_DESCRIPTION", "LAST_STATUS_MESSAGE", "LAST_SUM", "LAST_CURRENCY", "LAST_DATE"));
if ($arUserCards = $dbUserCards->GetNext()) {
    $arResult = $arUserCards;
    $arResult["CARD_NUM"] = CSaleUserCards::CryptData($arResult["CARD_NUM"], "D");
} else {
    $arResult["ID"] = 0;
    $arResult["ACTIVE"] = "Y";
    $arResult["SORT"] = 100;
}
if ($bVarsFromForm) {
    foreach ($_POST as $k => $v) {
        $arResult[$k] = htmlspecialcharsex($v);
        $arResult['~' . $k] = $v;
    }
}
$arResult["ERROR_MESSAGE"] = $errorMessage;
$dbPaySysActions = CSalePaySystemAction::GetList(array("PERSON_TYPE_ID" => "ASC", "NAME" => "ASC", "PT_NAME" => "ASC", "PS_NAME" => "ASC"), array("PS_LID" => SITE_ID, "HAVE_ACTION" => "Y"), false, false, array("*"));
$arResult["PAY_SYSTEM"] = array();
while ($arPaySysActions = $dbPaySysActions->GetNext()) {
    $arResult["PAY_SYSTEM"][] = $arPaySysActions;
}
$dbCurrency = CCurrency::GetList($by = "sort", $order = "asc");
$arResult["CURRENCY_INFO"] = array();
while ($arCurrency = $dbCurrency->GetNext()) {
    $arResult["CURRENCY_INFO"][] = $arCurrency;
}
$arResult["CARD_TYPE_INFO"] = array("VISA" => "Visa", "MASTERCARD" => "MasterCard", "AMEX" => "Amex", "DINERS" => "Diners", "DISCOVER" => "Discover", "JCB" => "JCB", "ENROUTE" => "Enroute");
Exemple #27
0
										<td align="left" style="vertical-align: top;"><a href="/bitrix/admin/sale_order_view.php?ID=<?php 
                echo $arOrder["ID"];
                ?>
&lang=<?php 
                echo LANGUAGE_ID;
                ?>
"><?php 
                echo GetMessage("GD_ORDERS_ORDER_1");
                echo $arOrder["ID"];
                ?>
</a><br><?php 
                echo $arOrder["DATE_INSERT"];
                ?>
</td>
										<td align="left" style="vertical-align: top;"><?php 
                echo htmlspecialcharsex(CurrencyFormat($arOrder["PRICE"], $arOrder["CURRENCY"]));
                ?>
</td>
										<td align="left" style="vertical-align: top;"><a href="/bitrix/admin/user_edit.php?ID=<?php 
                echo $arOrder["USER_ID"];
                ?>
&lang=<?php 
                echo LANGUAGE_ID;
                ?>
"><?php 
                echo htmlspecialcharsbx($arOrder["USER_NAME"]) . " " . htmlspecialcharsbx($arOrder["USER_LAST_NAME"]);
                ?>
</a></td>
										<td align="center" style="vertical-align: top;"><?php 
                echo $arOrder["PAYED"] == "Y" ? GetMessage("GD_ORDERS_YES") . "<br>" . $arOrder["DATE_PAYED"] : GetMessage("GD_ORDERS_NO");
                ?>
Exemple #28
0
echo GetMessage("BPATL_F_NAME");
?>
:</td>
		<td><input type="text" name="filter_name" value="<?php 
echo htmlspecialcharsex($filter_name);
?>
" size="30">
		</td>
	</tr>
	<tr>
		<td><?php 
echo GetMessage("BPATL_DESCR");
?>
:</td>
		<td><input type="text" name="filter_descr" value="<?php 
echo htmlspecialcharsex($filter_descr);
?>
" size="30">
		</td>
	</tr>
	<tr>
		<td><?php 
echo GetMessage("BPATL_FILTER_STATUS");
?>
:</td>
		<td>
			<select name="filter_status" >
				<option value="0"<?php 
if ($filter_status == "0") {
    echo " selected";
}
 }
 $dbItemsList = \Bitrix\Sale\Internals\OrderTable::getList(array('filter' => $arFilter, 'select' => array("BASKET_NAME" => 'BASKET.NAME', "BASKET_PRODUCT_ID" => 'BASKET.PRODUCT_ID', "BASKET_MODULE" => 'BASKET.MODULE', "BASKET_PRICE" => 'BASKET.PRICE', "BASKET_CURRENCY" => 'BASKET.CURRENCY', "BASKET_DISCOUNT_PRICE" => 'BASKET.DISCOUNT_PRICE', 'BASKET_QUANTITY' => 'SUM_BASKET_QUANTITY'), 'runtime' => array(new \Bitrix\Main\Entity\ExpressionField('SUM_BASKET_QUANTITY', 'SUM(%s)', array('BASKET.QUANTITY'))), 'order' => array("BASKET.MODULE" => "ASC", "BASKET.NAME" => "ASC", "BASKET.PRODUCT_ID" => "ASC"), 'group' => array("BASKET.MODULE", "BASKET.PRODUCT_ID", "BASKET.NAME", "BASKET.PRICE", "BASKET.CURRENCY", "BASKET.DISCOUNT_PRICE")));
 $arResult["ROWS"] = False;
 if ($arItemsList = $dbItemsList->Fetch()) {
     $affiliateCurrency = CSaleLang::GetLangCurrency(SITE_ID);
     $currentBasketModule = $arItemsList["BASKET_MODULE"];
     $currentBasketProductID = $arItemsList["BASKET_PRODUCT_ID"];
     $currentBasketName = $arItemsList["BASKET_NAME"];
     $currentQuantity = 0;
     $currentSum = 0;
     $totalQuantity = 0;
     $totalSum = 0;
     $arResult["ROWS"] = array();
     do {
         if ($currentBasketModule != $arItemsList["BASKET_MODULE"] || $currentBasketProductID != $arItemsList["BASKET_PRODUCT_ID"] || $currentBasketName != $arItemsList["BASKET_NAME"]) {
             $arResult["ROWS"][] = array("NAME" => htmlspecialcharsex($currentBasketName), "QUANTITY" => $currentQuantity, "SUM" => $currentSum, "CURRENCY" => $affiliateCurrency, "SUM_FORMAT" => SaleFormatCurrency($currentSum, $affiliateCurrency));
             $currentBasketModule = $arItemsList["BASKET_MODULE"];
             $currentBasketProductID = $arItemsList["BASKET_PRODUCT_ID"];
             $currentBasketName = $arItemsList["BASKET_NAME"];
             $totalQuantity += $currentQuantity;
             $totalSum += $currentSum;
             $currentQuantity = 0;
             $currentSum = 0;
         }
         $currentQuantity += $arItemsList["BASKET_QUANTITY"];
         if ($affiliateCurrency != $arItemsList["BASKET_CURRENCY"]) {
             //$currentSum += CCurrencyRates::ConvertCurrency(($arItemsList["BASKET_PRICE"] - $arItemsList["BASKET_DISCOUNT_PRICE"]) * $arItemsList["BASKET_QUANTITY"], $arItemsList["BASKET_CURRENCY"], $affiliateCurrency);
             $currentSum += CCurrencyRates::ConvertCurrency($arItemsList["BASKET_PRICE"] * $arItemsList["BASKET_QUANTITY"], $arItemsList["BASKET_CURRENCY"], $affiliateCurrency);
         } else {
             //$currentSum += ($arItemsList["BASKET_PRICE"] - $arItemsList["BASKET_DISCOUNT_PRICE"]) * $arItemsList["BASKET_QUANTITY"];
             $currentSum += $arItemsList["BASKET_PRICE"] * $arItemsList["BASKET_QUANTITY"];
                if ($arUser['PERSONAL_BIRTHDAY']) {
                    $arBirthDate = ParseDateTime($arUser['PERSONAL_BIRTHDAY'], CSite::GetDateFormat('SHORT'));
                    $arUser['IS_BIRTHDAY'] = intval($arBirthDate['MM']) == date('n') && intval($arBirthDate['DD']) == date('j');
                }
                $arUser['IS_FEATURED'] = CIntranetUtils::IsUserHonoured($arUser['ID']);
                $arUser['IS_ABSENT'] = CIntranetUtils::IsUserAbsent($arUser['ID']);
                $arResult["SEARCH"][$i]["USER"] = $arUser;
            }
        }
    }
    $arResult['USER_PROP'] = array();
    $arRes = $GLOBALS["USER_FIELD_MANAGER"]->GetUserFields("USER", 0, LANGUAGE_ID);
    if (!empty($arRes)) {
        foreach ($arRes as $key => $val) {
            $arResult['USER_PROP'][$val["FIELD_NAME"]] = strLen($val["EDIT_FORM_LABEL"]) > 0 ? $val["EDIT_FORM_LABEL"] : $val["FIELD_NAME"];
        }
    }
}
$arrDropdown = array();
$arResult["DROPDOWN_SONET"] = array();
$EntityType = array_key_exists("arrFILTER", $arParams) && in_array("socialnetwork_group", $arParams["arrFILTER"]) ? SONET_ENTITY_GROUP : SONET_ENTITY_USER;
$EntityID = $EntityType == SONET_ENTITY_GROUP ? $arParams["arrFILTER_socialnetwork"][0] : $arParams["arrFILTER_socialnetwork_user"];
$arActiveFeaturesNames = CSocNetFeatures::GetActiveFeaturesNames($EntityType, $EntityID);
foreach ($arParams["arrWHERE_SONET"] as $feature_id) {
    if (strlen($feature_id) > 0 && array_key_exists($feature_id, $arActiveFeaturesNames) && CSocNetFeaturesPerms::CanPerformOperation($GLOBALS["USER"]->GetID(), $EntityType, $EntityID, $feature_id, $arSocNetFeaturesSettings[$feature_id]["minoperation"][0], CSocNetUser::IsCurrentUserModuleAdmin()) && array_key_exists($feature_id, $arSocNetFeaturesSettings)) {
        $arrDropdown[$feature_id] = strlen($arActiveFeaturesNames[$feature_id]) > 0 ? $arActiveFeaturesNames[$feature_id] : GetMessage("SEARCH_CONTENT_TYPE_" . strtoupper($feature_id) . "_" . $EntityType);
    }
}
if (count($arrDropdown) > 0) {
    $arResult["DROPDOWN_SONET"] = htmlspecialcharsex($arrDropdown);
}