1
0
mirror of synced 2024-11-26 07:16:08 +03:00

Merge pull request #8 from ghostrainman/master

v.1.1.2
This commit is contained in:
Alex Lushpai 2015-05-20 10:50:08 +03:00
commit 7da2d5cdf0
5 changed files with 2165 additions and 2146 deletions

View File

@ -1,3 +1,6 @@
## 2015-05-18 v.1.1.2
* Добавлена возможность изменять файлы основных классов(ICMLLoader и ICrmOrderActions) и экспорт каталога без потери обновлений
* Исправлены мелкие ошибки
## 2015-03-19 v.1.1.1 ## 2015-03-19 v.1.1.1
* Исправлена ошибка, связанная с версионностью PHP в History. * Исправлена ошибка, связанная с версионностью PHP в History.
* Добавлена выгрузка закупочной цены вместе с заказом * Добавлена выгрузка закупочной цены вместе с заказом

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,83 +1,87 @@
<?php <?php
if (file_exists($_SERVER["DOCUMENT_ROOT"]."/bitrix/php_interface/retailcrm/export_run.php")){
ignore_user_abort(true); require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/php_interface/retailcrm/export_run.php");
set_time_limit(0);
global $APPLICATION;
if (!CModule::IncludeModule("iblock"))
return;
if (!CModule::IncludeModule("catalog"))
return;
if (!CModule::IncludeModule("intaro.intarocrm"))
return;
$rsSites = CSite::GetList($by, $sort, array('ACTIVE' => 'Y'));
while ($ar = $rsSites->Fetch()){
if($ar['DEF'] == 'Y'){
$SERVER_NAME = $ar['SERVER_NAME'];//разделить потом с учетом многосайтовости
}
} }
else{
ignore_user_abort(true);
set_time_limit(0);
$iblockProperties = Array( global $APPLICATION;
"article" => "article", if (!CModule::IncludeModule("iblock"))
"manufacturer" => "manufacturer", return;
"color" =>"color", if (!CModule::IncludeModule("catalog"))
"weight" => "weight", return;
"size" => "size", if (!CModule::IncludeModule("intaro.intarocrm"))
"length" => "length", return;
"width" => "width",
"height" => "height",
);
$IBLOCK_PROPERTY_SKU = array();
$IBLOCK_PROPERTY_UNIT_SKU = array();
foreach ($iblockProperties as $prop) {
$skuUnitProps = ('IBLOCK_PROPERTY_UNIT_SKU' . "_" . $prop); $rsSites = CSite::GetList($by, $sort, array('ACTIVE' => 'Y'));
$skuUnitProps = $$skuUnitProps; while ($ar = $rsSites->Fetch()){
if (is_array($skuUnitProps)) { if($ar['DEF'] == 'Y'){
foreach ($skuUnitProps as $iblock => $val) { $SERVER_NAME = $ar['SERVER_NAME'];//разделить потом с учетом многосайтовости
$IBLOCK_PROPERTY_UNIT_SKU[$iblock][$prop] = $val;
} }
} }
$skuProps = ('IBLOCK_PROPERTY_SKU' . "_" . $prop); $iblockProperties = Array(
$skuProps = $$skuProps; "article" => "article",
if (is_array($skuProps)) { "manufacturer" => "manufacturer",
foreach ($skuProps as $iblock => $val) { "color" =>"color",
$IBLOCK_PROPERTY_SKU[$iblock][$prop] = $val; "weight" => "weight",
"size" => "size",
"length" => "length",
"width" => "width",
"height" => "height",
);
$IBLOCK_PROPERTY_SKU = array();
$IBLOCK_PROPERTY_UNIT_SKU = array();
foreach ($iblockProperties as $prop) {
$skuUnitProps = ('IBLOCK_PROPERTY_UNIT_SKU' . "_" . $prop);
$skuUnitProps = $$skuUnitProps;
if (is_array($skuUnitProps)) {
foreach ($skuUnitProps as $iblock => $val) {
$IBLOCK_PROPERTY_UNIT_SKU[$iblock][$prop] = $val;
}
}
$skuProps = ('IBLOCK_PROPERTY_SKU' . "_" . $prop);
$skuProps = $$skuProps;
if (is_array($skuProps)) {
foreach ($skuProps as $iblock => $val) {
$IBLOCK_PROPERTY_SKU[$iblock][$prop] = $val;
}
} }
} }
$IBLOCK_PROPERTY_PRODUCT = array();
$IBLOCK_PROPERTY_UNIT_PRODUCT = array();
foreach ($iblockProperties as $prop) {
$productUnitProps = "IBLOCK_PROPERTY_UNIT_PRODUCT" . "_" . $prop;
$productUnitProps = $$productUnitProps;
if (is_array($productUnitProps)) {
foreach ($productUnitProps as $iblock => $val) {
$IBLOCK_PROPERTY_UNIT_PRODUCT[$iblock][$prop] = $val;
}
}
$productProps = "IBLOCK_PROPERTY_PRODUCT" . "_" . $prop;
$productProps = $$productProps;
if (is_array($productProps)) {
foreach ($productProps as $iblock => $val) {
$IBLOCK_PROPERTY_PRODUCT[$iblock][$prop] = $val;
}
}
}
$loader = new ICMLLoader();
$loader->profileID = $PROFILE_ID;
$loader->iblocks = $IBLOCK_EXPORT;
$loader->propertiesSKU = $IBLOCK_PROPERTY_SKU;
$loader->propertiesUnitSKU = $IBLOCK_PROPERTY_UNIT_SKU;
$loader->propertiesProduct = $IBLOCK_PROPERTY_PRODUCT;
$loader->propertiesUnitProduct = $IBLOCK_PROPERTY_UNIT_PRODUCT;
$loader->filename = $SETUP_FILE_NAME;
$loader->serverName = $SERVER_NAME;
$loader->application = $APPLICATION;
$loader->loadPurchasePrice = $LOAD_PURCHASE_PRICE == 'Y';
$loader->Load();
} }
$IBLOCK_PROPERTY_PRODUCT = array();
$IBLOCK_PROPERTY_UNIT_PRODUCT = array();
foreach ($iblockProperties as $prop) {
$productUnitProps = "IBLOCK_PROPERTY_UNIT_PRODUCT" . "_" . $prop;
$productUnitProps = $$productUnitProps;
if (is_array($productUnitProps)) {
foreach ($productUnitProps as $iblock => $val) {
$IBLOCK_PROPERTY_UNIT_PRODUCT[$iblock][$prop] = $val;
}
}
$productProps = "IBLOCK_PROPERTY_PRODUCT" . "_" . $prop;
$productProps = $$productProps;
if (is_array($productProps)) {
foreach ($productProps as $iblock => $val) {
$IBLOCK_PROPERTY_PRODUCT[$iblock][$prop] = $val;
}
}
}
$loader = new ICMLLoader();
$loader->profileID = $PROFILE_ID;
$loader->iblocks = $IBLOCK_EXPORT;
$loader->propertiesSKU = $IBLOCK_PROPERTY_SKU;
$loader->propertiesUnitSKU = $IBLOCK_PROPERTY_UNIT_SKU;
$loader->propertiesProduct = $IBLOCK_PROPERTY_PRODUCT;
$loader->propertiesUnitProduct = $IBLOCK_PROPERTY_UNIT_PRODUCT;
$loader->filename = $SETUP_FILE_NAME;
$loader->serverName = $SERVER_NAME;
$loader->application = $APPLICATION;
$loader->loadPurchasePrice = $LOAD_PURCHASE_PRICE == 'Y';
$loader->Load();

File diff suppressed because it is too large Load Diff