1
0
mirror of synced 2024-11-22 05:16:09 +03:00

Merge branch 'master' of github.com:intarocrm/bitrix-module into referenceDeliveryTypeExport

This commit is contained in:
Grisha Pomadchin 2013-08-27 15:37:28 +04:00
commit eda0e3b68b
17 changed files with 863 additions and 664 deletions

View File

@ -9,321 +9,297 @@ class ICMLLoader {
public $encoding = 'utf-8';
protected $fp;
public static function AgentLoad3( $filename)
{
echo $filename;
$arFilename = "'" . $filename . "'";
return "ICMLLoader::AgentLoad( " . $arFilename . ");";
protected $mainSection = 1000000;
}
public static function AgentLoad($iblocks, $filename)
{
if (!CModule::IncludeModule("iblock")) {
//handle err
self::eventLog('ICMLLoader::AgentLoad', 'iblock', 'module not found');
return true;
}
if (!CModule::IncludeModule("catalog")) {
//handle err
self::eventLog('ICMLLoader::AgentLoad', 'catalog', 'module not found');
return true;
}
global $APPLICATION, $USER;
if(!isset($USER)) {
$USER = new CUser;
}
$loader = new ICMLLoader();
$loader->iblocks = json_decode($iblocks, true);
$loader->filename = $filename;
$loader->application = $APPLICATION;
$loader->Load();
$arIblocks = "'" . $iblocks . "'";
$arFilename = "'" . $filename . "'";
return "ICMLLoader::AgentLoad(" . $arIblocks . ", " . $arFilename . ");";
}
public function Load()
{
$categories = $this->GetCategories();
$offers = $this->GetOffers();
/*foreach ($offers as $obj)
if (is_array($obj))
foreach ($obj as $obj2)
print(htmlspecialcharsbx($obj2) . "<br>");
else
print(htmlspecialcharsbx($obj) . "<br>");
*/
$this->PrepareFile();
$this->PreWriteCatalog();
$this->WriteCategories($categories);
$this->WriteOffers($offers);
$this->PostWriteCatalog();
$this->CloseFile();
global $USER;
if(!isset($USER))
$USER = new CUser;
if (count($this->iblocks) < count($this->articleProperties))
return false;
$categories = $this->GetCategories();
$offers = $this->GetOffers();
$this->PrepareFile();
$this->PreWriteCatalog();
$this->WriteCategories($categories);
$this->WriteOffers($offers);
$this->PostWriteCatalog();
$this->CloseFile();
return true;
}
protected function PrepareValue($text)
{
//$text = htmlspecialcharsbx($text);
//$text = str_replace('&quot;', '"', $text);
//$text = preg_replace("/[\x1-\x8\xB-\xC\xE-\x1F]/", "", $text);
//$text = str_replace("'", "&apos;", $text);
$text = $this->application->ConvertCharset($text, LANG_CHARSET, $this->encoding);
return $text;
$newText = $this->application->ConvertCharset($text, LANG_CHARSET, $this->encoding);
$newText = strip_tags($newText);
$newText = str_replace("&", "&#x26;", $newText);
return $newText;
}
protected function PrepareFile()
{
$fullFilename = $_SERVER["DOCUMENT_ROOT"] . $this->filename;
CheckDirPath($fullFilename);
if (!$this->fp = @fopen($fullFilename, "w"))
return false;
else
return true;
$fullFilename = $_SERVER["DOCUMENT_ROOT"] . $this->filename;
CheckDirPath($fullFilename);
if (!$this->fp = @fopen($fullFilename, "w"))
return false;
else
return true;
}
protected function PreWriteCatalog()
{
@fwrite($this->fp, "<yml_catalog date=\"".Date("Y-m-d H:i:s")."\">\n");
@fwrite($this->fp, "<shop>\n");
@fwrite($this->fp, "<name>".$this->application->ConvertCharset(htmlspecialcharsbx(COption::GetOptionString("main", "site_name", "")), LANG_CHARSET, $encoding)."</name>\n");
@fwrite($this->fp, "<company>".$this->application->ConvertCharset(htmlspecialcharsbx(COption::GetOptionString("main", "site_name", "")), LANG_CHARSET, $encoding)."</company>\n");
@fwrite($this->fp, "<yml_catalog date=\"" . $this->PrepareValue(Date("Y-m-d H:i:s")) . "\">\n");
@fwrite($this->fp, "<shop>\n");
@fwrite($this->fp, "<name>". $this->PrepareValue(COption::GetOptionString("main", "site_name", ""))."</name>\n");
@fwrite($this->fp, "<company>".$this->PrepareValue(COption::GetOptionString("main", "site_name", ""))."</company>\n");
}
protected function WriteCategories($categories)
{
@fwrite($this->fp, "<categories>\n");
foreach ($categories as $category) {
@fwrite($this->fp, $category . "\n");
}
@fwrite($this->fp, "</categories>\n");
@fwrite($this->fp, "<categories>\n");
foreach ($categories as $category) {
@fwrite($this->fp, $category . "\n");
}
@fwrite($this->fp, "</categories>\n");
}
protected function WriteOffers($offers)
{
@fwrite($this->fp, "<offers>\n");
foreach ($offers as $offer) {
@fwrite($this->fp, $offer . "\n");
}
@fwrite($this->fp, "</offers>\n");
@fwrite($this->fp, "<offers>\n");
foreach ($offers as $offer) {
@fwrite($this->fp, $offer . "\n");
}
@fwrite($this->fp, "</offers>\n");
}
protected function PostWriteCatalog()
{
@fwrite($this->fp, "</shop>\n");
@fwrite($this->fp, "</yml_catalog>\n");
@fwrite($this->fp, "</shop>\n");
@fwrite($this->fp, "</yml_catalog>\n");
}
protected function CloseFile()
{
@fclose($this->fp);
@fclose($this->fp);
}
protected function GetCategories()
{
$categories = array();
foreach ($this->iblocks as $id)
{
$filter = Array(
"IBLOCK_ID" => $id,
"ACTIVE" => "Y",
"IBLOCK_ACTIVE" => "Y",
"GLOBAL_ACTIVE" => "Y"
);
$dbRes = CIBlockSection::GetList(array("left_margin" => "asc"), $filter);
while ($arRes = $dbRes->Fetch())
{
$categories[] = $this->BuildCategory($arRes);
}
}
return $categories;
$categories = array();
foreach ($this->iblocks as $id)
{
$filter = Array(
"IBLOCK_ID" => $id,
"ACTIVE" => "Y",
"IBLOCK_ACTIVE" => "Y",
"GLOBAL_ACTIVE" => "Y"
);
$dbRes = CIBlockSection::GetList(array("left_margin" => "asc"), $filter);
while ($arRes = $dbRes->Fetch())
{
$categories[] = $this->BuildCategory($arRes);
}
if (count($categories) == 0)
{
$arRes = Array();
$arRes['ID'] = $this->mainSection + $id;
$arRes['IBLOCK_SECTION_ID'] = 0;
$arRes['NAME'] = "Основной раздел каталога";
$categories[] = $this->BuildCategory($arRes);
}
}
return $categories;
}
protected function BuildCategory($arCategory)
{
return "
<category id=\"" . $arCategory["ID"] . "\""
. ( intval($arCategory["IBLOCK_SECTION_ID"] ) > 0 ?
" parentId=\"" . $arCategory["IBLOCK_SECTION_ID"] . "\""
:"")
. ">"
. $arCategory["NAME"]
. "</category>";
return "
<category id=\"" . $this->PrepareValue($arCategory["ID"]) . "\""
. ( intval($arCategory["IBLOCK_SECTION_ID"] ) > 0 ?
" parentId=\"" . $this->PrepareValue($arCategory["IBLOCK_SECTION_ID"]) . "\""
:"")
. ">"
. $this->PrepareValue($arCategory["NAME"])
. "</category>";
}
protected function GetOffers()
{
$offers = Array();
foreach ($this->iblocks as $key => $id)
{
$iblock['IBLOCK_DB'] = CIBlock::GetByID($id)->Fetch();
$iblockOffer = CCatalogSKU::GetInfoByProductIBlock($id);
$arSelect = Array (
"ID",
"LID",
"IBLOCK_ID",
"IBLOCK_SECTION_ID",
"ACTIVE",
"ACTIVE_FROM",
"ACTIVE_TO",
"NAME",
"DETAIL_PICTURE",
"DETAIL_TEXT",
"DETAIL_PICTURE",
"LANG_DIR",
"DETAIL_PAGE_URL",
"PROPERTY_" . $this->articleProperties[$key]
);
$offers = Array();
foreach ($this->iblocks as $key => $id)
{
$filter = Array (
"IBLOCK_ID" => $id,
"ACTIVE_DATE" => "Y",
"ACTIVE" => "Y",
"INCLUDE_SUBSECTIONS" => "Y"
);
$counter = 0;
$dbResProducts = CIBlockElement::GetList(array(), $filter, false, false, $arSelect);
while ($product = $dbResProducts->GetNextElement()) {
$product = $product->GetFields();
$categoriesString = "";
$existOffer = false;
if (!empty($iblockOffer['IBLOCK_ID'])) {
$arFilterOffer = Array (
'IBLOCK_ID' => $iblockOffer['IBLOCK_ID'],
'PROPERTY_'.$iblockOffer['SKU_PROPERTY_ID'] => $product["ID"]
);
$arSelectOffer = Array (
'ID',
"NAME",
"DETAIL_TEXT",
"DETAIL_PAGE_URL",
"DETAIL_PICTURE",
"PROPERTY_" . $this->articleProperties[$key]
);
$rsOffers = CIBlockElement::GetList(array(), $arFilterOffer, false, false, $arSelectOffer);
while ($arOffer = $rsOffers->GetNext()) {
$dbResCategories = CIBlockElement::GetElementGroups($arOffer['ID'], true);
while ($arResCategory = $dbResCategories->Fetch()) {
$categoriesString .= "<categoryId>" . $arResCategory["ID"] . "</categoryId>\n";
}
$offer = CCatalogProduct::GetByID($arOffer['ID']);
$arOffer['QUANTITY'] = $offer["QUANTITY"];
$arOffer['PRODUCT_ID'] = $product["ID"];
$arOffer['DETAIL_PAGE_URL'] = $product["DETAIL_PAGE_URL"];
$arOffer['DETAIL_PICTURE'] = $product["DETAIL_PICTURE"];
$arOffer['PREVIEW_PICTURE'] = $product["PREVIEW_PICTURE"];
$arOffer['PRODUCT_NAME'] = $product["NAME"];
$arOffer['ARTICLE'] = $arOffer["PROPERTY_" . $this->articleProperties[$key] . "_VALUE"];
$dbPrice = GetCatalogProductPrice($arOffer["ID"],1);
$arOffer['PRICE'] = $dbPrice['PRICE'];
$offers[] = $this->BuildOffer($arOffer, $categoriesString, $iblock);
$existOffer = true;
}
}
if (!$existOffer) {
$dbResCategories = CIBlockElement::GetElementGroups($product["ID"], true);
while ($arResCategory = $dbResCategories->Fetch()) {
$categoriesString .= "<categoryId>" . $arResCategory["ID"] . "</categoryId>\n";
}
$offer = CCatalogProduct::GetByID($product['ID']);
$product['QUANTITY'] = $offer["QUANTITY"];
$product['PRODUCT_ID'] = $product["ID"];
$product['PRODUCT_NAME'] = $product["NAME"];
$product['ARTICLE'] = $product["PROPERTY_" . $this->articleProperties[$key] . "_VALUE"];
$dbPrice = GetCatalogProductPrice($product["ID"],1);
$product['PRICE'] = $dbPrice['PRICE'];
$offers[] = $this->BuildOffer($product, $categoriesString, $iblock);
}
}
}
return $offers;
$iblock['IBLOCK_DB'] = CIBlock::GetByID($id)->Fetch();
$iblockOffer = CCatalogSKU::GetInfoByProductIBlock($id);
$arSelect = Array (
"ID",
"LID",
"IBLOCK_ID",
"IBLOCK_SECTION_ID",
"ACTIVE",
"ACTIVE_FROM",
"ACTIVE_TO",
"NAME",
"DETAIL_PICTURE",
"DETAIL_TEXT",
"DETAIL_PICTURE",
"LANG_DIR",
"DETAIL_PAGE_URL"
);
if (isset($this->articleProperties[$id]))
$arSelect[] = "PROPERTY_" . $this->articleProperties[$id];
$filter = Array (
"IBLOCK_ID" => $id,
"ACTIVE_DATE" => "Y",
"ACTIVE" => "Y",
"INCLUDE_SUBSECTIONS" => "Y"
);
$dbResProducts = CIBlockElement::GetList(array(), $filter, false, false, $arSelect);
while ($product = $dbResProducts->GetNextElement()) {
$product = $product->GetFields();
$categoriesString = "";
$existOffer = false;
if (!empty($iblockOffer['IBLOCK_ID'])) {
$arFilterOffer = Array (
'IBLOCK_ID' => $iblockOffer['IBLOCK_ID'],
'PROPERTY_'.$iblockOffer['SKU_PROPERTY_ID'] => $product["ID"]
);
$arSelectOffer = Array (
'ID',
"NAME",
"DETAIL_TEXT",
"DETAIL_PAGE_URL",
"DETAIL_PICTURE"
);
if (isset($this->articleProperties[$id]))
$arSelectOffer[] = "PROPERTY_" . $this->articleProperties[$id];
$rsOffers = CIBlockElement::GetList(array(), $arFilterOffer, false, false, $arSelectOffer);
while ($arOffer = $rsOffers->GetNext()) {
$dbResCategories = CIBlockElement::GetElementGroups($arOffer['ID'], true);
while ($arResCategory = $dbResCategories->Fetch()) {
$categoriesString .= "<categoryId>" . $arResCategory["ID"] . "</categoryId>\n";
}
if ($categoriesString == '')
$categoriesString .= "<categoryId>" . ($this->mainSection + $id) . "</categoryId>\n";
$offer = CCatalogProduct::GetByID($arOffer['ID']);
$arOffer['QUANTITY'] = $offer["QUANTITY"];
$arOffer['PRODUCT_ID'] = $product["ID"];
$arOffer['DETAIL_PAGE_URL'] = $product["DETAIL_PAGE_URL"];
$arOffer['DETAIL_PICTURE'] = $product["DETAIL_PICTURE"];
$arOffer['PREVIEW_PICTURE'] = $product["PREVIEW_PICTURE"];
$arOffer['PRODUCT_NAME'] = $product["NAME"];
if (isset($this->articleProperties[$id]))
$arOffer['ARTICLE'] = $arOffer["PROPERTY_" . $this->articleProperties[$id] . "_VALUE"];
$dbPrice = GetCatalogProductPrice($arOffer["ID"],1);
$arOffer['PRICE'] = $dbPrice['PRICE'];
$offers[] = $this->BuildOffer($arOffer, $categoriesString, $iblock);
$existOffer = true;
}
}
if (!$existOffer) {
$dbResCategories = CIBlockElement::GetElementGroups($product["ID"], true);
while ($arResCategory = $dbResCategories->Fetch()) {
$categoriesString .= "<categoryId>" . $arResCategory["ID"] . "</categoryId>\n";
}
if ($categoriesString == '')
$categoriesString .= "<categoryId>" . ($this->mainSection + $id) . "</categoryId>\n";
$offer = CCatalogProduct::GetByID($product['ID']);
$product['QUANTITY'] = $offer["QUANTITY"];
$product['PRODUCT_ID'] = $product["ID"];
$product['PRODUCT_NAME'] = $product["NAME"];
if (isset($this->articleProperties[$id]))
$product['ARTICLE'] = $product["PROPERTY_" . $this->articleProperties[$id] . "_VALUE"];
$dbPrice = GetCatalogProductPrice($product["ID"],1);
$product['PRICE'] = $dbPrice['PRICE'];
$offers[] = $this->BuildOffer($product, $categoriesString, $iblock);
}
}
}
return $offers;
}
protected function BuildOffer($arOffer, $categoriesString, $iblock)
{
$offer = "";
$offer .= "<offer
id=\"" . $arOffer["ID"] . "\"
productId=\"" . $arOffer["PRODUCT_ID"] . "\"
quantity=\"" . DoubleVal($arOffer['QUANTITY']) . "\"
>\n";
$offer .= "<url>http://" . $iblock['IBLOCK_DB']['SERVER_NAME'] . $arOffer['DETAIL_PAGE_URL'] . "</url>\n";
$offer = "";
$offer .= "<offer id=\"" .$this->PrepareValue($arOffer["ID"]) . "\" ".
"productId=\"" . $this->PrepareValue($arOffer["PRODUCT_ID"]) . "\" ".
"quantity=\"" . $this->PrepareValue(DoubleVal($arOffer['QUANTITY'])) . "\">\n";
$offer .= "<url>http://" . $this->PrepareValue($iblock['IBLOCK_DB']['SERVER_NAME']) . $this->PrepareValue($arOffer['DETAIL_PAGE_URL']) . "</url>\n";
$offer .= "<price>" . $arOffer['PRICE'] . "</price>\n";
$offer .= $categoriesString;
$detailPicture = intval($arOffer["DETAIL_PICTURE"]);
$previewPicture = intval($arOffer["PREVIEW_PICTURE"]);
$offer .= "<price>" . $this->PrepareValue($arOffer['PRICE']) . "</price>\n";
$offer .= $categoriesString;
if ($detailPicture > 0 || $previewPicture > 0)
{
$picture = $detailPicture;
if ($picture <= 0) {
$picture = $previewPicture;
}
$detailPicture = intval($arOffer["DETAIL_PICTURE"]);
$previewPicture = intval($arOffer["PREVIEW_PICTURE"]);
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"])));
elseif(preg_match("/^(http|https):\\/\\/(.*?)\\/(.*)\$/", $arFile["SRC"], $match))
$strFile = "http://" . $match[2] . '/' . implode("/", array_map("rawurlencode", explode("/", $match[3])));
else
$strFile = $arFile["SRC"];
$offer .= "<picture>" . $strFile . "</picture>\n";
}
}
$offer .= "<name>" . $this->PrepareValue($arOffer["NAME"]) . "</name>\n";
$offer .= "<description>" . (strip_tags( html_entity_decode(str_replace("&nbsp;", ' ', $this->PrepareValue($arOffer["DETAIL_TEXT"]))))) .
"</description>\n";
if ($detailPicture > 0 || $previewPicture > 0)
{
$picture = $detailPicture;
if ($picture <= 0) {
$picture = $previewPicture;
}
$offer .= "<xmlId>" . $arOffer["EXTERNAL_ID"] . "</xmlId>\n";
$offer .= "<productName>" . $arOffer["PRODUCT_NAME"] . "</productName>\n";
$offer .= "<article>" . $arOffer["ARTICLE"] . "</article>\n";
$offer.= "</offer>\n";
return $offer;
if ($arFile = CFile::GetFileArray($picture))
{
if(substr($arFile["SRC"], 0, 1) == "/")
$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://" . $this->PrepareValue($match[2]) . '/' . implode("/", array_map("rawurlencode", explode("/", $this->PrepareValue($match[3]))));
else
$strFile = $arFile["SRC"];
$offer .= "<picture>" . $this->PrepareValue($strFile) . "</picture>\n";
}
}
$offer .= "<name>" . $this->PrepareValue($arOffer["NAME"]) . "</name>\n";
$offer .= "<xmlId>" . $this->PrepareValue($arOffer["EXTERNAL_ID"]) . "</xmlId>\n";
$offer .= "<productName>" . $this->PrepareValue($arOffer["PRODUCT_NAME"]) . "</productName>\n";
if (isset($arOffer["ARTICLE"]))
$offer .= "<article>" . $this->PrepareValue($arOffer["ARTICLE"]) . "</article>\n";
$offer.= "</offer>\n";
return $offer;
}

