diff --git a/intaro.intarocrm/classes/general/ICMLLoader.php b/intaro.intarocrm/classes/general/ICMLLoader.php
index c2ee5c29..4ba5659b 100644
--- a/intaro.intarocrm/classes/general/ICMLLoader.php
+++ b/intaro.intarocrm/classes/general/ICMLLoader.php
@@ -49,16 +49,7 @@ class ICMLLoader {
$categories = $this->GetCategories();
$offers = $this->GetOffers();
-
- /*foreach ($offers as $obj)
- if (is_array($obj))
- foreach ($obj as $obj2)
- print(htmlspecialcharsbx($obj2) . "
");
- else
- print(htmlspecialcharsbx($obj) . "
");
- */
-
-
+
$this->PrepareFile();
$this->PreWriteCatalog();
@@ -74,13 +65,7 @@ class ICMLLoader {
protected function PrepareValue($text)
{
-
- //$text = htmlspecialcharsbx($text);
- //$text = str_replace('"', '"', $text);
- //$text = preg_replace("/[\x1-\x8\xB-\xC\xE-\x1F]/", "", $text);
- //$text = str_replace("'", "'", $text);
- $text = $this->application->ConvertCharset($text, LANG_CHARSET, $this->encoding);
- return $text;
+ return $this->application->ConvertCharset($text, LANG_CHARSET, $this->encoding);
}
protected function PrepareFile()
@@ -96,12 +81,12 @@ class ICMLLoader {
protected function PreWriteCatalog()
{
- @fwrite($this->fp, "\n");
+ @fwrite($this->fp, "PrepareValue(Date("Y-m-d H:i:s")) . "\">\n");
@fwrite($this->fp, "\n");
- @fwrite($this->fp, "".$this->application->ConvertCharset(htmlspecialcharsbx(COption::GetOptionString("main", "site_name", "")), LANG_CHARSET, $encoding)."\n");
+ @fwrite($this->fp, "". $this->PrepareValue(COption::GetOptionString("main", "site_name", ""))."\n");
- @fwrite($this->fp, "".$this->application->ConvertCharset(htmlspecialcharsbx(COption::GetOptionString("main", "site_name", "")), LANG_CHARSET, $encoding)."\n");
+ @fwrite($this->fp, "".$this->PrepareValue(COption::GetOptionString("main", "site_name", ""))."\n");
}
@@ -160,12 +145,12 @@ class ICMLLoader {
protected function BuildCategory($arCategory)
{
return "
- PrepareValue($arCategory["ID"]) . "\""
. ( intval($arCategory["IBLOCK_SECTION_ID"] ) > 0 ?
- " parentId=\"" . $arCategory["IBLOCK_SECTION_ID"] . "\""
+ " parentId=\"" . $this->PrepareValue($arCategory["IBLOCK_SECTION_ID"]) . "\""
:"")
. ">"
- . $arCategory["NAME"]
+ . $this->PrepareValue($arCategory["NAME"])
. "";
}
@@ -203,7 +188,7 @@ class ICMLLoader {
"ACTIVE" => "Y",
"INCLUDE_SUBSECTIONS" => "Y"
);
- $counter = 0;
+
$dbResProducts = CIBlockElement::GetList(array(), $filter, false, false, $arSelect);
while ($product = $dbResProducts->GetNextElement()) {
@@ -281,14 +266,12 @@ class ICMLLoader {
protected function BuildOffer($arOffer, $categoriesString, $iblock)
{
$offer = "";
- $offer .= "\n";
- $offer .= "http://" . $iblock['IBLOCK_DB']['SERVER_NAME'] . $arOffer['DETAIL_PAGE_URL'] . "\n";
+ $offer .= "PrepareValue($arOffer["ID"]) . "\" ".
+ "productId=\"" . $this->PrepareValue($arOffer["PRODUCT_ID"]) . "\" ".
+ "quantity=\"" . $this->PrepareValue(DoubleVal($arOffer['QUANTITY'])) . "\">\n";
+ $offer .= "http://" . $this->PrepareValue($iblock['IBLOCK_DB']['SERVER_NAME']) . $this->PrepareValue($arOffer['DETAIL_PAGE_URL']) . "\n";
- $offer .= "" . $arOffer['PRICE'] . "\n";
+ $offer .= "" . $this->PrepareValue($arOffer['PRICE']) . "\n";
$offer .= $categoriesString;
$detailPicture = intval($arOffer["DETAIL_PICTURE"]);
@@ -304,23 +287,22 @@ class ICMLLoader {
if ($arFile = CFile::GetFileArray($picture))
{
if(substr($arFile["SRC"], 0, 1) == "/")
- $strFile = "http://" . $iblock['IBLOCK_DB']['SERVER_NAME'] . implode("/", array_map("rawurlencode", explode("/", $arFile["SRC"])));
+ $strFile = "http://" . $this->PrepareValue($iblock['IBLOCK_DB']['SERVER_NAME']) . implode("/", array_map("rawurlencode", explode("/", $arFile["SRC"])));
elseif(preg_match("/^(http|https):\\/\\/(.*?)\\/(.*)\$/", $arFile["SRC"], $match))
- $strFile = "http://" . $match[2] . '/' . implode("/", array_map("rawurlencode", explode("/", $match[3])));
+ $strFile = "http://" . $this->PrepareValue($match[2]) . '/' . implode("/", array_map("rawurlencode", explode("/", $this->PrepareValue($match[3]))));
else
$strFile = $arFile["SRC"];
- $offer .= "" . $strFile . "\n";
+ $offer .= "" . $this->PrepareValue($strFile) . "\n";
}
}
$offer .= "" . $this->PrepareValue($arOffer["NAME"]) . "\n";
- $offer .= "" . (strip_tags( html_entity_decode(str_replace(" ", ' ', $this->PrepareValue($arOffer["DETAIL_TEXT"]))))) .
- "\n";
+ $offer .= "" . (strip_tags( html_entity_decode(str_replace(" ", ' ', $this->PrepareValue($arOffer["DETAIL_TEXT"]))))) ."\n";
- $offer .= "" . $arOffer["EXTERNAL_ID"] . "\n";
- $offer .= "" . $arOffer["PRODUCT_NAME"] . "\n";
- $offer .= "" . $arOffer["ARTICLE"] . "\n";
+ $offer .= "" . $this->PrepareValue($arOffer["EXTERNAL_ID"]) . "\n";
+ $offer .= "" . $this->PrepareValue($arOffer["PRODUCT_NAME"]) . "\n";
+ $offer .= "" . $this->PrepareValue($arOffer["ARTICLE"]) . "\n";
$offer.= "\n";
return $offer;
diff --git a/intaro.intarocrm/install/export/intarocrm_setup.php b/intaro.intarocrm/install/export/intarocrm_setup.php
index 60eee5bd..c567272a 100644
--- a/intaro.intarocrm/install/export/intarocrm_setup.php
+++ b/intaro.intarocrm/install/export/intarocrm_setup.php
@@ -55,7 +55,7 @@ if ($STEP==1)
}
$boolAll = false;
- $intCountChecked = 2;
+ $intCountChecked = 0;
$intCountAvailIBlock = 0;
$arIBlockList = array();
$db_res = CIBlock::GetList(Array("IBLOCK_TYPE"=>"ASC", "NAME"=>"ASC"),array('CHECK_PERMISSIONS' => 'Y','MIN_PERMISSION' => 'W'));
@@ -94,8 +94,8 @@ if ($STEP==1)
}
}
}
- if ($intCountChecked == $intCountAvailIBlock)
- $boolAll = true;
+ $intCountChecked = $intCountAvailIBlock;
+ $boolAll = true;
?>
@@ -189,7 +189,7 @@ if ($STEP==1)
'catalog',
'export_default_path',
'/bitrix/catalog_export/'))
- .'testintarocrm'/* .mt_rand(0, 999999) */.'.xml'
+ .'intarocrm'/* .mt_rand(0, 999999) */.'.xml'
); ?>" size="50">
@@ -249,7 +249,6 @@ if ($STEP==1)
}
elseif ($STEP==2)
{
-
$FINITE = true;
}
diff --git a/intaro.intarocrm/install/step4.php b/intaro.intarocrm/install/step4.php
index 3a5ace94..00a72f55 100644
--- a/intaro.intarocrm/install/step4.php
+++ b/intaro.intarocrm/install/step4.php
@@ -3,9 +3,11 @@
if(!check_bitrix_sessid()) return;
IncludeModuleLangFile(__FILE__);
__IncludeLang(GetLangFileName($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/intaro.intarocrm/lang/", "/icml_export_setup.php"));
-
-if(isset($arResult['errCode']) && $arResult['errCode'])
- echo CAdminMessage::ShowMessage(GetMessage($arResult['errCode']));
+?>
+=GetMessage("EXPORT_CATALOGS_INFO");?>
+