1
0
mirror of synced 2024-11-22 21:36:10 +03:00

+step in installer

This commit is contained in:
Grisha Pomadchin 2013-09-05 12:11:29 +04:00
parent edcadcd052
commit 6f97c22b54
11 changed files with 1127 additions and 906 deletions

File diff suppressed because it is too large Load Diff

View File

@ -2,168 +2,30 @@
if (!check_bitrix_sessid()) if (!check_bitrix_sessid())
return; return;
IncludeModuleLangFile(__FILE__); IncludeModuleLangFile(__FILE__);
$defaultOrderProps = array(
'fio' => 'FIO',
'index' => 'ZIP',
'text' => 'ADDRESS',
'phone' => 'PHONE',
'email' => 'EMAIL'
);
?> ?>
<style type="text/css">
.instal-load-block { /* */ }
.instal-load-label {
color: #000;
margin-bottom: 15px;
}
.instal-progress-bar-outer {
height: 32px;
border:1px solid;
border-color:#9ba6a8 #b1bbbe #bbc5c9 #b1bbbe;
-webkit-box-shadow: 1px 1px 0 #fff, inset 0 2px 2px #c0cbce;
box-shadow: 1px 1px 0 #fff, inset 0 2px 2px #c0cbce;
background-color:#cdd8da;
background-image:-webkit-linear-gradient(top, #cdd8da, #c3ced1);
background-image:-moz-linear-gradient(top, #cdd8da, #c3ced1);
background-image:-ms-linear-gradient(top, #cdd8da, #c3ced1);
background-image:-o-linear-gradient(top, #cdd8da, #c3ced1);
background-image:linear-gradient(top, #ced9db, #c3ced1);
border-radius: 2px;
text-align: center;
color: #6a808e;
text-shadow: 0 1px rgba(255,255,255,0.85);
font-size: 18px;
line-height: 35px;
font-weight: bold;
}
.instal-progress-bar-alignment {
height: 28px;
margin: 0;
position: relative;
}
.instal-progress-bar-inner {
height: 28px;
border-radius: 2px;
border-top: solid 1px #52b9df;
background-color:#2396ce;
background-image:-webkit-linear-gradient(top, #27a8d7, #2396ce, #1c79c0);
background-image:-moz-linear-gradient(top, #27a8d7, #2396ce, #1c79c0);
background-image:-ms-linear-gradient(top, #27a8d7, #2396ce, #1c79c0);
background-image:-o-linear-gradient(top, #27a8d7, #2396ce, #1c79c0);
background-image:linear-gradient(top, #27a8d7, #2396ce, #1c79c0);
position: absolute;
overflow: hidden;
top: 1px;
left:0;
}
.instal-progress-bar-inner-text {
color: #fff;
text-shadow: 0 1px rgba(0,0,0,0.2);
font-size: 18px;
line-height: 32px;
font-weight: bold;
text-align: center;
position: absolute;
left: -2px;
top: -2px;
}
</style>
<script type="text/javascript" src="/bitrix/js/main/jquery/jquery-1.7.min.js"></script> <script type="text/javascript" src="/bitrix/js/main/jquery/jquery-1.7.min.js"></script>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
var globStop = false; $('input[name="address-detail"]').change(function(){
if(parseInt($(this).val()) === 1)
$('tr.address-detail').show('slow');
else if(parseInt($(this).val()) === 0)
$('tr.address-detail').hide('slow');
$('#percent').width($('.instal-progress-bar-outer').width());
$(window).resize(function(){ // strechin progress bar
$('#percent').width($('.instal-progress-bar-outer').width());
});
// orderUpload function
function orderUpload(finish) {
if(globStop)
return false;
if(finish == 1) {
$('#status').text('<?php echo GetMessage("MESS_3"); ?>');
BX.closeWait();
$('input[name="inst"]').css('opacity', '1').removeAttr('disabled');
$('input[name="stop"]').css('opacity', '0.5').attr('disabled', 'disabled');
$('input[name="stop"]').attr('value', '<?php echo GetMessage("START_1"); ?>');
return true; // exit from function, end recursion
}
var handlerUrl = $(this).parents('form').attr('action');
var step = $('input[name="continue"]').val();
var id = $('input[name="id"]').val();
var install = $('input[name="install"]').val();
var sessid = BX.bitrix_sessid();
var data = 'install=' + install +'&step=' + step + '&sessid=' + sessid +
'&id=' + id + '&ajax=1&finish=' + finish;
// ajax request
$.ajax({
type: 'POST',
url: handlerUrl,
data: data,
dataType: 'json',
success: function(response) {
$('#indicator').css('width', response.percent + '%');
$('#percent').html(response.percent + '%');
$('#percent2').html(response.percent + '%');
orderUpload(response.finish); // wait until next response
},
error: function () {
BX.closeWait();
$('input[name="inst"]').css('opacity', '1').removeAttr('disabled');
$('input[name="stop"]').attr('name', 'start');
$('input[name="stop"]').attr('value', '<?php echo GetMessage("START_3"); ?>');
$('#status').text('<?php echo GetMessage('MESS_4'); ?>');
globStop = true;
alert('<?php echo GetMessage('MESS_5'); ?>');
}
}); });
} });
$('input[name="start"]').live('click', function() {
BX.showWait();
$(this).attr('name', 'stop');
$(this).attr('value', '<?php echo GetMessage("START_2"); ?>');
$('#status').text('<?php echo GetMessage('MESS_2'); ?>');
if(globStop)
globStop = false;
// hide next step button
$('input[name="inst"]').css('opacity', '0.5').attr('disabled', 'disabled');
orderUpload(0);
return false;
});
$('input[name="stop"]').live('click', function() {
BX.closeWait();
// show next step button
$('input[name="inst"]').css('opacity', '1').removeAttr('disabled');
$(this).attr('name', 'start');
$(this).attr('value', '<?php echo GetMessage("START_3"); ?>');
$('#status').text('<?php echo GetMessage('MESS_4'); ?>');
globStop = true;
return false;
});
});
</script> </script>
<div class="adm-detail-content-item-block">
<form action="<?php echo $APPLICATION->GetCurPage() ?>" method="POST"> <form action="<?php echo $APPLICATION->GetCurPage() ?>" method="POST">
<?php echo bitrix_sessid_post(); ?> <?php echo bitrix_sessid_post(); ?>
<input type="hidden" name="lang" value="<?php echo LANGUAGE_ID ?>"> <input type="hidden" name="lang" value="<?php echo LANGUAGE_ID ?>">
@ -171,33 +33,53 @@ IncludeModuleLangFile(__FILE__);
<input type="hidden" name="install" value="Y"> <input type="hidden" name="install" value="Y">
<input type="hidden" name="step" value="4"> <input type="hidden" name="step" value="4">
<input type="hidden" name="continue" value="3"> <input type="hidden" name="continue" value="3">
<div class="adm-detail-content-item-block">
<table class="adm-detail-content-table edit-table" id="edit1_edit_table"> <table class="adm-detail-content-table edit-table" id="edit1_edit_table">
<tbody> <tbody>
<tr class="heading"> <tr class="heading">
<td colspan="2"><b><?php echo GetMessage('STEP_NAME'); ?></b></td> <td colspan="2"><b><?php echo GetMessage('STEP_NAME'); ?></b></td>
</tr> </tr>
</tbody> <tr class="heading">
</table> <td colspan="2"><b><?php echo GetMessage('ORDER_PROPS'); ?></b></td>
<div class="instal-load-block" id="result"> </tr>
<div class="instal-load-label" id="status"><?php echo GetMessage('MESS_1'); ?></div> <?php $countProps = 0;
<div class="instal-progress-bar-outer"> foreach ($arResult['orderProps'] as $orderProp): ?>
<div class="instal-progress-bar-alignment" style="width: 100%;"> <?php if ($orderProp['ID'] == 'text'): ?>
<div class="instal-progress-bar-inner" id="indicator" style="width: 0%;"> <tr class="heading">
<div class="instal-progress-bar-inner-text" style="width: 100%;" id="percent">0%</div> <td colspan="2">
</div> <b>
<span id="percent2">0%</span> <label><input type="radio" name="address-detail" value="0" <?php if (count($defaultOrderProps) < 6) echo "checked"; ?>><?php echo GetMessage('ADDRESS_SHORT'); ?></label>
</div> <label><input type="radio" name="address-detail" value="1" <?php if (count($defaultOrderProps) > 5) echo "checked"; ?>><?php echo GetMessage('ADDRESS_FULL'); ?></label>
</div> </b>
</div> </td>
</tr>
<?php endif; ?>
<tr <?php if ($countProps > 5) echo 'class="address-detail"'; if (($countProps > 5) && (count($defaultOrderProps) < 6)) echo 'style="display:none;"'; ?>>
<td width="50%" class="adm-detail-content-cell-l" name="<?php echo $orderProp['ID']; ?>">
<?php echo $orderProp['NAME']; ?>
</td>
<td width="50%" class="adm-detail-content-cell-r">
<select name="order-prop-<?php echo $orderProp['ID']; ?>" class="typeselect">
<option value=""></option>
<?php foreach ($arResult['arProp'] as $arProp): ?>
<option value="<?php echo $arProp['CODE']; ?>" <?php if ($defaultOrderProps[$orderProp['ID']] == $arProp['CODE']) echo 'selected'; ?>>
<?php echo $arProp['NAME']; ?>
</option>
<?php endforeach; ?>
</select>
</td>
</tr>
<?php $countProps++; endforeach; ?>
</tbody>
</table>
<br /> <br />
<div style="padding: 1px 13px 2px; height:28px;"> <div style="padding: 1px 13px 2px; height:28px;">
<div align="right" style="float:right; width:50%; position:relative;"> <div align="right" style="float:right; width:50%; position:relative;">
<input type="submit" name="inst" value="<?php echo GetMessage("MOD_NEXT_STEP"); ?>" class="adm-btn-save"> <input type="submit" name="inst" value="<?php echo GetMessage("MOD_NEXT_STEP"); ?>" class="adm-btn-save">
</div> </div>
<div align="left" style="float:right; width:50%; position:relative; visible: none;"> <div align="left" style="float:right; width:50%; position:relative; visible: none;">
<input type="submit" name="start" value="<?php echo GetMessage("START_1"); ?>" class="adm-btn-save"> <input type="submit" name="start" value="<?php echo GetMessage("MOD_PREV_STEP"); ?>" class="adm-btn-save">
</div> </div>
</div> </div>
</div>
</form> </form>
</div>

View File

@ -1,263 +1,203 @@
<?php <?php
if (!check_bitrix_sessid())
if(!check_bitrix_sessid()) return; return;
IncludeModuleLangFile(__FILE__); IncludeModuleLangFile(__FILE__);
__IncludeLang(GetLangFileName($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/intaro.intarocrm/lang/", "/icml_export_setup.php"));
?> ?>
<h3><?=GetMessage("EXPORT_CATALOGS_INFO");?></h3>
<?php <style type="text/css">
if(isset($arResult['errCode']) && $arResult['errCode']) .instal-load-block { /* */ }
echo CAdminMessage::ShowMessage(GetMessage($arResult['errCode']));
global $oldValues; .instal-load-label {
if (!empty($oldValues)) { color: #000;
$IBLOCK_EXPORT = $oldValues['IBLOCK_EXPORT']; margin-bottom: 15px;
$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>
<?
if (!isset($IBLOCK_EXPORT) || !is_array($IBLOCK_EXPORT))
{
$IBLOCK_EXPORT = array();
} }
$boolAll = false; .instal-progress-bar-outer {
$intCountChecked = 0; height: 32px;
$intCountAvailIBlock = 0; border:1px solid;
$arIBlockList = array(); border-color:#9ba6a8 #b1bbbe #bbc5c9 #b1bbbe;
$db_res = CIBlock::GetList(Array("IBLOCK_TYPE"=>"ASC", "NAME"=>"ASC"),array('CHECK_PERMISSIONS' => 'Y','MIN_PERMISSION' => 'W')); -webkit-box-shadow: 1px 1px 0 #fff, inset 0 2px 2px #c0cbce;
while ($res = $db_res->Fetch()) box-shadow: 1px 1px 0 #fff, inset 0 2px 2px #c0cbce;
{ background-color:#cdd8da;
if ($arCatalog = CCatalog::GetByIDExt($res["ID"])) background-image:-webkit-linear-gradient(top, #cdd8da, #c3ced1);
{ background-image:-moz-linear-gradient(top, #cdd8da, #c3ced1);
if($arCatalog['CATALOG_TYPE'] == "D" || $arCatalog['CATALOG_TYPE'] == "X" || $arCatalog['CATALOG_TYPE'] == "P") background-image:-ms-linear-gradient(top, #cdd8da, #c3ced1);
{ background-image:-o-linear-gradient(top, #cdd8da, #c3ced1);
$arSiteList = array(); background-image:linear-gradient(top, #ced9db, #c3ced1);
$rsSites = CIBlock::GetSite($res["ID"]); border-radius: 2px;
while ($arSite = $rsSites->Fetch()) text-align: center;
{ color: #6a808e;
$arSiteList[] = $arSite["SITE_ID"]; text-shadow: 0 1px rgba(255,255,255,0.85);
} font-size: 18px;
$db_properties = CIBlock::GetProperties($res['ID'], Array()); line-height: 35px;
font-weight: bold;
}
$properties = Array(); .instal-progress-bar-alignment {
while($prop = $db_properties->Fetch()) height: 28px;
$properties[] = $prop; margin: 0;
position: relative;
}
if (count($IBLOCK_EXPORT) != 0) .instal-progress-bar-inner {
$boolExport = (in_array($res['ID'], $IBLOCK_EXPORT)); height: 28px;
else border-radius: 2px;
$boolExport = true; border-top: solid 1px #52b9df;
background-color:#2396ce;
background-image:-webkit-linear-gradient(top, #27a8d7, #2396ce, #1c79c0);
background-image:-moz-linear-gradient(top, #27a8d7, #2396ce, #1c79c0);
background-image:-ms-linear-gradient(top, #27a8d7, #2396ce, #1c79c0);
background-image:-o-linear-gradient(top, #27a8d7, #2396ce, #1c79c0);
background-image:linear-gradient(top, #27a8d7, #2396ce, #1c79c0);
position: absolute;
overflow: hidden;
top: 1px;
left:0;
}
$arIBlockList[] = array( .instal-progress-bar-inner-text {
'ID' => $res['ID'], color: #fff;
'NAME' => $res['NAME'], text-shadow: 0 1px rgba(0,0,0,0.2);
'IBLOCK_TYPE_ID' => $res['IBLOCK_TYPE_ID'], font-size: 18px;
'IBLOCK_EXPORT' => $boolExport, line-height: 32px;
'PROPERTIES' => $properties, font-weight: bold;
'OLD_PROPERTY_SELECT' => $IBLOCK_PROPERTY_ARTICLE[$res['ID']] != "" ? $IBLOCK_PROPERTY_ARTICLE[$res['ID']] : null, text-align: center;
'SITE_LIST' => '('.implode(' ',$arSiteList).')', position: absolute;
); left: -2px;
top: -2px;
}
</style>
if ($boolExport) <script type="text/javascript" src="/bitrix/js/main/jquery/jquery-1.7.min.js"></script>
$intCountChecked++; <script type="text/javascript">
$intCountAvailIBlock++; $(document).ready(function() {
} var globStop = false;
$('#percent').width($('.instal-progress-bar-outer').width());
$(window).resize(function(){ // strechin progress bar
$('#percent').width($('.instal-progress-bar-outer').width());
});
// orderUpload function
function orderUpload(finish) {
if(globStop)
return false;
if(finish == 1) {
$('#status').text('<?php echo GetMessage("MESS_3"); ?>');
BX.closeWait();
$('input[name="inst"]').css('opacity', '1').removeAttr('disabled');
$('input[name="stop"]').css('opacity', '0.5').attr('disabled', 'disabled');
$('input[name="stop"]').attr('value', '<?php echo GetMessage("START_1"); ?>');
return true; // exit from function, end recursion
} }
}
if (count($IBLOCK_EXPORT) != 0) {
if ($intCountChecked == $intCountAvailIBlock)
$boolAll = true;
} else {
$intCountChecked = $intCountAvailIBlock;
$boolAll = true;
}
?> var handlerUrl = $(this).parents('form').attr('action');
var step = $('input[name="continue"]').val();
var id = $('input[name="id"]').val();
var install = $('input[name="install"]').val();
var sessid = BX.bitrix_sessid();
var data = 'install=' + install +'&step=' + step + '&sessid=' + sessid +
'&id=' + id + '&ajax=1&finish=' + finish;
// ajax request
$.ajax({
type: 'POST',
url: handlerUrl,
data: data,
dataType: 'json',
success: function(response) {
$('#indicator').css('width', response.percent + '%');
$('#percent').html(response.percent + '%');
$('#percent2').html(response.percent + '%');
<table class="adm-list-table" id="export_setup"> orderUpload(response.finish); // wait until next response
<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"> error: function () {
&nbsp; BX.closeWait();
</td> $('input[name="inst"]').css('opacity', '1').removeAttr('disabled');
</tr> $('input[name="stop"]').attr('name', 'start');
<? $('input[name="stop"]').attr('value', '<?php echo GetMessage("START_3"); ?>');
foreach ($arIBlockList as $key => $arIBlock) $('#status').text('<?php echo GetMessage('MESS_4'); ?>');
{ globStop = true;
?>
<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 ($prop["CODE"] == "ARTICLE" ||
$prop["CODE"] == "ART" ||
$prop["CODE"] == "ARTNUMBER" )
echo " selected";
}
alert('<?php echo GetMessage('MESS_5'); ?>');
}
});
}
?> $('input[name="start"]').live('click', function() {
> BX.showWait();
<?=$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> $(this).attr('name', 'stop');
<input type="text" name="SETUP_FILE_NAME" $(this).attr('value', '<?php echo GetMessage("START_2"); ?>');
value="<?=htmlspecialcharsbx(strlen($SETUP_FILE_NAME) > 0 ? $('#status').text('<?php echo GetMessage('MESS_2'); ?>');
$SETUP_FILE_NAME :
(COption::GetOptionString(
'catalog',
'export_default_path',
'/bitrix/catalog_export/'))
.'intarocrm'/* .mt_rand(0, 999999) */.'.xml'
); ?>" size="50">
<br> if(globStop)
<br> globStop = false;
<br>
<font class="text"><?=GetMessage("LOAD_PERIOD");?><br><br></font> // hide next step button
<input type="radio" name="TYPE_LOADING" value="none" onclick="checkProfile(this);"><?=GetMessage("NOT_LOADING");?><Br> $('input[name="inst"]').css('opacity', '0.5').attr('disabled', 'disabled');
<input type="radio" name="TYPE_LOADING" value="cron" onclick="checkProfile(this);"><?=GetMessage("CRON_LOADING");?><Br>
<input type="radio" name="TYPE_LOADING" value="agent" checked onclick="checkProfile(this);"><?=GetMessage("AGENT_LOADING");?><Br>
<br>
<br>
<font class="text"><?=GetMessage("LOAD_NOW");?>&nbsp;</font>
<input id="load-now" type="checkbox" name="LOAD_NOW" value="now" checked >
<br>
<br>
<br>
<div id="profile-field" > orderUpload(0);
<font class="text"><?=GetMessage("PROFILE_NAME");?>&nbsp;</font>
<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> return false;
<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';
};
function checkProfile(obj)
{
if (obj.value !== 'none')
$('#profile-field').show();
else
$('#profile-field').hide();
};
</script>
$('input[name="stop"]').live('click', function() {
BX.closeWait();
<?//Следующие переменные должны быть обязательно установлены?> // show next step button
<?=bitrix_sessid_post();?> $('input[name="inst"]').css('opacity', '1').removeAttr('disabled');
<input type="hidden" name="lang" value="<?php echo LANG; ?>"> $(this).attr('name', 'start');
$(this).attr('value', '<?php echo GetMessage("START_3"); ?>');
$('#status').text('<?php echo GetMessage('MESS_4'); ?>');
globStop = true;
return false;
});
});
</script>
<form action="<?php echo $APPLICATION->GetCurPage() ?>" method="POST">
<?php echo bitrix_sessid_post(); ?>
<input type="hidden" name="lang" value="<?php echo LANGUAGE_ID ?>">
<input type="hidden" name="id" value="intaro.intarocrm"> <input type="hidden" name="id" value="intaro.intarocrm">
<input type="hidden" name="install" value="Y"> <input type="hidden" name="install" value="Y">
<input type="hidden" name="step" value="5"> <input type="hidden" name="step" value="5">
<input type="hidden" name="continue" value="4"> <input type="hidden" name="continue" value="4">
<div class="adm-detail-content-item-block">
<table class="adm-detail-content-table edit-table" id="edit1_edit_table">
<tbody>
<tr class="heading">
<td colspan="2"><b><?php echo GetMessage('STEP_NAME'); ?></b></td>
</tr>
</tbody>
</table>
<div class="instal-load-block" id="result">
<div class="instal-load-label" id="status"><?php echo GetMessage('MESS_1'); ?></div>
<div class="instal-progress-bar-outer">
<div class="instal-progress-bar-alignment" style="width: 100%;">
<div class="instal-progress-bar-inner" id="indicator" style="width: 0%;">
<div class="instal-progress-bar-inner-text" style="width: 100%;" id="percent">0%</div>
</div>
<span id="percent2">0%</span>
</div>
</div>
</div>
<br />
<div style="padding: 1px 13px 2px; height:28px;"> <div style="padding: 1px 13px 2px; height:28px;">
<div align="right" style="float:right; width:50%; position:relative;"> <div align="right" style="float:right; width:50%; position:relative;">
<input type="submit" name="inst" value="<?php echo GetMessage("MOD_NEXT_STEP"); ?>" class="adm-btn-save"> <input type="submit" name="inst" value="<?php echo GetMessage("MOD_NEXT_STEP"); ?>" class="adm-btn-save">
</div> </div>
<div align="left" style="float:right; width:50%; position:relative;"> <div align="left" style="float:right; width:50%; position:relative; visible: none;">
<input type="submit" name="back" value="<?php echo GetMessage("MOD_PREV_STEP"); ?>" class="adm-btn-save"> <input type="submit" name="start" value="<?php echo GetMessage("START_1"); ?>" class="adm-btn-save">
</div> </div>
</div> </div>
</div>
</form> </form>

View File

@ -1,11 +1,263 @@
<?php <?php
if(!check_bitrix_sessid()) return;
echo CAdminMessage::ShowNote(GetMessage("MOD_INST_OK"));
echo GetMessage("INTAROCRM_INFO"); ?>
<form action="<?php echo $APPLICATION->GetCurPage(); ?>"> if(!check_bitrix_sessid()) return;
<input type="hidden" name="lang" value="<?php echo LANG; ?>"> IncludeModuleLangFile(__FILE__);
<input type="hidden" name="id" value="intaro.intarocrm"> __IncludeLang(GetLangFileName($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/intaro.intarocrm/lang/", "/icml_export_setup.php"));
<input type="hidden" name="install" value="Y"> ?>
<input type="submit" name="" value="<?php echo GetMessage("MOD_BACK"); ?>"> <h3><?=GetMessage("EXPORT_CATALOGS_INFO");?></h3>
<form> <?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>
<?
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 ($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>
<font class="text"><?=GetMessage("LOAD_PERIOD");?><br><br></font>
<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" checked onclick="checkProfile(this);"><?=GetMessage("AGENT_LOADING");?><Br>
<br>
<br>
<font class="text"><?=GetMessage("LOAD_NOW");?>&nbsp;</font>
<input id="load-now" type="checkbox" name="LOAD_NOW" value="now" checked >
<br>
<br>
<br>
<div id="profile-field" >
<font class="text"><?=GetMessage("PROFILE_NAME");?>&nbsp;</font>
<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)
{
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';
};
function checkProfile(obj)
{
if (obj.value !== 'none')
$('#profile-field').show();
else
$('#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">
<input type="hidden" name="step" value="6">
<input type="hidden" name="continue" value="5">
<div style="padding: 1px 13px 2px; height:28px;">
<div align="right" style="float:right; width:50%; position:relative;">
<input type="submit" name="inst" value="<?php echo GetMessage("MOD_NEXT_STEP"); ?>" class="adm-btn-save">
</div>
<div align="left" style="float:right; width:50%; position:relative;">
<input type="submit" name="back" value="<?php echo GetMessage("MOD_PREV_STEP"); ?>" class="adm-btn-save">
</div>
</div>
</form>

View File

@ -0,0 +1,11 @@
<?php
if(!check_bitrix_sessid()) return;
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; ?>">
<input type="hidden" name="id" value="intaro.intarocrm">
<input type="hidden" name="install" value="Y">
<input type="submit" name="" value="<?php echo GetMessage("MOD_BACK"); ?>">
<form>

View File

@ -13,3 +13,22 @@ $MESS ['ERR_CATALOG'] = 'Отсутствует модуль catalog! Дальн
$MESS ['INTAROCRM_CURL_ERR'] = 'Для работы модуля интеграции с IntaroCRM требуется PHP-расширение CURL.'; $MESS ['INTAROCRM_CURL_ERR'] = 'Для работы модуля интеграции с IntaroCRM требуется PHP-расширение CURL.';
$MESS ['ERR_ARTICLE_IBLOCK'] = 'Не установлены артикулы'; $MESS ['ERR_ARTICLE_IBLOCK'] = 'Не установлены артикулы';
$MESS ['DATE_TIMEZONE_ERR'] = 'Не указана временная зона в настройках php.'; $MESS ['DATE_TIMEZONE_ERR'] = 'Не указана временная зона в настройках php.';
$MESS ['ORDER_PROPS'] = 'Настройки соответствия полей заказа IntaroCRM свойствам заказа 1С-Битрикс';
$MESS ['FIO'] = 'ф.И.О.';
$MESS ['ZIP'] = 'Индекс';
$MESS ['ADDRESS'] = 'Адрес (строкой)';
$MESS ['PHONE'] = 'Телефон';
$MESS ['EMAIL'] = 'E-mail';
$MESS ['COUNTRY'] = 'Страна';
$MESS ['REGION'] = 'Область / Край';
$MESS ['CITY'] = 'Город';
$MESS ['STREET'] = 'Улица';
$MESS ['BUILDING'] = 'Строение';
$MESS ['FLAT'] = 'Квартира';
$MESS ['INTERCOMCODE'] = 'Домофон';
$MESS ['FLOOR'] = 'Этаж';
$MESS ['BLOCK'] = 'Подъезд';
$MESS ['HOUSE'] = 'Строение / корпус';
$MESS ['ADDRESS_SHORT'] = 'Краткий адрес';
$MESS ['ADDRESS_FULL'] = 'Детальный адрес';

View File

@ -10,3 +10,23 @@ $MESS ['START_1'] = 'Начать выгрузку';
$MESS ['START_2'] = 'Приостановить выгрузку'; $MESS ['START_2'] = 'Приостановить выгрузку';
$MESS ['START_3'] = 'Возобновить выгрузку'; $MESS ['START_3'] = 'Возобновить выгрузку';
$MESS ['MOD_NEXT_STEP'] = 'Следующий шаг'; $MESS ['MOD_NEXT_STEP'] = 'Следующий шаг';
$MESS ['MOD_PREV_STEP'] = 'Предыдущий шаг';
$MESS ['ORDER_PROPS'] = 'Настройки соответствия полей заказа IntaroCRM свойствам заказа 1С-Битрикс';
$MESS ['FIO'] = 'ф.И.О.';
$MESS ['ZIP'] = 'Индекс';
$MESS ['ADDRESS'] = 'Адрес (строкой)';
$MESS ['PHONE'] = 'Телефон';
$MESS ['EMAIL'] = 'E-mail';
$MESS ['COUNTRY'] = 'Страна';
$MESS ['REGION'] = 'Область / Край';
$MESS ['CITY'] = 'Город';
$MESS ['STREET'] = 'Улица';
$MESS ['BUILDING'] = 'Строение';
$MESS ['FLAT'] = 'Квартира';
$MESS ['INTERCOMCODE'] = 'Домофон';
$MESS ['FLOOR'] = 'Этаж';
$MESS ['BLOCK'] = 'Подъезд';
$MESS ['HOUSE'] = 'Строение / корпус';
$MESS ['ADDRESS_SHORT'] = 'Краткий адрес';
$MESS ['ADDRESS_FULL'] = 'Детальный адрес';

32
intaro.intarocrm/lang/ru/install/step4.php Executable file → Normal file
View File

@ -1,24 +1,12 @@
<?php <?php
$MESS ['STEP_NAME'] = 'Шаг 4'; $MESS ['STEP_NAME'] = 'Шаг 4';
$MESS ['MOD_NEXT_STEP'] = 'Завершить установку'; $MESS ['MESS_1'] = 'На данном шаге вы можете выгрузить ранее оформленные заказы в IntaroCRM. Для запуска выгрузки нажмите кнопку «Начать выгрузку».';
$MESS ['MOD_PREV_STEP'] = 'Предыдущий шаг'; $MESS ['MESS_2'] = 'Экспорт...';
$MESS ['DELIVERY_TYPES_LIST'] = 'Способы доставки'; $MESS ['MESS_3'] = 'Экспорт заказов успешно завершён.';
$MESS ['PAYMENT_TYPES_LIST'] = 'Способы оплаты'; $MESS ['MESS_4'] = 'Экспорт заказов приостановлен.';
$MESS ['PAYMENT_STATUS_LIST'] = 'Статусы'; $MESS ['MESS_5'] = 'Произошла ошибка сервера, обратитесь в Интаро Софт.';
$MESS ['ORDER_TYPES_LIST'] = 'Типы заказа'; $MESS ['STOP'] = 'Приостановить выгрузку';
$MESS ['PAYMENT_LIST'] = 'Оплата'; $MESS ['START_1'] = 'Начать выгрузку';
$MESS ['PAYMENT_Y'] = 'Оплачен'; $MESS ['START_2'] = 'Приостановить выгрузку';
$MESS ['PAYMENT_N'] = 'Не оплачен'; $MESS ['START_3'] = 'Возобновить выгрузку';
$MESS ['CANCELED'] = 'Флаг «Отменен»'; $MESS ['MOD_NEXT_STEP'] = 'Следующий шаг';
$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

@ -1,18 +1,24 @@
<?php <?php
$MESS ['INTAROCRM_INFO'] = ' $MESS ['STEP_NAME'] = 'Шаг 5';
<h2>Дальнейшие действия<h2> $MESS ['MOD_NEXT_STEP'] = 'Завершить установку';
<p> $MESS ['MOD_PREV_STEP'] = 'Предыдущий шаг';
Если вы произвели выгрузку заказов на шаге 3, то эти заказы уже доступны в вашей CRM и $MESS ['DELIVERY_TYPES_LIST'] = 'Способы доставки';
через некоторое время по этим заказам будет подготовлены аналитические отчеты в Панели KPI. $MESS ['PAYMENT_TYPES_LIST'] = 'Способы оплаты';
</p> $MESS ['PAYMENT_STATUS_LIST'] = 'Статусы';
<p> $MESS ['ORDER_TYPES_LIST'] = 'Типы заказа';
Новые заказы будут отправляться агентом <span style="font-family: Courier New;">ICrmOrderActions::uploadOrdersAgent();</span> $MESS ['PAYMENT_LIST'] = 'Оплата';
в IntaroCRM каждые 10 минут (интервал можно изменить в разделе <a href="/bitrix/admin/agent_list.php">Агенты</a>). $MESS ['PAYMENT_Y'] = 'Оплачен';
</p> $MESS ['PAYMENT_N'] = 'Не оплачен';
<p> $MESS ['CANCELED'] = 'Флаг «Отменен»';
Если вы выбрали опцию «Выгрузить каталог сейчас» на шаге 4, то ваш каталог уже загружается в IntaroCRM. $MESS ['INFO_1'] = ' Задайте соответствие между справочниками 1C-Битрикс и справочниками IntaroCRM.';
Загрузка длится, как правило, не более 10 минут. Если вы не выбирали эту опцию, то генерацию файла с каталогом $MESS ['LOAD_PERIOD'] = 'Выгружать каталог периодически';
можно произвести экспортом «IntaroCRM» в разделе Магазин > Настройки > <a href="/bitrix/admin/cat_export_setup.php">Экспорт данных</a>. $MESS ['NOT_LOADING'] = 'Нет';
IntaroCRM проверяет и загружает данный файл с каталогом каждые 3 часа. $MESS ['CRON_LOADING'] = 'С помощью CRON каждые 24 часа';
</p> $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>
';

View File

@ -26,37 +26,77 @@ if($_GET['ok'] && $_GET['ok'] == 'Y') echo CAdminMessage::ShowNote(GetMessage('I
$arResult = array(); $arResult = array();
$arResult['orderProps'][0]['NAME'] = GetMessage('FIO'); $arResult['orderProps'] = array(
$arResult['orderProps'][0]['ID'] = 'fio'; array(
$arResult['orderProps'][1]['NAME'] = GetMessage('ZIP'); 'NAME' => GetMessage('FIO'),
$arResult['orderProps'][1]['ID'] = 'index'; 'ID' => 'fio'
$arResult['orderProps'][2]['NAME'] = GetMessage('PHONE'); ),
$arResult['orderProps'][2]['ID'] = 'phone'; array(
$arResult['orderProps'][3]['NAME'] = GetMessage('EMAIL'); 'NAME' => GetMessage('ZIP'),
$arResult['orderProps'][3]['ID'] = 'email'; 'ID' => 'index'
// address ),
$arResult['orderProps'][4]['NAME'] = GetMessage('ADDRESS'); array(
$arResult['orderProps'][4]['ID'] = 'text'; 'NAME' => GetMessage('PHONE'),
//$arResult['orderProps'][5]['NAME'] = GetMessage('COUNTRY'); 'ID' => 'phone'
//$arResult['orderProps'][5]['ID'] = 'country'; ),
//$arResult['orderProps'][6]['NAME'] = GetMessage('REGION'); array(
//$arResult['orderProps'][6]['ID'] = 'region'; 'NAME' => GetMessage('EMAIL'),
//$arResult['orderProps'][7]['NAME'] = GetMessage('CITY'); 'ID' => 'email'
//$arResult['orderProps'][7]['ID'] = 'city'; ),
$arResult['orderProps'][8]['NAME'] = GetMessage('STREET'); array(
$arResult['orderProps'][8]['ID'] = 'street'; 'NAME' => GetMessage('ZIP'),
$arResult['orderProps'][9]['NAME'] = GetMessage('BUILDING'); 'ID' => 'index'
$arResult['orderProps'][9]['ID'] = 'building'; ),
$arResult['orderProps'][10]['NAME'] = GetMessage('FLAT'); array(
$arResult['orderProps'][10]['ID'] = 'flat'; 'NAME' => GetMessage('ADDRESS'),
$arResult['orderProps'][11]['NAME'] = GetMessage('INTERCOMCODE'); 'ID' => 'text'
$arResult['orderProps'][11]['ID'] = 'intercomecode'; ),
$arResult['orderProps'][12]['NAME'] = GetMessage('FLOOR'); // address
$arResult['orderProps'][12]['ID'] = 'floor'; /* array(
$arResult['orderProps'][13]['NAME'] = GetMessage('BLOCK'); 'NAME' => GetMessage('COUNTRY'),
$arResult['orderProps'][13]['ID'] = 'block'; 'ID' => 'country'
$arResult['orderProps'][14]['NAME'] = GetMessage('HOUSE'); ),
$arResult['orderProps'][14]['ID'] = 'house'; array(
'NAME' => GetMessage('REGION'),
'ID' => 'region'
),
array(
'NAME' => GetMessage('CITY'),
'ID' => 'city'
),*/
array(
'NAME' => GetMessage('ZIP'),
'ID' => 'index'
),
array(
'NAME' => GetMessage('STREET'),
'ID' => 'street'
),
array(
'NAME' => GetMessage('BUILDING'),
'ID' => 'building'
),
array(
'NAME' => GetMessage('FLAT'),
'ID' => 'flat'
),
array(
'NAME' => GetMessage('INTERCOMECODE'),
'ID' => 'intercomecode'
),
array(
'NAME' => GetMessage('FLOOR'),
'ID' => 'floor'
),
array(
'NAME' => GetMessage('BLOCK'),
'ID' => 'block'
),
array(
'NAME' => GetMessage('HOUSE'),
'ID' => 'house'
)
);
//update connection settings //update connection settings
if (isset($_POST['Update']) && ($_POST['Update'] == 'Y')) { if (isset($_POST['Update']) && ($_POST['Update'] == 'Y')) {
@ -175,7 +215,7 @@ if (isset($_POST['Update']) && ($_POST['Update'] == 'Y')) {
$propsCount = 0; $propsCount = 0;
$orderPropsArr = array(); $orderPropsArr = array();
foreach($arResult['orderProps'] as $orderProp) { foreach($arResult['orderProps'] as $orderProp) {
if((!(int) htmlspecialchars(trim($_POST['address-detail']))) && $propsCount > 4) if((!(int) htmlspecialchars(trim($_POST['address-detail']))) && $propsCount > 5)
break; break;
$orderPropsArr[$orderProp['ID']] = htmlspecialchars(trim($_POST['order-prop-' . $orderProp['ID']])); $orderPropsArr[$orderProp['ID']] = htmlspecialchars(trim($_POST['order-prop-' . $orderProp['ID']]));
$propsCount++; $propsCount++;
@ -501,7 +541,7 @@ if (isset($_POST['Update']) && ($_POST['Update'] == 'Y')) {
</td> </td>
</tr> </tr>
<?php endif; ?> <?php endif; ?>
<tr <?php if ($countProps > 4) echo 'class="address-detail"'; if(($countProps > 4) && (count($optionsOrderProps) < 6)) echo 'style="display:none;"';?>> <tr <?php if ($countProps > 5) echo 'class="address-detail"'; if(($countProps > 5) && (count($optionsOrderProps) < 6)) echo 'style="display:none;"';?>>
<td width="50%" class="adm-detail-content-cell-l" name="<?php echo $orderProp['ID']; ?>"> <td width="50%" class="adm-detail-content-cell-l" name="<?php echo $orderProp['ID']; ?>">
<?php echo $orderProp['NAME']; ?> <?php echo $orderProp['NAME']; ?>
</td> </td>