View File

@ -0,0 +1,19 @@
<?php
set_time_limit(0);
global $APPLICATION;
if (!CModule::IncludeModule("iblock"))
return;
if (!CModule::IncludeModule("catalog"))
return;
if (!CModule::IncludeModule("intaro.intarocrm"))
return;
$loader = new ICMLLoader();
$loader->iblocks = $IBLOCK_EXPORT;
$loader->articleProperties = $IBLOCK_PROPERTY_ARTICLE;
$loader->filename = $SETUP_FILE_NAME;
$loader->application = $APPLICATION;
$loader->Load();

View File

@ -0,0 +1,295 @@
<?
if(!check_bitrix_sessid()) return;
__IncludeLang(GetLangFileName($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/intaro.intarocrm/lang/", "/icml_export_setup.php"));
if (($ACTION == 'EXPORT_EDIT' || $ACTION == 'EXPORT_COPY') && $STEP == 1)
{
if (isset($arOldSetupVars['SETUP_FILE_NAME']))
$SETUP_FILE_NAME = $arOldSetupVars['SETUP_FILE_NAME'];
if (isset($arOldSetupVars['SETUP_PROFILE_NAME']))
$SETUP_PROFILE_NAME = $arOldSetupVars['SETUP_PROFILE_NAME'];
if (isset($arOldSetupVars['IBLOCK_EXPORT']))
$IBLOCK_EXPORT = $arOldSetupVars['IBLOCK_EXPORT'];
if (isset($arOldSetupVars['IBLOCK_PROPERTY_ARTICLE']))
$IBLOCK_PROPERTY_ARTICLE = $arOldSetupVars['IBLOCK_PROPERTY_ARTICLE'];
}
if ($STEP>1)
{
if (count($IBLOCK_EXPORT) < count($IBLOCK_PROPERTY_ARTICLE))
$arSetupErrors[] = GetMessage("ERROR_ARTICLE_NOT_SET");
if (strlen($SETUP_FILE_NAME)<=0)
{
$arSetupErrors[] = GetMessage("CET_ERROR_NO_FILENAME");
}
elseif ($APPLICATION->GetFileAccessPermission($SETUP_FILE_NAME) < "W")
{
$arSetupErrors[] = str_replace("#FILE#", $SETUP_FILE_NAME, GetMessage('CET_YAND_RUN_ERR_SETUP_FILE_ACCESS_DENIED'));
}
if (($ACTION=="EXPORT_SETUP" || $ACTION == 'EXPORT_EDIT' || $ACTION == 'EXPORT_COPY') && strlen($SETUP_PROFILE_NAME)<=0)
{
$arSetupErrors[] = GetMessage("CET_ERROR_NO_PROFILE_NAME");
}
if (!empty($arSetupErrors))
{
$STEP = 1;
}
}
if (!empty($arSetupErrors))
echo ShowError(implode('<br />', $arSetupErrors));
if ($STEP==1)
{
?>
<form method="post" action="<?php echo $APPLICATION->GetCurPage(); ?>" >
<?if ($ACTION == 'EXPORT_EDIT' || $ACTION == 'EXPORT_COPY')
{
?><input type="hidden" name="PROFILE_ID" value="<? echo intval($PROFILE_ID); ?>"><?
}
?>
<font class="text"><?=GetMessage("EXPORT_CATALOGS");?><br><br></font>
<?
if (!isset($IBLOCK_EXPORT) || !is_array($IBLOCK_EXPORT))
{
$IBLOCK_EXPORT = array();
}
$boolAll = false;
$intCountChecked = 0;
$intCountAvailIBlock = 0;
$arIBlockList = array();
$db_res = CIBlock::GetList(Array("IBLOCK_TYPE"=>"ASC", "NAME"=>"ASC"),array('CHECK_PERMISSIONS' => 'Y','MIN_PERMISSION' => 'W'));
while ($res = $db_res->Fetch())
{
if ($arCatalog = CCatalog::GetByIDExt($res["ID"]))
{
if($arCatalog['CATALOG_TYPE'] == "D" || $arCatalog['CATALOG_TYPE'] == "X" || $arCatalog['CATALOG_TYPE'] == "P")
{
$arSiteList = array();
$rsSites = CIBlock::GetSite($res["ID"]);
while ($arSite = $rsSites->Fetch())
{
$arSiteList[] = $arSite["SITE_ID"];
}
$db_properties = CIBlock::GetProperties($res['ID'], Array());
$properties = Array();
while($prop = $db_properties->Fetch())
$properties[] = $prop;
if (count($IBLOCK_EXPORT) != 0)
$boolExport = (in_array($res['ID'], $IBLOCK_EXPORT));
else
$boolExport = true;
$arIBlockList[] = array(
'ID' => $res['ID'],
'NAME' => $res['NAME'],
'IBLOCK_TYPE_ID' => $res['IBLOCK_TYPE_ID'],
'IBLOCK_EXPORT' => $boolExport,
'PROPERTIES' => $properties,
'OLD_PROPERTY_SELECT' => $IBLOCK_PROPERTY_ARTICLE[$res['ID']] != "" ? $IBLOCK_PROPERTY_ARTICLE[$res['ID']] : null,
'SITE_LIST' => '('.implode(' ',$arSiteList).')',
);
if ($boolExport)
$intCountChecked++;
$intCountAvailIBlock++;
}
}
}
if (count($IBLOCK_EXPORT) != 0) {
if ($intCountChecked == $intCountAvailIBlock)
$boolAll = true;
} else {
$intCountChecked = $intCountAvailIBlock;
$boolAll = true;
}
?>
<table class="adm-list-table" id="export_setup">
<thead>
<tr class="adm-list-table-header">
<td class="adm-list-table-cell">
<div class="adm-list-table-cell-inner"><?echo GetMessage("CATALOG");?></div>
</td>
<td class="adm-list-table-cell">
<div class="adm-list-table-cell-inner">
<?echo GetMessage("EXPORT2INTAROCML");?>&nbsp;
</div>
</td>
<td class="adm-list-table-cell">
<div class="adm-list-table-cell-inner"><?echo GetMessage("PROPERTY");?></div>
</td>
</tr>
</thead>
<tbody>
<tr class="adm-list-table-row">
<td class="adm-list-table-cell">
<?echo GetMessage("ALL_CATALOG");?>
</td>
<td class="adm-list-table-cell">
<input style="vertical-align: middle;" type="checkbox" name="icml_export_all" id="icml_export_all" value="Y" onclick="checkAll(this,<? echo $intCountAvailIBlock; ?>);"<? echo ($boolAll ? ' checked' : ''); ?>>
</td>
<td class="adm-list-table-cell">
&nbsp;
</td>
</tr>
<?
foreach ($arIBlockList as $key => $arIBlock)
{
?>
<tr class="adm-list-table-row">
<td class="adm-list-table-cell" style="padding-left: 5em">
<? echo htmlspecialcharsex("[".$arIBlock["IBLOCK_TYPE_ID"]."] ".$arIBlock["NAME"]." ".$arIBlock['SITE_LIST']); ?>
</td>
<td class="adm-list-table-cell">
<font class="tablebodytext">
<input
type="checkbox"
name="IBLOCK_EXPORT[<?=$arIBlock["ID"]?>]"
id="IBLOCK_EXPORT<?=$arIBlock["ID"]?>"
value="<?=$arIBlock["ID"]?>"
<? if ($arIBlock['IBLOCK_EXPORT']) echo " checked"; ?>
onclick="checkOne(this,<? echo $intCountAvailIBlock; ?>);"
>
</font>
</td>
<td class="adm-list-table-cell">
<select
style="width: 200px;"
id="IBLOCK_PROPERTY_ARTICLE<?=$arIBlock["ID"]?>"
name="IBLOCK_PROPERTY_ARTICLE[<?=$arIBlock["ID"]?>]"
class="property-export">
<option value=""></option>
<?
foreach ($arIBlock['PROPERTIES'] as $prop)
{
?>
<option value="<?=$prop['CODE'] ?>"
<?
if ($arIBlock['OLD_PROPERTY_SELECT'] == $prop["CODE"]){
echo " selected";
} else {
if ($arIBlock['OLD_PROPERTY_SELECT'] != "") {
if ($prop["CODE"] == "ARTICLE" ||
$prop["CODE"] == "ART" ||
$prop["CODE"] == "ARTNUMBER" )
echo " selected";
}
}
?>
>
<?=$prop["NAME"];?>
</option>
<?
}
?>
</select>
</td>
</tr>
<?
}
?>
</tbody>
</table>
<input type="hidden" name="count_checked" id="count_checked" value="<? echo $intCountChecked; ?>">
<br>
<br>
<br>
<font class="text"><?=GetMessage("FILENAME");?><br><br></font>
<input type="text" name="SETUP_FILE_NAME"
value="<?=htmlspecialcharsbx(strlen($SETUP_FILE_NAME) > 0 ?
$SETUP_FILE_NAME :
(COption::GetOptionString(
'catalog',
'export_default_path',
'/bitrix/catalog_export/'))
.'intarocrm'/* .mt_rand(0, 999999) */.'.xml'
); ?>" size="50">
<br>
<br>
<br>
<?if ($ACTION=="EXPORT_SETUP" || $ACTION == 'EXPORT_EDIT' || $ACTION == 'EXPORT_COPY'):?>
<font class="text"><?=GetMessage("PROFILE_NAME");?><br><br></font>
<input
type="text"
name="SETUP_PROFILE_NAME"
value="<?echo htmlspecialchars($SETUP_PROFILE_NAME)?>"
size="50">
<br>
<br>
<br>
<?endif;?>
<script type="text/javascript" src="/bitrix/js/main/jquery/jquery-1.7.min.js"></script>
<script type="text/javascript">
function checkAll(obj,cnt)
{
var boolCheck = obj.checked;
for (i = 0; i < cnt; i++)
{
BX('IBLOCK_EXPORT'+i).checked = boolCheck;
}
BX('count_checked').value = (boolCheck ? cnt : 0);
};
function checkOne(obj,cnt)
{
var boolCheck = obj.checked;
var intCurrent = parseInt(BX('count_checked').value);
intCurrent += (boolCheck ? 1 : -1);
BX('icml_export_all').checked = (intCurrent < cnt ? false : true);
BX('count_checked').value = intCurrent;
if (!boolCheck)
BX(obj.id.replace('IBLOCK_EXPORT','IBLOCK_PROPERTY_ARTICLE')).value = 'none';
};
</script>
<?//Следующие переменные должны быть обязательно установлены?>
<?=bitrix_sessid_post();?>
<input type="hidden" name="lang" value="<?echo LANGUAGE_ID ?>">
<input type="hidden" name="ACT_FILE" value="<?echo htmlspecialcharsbx($_REQUEST["ACT_FILE"]) ?>">
<input type="hidden" name="ACTION" value="<?echo htmlspecialcharsbx($ACTION) ?>">
<input type="hidden" name="STEP" value="<?echo intval($STEP) + 1 ?>">
<input type="hidden" name="SETUP_FIELDS_LIST" value="SETUP_FILE_NAME,IBLOCK_EXPORT,IBLOCK_PROPERTY_ARTICLE">
<input type="submit" value="<?echo ($ACTION=="EXPORT")?GetMessage("CET_EXPORT"):GetMessage("CET_SAVE")?>">
</form>
<?
}
elseif ($STEP==2)
{
$FINITE = true;
}
?>

View File

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

View File

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

View File

@ -681,6 +681,15 @@ class intaro_intarocrm extends CModule
);
} else if ($step == 5) {
if(!CModule::IncludeModule("iblock")) {
$arResult['errCode'] = 'ERR_IBLOCK';
}
if(!CModule::IncludeModule("catalog")) {
$arResult['errCode'] = 'ERR_CATALOG';
}
if(isset($arResult['errCode']) && $arResult['errCode']) {
$APPLICATION->IncludeAdminFile(
GetMessage('MODULE_INSTALL_TITLE'),
@ -695,153 +704,185 @@ class intaro_intarocrm extends CModule
$_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/' . $this->MODULE_ID . '/install/step3.php'
);
}
RegisterModule($this->MODULE_ID);
RegisterModuleDependences("sale", "OnSaleCancelOrder", $this->MODULE_ID, "ICrmOrderEvent", "onSaleCancelOrder");
RegisterModuleDependences("sale", "OnSalePayOrder", $this->MODULE_ID, "ICrmOrderEvent", "onSalePayOrder");
if(!CModule::IncludeModule("iblock")) {
$arResult['errCode'] = 'ERR_IBLOCK';
}
if (!CModule::IncludeModule("catalog")) {
$arResult['errCode'] = 'ERR_CATALOG';
}
if (!isset($_POST['IBLOCK_EXPORT']))
$iblocks = 0;
if(!isset($_POST['IBLOCK_EXPORT']))
$arResult['errCode'] = 'ERR_FIELDS_IBLOCK';
else
$iblocks = $_POST['IBLOCK_EXPORT'];
if (!isset($_POST['IBLOCK_PROPERTY_ARTICLE']))
$articleProperties = 0;
if(!isset($_POST['IBLOCK_PROPERTY_ARTICLE']))
$arResult['errCode'] = 'ERR_FIELDS_ARTICLE';
else
$articleProperties = $_POST['IBLOCK_PROPERTY_ARTICLE'];
if (!isset($_POST['SETUP_PROFILE_NAME']))
$profileName = 0;
else
$profileName = $_POST['SETUP_PROFILE_NAME'];
if (!isset($_POST['SETUP_FILE_NAME']))
$filename = 0;
if(!isset($_POST['SETUP_FILE_NAME']))
$arResult['errCode'] = 'ERR_FIELDS_FILE';
else
$filename = $_POST['SETUP_FILE_NAME'];
if (!isset($_POST['TYPE_LOADING']))
if (count($iblocks) < count($articleProperties))
$arResult['errCode'] = 'ERR_ARTICLE_IBLOCK';
if(!isset($_POST['TYPE_LOADING']))
$typeLoading = 0;
else
$typeLoading = $_POST['TYPE_LOADING'];
if(!isset($_POST['SETUP_PROFILE_NAME']) )
$profileName = "";
else
$profileName = $_POST['SETUP_PROFILE_NAME'];
if ($typeLoading != 'none' && $profileName == "")
$arResult['errCode'] = 'ERR_FIELDS_PROFILE';
if($filename == "")
$arResult['errCode'] = 'ERR_FIELDS_FILE';
if(isset($arResult['errCode']) && $arResult['errCode']) {
$arOldValues = Array(
'IBLOCK_EXPORT' => $iblocks,
'IBLOCK_PROPERTY_ARTICLE' => $articleProperties,
'SETUP_FILE_NAME' => $filename,
'SETUP_PROFILE_NAME' => $profileName
);
global $oldValues;
$oldValues = $arOldValues;
$APPLICATION->IncludeAdminFile(
GetMessage('MODULE_INSTALL_TITLE'),
$_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/' . $this->MODULE_ID . '/install/step4.php'
);
return;
}
RegisterModule($this->MODULE_ID);
RegisterModuleDependences("sale", "OnSaleCancelOrder", $this->MODULE_ID, "ICrmOrderEvent", "onSaleCancelOrder");
$this->CopyFiles();
if (isset($_POST['LOAD_NOW'])) {
$loader = new ICMLLoader();
$loader->iblocks = $iblocks;
$loader->articleProperties = $articleProperties;
$loader->filename = $filename;
$loader->application = $APPLICATION;
$loader->Load();
}
if (!isset($_POST['TYPE_LOADING']))
$typeLoading = 0;
else
$typeLoading = $_POST['TYPE_LOADING'];
}
if ($typeLoading == 'agent' || $typeLoading == 'cron') {
$dbProfile = CCatalogExport::GetList(array(), array("FILE_NAME" => $this->INTARO_CRM_EXPORT));
if (file_exists($_SERVER['DOCUMENT_ROOT'] . '/bitrix/php_interface/include/catalog_export/' . $this->INTARO_CRM_EXPORT . '_run.php')) {
$dbProfile = CCatalogExport::GetList(array(), array("FILE_NAME" => $this->INTARO_CRM_EXPORT));
while ($arProfile = $dbProfile->Fetch()) {
if ($arProfile["DEFAULT_PROFILE"] != "Y")
CAgent::RemoveAgent("CCatalogExport::PreGenerateExport(" . $arProfile['ID'] . ");", "catalog");
while ($arProfile = $dbProfile->Fetch()) {
if ($arProfile["DEFAULT_PROFILE"]!="Y") {
CAgent::RemoveAgent("CCatalogExport::PreGenerateExport(".$arProfile['ID'].");", "catalog");
CCatalogExport::Delete($arProfile['ID']);
}
}
}
$ar = $this->GetProfileSetupVars($iblocks, $articleProperties, $filename);
$PROFILE_ID = CCatalogExport::Add(array(
"LAST_USE" => false,
"FILE_NAME" => $this->INTARO_CRM_EXPORT,
"NAME" => $profileName,
"DEFAULT_PROFILE" => "N",
"IN_MENU" => "N",
"IN_AGENT" => "N",
"IN_CRON" => "N",
"NEED_EDIT" => "N",
"SETUP_VARS" => $ar
));
"LAST_USE" => false,
"FILE_NAME" => $this->INTARO_CRM_EXPORT,
"NAME" => $profileName,
"DEFAULT_PROFILE" => "N",
"IN_MENU" => "N",
"IN_AGENT" => "N",
"IN_CRON" => "N",
"NEED_EDIT" => "N",
"SETUP_VARS" => $ar
));
if (intval($PROFILE_ID) <= 0) {
$arResult['errCode'] = 'ERR_IBLOCK';
return;
}
if ($typeLoading == 'agent') {
$dateAgent = new DateTime();
$intAgent = new DateInterval('PT60S'); // PT60S - 60 sec;
$dateAgent->add($intAgent);
CAgent::AddAgent(
"CCatalogExport::PreGenerateExport(" . $PROFILE_ID . ");", "catalog", "N", 86400, $dateAgent->format('d.m.Y H:i:s'), // date of first check
"CCatalogExport::PreGenerateExport(" . $PROFILE_ID . ");",
"catalog",
"N",
86400,
$dateAgent->format('d.m.Y H:i:s'), // date of first check
"Y", // агент активен
$dateAgent->format('d.m.Y H:i:s'), // date of first start
30
);
);
CCatalogExport::Update($PROFILE_ID, array(
"IN_CRON" => ($arProfile["IN_AGENT"] == "Y" ? "N" : "Y")
));
"IN_AGENT" => "Y"
));
} else {
$agent_period = 24;
$agent_php_path = "/usr/local/php/bin/php";
if (!file_exists($_SERVER["DOCUMENT_ROOT"] . CATALOG_PATH2EXPORTS . "cron_frame.php")) {
CheckDirPath($_SERVER["DOCUMENT_ROOT"] . CATALOG_PATH2EXPORTS);
$tmp_file_size = filesize($_SERVER["DOCUMENT_ROOT"] . CATALOG_PATH2EXPORTS_DEF . "cron_frame.php");
$fp = fopen($_SERVER["DOCUMENT_ROOT"] . CATALOG_PATH2EXPORTS_DEF . "cron_frame.php", "rb");
if (!file_exists($_SERVER["DOCUMENT_ROOT"].CATALOG_PATH2EXPORTS."cron_frame.php"))
{
CheckDirPath($_SERVER["DOCUMENT_ROOT"].CATALOG_PATH2EXPORTS);
$tmp_file_size = filesize($_SERVER["DOCUMENT_ROOT"].CATALOG_PATH2EXPORTS_DEF."cron_frame.php");
$fp = fopen($_SERVER["DOCUMENT_ROOT"].CATALOG_PATH2EXPORTS_DEF."cron_frame.php", "rb");
$tmp_data = fread($fp, $tmp_file_size);
fclose($fp);
$tmp_data = str_replace("#DOCUMENT_ROOT#", $_SERVER["DOCUMENT_ROOT"], $tmp_data);
$tmp_data = str_replace("#PHP_PATH#", $agent_php_path, $tmp_data);
$fp = fopen($_SERVER["DOCUMENT_ROOT"] . CATALOG_PATH2EXPORTS . "cron_frame.php", "ab");
$fp = fopen($_SERVER["DOCUMENT_ROOT"].CATALOG_PATH2EXPORTS."cron_frame.php", "ab");
fwrite($fp, $tmp_data);
fclose($fp);
}
$cfg_data = "";
if (file_exists($_SERVER["DOCUMENT_ROOT"] . "/bitrix/crontab/crontab.cfg")) {
$cfg_file_size = filesize($_SERVER["DOCUMENT_ROOT"] . "/bitrix/crontab/crontab.cfg");
$fp = fopen($_SERVER["DOCUMENT_ROOT"] . "/bitrix/crontab/crontab.cfg", "rb");
$cfg_data = fread($fp, $cfg_file_size);
fclose($fp);
if (file_exists($_SERVER["DOCUMENT_ROOT"]."/bitrix/crontab/crontab.cfg"))
{
$cfg_file_size = filesize($_SERVER["DOCUMENT_ROOT"]."/bitrix/crontab/crontab.cfg");
$fp = fopen($_SERVER["DOCUMENT_ROOT"]."/bitrix/crontab/crontab.cfg", "rb");
$cfg_data = fread($fp, $cfg_file_size);
fclose($fp);
}
CheckDirPath($_SERVER["DOCUMENT_ROOT"] . CATALOG_PATH2EXPORTS . "logs/");
if ($arProfile["IN_CRON"] == "Y") {
// remove
$cfg_data = preg_replace("#^.*?" . preg_quote(CATALOG_PATH2EXPORTS) . "cron_frame.php +" . $PROFILE_ID . " *>.*?$#im", "", $cfg_data);
} else {
$strTime = "0 */" . $agent_period . " * * * ";
if (strlen($cfg_data) > 0)
CheckDirPath($_SERVER["DOCUMENT_ROOT"].CATALOG_PATH2EXPORTS."logs/");
if ($arProfile["IN_CRON"]=="Y")
{
// remove
$cfg_data = preg_replace("#^.*?".preg_quote(CATALOG_PATH2EXPORTS)."cron_frame.php +".$PROFILE_ID." *>.*?$#im", "", $cfg_data);
}
else
{
$strTime = "0 */".$agent_period." * * * ";
if (strlen($cfg_data)>0)
$cfg_data .= "\n";
$cfg_data .= $strTime . $agent_php_path . " -f " . $_SERVER["DOCUMENT_ROOT"] . CATALOG_PATH2EXPORTS . "cron_frame.php " . $PROFILE_ID . " >" . $_SERVER["DOCUMENT_ROOT"] . CATALOG_PATH2EXPORTS . "logs/" . $PROFILE_ID . ".txt\n";
$cfg_data .= $strTime.$agent_php_path." -f ".$_SERVER["DOCUMENT_ROOT"].CATALOG_PATH2EXPORTS."cron_frame.php ".$PROFILE_ID." >".$_SERVER["DOCUMENT_ROOT"].CATALOG_PATH2EXPORTS."logs/".$PROFILE_ID.".txt\n";
}
CCatalogExport::Update($PROFILE_ID, array(
"IN_CRON" => ($arProfile["IN_CRON"] == "Y" ? "N" : "Y")
));
CheckDirPath($_SERVER["DOCUMENT_ROOT"] . "/bitrix/crontab/");
"IN_CRON" => "Y"
));
CheckDirPath($_SERVER["DOCUMENT_ROOT"]."/bitrix/crontab/");
$cfg_data = preg_replace("#[\r\n]{2,}#im", "\n", $cfg_data);
$fp = fopen($_SERVER["DOCUMENT_ROOT"] . "/bitrix/crontab/crontab.cfg", "wb");
$fp = fopen($_SERVER["DOCUMENT_ROOT"]."/bitrix/crontab/crontab.cfg", "wb");
fwrite($fp, $cfg_data);
fclose($fp);
$arRetval = array();
@exec("crontab " . $_SERVER["DOCUMENT_ROOT"] . "/bitrix/crontab/crontab.cfg", $arRetval, $return_var);
}
@exec("crontab ".$_SERVER["DOCUMENT_ROOT"]."/bitrix/crontab/crontab.cfg", $arRetval, $return_var);
}
}
//
//agent
$dateAgent = new DateTime();
$intAgent = new DateInterval('PT60S'); // PT60S - 60 sec;
$dateAgent->add($intAgent);
@ -857,14 +898,11 @@ class intaro_intarocrm extends CModule
30
);
$this->CopyFiles();
// statistic update
$api_host = COption::GetOptionString($this->MODULE_ID, $this->CRM_API_HOST_OPTION, 0);
$api_key = COption::GetOptionString($this->MODULE_ID, $this->CRM_API_KEY_OPTION, 0);
$this->INTARO_CRM_API = new \IntaroCrm\RestApi($api_host, $api_key);
$this->INTARO_CRM_API->statisticUpdate();
$APPLICATION->IncludeAdminFile(
GetMessage('MODULE_INSTALL_TITLE'),
$_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/' . $this->MODULE_ID . '/install/step5.php'
@ -887,6 +925,18 @@ class intaro_intarocrm extends CModule
UnRegisterModuleDependences("sale", "OnSalePayOrder", $this->MODULE_ID, "ICrmOrderEvent", "onSalePayOrder");
UnRegisterModuleDependences("sale", "OnSaleCancelOrder", $this->MODULE_ID, "ICrmOrderEvent", "onSaleCancelOrder");
if(CModule::IncludeModule("catalog")) {
if (file_exists($_SERVER['DOCUMENT_ROOT'] . '/bitrix/php_interface/include/catalog_export/' . $this->INTARO_CRM_EXPORT . '_run.php')) {
$dbProfile = CCatalogExport::GetList(array(), array("FILE_NAME" => $this->INTARO_CRM_EXPORT));
while ($arProfile = $dbProfile->Fetch()) {
if ($arProfile["DEFAULT_PROFILE"]!="Y") {
CAgent::RemoveAgent("CCatalogExport::PreGenerateExport(".$arProfile['ID'].");", "catalog");
CCatalogExport::Delete($arProfile['ID']);
}
}
}
}
$this->DeleteFiles();
@ -911,4 +961,23 @@ class intaro_intarocrm extends CModule
unlink($_SERVER['DOCUMENT_ROOT'] . '/bitrix/php_interface/include/catalog_export/intarocrm_run.php');
unlink($_SERVER['DOCUMENT_ROOT'] . '/bitrix/php_interface/include/catalog_export/intarocrm_setup.php');
}
function GetProfileSetupVars($iblocks, $articleProperties, $filename) {
// Get string like IBLOCK_EXPORT[0]=3&
// IBLOCK_EXPORT[1]=6&
// IBLOCK_PROPERTY_ARTICLE[0]=ARTICLE&
// IBLOCK_PROPERTY_ARTICLE[1]=ARTNUMBER&
// SETUP_FILE_NAME=%2Fbitrix%2Fcatalog_export%2Ftestintarocrm.xml
//$arProfileFields = explode(",", $SETUP_FIELDS_LIST);
$strVars = "";
foreach ($iblocks as $key => $val)
$strVars .= 'IBLOCK_EXPORT[' . $key . ']=' . $val . '&';
foreach ($articleProperties as $key => $val)
$strVars .= 'IBLOCK_PROPERTY_ARTICLE[' . $key . ']=' . $val . '&';
$strVars .= 'SETUP_FILE_NAME=' . urlencode($filename);
return $strVars;
}
}

