2013-07-05 18:19:42 +04:00
|
|
|
<?php
|
2013-07-23 17:02:37 +04:00
|
|
|
if (!check_bitrix_sessid())
|
|
|
|
return;
|
|
|
|
IncludeModuleLangFile(__FILE__);
|
|
|
|
|
2013-09-05 12:11:29 +04:00
|
|
|
$defaultOrderProps = array(
|
2013-09-05 13:38:58 +04:00
|
|
|
1 => array(
|
|
|
|
'fio' => 'FIO',
|
|
|
|
'index' => 'ZIP',
|
|
|
|
'text' => 'ADDRESS',
|
|
|
|
'phone' => 'PHONE',
|
|
|
|
'email' => 'EMAIL'
|
|
|
|
),
|
|
|
|
2 => array(
|
|
|
|
'fio' => 'FIO',
|
|
|
|
'index' => 'ZIP',
|
|
|
|
'text' => 'ADDRESS',
|
|
|
|
'phone' => 'PHONE',
|
|
|
|
'email' => 'EMAIL'
|
|
|
|
)
|
2013-09-05 12:11:29 +04:00
|
|
|
);
|
|
|
|
?>
|
2013-07-23 17:02:37 +04:00
|
|
|
<script type="text/javascript" src="/bitrix/js/main/jquery/jquery-1.7.min.js"></script>
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(document).ready(function() {
|
2013-09-05 13:38:58 +04:00
|
|
|
$('input.addr').change(function(){
|
|
|
|
splitName = $(this).attr('name').split('-');
|
|
|
|
orderType = splitName[2];
|
|
|
|
|
2013-09-05 12:11:29 +04:00
|
|
|
if(parseInt($(this).val()) === 1)
|
2013-09-05 13:38:58 +04:00
|
|
|
$('tr.address-detail-' + orderType).show('slow');
|
2013-09-05 12:11:29 +04:00
|
|
|
else if(parseInt($(this).val()) === 0)
|
2013-09-05 13:38:58 +04:00
|
|
|
$('tr.address-detail-' + orderType).hide('slow');
|
2015-03-03 16:37:34 +03:00
|
|
|
});
|
|
|
|
|
|
|
|
$('tr.contragent-type select').change(function(){
|
|
|
|
splitName = $(this).attr('name').split('-');
|
|
|
|
contragentType = $(this).val();
|
|
|
|
orderType = splitName[2];
|
|
|
|
|
|
|
|
$('tr.legal-detail-' + orderType).hide();
|
|
|
|
$('.legal-detail-title-' + orderType).hide();
|
|
|
|
|
|
|
|
$('tr.legal-detail-' + orderType).each(function(){
|
|
|
|
if($(this).hasClass(contragentType)){
|
|
|
|
$(this).show();
|
|
|
|
$('.legal-detail-title-' + orderType).show();
|
|
|
|
}
|
2013-07-23 17:02:37 +04:00
|
|
|
});
|
2015-03-03 16:37:34 +03:00
|
|
|
});
|
2013-09-05 12:11:29 +04:00
|
|
|
});
|
2013-07-23 17:02:37 +04:00
|
|
|
</script>
|
|
|
|
|
2013-09-05 12:11:29 +04:00
|
|
|
<div class="adm-detail-content-item-block">
|
2013-07-23 17:02:37 +04:00
|
|
|
<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="install" value="Y">
|
|
|
|
<input type="hidden" name="step" value="4">
|
|
|
|
<input type="hidden" name="continue" value="3">
|
2013-09-05 12:11:29 +04:00
|
|
|
|
|
|
|
<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>
|
|
|
|
<tr class="heading">
|
|
|
|
<td colspan="2"><b><?php echo GetMessage('ORDER_PROPS'); ?></b></td>
|
|
|
|
</tr>
|
2013-09-05 13:38:58 +04:00
|
|
|
<tr align="center">
|
|
|
|
<td colspan="2"><b><?php echo GetMessage('INFO_2'); ?></b></td>
|
|
|
|
</tr>
|
|
|
|
<?php foreach($arResult['bitrixOrderTypesList'] as $bitrixOrderType): ?>
|
|
|
|
<tr class="heading">
|
2013-09-19 00:18:32 +04:00
|
|
|
<td colspan="2"><b><?php echo GetMessage('ORDER_TYPE_INFO') . ' ' . $bitrixOrderType['NAME']; ?></b></td>
|
2013-09-05 13:38:58 +04:00
|
|
|
</tr>
|
2015-03-03 16:37:34 +03:00
|
|
|
<tr class="contragent-type">
|
|
|
|
<td width="50%" class="adm-detail-content-cell-l">
|
|
|
|
<?php echo GetMessage('CONTRAGENT_TYPE'); ?>
|
|
|
|
</td>
|
|
|
|
<td width="50%" class="adm-detail-content-cell-r">
|
|
|
|
<select name="contragent-type-<?php echo $bitrixOrderType['ID']; ?>" class="typeselect">
|
|
|
|
<?php foreach ($arResult['contragentType'] as $contragentType): ?>
|
|
|
|
<option value="<?php echo $contragentType["ID"]; ?>" <?php if ($optionsContragentType[$bitrixOrderType['ID']] == $contragentType['ID']) echo 'selected'; ?>>
|
|
|
|
<?php echo $contragentType["NAME"]; ?>
|
|
|
|
</option>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
</select>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
2013-09-05 13:38:58 +04:00
|
|
|
<?php $countProps = 0; foreach($arResult['orderProps'] as $orderProp): ?>
|
|
|
|
<?php if($orderProp['ID'] == 'text'): ?>
|
2013-09-05 12:11:29 +04:00
|
|
|
<tr class="heading">
|
2013-09-19 00:18:32 +04:00
|
|
|
<td colspan="2" style="background-color: transparent;">
|
2013-09-05 12:11:29 +04:00
|
|
|
<b>
|
2013-11-13 23:18:47 +04:00
|
|
|
<label><input class="addr" type="radio" name="address-detail-<?php echo $bitrixOrderType['ID']; ?>" value="0" <?php if(count($defaultOrderProps[$bitrixOrderType['ID']]) < 6) echo "checked"; ?>><?php echo GetMessage('ADDRESS_SHORT'); ?></label>
|
2013-09-05 13:38:58 +04:00
|
|
|
<label><input class="addr" type="radio" name="address-detail-<?php echo $bitrixOrderType['ID']; ?>" value="1" <?php if(count($defaultOrderProps[$bitrixOrderType['ID']]) > 5) echo "checked"; ?>><?php echo GetMessage('ADDRESS_FULL'); ?></label>
|
2013-09-05 12:11:29 +04:00
|
|
|
</b>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<?php endif; ?>
|
2015-03-03 16:37:34 +03:00
|
|
|
|
2014-09-18 18:08:19 +04:00
|
|
|
<tr <?php if ($countProps > 3) echo 'class="address-detail-' . $bitrixOrderType['ID'] . '"'; if(($countProps > 3) && (count($defaultOrderProps[$bitrixOrderType['ID']]) < 6)) echo 'style="display:none;"';?>>
|
2013-09-05 12:11:29 +04:00
|
|
|
<td width="50%" class="adm-detail-content-cell-l" name="<?php echo $orderProp['ID']; ?>">
|
2013-11-13 23:18:47 +04:00
|
|
|
<?php echo $orderProp['NAME']; ?>
|
2013-09-05 12:11:29 +04:00
|
|
|
</td>
|
2015-03-03 16:37:34 +03:00
|
|
|
<td width="50%" class="adm-detail-content-cell-r">
|
|
|
|
<select name="order-prop-<?php echo $orderProp['ID'] . '-' . $bitrixOrderType['ID']; ?>" class="typeselect">
|
|
|
|
<option value=""></option>
|
|
|
|
<?php foreach ($arResult['arProp'][$bitrixOrderType['ID']] as $arProp): ?>
|
|
|
|
<option value="<?php echo $arProp['CODE']; ?>" <?php if ($defaultOrderProps[$bitrixOrderType['ID']][$orderProp['ID']] == $arProp['CODE']) echo 'selected'; ?>>
|
|
|
|
<?php echo $arProp['NAME']; ?>
|
|
|
|
</option>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
</select>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<?php $countProps++; endforeach; ?>
|
|
|
|
|
|
|
|
<?if (isset($arResult['customFields']) && count($arResult['customFields']) > 0):?>
|
|
|
|
<tr class="heading custom-detail-title">
|
|
|
|
<td colspan="2" style="background-color: transparent;">
|
|
|
|
<b>
|
|
|
|
<?=GetMessage("ORDER_CUSTOM"); ?>
|
|
|
|
</b>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<?foreach($arResult['customFields'] as $customFields):?>
|
|
|
|
<tr class="custom-detail-<?=$customFields['ID'];?>">
|
|
|
|
<td width="50%" class="" name="">
|
|
|
|
<?=$customFields['NAME']; ?>
|
|
|
|
</td>
|
|
|
|
<td width="50%" class="">
|
|
|
|
<select name="custom-fields-<?=$customFields['ID'] . '-' . $bitrixOrderType['ID']; ?>" class="typeselect">
|
|
|
|
<option value=""></option>
|
|
|
|
<?foreach ($arResult['arProp'][$bitrixOrderType['ID']] as $arProp):?>
|
|
|
|
<option value="<?=$arProp['CODE']?>" <?php if ($optionsCustomFields[$bitrixOrderType['ID']][$customFields['ID']] == $arProp['CODE']) echo 'selected'; ?>>
|
|
|
|
<?=$arProp['NAME']; ?>
|
|
|
|
</option>
|
|
|
|
<?endforeach;?>
|
|
|
|
</select>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<?endforeach;?>
|
|
|
|
<?endif;?>
|
|
|
|
|
|
|
|
<tr class="heading legal-detail-title-<?php echo $bitrixOrderType['ID'];?>" style="display:none">
|
|
|
|
<td colspan="2" style="background-color: transparent;">
|
|
|
|
<b>
|
|
|
|
<?php echo GetMessage("ORDER_LEGAL_INFO"); ?>
|
|
|
|
</b>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<?php foreach($arResult['legalDetails'] as $legalDetails): ?>
|
|
|
|
<tr class="legal-detail-<?php echo $bitrixOrderType['ID'];?> <?php foreach($legalDetails['GROUP'] as $gr) echo $gr . ' ';?>" style="display:none">
|
|
|
|
<td width="50%" class="adm-detail-content-cell-l">
|
|
|
|
<?php echo $legalDetails['NAME']; ?>
|
|
|
|
</td>
|
|
|
|
<td width="50%" class="adm-detail-content-cell-r">
|
|
|
|
<select name="legal-detail-<?php echo $legalDetails['ID'] . '-' . $bitrixOrderType['ID']; ?>" class="typeselect">
|
|
|
|
<option value=""></option>
|
|
|
|
<?php foreach ($arResult['arProp'][$bitrixOrderType['ID']] as $arProp): ?>
|
|
|
|
<option value="<?php echo $arProp['CODE']; ?>" <?php if ($optionsLegalDetails[$bitrixOrderType['ID']][$legalDetails['ID']] == $arProp['CODE']) echo 'selected'; ?>>
|
|
|
|
<?php echo $arProp['NAME']; ?>
|
|
|
|
</option>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
</select>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
|
|
|
<?php endforeach; ?>
|
2013-09-05 12:11:29 +04:00
|
|
|
</tbody>
|
|
|
|
</table>
|
2013-07-23 17:02:37 +04:00
|
|
|
<br />
|
|
|
|
<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; visible: none;">
|
2014-01-23 17:50:58 +04:00
|
|
|
<input type="submit" name="back" value="<?php echo GetMessage("MOD_PREV_STEP"); ?>" class="adm-btn-save">
|
2013-07-23 17:02:37 +04:00
|
|
|
</div>
|
|
|
|
</div>
|
2013-09-05 12:11:29 +04:00
|
|
|
</form>
|
|
|
|
</div>
|