1
0
mirror of synced 2024-11-24 22:36:07 +03:00

Articles is not modatory now

This commit is contained in:
m.korolev 2013-08-20 13:42:13 +04:00
parent 57335ffb54
commit b1a71726fc
6 changed files with 24 additions and 15 deletions

View File

@ -17,7 +17,7 @@ class ICMLLoader {
if(!isset($USER)) if(!isset($USER))
$USER = new CUser; $USER = new CUser;
if (count($this->iblocks) != count($this->articleProperties)) if (count($this->iblocks) < count($this->articleProperties))
return false; return false;
$categories = $this->GetCategories(); $categories = $this->GetCategories();
@ -164,9 +164,12 @@ class ICMLLoader {
"DETAIL_TEXT", "DETAIL_TEXT",
"DETAIL_PICTURE", "DETAIL_PICTURE",
"LANG_DIR", "LANG_DIR",
"DETAIL_PAGE_URL", "DETAIL_PAGE_URL"
"PROPERTY_" . $this->articleProperties[$id]
); );
if (isset($this->articleProperties[$id]))
$arSelect[] = "PROPERTY_" . $this->articleProperties[$id];
$filter = Array ( $filter = Array (
"IBLOCK_ID" => $id, "IBLOCK_ID" => $id,
@ -194,9 +197,10 @@ class ICMLLoader {
"NAME", "NAME",
"DETAIL_TEXT", "DETAIL_TEXT",
"DETAIL_PAGE_URL", "DETAIL_PAGE_URL",
"DETAIL_PICTURE", "DETAIL_PICTURE"
"PROPERTY_" . $this->articleProperties[$id]
); );
if (isset($this->articleProperties[$id]))
$arSelectOffer[] = "PROPERTY_" . $this->articleProperties[$id];
$rsOffers = CIBlockElement::GetList(array(), $arFilterOffer, false, false, $arSelectOffer); $rsOffers = CIBlockElement::GetList(array(), $arFilterOffer, false, false, $arSelectOffer);
while ($arOffer = $rsOffers->GetNext()) { while ($arOffer = $rsOffers->GetNext()) {
@ -215,7 +219,8 @@ class ICMLLoader {
$arOffer['DETAIL_PICTURE'] = $product["DETAIL_PICTURE"]; $arOffer['DETAIL_PICTURE'] = $product["DETAIL_PICTURE"];
$arOffer['PREVIEW_PICTURE'] = $product["PREVIEW_PICTURE"]; $arOffer['PREVIEW_PICTURE'] = $product["PREVIEW_PICTURE"];
$arOffer['PRODUCT_NAME'] = $product["NAME"]; $arOffer['PRODUCT_NAME'] = $product["NAME"];
$arOffer['ARTICLE'] = $arOffer["PROPERTY_" . $this->articleProperties[$id] . "_VALUE"]; if (isset($this->articleProperties[$id]))
$arOffer['ARTICLE'] = $arOffer["PROPERTY_" . $this->articleProperties[$id] . "_VALUE"];
$dbPrice = GetCatalogProductPrice($arOffer["ID"],1); $dbPrice = GetCatalogProductPrice($arOffer["ID"],1);
$arOffer['PRICE'] = $dbPrice['PRICE']; $arOffer['PRICE'] = $dbPrice['PRICE'];
@ -239,7 +244,8 @@ class ICMLLoader {
$product['PRODUCT_ID'] = $product["ID"]; $product['PRODUCT_ID'] = $product["ID"];
$product['PRODUCT_NAME'] = $product["NAME"]; $product['PRODUCT_NAME'] = $product["NAME"];
$product['ARTICLE'] = $product["PROPERTY_" . $this->articleProperties[$id] . "_VALUE"]; if (isset($this->articleProperties[$id]))
$product['ARTICLE'] = $product["PROPERTY_" . $this->articleProperties[$id] . "_VALUE"];
$dbPrice = GetCatalogProductPrice($product["ID"],1); $dbPrice = GetCatalogProductPrice($product["ID"],1);
$product['PRICE'] = $dbPrice['PRICE']; $product['PRICE'] = $dbPrice['PRICE'];
@ -289,7 +295,8 @@ class ICMLLoader {
$offer .= "<xmlId>" . $this->PrepareValue($arOffer["EXTERNAL_ID"]) . "</xmlId>\n"; $offer .= "<xmlId>" . $this->PrepareValue($arOffer["EXTERNAL_ID"]) . "</xmlId>\n";
$offer .= "<productName>" . $this->PrepareValue($arOffer["PRODUCT_NAME"]) . "</productName>\n"; $offer .= "<productName>" . $this->PrepareValue($arOffer["PRODUCT_NAME"]) . "</productName>\n";
$offer .= "<article>" . $this->PrepareValue($arOffer["ARTICLE"]) . "</article>\n"; if (isset($arOffer["ARTICLE"]))
$offer .= "<article>" . $this->PrepareValue($arOffer["ARTICLE"]) . "</article>\n";
$offer.= "</offer>\n"; $offer.= "</offer>\n";
return $offer; return $offer;

View File

@ -22,7 +22,7 @@ if ($STEP>1)
{ {
if (count($IBLOCK_EXPORT) != count($IBLOCK_PROPERTY_ARTICLE)) if (count($IBLOCK_EXPORT) < count($IBLOCK_PROPERTY_ARTICLE))
$arSetupErrors[] = GetMessage("ERROR_ARTICLE_NOT_SET"); $arSetupErrors[] = GetMessage("ERROR_ARTICLE_NOT_SET");
if (strlen($SETUP_FILE_NAME)<=0) if (strlen($SETUP_FILE_NAME)<=0)
@ -159,8 +159,8 @@ if ($STEP==1)
<font class="tablebodytext"> <font class="tablebodytext">
<input <input
type="checkbox" type="checkbox"
name="IBLOCK_EXPORT[<?=$key?>]" name="IBLOCK_EXPORT[<?=$arIBlock["ID"]?>]"
id="IBLOCK_EXPORT<?=$key?>" id="IBLOCK_EXPORT<?=$arIBlock["ID"]?>"
value="<?=$arIBlock["ID"]?>" value="<?=$arIBlock["ID"]?>"
<? if ($arIBlock['IBLOCK_EXPORT']) echo " checked"; ?> <? if ($arIBlock['IBLOCK_EXPORT']) echo " checked"; ?>
onclick="checkOne(this,<? echo $intCountAvailIBlock; ?>);" onclick="checkOne(this,<? echo $intCountAvailIBlock; ?>);"

View File

@ -1,3 +1,3 @@
<? <?
//<title>IntaroCRM</title> //<title>IntaroCRM</title>
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/intaro.intarocrm/export/load/export_run.php"); require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/intaro.intarocrm/export/export_run.php");

View File

@ -1,3 +1,3 @@
<? <?
//<title>IntaroCRM</title> //<title>IntaroCRM</title>
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/intaro.intarocrm/export/load/export_setup.php"); require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/intaro.intarocrm/export/export_setup.php");

View File

@ -677,7 +677,7 @@ class intaro_intarocrm extends CModule
else else
$filename = $_POST['SETUP_FILE_NAME']; $filename = $_POST['SETUP_FILE_NAME'];
if (count($iblocks) != count($articleProperties)) if (count($iblocks) < count($articleProperties))
$arResult['errCode'] = 'ERR_ARTICLE_IBLOCK'; $arResult['errCode'] = 'ERR_ARTICLE_IBLOCK';
@ -694,6 +694,8 @@ class intaro_intarocrm extends CModule
if ($typeLoading != 'none' && $profileName == "") if ($typeLoading != 'none' && $profileName == "")
$arResult['errCode'] = 'ERR_FIELDS_PROFILE'; $arResult['errCode'] = 'ERR_FIELDS_PROFILE';
if($filename == "")
$arResult['errCode'] = 'ERR_FIELDS_FILE';
if(isset($arResult['errCode']) && $arResult['errCode']) { if(isset($arResult['errCode']) && $arResult['errCode']) {

View File

@ -12,6 +12,6 @@ $MESS["CET_SAVE"] = "Сохранить";
$MESS["ERROR_IBLOCK_MODULE"] = "Модуль Инфоблоки не установлен"; $MESS["ERROR_IBLOCK_MODULE"] = "Модуль Инфоблоки не установлен";
$MESS["ERROR_IBLOCK_CATALOG"] = "Модуль Каталог не установлен"; $MESS["ERROR_IBLOCK_CATALOG"] = "Модуль Каталог не установлен";
$MESS["ERROR_IBLOCK_INTAROCRM"] = "Модуль IntaroCRM не установлен"; $MESS["ERROR_IBLOCK_INTAROCRM"] = "Модуль IntaroCRM не установлен";
$MESS["ERROR_ARTICLE_NOT_SET"] = "Не установлены поля артикулов"; $MESS["ERROR_ARTICLE_NOT_SET"] = "Были установлены поля артикулов, но не установлены Информационные блоки";
?> ?>