View File

@ -3,7 +3,18 @@
if(!check_bitrix_sessid()) return;
IncludeModuleLangFile(__FILE__);
__IncludeLang(GetLangFileName($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/intaro.intarocrm/lang/", "/icml_export_setup.php"));
?>
<h3><?=GetMessage("EXPORT_CATALOGS_INFO");?></h3>
<?php
if(isset($arResult['errCode']) && $arResult['errCode'])
echo CAdminMessage::ShowMessage(GetMessage($arResult['errCode']));
global $oldValues;
if (!empty($oldValues)) {
$IBLOCK_EXPORT = $oldValues['IBLOCK_EXPORT'];
$IBLOCK_PROPERTY_ARTICLE = $oldValues['IBLOCK_PROPERTY_ARTICLE'];
$SETUP_FILE_NAME = $oldValues['SETUP_FILE_NAME'];
$SETUP_PROFILE_NAME = $oldValues['SETUP_PROFILE_NAME'];
}
?>
<form method="post" action="<?php echo $APPLICATION->GetCurPage(); ?>" >
<font class="text"><?=GetMessage("EXPORT_CATALOGS");?><br><br></font>
@ -12,7 +23,7 @@ __IncludeLang(GetLangFileName($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/intaro.
{
$IBLOCK_EXPORT = array();
}
$boolAll = false;
$intCountChecked = 0;
$intCountAvailIBlock = 0;
@ -33,33 +44,42 @@ __IncludeLang(GetLangFileName($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/intaro.
$db_properties = CIBlock::GetProperties($res['ID'], Array());
$properties = Array();
while($prop = $db_properties->Fetch())
while($prop = $db_properties->Fetch())
$properties[] = $prop;
$boolExport = (in_array($res['ID'],$IBLOCK_EXPORT));
if (count($IBLOCK_EXPORT) != 0)
$boolExport = (in_array($res['ID'], $IBLOCK_EXPORT));
else
$boolExport = true;
$arIBlockList[] = array(
'ID' => $res['ID'],
'NAME' => $res['NAME'],
'IBLOCK_TYPE_ID' => $res['IBLOCK_TYPE_ID'],
'IBLOCK_EXPORT' => $boolExport,
'PROPERTIES' => $properties,
'OLD_PROPERTY_SELECT' => $IBLOCK_PROPERTY_ARTICLE[$res['ID']] != "" ? $IBLOCK_PROPERTY_ARTICLE[$res['ID']] : null,
'SITE_LIST' => '('.implode(' ',$arSiteList).')',
);
if ($boolExport)
$intCountChecked++;
$intCountAvailIBlock++;
}
}
}
if ($intCountChecked == $intCountAvailIBlock)
if (count($IBLOCK_EXPORT) != 0) {
if ($intCountChecked == $intCountAvailIBlock)
$boolAll = true;
} else {
$intCountChecked = $intCountAvailIBlock;
$boolAll = true;
}
?>
<table class="adm-list-table" id="export_setup">
<thead>
<tr class="adm-list-table-header">
@ -101,8 +121,8 @@ __IncludeLang(GetLangFileName($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/intaro.
<font class="tablebodytext">
<input
type="checkbox"
name="IBLOCK_EXPORT[<?=$key?>]"
id="IBLOCK_EXPORT<?=$key?>"
name="IBLOCK_EXPORT[<?=$arIBlock["ID"]?>]"
id="IBLOCK_EXPORT<?=$arIBlock["ID"]?>"
value="<?=$arIBlock["ID"]?>"
<? if ($arIBlock['IBLOCK_EXPORT']) echo " checked"; ?>
onclick="checkOne(this,<? echo $intCountAvailIBlock; ?>);"
@ -110,16 +130,29 @@ __IncludeLang(GetLangFileName($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/intaro.
</font>
</td>
<td class="adm-list-table-cell">
<select style="width: 200px;" name="IBLOCK_PROPERTY_ARTICLE[<?=$key?>]" class="property-export">
<select
style="width: 200px;"
id="IBLOCK_PROPERTY_ARTICLE<?=$arIBlock["ID"]?>"
name="IBLOCK_PROPERTY_ARTICLE[<?=$arIBlock["ID"]?>]"
class="property-export">
<option value=""></option>
<?
foreach ($arIBlock['PROPERTIES'] as $prop)
{
?>
<option value="<?=$prop['CODE'] ?>"
<?if ($prop["CODE"] == "ARTICLE" ||
$prop["CODE"] == "ART" ||
$prop["CODE"] == "ARTNUMBER" )
echo " selected";?>
<?
if ($arIBlock['OLD_PROPERTY_SELECT'] == $prop["CODE"]){
echo " selected";
} else {
if ($prop["CODE"] == "ARTICLE" ||
$prop["CODE"] == "ART" ||
$prop["CODE"] == "ARTNUMBER" )
echo " selected";
}
?>
>
<?=$prop["NAME"];?>
</option>
@ -147,37 +180,37 @@ __IncludeLang(GetLangFileName($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/intaro.
'catalog',
'export_default_path',
'/bitrix/catalog_export/'))
.'testintarocrm'/* .mt_rand(0, 999999) */.'.xml'
.'intarocrm'/* .mt_rand(0, 999999) */.'.xml'
); ?>" size="50">
<br>
<br>
<br>
<font class="text"><?=GetMessage("LOAD_PERIOD");?><br><br></font>
<input type="radio" name="TYPE_LOADING" value="none" checked onclick="checkProfile(this);"><?=GetMessage("NOT_LOADING");?><Br>
<input type="radio" name="TYPE_LOADING" value="none" onclick="checkProfile(this);"><?=GetMessage("NOT_LOADING");?><Br>
<input type="radio" name="TYPE_LOADING" value="cron" onclick="checkProfile(this);"><?=GetMessage("CRON_LOADING");?><Br>
<input type="radio" name="TYPE_LOADING" value="agent" onclick="checkProfile(this);"><?=GetMessage("AGENT_LOADING");?><Br>
<input type="radio" name="TYPE_LOADING" value="agent" checked onclick="checkProfile(this);"><?=GetMessage("AGENT_LOADING");?><Br>
<br>
<br>
<br>
<font class="text"><?=GetMessage("LOAD_NOW");?>&nbsp;</font>
<input id="load-now" type="checkbox" name="LOAD_NOW" value="now">
<input id="load-now" type="checkbox" name="LOAD_NOW" value="now" checked >
<br>
<br>
<br>
<div id="profile-field" style="display: none">
<div id="profile-field" >
<font class="text"><?=GetMessage("PROFILE_NAME");?>&nbsp;</font>
<input
type="text"
name="SETUP_PROFILE_NAME"
value="<?echo htmlspecialchars($SETUP_PROFILE_NAME)?>"
<input
type="text"
name="SETUP_PROFILE_NAME"
value="<?= ($SETUP_PROFILE_NAME ? $SETUP_PROFILE_NAME: GetMessage("PROFILE_NAME_EXAMPLE"));?>"
size="30">
<br>
<br>
<br>
</div>
<script type="text/javascript" src="/bitrix/js/main/jquery/jquery-1.7.min.js"></script>
<script type="text/javascript">
function checkAll(obj,cnt)
@ -191,11 +224,13 @@ __IncludeLang(GetLangFileName($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/intaro.
};
function checkOne(obj,cnt)
{
var boolCheck = obj.checked;
var intCurrent = parseInt(BX('count_checked').value);
intCurrent += (boolCheck ? 1 : -1);
BX('icml_export_all').checked = (intCurrent < cnt ? false : true);
BX('count_checked').value = intCurrent;
var boolCheck = obj.checked;
var intCurrent = parseInt(BX('count_checked').value);
intCurrent += (boolCheck ? 1 : -1);
BX('icml_export_all').checked = (intCurrent < cnt ? false : true);
BX('count_checked').value = intCurrent;
if (!boolCheck)
BX(obj.id.replace('IBLOCK_EXPORT','IBLOCK_PROPERTY_ARTICLE')).value = 'none';
};
function checkProfile(obj)
{
@ -205,11 +240,11 @@ __IncludeLang(GetLangFileName($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/intaro.
$('#profile-field').hide();
};
</script>
<?//Следующие переменные должны быть обязательно установлены?>
<?=bitrix_sessid_post();?>
<input type="hidden" name="lang" value="<?php echo LANG; ?>">
<input type="hidden" name="id" value="intaro.intarocrm">
<input type="hidden" name="install" value="Y">

View File

@ -1,6 +1,7 @@
<?php
if(!check_bitrix_sessid()) return;
echo CAdminMessage::ShowNote(GetMessage("MOD_INST_OK")); ?>
echo CAdminMessage::ShowNote(GetMessage("MOD_INST_OK"));
echo GetMessage("INTAROCRM_INFO"); ?>
<form action="<?php echo $APPLICATION->GetCurPage(); ?>">
<input type="hidden" name="lang" value="<?php echo LANG; ?>">

View File

@ -1,5 +1,5 @@
<?
$arModuleVersion = array(
'VERSION' => '0.3.8',
'VERSION_DATE' => '2013-08-14 19:32:00',
"VERSION" => "0.3.9",
"VERSION_DATE" => "2013-08-21 18:32:00",
);

View File

@ -1,109 +0,0 @@
<?php
$MESS["YANDEX_DETAIL_TITLE"] = "Настройка дополнительных параметров";
$MESS["YANDEX_ERR_NO_ACCESS_EXPORT"] = "Нет доступа к управлению экспортом";
$MESS["YANDEX_ERR_NO_IBLOCK_CHOSEN"] = "Не выбран инфоблок";
$MESS["YANDEX_ERR_NO_IBLOCK_FOUND"] = "Инфоблок не найден";
$MESS["YANDEX_ERR_NO_ACCESS_IBLOCK"] = "Нет доступа к инфоблоку";
$MESS["YANDEX_TAB1_TITLE"] = "Настройка выгрузки";
$MESS["YANDEX_TAB1_DESC"] = "Настройка данных и типа выгрузки";
$MESS["YANDEX_TAB2_TITLE"] = "Валюты и цены";
$MESS["YANDEX_TAB2_DESC"] = "Настройка списка используемых валют и типов цен";
$MESS["YANDEX_SKIP_PROP"] = "(не выводить)";
$MESS["YANDEX_PROP_country_of_origin"] = "Страна производства товара";
$MESS["YANDEX_PROP_vendor"] = "Производитель";
$MESS["YANDEX_PROP_model"] = "Модель";
$MESS["YANDEX_PROP_vendorCode"] = "Код производителя";
$MESS["YANDEX_PROP_manufacturer_warranty"] = "Гарантия производителя";
$MESS["YANDEX_PROP_author"] = "Автор";
$MESS["YANDEX_PROP_publisher"] = "Издательство";
$MESS["YANDEX_PROP_series"] = "Серия";
$MESS["YANDEX_PROP_year"] = "Год издания";
$MESS["YANDEX_PROP_ISBN"] = "Код книги (ISBN)";
$MESS["YANDEX_PROP_volume"] = "Кол-во томов";
$MESS["YANDEX_PROP_part"] = "Номер тома";
$MESS["YANDEX_PROP_language"] = "Язык";
$MESS["YANDEX_PROP_binding"] = "Переплет";
$MESS["YANDEX_PROP_page_extent"] = "Кол-во страниц";
$MESS["YANDEX_PROP_table_of_contents"] = "Оглавление";
$MESS["YANDEX_PROP_performed_by"] = "Исполнитель";
$MESS["YANDEX_PROP_performance_type"] = "Тип";
$MESS["YANDEX_PROP_format"] = "Формат аудиокниги";
$MESS["YANDEX_PROP_storage"] = "Носитель";
$MESS["YANDEX_PROP_recording_length"] = "Время звучания (mm.ss)";
$MESS["YANDEX_PROP_title"] = "Наименование";
$MESS["YANDEX_PROP_artist"] = "Исполнитель";
$MESS["YANDEX_PROP_director"] = "Режиссер";
$MESS["YANDEX_PROP_starring"] = "Актеры";
$MESS["YANDEX_PROP_originalName"] = "Оригинальное наименование";
$MESS["YANDEX_PROP_country"] = "Страна";
$MESS["YANDEX_PROP_media"] = "Носитель";
$MESS["YANDEX_PROP_worldRegion"] = "Часть света";
$MESS["YANDEX_PROP_region"] = "Курорт или город";
$MESS["YANDEX_PROP_days"] = "Количество дней тура";
$MESS["YANDEX_PROP_dataTour"] = "Даты заездов";
$MESS["YANDEX_PROP_hotel_stars"] = "Звезды отеля (5*****)";
$MESS["YANDEX_PROP_room"] = "Тип комнаты (SNG, DBL...)";
$MESS["YANDEX_PROP_meal"] = "Тип питания (All, HB...)";
$MESS["YANDEX_PROP_included"] = "Что включено в стоимость тура";
$MESS["YANDEX_PROP_transport"] = "Транспорт";
$MESS["YANDEX_PROP_place"] = "Место";
$MESS["YANDEX_PROP_hall"] = "Зал";
$MESS["YANDEX_PROP_date"] = "Дата и время";
$MESS["YANDEX_PROP_is_premiere"] = "Премьера?";
$MESS["YANDEX_PROP_is_kids"] = "Детское?";
$MESS["YANDEX_TYPE"] = "Тип описания";
$MESS["YANDEX_TYPE_SIMPLE"] = "упрощенное";
$MESS["YANDEX_TYPE_NOTE"] = "Подробнее см. <a href=\"http://partner.market.yandex.ru/legal/tt/\" target=\"_blank\">http://partner.market.yandex.ru/legal/tt/</a>";
$MESS["YANDEX_PROPS_COMMON"] = "Общие настройки";
$MESS["YANDEX_PROPS_TYPE"] = "Настройки типа описания";
$MESS["YANDEX_PROPS_NO"] = "нет";
$MESS["YANDEX_PROPS_ADDITIONAL"] = "Дополнительные свойства для выгрузки";
$MESS["YANDEX_PROPS_ADDITIONAL_TITLE"] = "Выберите свойства";
$MESS["YANDEX_PROPS_ADDITIONAL_MORE"] = "Еще";
$MESS["YANDEX_PRICES"] = "Цены";
$MESS["YANDEX_PRICE_TYPE"] = "Выводить цену";
$MESS["YANDEX_PRICE_TYPE_NONE"] = "оптимальную";
$MESS["YANDEX_CURRENCIES"] = "Валюты";
$MESS["YANDEX_CURRENCY"] = "валюта";
$MESS["YANDEX_CURRENCY_RATE"] = "курс";
$MESS["YANDEX_CURRENCY_RATE_SITE"] = "сайт";
$MESS["YANDEX_CURRENCY_RATE_CBRF"] = "Центральный банк РФ";
$MESS["YANDEX_CURRENCY_RATE_NBU"] = "Национальный банк Украины";
$MESS["YANDEX_CURRENCY_RATE_NBK"] = "Национальный банк Казахстана";
$MESS["YANDEX_CURRENCY_RATE_CB"] = "банк своего региона";
$MESS["YANDEX_CURRENCY_PLUS"] = "коррекция курса";
$MESS["YANDEX_PARAMS_TITLE"] = "Свойство";
$MESS["YANDEX_ERR_NO_ACCESS_IBLOCK_SKU"] = "Нет доступа к инфоблоку торговых предложений";
$MESS["YANDEX_ERR_NO_IBLOCK_SKU_FOUND"] = "Инфоблок торговых предложений #ID# не найден";
$MESS["YANDEX_ERR_NO_IBLOCK_FOUND_EXT"] = "Инфоблок #ID# не найден";
$MESS["YANDEX_ERR_NO_IBLOCK_IS_CATALOG"] = "Инфоблок #ID# не является торговым каталогом и не имеет торговых предложений";
$MESS["YANDEX_ERR_NO_SECTION_LIST"] = "Список разделов не задан";
$MESS["YANDEX_ERR_FILE_ACCESS_DENIED"] = "Недостаточно прав для перезаписи файла #FILE#";
$MESS["YANDEX_ERR_FILE_OPEN_WRITING"] = "Невозможно открыть файл #FILE# для записи";
$MESS["YANDEX_ERR_SETUP_FILE_WRITE"] = "Запись в файл #FILE# невозможна";
$MESS["YANDEX_PRODUCT_PROPS"] = "--- Инфоблок товаров ---";
$MESS["YANDEX_OFFERS_PROPS"] = "--- Инфоблок торговых предложений ---";
$MESS["YANDEX_SKU_SETTINGS"] = "Выгрузка торговых предложений";
$MESS["YANDEX_OFFERS_SELECT"] = "Условие отбора";
$MESS["YANDEX_SKU_EXPORT_ALL_TITLE"] = "Все предложения товара";
$MESS["YANDEX_SKU_EXPORT_MIN_PRICE_TITLE"] = "Предложение с минимальной ценой";
$MESS["YANDEX_SKU_EXPORT_PROP_TITLE"] = "Отбор по свойству";
$MESS["YANDEX_SKU_EXPORT_PROP_ID"] = "Свойство";
$MESS["YANDEX_SKU_EXPORT_PROP_COND"] = "Условие отбора";
$MESS["YANDEX_SKU_EXPORT_PROP_VALUE"] = "Значения";
$MESS["YANDEX_SKU_EXPORT_PROP_EMPTY"] = "--- выберите свойство ---";
$MESS["YANDEX_SKU_EXPORT_PROP_SELECT_ZERO"] = "пусто";
$MESS["YANDEX_SKU_EXPORT_PROP_SELECT_NONZERO"] = "не пусто";
$MESS["YANDEX_SKU_EXPORT_PROP_SELECT_EQUAL"] = "равно";
$MESS["YANDEX_SKU_EXPORT_PROP_SELECT_NONEQUAL"] = "не равно";
$MESS["YANDEX_SKU_EXPORT_ERR_CONDITION_ABSENT"] = "Не указано, по какому принципу фильтровать экспортируемые торговые предложения";
$MESS["YANDEX_SKU_EXPORT_ERR_PROPERTY_ABSENT"] = "Не указано свойство, по значению которого фильтруются торговые предложения";
$MESS["YANDEX_SKU_EXPORT_ERR_PROPERTY_COND_ABSENT"] = "Не указано условие фильтрации торговых предложений по свойству";
$MESS["YANDEX_SKU_EXPORT_ERR_PROPERTY_VALUES_ABSENT"] = "Не указаны значения свойств для фильтрации торговых предложений";
$MESS["YANDEX_SAVE_ERR"] = "Ошибки сохранения";
$MESS["YANDEX_ERR_BAD_PRICE_TYPE"] = "Задан неверный тип цен для выгрузки";
$MESS["YANDEX_ERR_BAD_OFFERS_IBLOCK_ID"] = "Неверный ID инфоблока торговых предложений";
$MESS["YANDEX_ERR_SKU_SETTINGS_ABSENT"] = "Отсутствуют настройки экспорта торговых предложений";
$MESS["YANDEX_ROOT_DIRECTORY"] = "Основной раздел каталога";
$MESS["CET_ERROR_IBLOCK_PERM"] = "Недостаточно прав для работы с инфоблоком ##IBLOCK_ID#";
$MESS["CES_ERROR_BAD_EXPORT_FILENAME"] = "Имя файла экспорта содержит запрещенные символы";

View File

@ -1,124 +0,0 @@
<?php
$MESS["CET_ERROR_NO_NAME"] = "Введите название профиля выгрузки.";
$MESS["CET_STEP1"] = "Шаг";
$MESS["CET_STEP2"] = "из";
$MESS["CET_SAVE"] = "Сохранить";
$MESS["CET_ERROR_NO_IBLOCK1"] = "Информационный блок";
$MESS["CET_ERROR_NO_IBLOCK2"] = "не найден.";
$MESS["CET_ERROR_NO_FILENAME"] = "Не указано имя файла для экспорта.";
$MESS["CET_ERROR_NO_GROUPS"] = "Не указаны выгружаемые группы.";
$MESS["CET_ERROR_NO_PROFILE_NAME"] = "Введите название профиля выгрузки.";
$MESS["CET_SELECT_IBLOCK"] = "Выберите инфоблок";
$MESS["CET_SELECT_IBLOCK_EXT"] = "Выберите инфоблок для экспорта:";
$MESS["CET_SELECT_GROUP"] = "Выберите группы:";
$MESS["CET_FIRST_SELECT_IBLOCK"] = "Сначала выберите информационный блок";
$MESS["CET_ALL_GROUPS"] = "Все группы";
$MESS["CET_SERVER_NAME"] = "Доменное имя:";
$MESS["CET_SERVER_NAME_SET_CURRENT"] = "текущее";
$MESS["CET_SAVE_FILENAME"] = "Сохранить в файл:";
$MESS["CET_PROFILE_NAME"] = "Имя профиля:";
$MESS["CET_EXPORT"] = "Экспортировать";
$MESS["CET_ERROR_NO_IBLOCKS"] = "Не указаны выгружаемые информационные блоки.";
$MESS["CET_EXPORT_CATALOGS"] = "Каталоги для экспорта:";
$MESS["CET_CATALOG"] = "Каталог";
$MESS["CET_EXPORT2YANDEX"] = "Экспортировать в Яндекс.Товары";
$MESS["CATI_DATA_EXPORT"] = "Экспорт данных";
$MESS["CATI_NO_IBLOCK"] = "Информационный блок не выбран. Выгрузка невозможна.";
$MESS["CATI_NO_FORMAT"] = "Укажите формат файла данных и его свойства.";
$MESS["CATI_NO_DELIMITER"] = "Укажите символ-разделитель полей.";
$MESS["CATI_NO_SAVE_FILE"] = "Укажите файл для сохранения результата.";
$MESS["CATI_CANNOT_CREATE_FILE"] = "Ошибка создания файла данных.";
$MESS["CATI_NO_FIELDS"] = "Не заданы поля для экспорта.";
$MESS["CATI_SCHEME_EXISTS"] = "Схема с таким именем уже существует.";
$MESS["CATI_PAGE_TITLE"] = "Выгрузка каталога: шаг";
$MESS["CATI_NEXT_STEP"] = "Далее";
$MESS["CATI_INFOBLOCK"] = "Информационный блок для экспорта:";
$MESS["CATI_SCHEME_NAME"] = "Схема выгрузки:";
$MESS["CATI_NOT"] = "Нет";
$MESS["CATI_DELETE"] = "удалить";
$MESS["CATI_FIELDS"] = "Задайте соответствие полей в файле полям в базе";
$MESS["CATI_FI_ID"] = "Идентификатор";
$MESS["CATI_FI_NAME"] = "Название";
$MESS["CATI_FI_ACTIV"] = "Активность";
$MESS["CATI_FI_ACTIVFROM"] = "Активность с";
$MESS["CATI_FI_ACTIVTO"] = "Активность до";
$MESS["CATI_FI_CATIMG"] = "Картинка для списка";
$MESS["CATI_FI_CATDESCR"] = "Описание для списка";
$MESS["CATI_FI_DETIMG"] = "Картинка";
$MESS["CATI_FI_DETDESCR"] = "Описание";
$MESS["CATI_FI_UNIXML"] = "Уникальный идентификатор";
$MESS["CATI_FI_QUANT"] = "Количество";
$MESS["CATI_FI_WEIGHT"] = "Вес";
$MESS["CATI_FI_PROPS"] = "Свойство";
$MESS["CATI_FI_GROUP_LEV"] = "Группа уровня";
$MESS["CATI_FI_PRICE_TYPE"] = "Цена типа";
$MESS["CATI_FIELD"] = "поле";
$MESS["CATI_FORMAT_PROPS"] = "Задайте свойства формата файла";
$MESS["CATI_DELIMITERS"] = "С разделителями";
$MESS["CATI_DELIMITER_TYPE"] = "Разделитель полей";
$MESS["CATI_TAB"] = "табуляция";
$MESS["CATI_TZP"] = "точка с запятой";
$MESS["CATI_ZPT"] = "запятая";
$MESS["CATI_SPS"] = "пробел";
$MESS["CATI_OTR"] = "другой";
$MESS["CATI_SAVE_SCHEME"] = "Сохранить настройки как схему";
$MESS["CATI_SSCHEME_NAME"] = "Имя схемы";
$MESS["CATI_DATA_FILE_NAME"] = "Сохранить файл данных как...";
$MESS["CATI_DATA_FILE_NAME1"] = "Имя файла данных";
$MESS["CATI_SUCCESS"] = "Выгрузка завершена";
$MESS["CATI_SU_ALL"] = "Всего выгружено строк:";
$MESS["CATI_BACK"] = "Назад";
$MESS["CATI_FIRST_LINE_NAMES"] = "Первая строка содержит имена полей";
$MESS["CATI_SU_ALL1"] = "Скачать файл %DATA_URL% на свой компьютер";
$MESS["CATI_FIELDS_NEEDED"] = "Выгружать";
$MESS["CATI_FIELDS_NAMES"] = "Название поля";
$MESS["CATI_FIELDS_SORTING"] = "Порядок";
$MESS["CATI_NEXT_STEP_F"] = "Начать выгрузку";
$MESS["CATI_DATA_FILE_NAME1_DESC"] = "Если такой файл существует, то он будет перезаписан";
$MESS["CATI_TOO_MANY_TABLES"] = "Слишком большое объединение таблиц. Уменьшите количество экспортируемых свойств или типов цен.";
$MESS["EST_QUANTITY_FROM"] = "Покупаемое количество от";
$MESS["EST_QUANTITY_TO"] = "Покупаемое количество до";
$MESS["EST_PRICE_TYPE"] = "Тип цен \"#TYPE#\"";
$MESS["EST_PRICE_TYPE2"] = "Тип цен \"#NAME#\" (#TYPE#)";
$MESS["CAT_DETAIL_PROPS"] = "Детальные настройки";
$MESS["CAT_DETAIL_PROPS_RUN"] = "настроить";
$MESS["CET_IS_SKU"] = "Выбран инфоблок торговых предложений.";
$MESS["CET_USE_PARENT_SECT"] = "Использовать группы инфоблока товаров";
$MESS["CET_YAND_RUN_ERR_IBLOCK_ABSENT"] = "Инфоблок ##IBLOCK_ID# не существует";
$MESS["CET_YAND_RUN_ERR_PRODUCT_IBLOCK_ABSENT"] = "Инфоблок товаров ##IBLOCK_ID# не существует";
$MESS["CET_YAND_RUN_ERR_SECTION_SET_EMPTY"] = "Список групп не задан";
$MESS["CET_YAND_RUN_ERR_SETUP_FILE_ACCESS_DENIED"] = "Недостаточно прав для перезаписи файла #FILE#";
$MESS["CET_YAND_RUN_ERR_SETUP_FILE_OPEN_WRITING"] = "Невозможно открыть файл #FILE# для записи";
$MESS["CET_YAND_RUN_ERR_SETUP_FILE_WRITE"] = "Запись в файл #FILE# невозможна";
$MESS["CET_YAND_SELECT_IBLOCK"] = "Инфоблок для экспорта";
$MESS["CET_SELECT_IBLOCK_TYPE"] = "Выберите тип инфоблока";
$MESS["CET_YAND_GROUP_AND_OFFERS"] = "Группы и товары для импорта";
$MESS["CET_YAND_USE_IBLOCK_SITE"] = "Брать доменное имя из инфоблока";
$MESS["CET_ERROR_IBLOCK_PERM"] = "Недостаточно прав для работы с инфоблоком ##IBLOCK_ID#";
$MESS["YANDEX_ERR_SKU_SETTINGS_ABSENT"] = "Отсутствуют настройки экспорта торговых предложений";
$MESS["CES_ERROR_BAD_EXPORT_FILENAME"] = "Имя файла экспорта содержит запрещенные символы";
$MESS["CES_ERROR_BAD_EXPORT_FILENAME_EXTENTIONS"] = "Имя файла экспорта содержит запрещенное расширение";
$MESS["CES_ERROR_FORBIDDEN_EXPORT_FILENAME"] = "Запрещенное имя файла экспорта";
$MESS["CES_ERROR_PATH_WITHOUT_DEFAUT"] = "Экспорт может быть осуществлён только в папку, указанную в поле <b>Путь по умолчанию для экспортируемых файлов</b> настроек модуля.";
$MESS["CAT_ADM_CSV_EXP_TAB1"] = "Инфоблок";
$MESS["CAT_ADM_CSV_EXP_TAB1_TITLE"] = "Выбор информационного блока для экспорта";
$MESS["CAT_ADM_CSV_EXP_TAB2"] = "Параметры экспорта";
$MESS["CAT_ADM_CSV_EXP_TAB2_TITLE"] = "Настройка параметров экспорта";
$MESS["CAT_ADM_CSV_EXP_TAB3"] = "Результат";
$MESS["CAT_ADM_CSV_EXP_TAB3_TITLE"] = "Результат экспорта";
$MESS["CAT_ADM_CSV_EXP_IBLOCK_ID"] = "Инфоблок";
$MESS["CAT_ADM_CSV_EXP_ADD_SETTINGS"] = "Дополнительные настройки";
$MESS["CAT_ADM_CSV_EXP_EXPORT_FILES"] = "Выгружать файлы";
$MESS["CAT_ADM_CSV_EXP_TIME_STEP"] = "Время выполнения шага";
$MESS["CAT_ADM_CSV_EXP_TIME_STEP_COMMENT"] = "0 - загрузить все сразу<br>положительное значение - число секунд на выполнение одного шага";
$MESS["CAT_ADM_CSV_EXP_SEP_ELEMENTS"] = "Поля и свойства элементов";
$MESS["CAT_ADM_CSV_EXP_SEP_SECTIONS"] = "Поля разделов";
$MESS["CAT_ADM_CSV_EXP_SEP_SECTIONS_EXT"] = "Поля и пользовательские свойства разделов";
$MESS["CAT_ADM_CSV_EXP_SEP_PRODUCT"] = "Свойства товара";
$MESS["CAT_ADM_CSV_EXP_SEP_PRICES"] = "Цены";
$MESS["CAT_ADM_CSV_EXP_SEP_SKU"] = "Поля и свойства торговых предложений";
$MESS["CAT_ADM_CSV_EXP_DESCR_SECT_PROP"] = "Пользовательское свойство";
$MESS["CAT_ADM_CSV_EXP_SECTION_LEVEL"] = "Раздел уровня #LEVEL#";
$MESS["CATI_FI_PRICE_TYPE2"] = "Цена типа \"#TYPE#\"";
$MESS["CATI_FI_PRICE_TYPE3"] = "Цена типа \"#NAME#\" (#TYPE#)";
$MESS["CATI_FI_PRICE_CURRENCY"] = "в валюте #CURRENCY#";

View File

@ -1,10 +0,0 @@
<?
$MESS["ERROR_FILENAME_NOT_SET"] = "Не указан файл данных.";
$MESS["ERROR_PROFIE_NOT_SET"] = "Не указано имя профиля";
$MESS["EXPORT_CATALOGS"] = "Выберите каталоги для выгрузки в ICML:";
$MESS["CATALOG"] = "Каталог";
$MESS["EXPORT2INTAROCML"] = "Выгрузить в ICML";
$MESS["FILENAME"] = "Укажите имя файла данных:";
$MESS["PROPERTY"] = "Свойство, содержащее артикул товара";
$MESS["ALL_CATALOG"] = "Все каталоги";
?>

View File

@ -0,0 +1,17 @@
<?
$MESS["ERROR_FILENAME_NOT_SET"] = "Не указан файл данных.";
$MESS["ERROR_PROFIE_NOT_SET"] = "Не указано имя профиля";
$MESS["EXPORT_CATALOGS"] = "Выберите каталоги для выгрузки в ICML:";
$MESS["CATALOG"] = "Каталог";
$MESS["EXPORT2INTAROCML"] = "Выгрузить в ICML";
$MESS["FILENAME"] = "Укажите имя файла данных:";
$MESS["PROPERTY"] = "Свойство, содержащее артикул товара";
$MESS["ALL_CATALOG"] = "Все каталоги";
$MESS["CET_EXPORT"] = "Экспортировать";
$MESS["CET_SAVE"] = "Сохранить";
$MESS["ERROR_IBLOCK_MODULE"] = "Модуль Инфоблоки не установлен";
$MESS["ERROR_IBLOCK_CATALOG"] = "Модуль Каталог не установлен";
$MESS["ERROR_IBLOCK_INTAROCRM"] = "Модуль IntaroCRM не установлен";
$MESS["ERROR_ARTICLE_NOT_SET"] = "Были установлены поля артикулов, но не установлены Информационные блоки";
$MESS["PROFILE_NAME"] = "Имя профиля";
?>

View File

@ -11,3 +11,4 @@ $MESS ['ERR_IBLOCK'] = 'Отсутствует модуль iblock! Дальне
$MESS ['ERR_CATALOG'] = 'Отсутствует модуль catalog! Дальнейшая установка невозможна.';
$MESS ['ERR_CATALOG'] = 'Отсутствует модуль catalog! Дальнейшая установка невозможна.';
$MESS ['INTAROCRM_CURL_ERR'] = 'Для работы модуля интеграции с IntaroCRM требуется PHP-расширение CURL.';
$MESS ['ERR_ARTICLE_IBLOCK'] = 'Не установлены артикулы';

View File

@ -1,12 +1,12 @@
<?php
$MESS ['STEP_NAME'] = 'Шаг 3';
$MESS ['MESS_1'] = 'На данном шаге вы можете выгрузить ранее оформленные заказы в IntaroCRM. Для запуска выгрузки нажмите кнопку «Начать выгрузку».';
$MESS ['MESS_2'] = 'Экспорт...';
$MESS ['MESS_3'] = 'Экспорт заказов успешно завершён.';
$MESS ['MESS_4'] = 'Экспорт заказов приостановлен.';
$MESS ['MESS_5'] = 'Произошла ошибка сервера, обратитесь в Интаро Софт.';
$MESS ['STOP'] = 'Приостановить выгрузку';
$MESS ['START_1'] = 'Начать выгрузку';
$MESS ['START_2'] = 'Приостановить выгрузку';
$MESS ['START_3'] = 'Возобновить выгрузку';
$MESS ['MOD_NEXT_STEP'] = 'Следующий шаг';
<?php
$MESS ['STEP_NAME'] = 'Шаг 3';
$MESS ['MESS_1'] = 'На данном шаге вы можете выгрузить ранее оформленные заказы в IntaroCRM. Для запуска выгрузки нажмите кнопку «Начать выгрузку».';
$MESS ['MESS_2'] = 'Экспорт...';
$MESS ['MESS_3'] = 'Экспорт заказов успешно завершён.';
$MESS ['MESS_4'] = 'Экспорт заказов приостановлен.';
$MESS ['MESS_5'] = 'Произошла ошибка сервера, обратитесь в Интаро Софт.';
$MESS ['STOP'] = 'Приостановить выгрузку';
$MESS ['START_1'] = 'Начать выгрузку';
$MESS ['START_2'] = 'Приостановить выгрузку';
$MESS ['START_3'] = 'Возобновить выгрузку';
$MESS ['MOD_NEXT_STEP'] = 'Следующий шаг';

View File

@ -1,19 +1,24 @@
<?php
$MESS ['STEP_NAME'] = 'Шаг 4';
$MESS ['MOD_NEXT_STEP'] = 'Завершить установку';
$MESS ['MOD_PREV_STEP'] = 'Предыдущий шаг';
$MESS ['DELIVERY_TYPES_LIST'] = 'Способы доставки';
$MESS ['PAYMENT_TYPES_LIST'] = 'Способы оплаты';
$MESS ['PAYMENT_STATUS_LIST'] = 'Статусы';
$MESS ['ORDER_TYPES_LIST'] = 'Типы заказа';
$MESS ['PAYMENT_LIST'] = 'Оплата';
$MESS ['PAYMENT_Y'] = 'Оплачен';
$MESS ['PAYMENT_N'] = 'Не оплачен';
$MESS ['CANCELED'] = 'Флаг «Отменен»';
$MESS ['INFO_1'] = ' Задайте соответствие между справочниками 1C-Битрикс и справочниками IntaroCRM.';
$MESS ['LOAD_PERIOD'] = 'Выгружать каталог периодически';
$MESS ['NOT_LOADING'] = 'Нет (по умолчанию)';
$MESS ['CRON_LOADING'] = 'CRON';
$MESS ['AGENT_LOADING'] = 'Агент';
$MESS ['LOAD_NOW'] = 'Выгрузить сейчас';
$MESS ['PROFILE_NAME'] = 'Имя профиля:';
<?php
$MESS ['STEP_NAME'] = 'Шаг 4';
$MESS ['MOD_NEXT_STEP'] = 'Завершить установку';
$MESS ['MOD_PREV_STEP'] = 'Предыдущий шаг';
$MESS ['DELIVERY_TYPES_LIST'] = 'Способы доставки';
$MESS ['PAYMENT_TYPES_LIST'] = 'Способы оплаты';
$MESS ['PAYMENT_STATUS_LIST'] = 'Статусы';
$MESS ['ORDER_TYPES_LIST'] = 'Типы заказа';
$MESS ['PAYMENT_LIST'] = 'Оплата';
$MESS ['PAYMENT_Y'] = 'Оплачен';
$MESS ['PAYMENT_N'] = 'Не оплачен';
$MESS ['CANCELED'] = 'Флаг «Отменен»';
$MESS ['INFO_1'] = ' Задайте соответствие между справочниками 1C-Битрикс и справочниками IntaroCRM.';
$MESS ['LOAD_PERIOD'] = 'Выгружать каталог периодически';
$MESS ['NOT_LOADING'] = 'Нет';
$MESS ['CRON_LOADING'] = 'С помощью CRON каждые 24 часа';
$MESS ['AGENT_LOADING'] = 'Агентом каждые 24 часа (по умолчанию)';
$MESS ['LOAD_NOW'] = 'Выгрузить сейчас';
$MESS ['PROFILE_NAME'] = 'Имя профиля:';
$MESS ['PROFILE_NAME_EXAMPLE'] = 'Выгрузка каталога IntaroCRM';
$MESS ['ERR_FIELDS_PROFILE'] = 'Неверно заполнено поле имени профиля';
$MESS ['ERR_FIELDS_IBLOCK'] = 'Не выбрано ни одного информационного блока';
$MESS ['ERR_FIELDS_ARTICLE'] = 'Не выбраны артикулы';
$MESS ['ERR_FIELDS_FILE'] = 'Не указано имя файла';

View File

@ -0,0 +1,18 @@
<?php
$MESS ['INTAROCRM_INFO'] = '
<h2>Дальнейшие действия<h2>
<p>
Если вы произвели выгрузку заказов на шаге 3, то эти заказы уже доступны в вашей CRM и
через некоторое время по этим заказам будет подготовлены аналитические отчеты в Панели KPI.
</p>
<p>
Новые заказы будут отправляться агентом <span style="font-family: Courier New;">ICrmOrderActions::uploadOrdersAgent();</span>
в IntaroCRM каждые 10 минут (интервал можно изменить в разделе <a href="/bitrix/admin/agent_list.php">Агенты</a>).
</p>
<p>
Если вы выбрали опцию «Выгрузить каталог сейчас» на шаге 4, то ваш каталог уже загружается в IntaroCRM.
Загрузка длится, как правило, не более 10 минут. Если вы не выбирали эту опцию, то генерацию файла с каталогом
можно произвести экспортом «IntaroCRM» в разделе Магазин > Настройки > <a href="/bitrix/admin/cat_export_setup.php">Экспорт данных</a>.
IntaroCRM проверяет и загружает данный файл с каталогом каждые 3 часа.
</p>
';