1
0
mirror of synced 2024-11-22 21:36:10 +03:00
bitrix-module/intaro.intarocrm/options.php

527 lines
22 KiB
PHP
Raw Normal View History

2013-07-05 18:19:42 +04:00
<?php
IncludeModuleLangFile(__FILE__);
2013-07-18 14:32:10 +04:00
$mid = 'intaro.intarocrm';
2013-07-05 18:19:42 +04:00
$uri = $APPLICATION->GetCurPage() . '?mid=' . htmlspecialchars($mid) . '&lang=' . LANGUAGE_ID;
$CRM_API_HOST_OPTION = 'api_host';
$CRM_API_KEY_OPTION = 'api_key';
$CRM_ORDER_TYPES_ARR = 'order_types_arr';
$CRM_DELIVERY_TYPES_ARR = 'deliv_types_arr';
$CRM_PAYMENT_TYPES = 'pay_types_arr';
$CRM_PAYMENT_STATUSES = 'pay_statuses_arr';
$CRM_PAYMENT = 'payment_arr'; //order payment Y/N
2013-07-09 19:03:56 +04:00
$CRM_ORDER_LAST_ID = 'order_last_id';
2013-09-02 15:48:12 +04:00
$CRM_ORDER_SITES = 'sites_ids';
2013-09-03 18:00:12 +04:00
$CRM_ORDER_PROPS = 'order_props';
2013-07-24 14:44:48 +04:00
if(!CModule::IncludeModule('intaro.intarocrm')
|| !CModule::IncludeModule('sale'))
return;
2013-07-05 18:19:42 +04:00
$_GET['errc'] = htmlspecialchars(trim($_GET['errc']));
$_GET['ok'] = htmlspecialchars(trim($_GET['ok']));
if($_GET['errc']) echo CAdminMessage::ShowMessage(GetMessage($_GET['errc']));
if($_GET['ok'] && $_GET['ok'] == 'Y') echo CAdminMessage::ShowNote(GetMessage('ICRM_OPTIONS_OK'));
$arResult = array();
2013-09-03 18:23:27 +04:00
2013-09-03 18:00:12 +04:00
$arResult['orderProps'][0]['NAME'] = GetMessage('FIO');
$arResult['orderProps'][0]['ID'] = 'fio';
$arResult['orderProps'][1]['NAME'] = GetMessage('ZIP');
$arResult['orderProps'][1]['ID'] = 'index';
$arResult['orderProps'][2]['NAME'] = GetMessage('PHONE');
$arResult['orderProps'][2]['ID'] = 'phone';
$arResult['orderProps'][3]['NAME'] = GetMessage('EMAIL');
$arResult['orderProps'][3]['ID'] = 'email';
// address
$arResult['orderProps'][4]['NAME'] = GetMessage('ADDRESS');
$arResult['orderProps'][4]['ID'] = 'text';
2013-09-03 18:23:27 +04:00
//$arResult['orderProps'][5]['NAME'] = GetMessage('COUNTRY');
//$arResult['orderProps'][5]['ID'] = 'country';
//$arResult['orderProps'][6]['NAME'] = GetMessage('REGION');
//$arResult['orderProps'][6]['ID'] = 'region';
//$arResult['orderProps'][7]['NAME'] = GetMessage('CITY');
//$arResult['orderProps'][7]['ID'] = 'city';
2013-09-03 18:00:12 +04:00
$arResult['orderProps'][8]['NAME'] = GetMessage('STREET');
$arResult['orderProps'][8]['ID'] = 'street';
$arResult['orderProps'][9]['NAME'] = GetMessage('BUILDING');
$arResult['orderProps'][9]['ID'] = 'building';
$arResult['orderProps'][10]['NAME'] = GetMessage('FLAT');
$arResult['orderProps'][10]['ID'] = 'flat';
$arResult['orderProps'][11]['NAME'] = GetMessage('INTERCOMCODE');
$arResult['orderProps'][11]['ID'] = 'intercomecode';
$arResult['orderProps'][12]['NAME'] = GetMessage('FLOOR');
$arResult['orderProps'][12]['ID'] = 'floor';
$arResult['orderProps'][13]['NAME'] = GetMessage('BLOCK');
$arResult['orderProps'][13]['ID'] = 'block';
$arResult['orderProps'][14]['NAME'] = GetMessage('HOUSE');
$arResult['orderProps'][14]['ID'] = 'house';
2013-07-05 18:19:42 +04:00
//update connection settings
2013-07-24 14:44:48 +04:00
if (isset($_POST['Update']) && ($_POST['Update'] == 'Y')) {
2013-07-05 18:19:42 +04:00
$api_host = htmlspecialchars(trim($_POST['api_host']));
$api_key = htmlspecialchars(trim($_POST['api_key']));
2013-09-02 15:48:12 +04:00
// if empty so select all? or exception --not obligatory
$orderSites = array();
foreach ($_POST[$CRM_ORDER_SITES] as $site) {
$orderSites[] = htmlspecialchars(trim($site));
}
2013-07-05 18:19:42 +04:00
if($api_host && $api_key) {
$api = new IntaroCrm\RestApi($api_host, $api_key);
2013-07-05 18:19:42 +04:00
$api->paymentStatusesList();
//check connection & apiKey valid
if((int) $api->getStatusCode() != 200) {
$uri .= '&errc=ERR_' . $api->getStatusCode();
LocalRedirect($uri);
} else {
COption::SetOptionString($mid, 'api_host', $api_host);
COption::SetOptionString($mid, 'api_key', $api_key);
}
}
2013-07-24 14:44:48 +04:00
//bitrix orderTypesList -- personTypes
2013-07-05 21:15:23 +04:00
$dbOrderTypesList = CSalePersonType::GetList(
array(
"SORT" => "ASC",
"NAME" => "ASC"
),
array(
"ACTIVE" => "Y",
),
false,
false,
array()
);
//form order types ids arr
$orderTypesArr = array();
2013-07-05 21:15:23 +04:00
if ($arOrderTypesList = $dbOrderTypesList->Fetch()) {
do {
$orderTypesArr[$arOrderTypesList['ID']] = $_POST['order-type-' . $arOrderTypesList['ID']];
} while ($arOrderTypesList = $dbOrderTypesList->Fetch());
}
2013-07-05 18:19:42 +04:00
//bitrix deliveryTypesList
$dbDeliveryTypesList = CSaleDelivery::GetList(
array(
"SORT" => "ASC",
"NAME" => "ASC"
),
array(
"ACTIVE" => "Y",
),
false,
false,
array()
);
2013-07-05 18:19:42 +04:00
//form delivery types ids arr
2013-07-05 21:15:23 +04:00
$deliveryTypesArr = array();
if ($arDeliveryTypesList = $dbDeliveryTypesList->Fetch()) {
do {
$deliveryTypesArr[$arDeliveryTypesList['ID']] = htmlspecialchars(trim($_POST['delivery-type-' . $arDeliveryTypesList['ID']]));
} while ($arDeliveryTypesList = $dbDeliveryTypesList->Fetch());
}
2013-07-05 18:19:42 +04:00
//bitrix paymentTypesList
$dbPaymentTypesList = CSalePaySystem::GetList(
array(
"SORT" => "ASC",
"NAME" => "ASC"
),
array(
"ACTIVE" => "Y"
)
);
2013-07-05 18:19:42 +04:00
//form payment types ids arr
$paymentTypesArr = array();
if ($arPaymentTypesList = $dbPaymentTypesList->Fetch()) {
do {
$paymentTypesArr[$arPaymentTypesList['ID']] = htmlspecialchars(trim($_POST['payment-type-' . $arPaymentTypesList['ID']]));
} while ($arPaymentTypesList = $dbPaymentTypesList->Fetch());
}
2013-07-05 18:19:42 +04:00
//bitrix paymentStatusesList
$dbPaymentStatusesList = CSaleStatus::GetList(
array(
"SORT" => "ASC",
"NAME" => "ASC"
),
array(
"LID" => "ru", //ru
"ACTIVE" => "Y"
2013-07-05 18:19:42 +04:00
)
);
2013-07-05 18:19:42 +04:00
//form payment statuses ids arr
$paymentStatusesArr['Y'] = htmlspecialchars(trim($_POST['payment-status-Y']));
if ($arPaymentStatusesList = $dbPaymentStatusesList->Fetch()) {
do {
$paymentStatusesArr[$arPaymentStatusesList['ID']] = htmlspecialchars(trim($_POST['payment-status-' . $arPaymentStatusesList['ID']]));
} while ($arPaymentStatusesList = $dbPaymentStatusesList->Fetch());
}
//form payment ids arr
$paymentArr = array();
$paymentArr['Y'] = htmlspecialchars(trim($_POST['payment-Y']));
$paymentArr['N'] = htmlspecialchars(trim($_POST['payment-N']));
2013-09-03 18:00:12 +04:00
$propsCount = 0;
$orderPropsArr = array();
foreach($arResult['orderProps'] as $orderProp) {
if((!(int) htmlspecialchars(trim($_POST['address-detail']))) && $propsCount > 4)
break;
$orderPropsArr[$orderProp['ID']] = htmlspecialchars(trim($_POST['order-prop-' . $orderProp['ID']]));
$propsCount++;
}
COption::SetOptionString($mid, $CRM_ORDER_TYPES_ARR, serialize($orderTypesArr));
COption::SetOptionString($mid, $CRM_DELIVERY_TYPES_ARR, serialize($deliveryTypesArr));
COption::SetOptionString($mid, $CRM_PAYMENT_TYPES, serialize($paymentTypesArr));
COption::SetOptionString($mid, $CRM_PAYMENT_STATUSES, serialize($paymentStatusesArr));
COption::SetOptionString($mid, $CRM_PAYMENT, serialize($paymentArr));
2013-09-02 15:48:12 +04:00
COption::SetOptionString($mid, $CRM_ORDER_SITES, serialize($orderSites));
2013-09-03 18:00:12 +04:00
COption::SetOptionString($mid, $CRM_ORDER_PROPS, serialize($orderPropsArr));
$uri .= '&ok=Y';
LocalRedirect($uri);
2013-07-05 18:19:42 +04:00
} else {
2013-07-09 19:03:56 +04:00
$api_host = COption::GetOptionString($mid, $CRM_API_HOST_OPTION, 0);
$api_key = COption::GetOptionString($mid, $CRM_API_KEY_OPTION, 0);
2013-07-05 18:19:42 +04:00
$api = new IntaroCrm\RestApi($api_host, $api_key);
2013-09-02 15:48:12 +04:00
$arResult['arSites'] = array();
$rsSites = CSite::GetList($by, $sort, array());
while ($ar = $rsSites->Fetch())
$arResult['arSites'][] = $ar;
2013-07-05 18:19:42 +04:00
//prepare crm lists
2013-07-05 21:15:23 +04:00
$arResult['orderTypesList'] = $api->orderTypesList();
2013-07-05 18:19:42 +04:00
$arResult['deliveryTypesList'] = $api->deliveryTypesList();
$arResult['paymentTypesList'] = $api->paymentTypesList();
$arResult['paymentStatusesList'] = $api->paymentStatusesList(); // --statuses
2013-07-09 19:03:56 +04:00
$arResult['paymentList'] = $api->orderStatusesList();
$arResult['paymentGroupList'] = $api->orderStatusGroupsList(); // -- statuses groups
2013-07-24 14:44:48 +04:00
//check connection & apiKey valid
if ((int) $api->getStatusCode() != 200)
echo CAdminMessage::ShowMessage(GetMessage('ERR_' . $api->getStatusCode()));
2013-07-05 18:19:42 +04:00
2013-07-05 21:15:23 +04:00
//bitrix orderTypesList -- personTypes
$dbOrderTypesList = CSalePersonType::GetList(
array(
"SORT" => "ASC",
"NAME" => "ASC"
),
array(
"ACTIVE" => "Y",
),
false,
false,
array()
);
if ($arOrderTypesList = $dbOrderTypesList->Fetch()) {
do {
$arResult['bitrixOrderTypesList'][] = $arOrderTypesList;
} while ($arOrderTypesList = $dbOrderTypesList->Fetch());
}
2013-07-05 18:19:42 +04:00
//bitrix deliveryTypesList
$dbDeliveryTypesList = CSaleDelivery::GetList(
array(
"SORT" => "ASC",
"NAME" => "ASC"
),
array(
"ACTIVE" => "Y",
),
false,
false,
array()
);
if ($arDeliveryTypesList = $dbDeliveryTypesList->Fetch()) {
do {
$arResult['bitrixDeliveryTypesList'][] = $arDeliveryTypesList;
} while ($arDeliveryTypesList = $dbDeliveryTypesList->Fetch());
}
//bitrix paymentTypesList
$dbPaymentTypesList = CSalePaySystem::GetList(
array(
"SORT" => "ASC",
"NAME" => "ASC"
),
array(
"ACTIVE" => "Y"
)
);
if ($arPaymentTypesList = $dbPaymentTypesList->Fetch()) {
do {
$arResult['bitrixPaymentTypesList'][] = $arPaymentTypesList;
} while ($arPaymentTypesList = $dbPaymentTypesList->Fetch());
}
//bitrix paymentStatusesList
$dbPaymentStatusesList = CSaleStatus::GetList(
array(
"SORT" => "ASC",
"NAME" => "ASC"
),
array(
"LID" => "ru", //ru
"ACTIVE" => "Y"
)
);
if ($arPaymentStatusesList = $dbPaymentStatusesList->Fetch()) {
do {
$arResult['bitrixPaymentStatusesList'][] = $arPaymentStatusesList;
} while ($arPaymentStatusesList = $dbPaymentStatusesList->Fetch());
}
$arResult['bitrixPaymentStatusesList'][] = array(
'ID' => 'Y',
2013-07-24 14:44:48 +04:00
'NAME' => GetMessage('CANCELED')
);
//bitrix pyament Y/N
$arResult['bitrixPaymentList'][0]['NAME'] = GetMessage('PAYMENT_Y');
$arResult['bitrixPaymentList'][0]['ID'] = 'Y';
$arResult['bitrixPaymentList'][1]['NAME'] = GetMessage('PAYMENT_N');
$arResult['bitrixPaymentList'][1]['ID'] = 'N';
2013-09-03 18:00:12 +04:00
$dbProp = CSaleOrderProps::GetList(array(), array());
while ($arProp = $dbProp->GetNext()) {
$arResult['arProp'][] = $arProp;
}
2013-07-05 18:19:42 +04:00
//saved cat params
$optionsOrderTypes = unserialize(COption::GetOptionString($mid, $CRM_ORDER_TYPES_ARR, 0));
$optionsDelivTypes = unserialize(COption::GetOptionString($mid, $CRM_DELIVERY_TYPES_ARR, 0));
$optionsPayTypes = unserialize(COption::GetOptionString($mid, $CRM_PAYMENT_TYPES, 0));
$optionsPayStatuses = unserialize(COption::GetOptionString($mid, $CRM_PAYMENT_STATUSES, 0)); // --statuses
$optionsPayment = unserialize(COption::GetOptionString($mid, $CRM_PAYMENT, 0));
2013-09-02 15:48:12 +04:00
$optionsSites = unserialize(COption::GetOptionString($mid, $CRM_ORDER_SITES, 0));
2013-09-03 18:00:12 +04:00
$optionsOrderProps = unserialize(COption::GetOptionString($mid, $CRM_ORDER_PROPS, 0));
2013-08-06 15:02:11 +04:00
2013-07-05 18:19:42 +04:00
$aTabs = array(
array(
"DIV" => "edit1",
"TAB" => GetMessage('ICRM_OPTIONS_GENERAL_TAB'),
"ICON" => "",
"TITLE" => GetMessage('ICRM_OPTIONS_GENERAL_CAPTION')
),
array(
"DIV" => "edit2",
"TAB" => GetMessage('ICRM_OPTIONS_CATALOG_TAB'),
"ICON" => '',
2013-07-09 19:03:56 +04:00
"TITLE" => GetMessage('ICRM_OPTIONS_CATALOG_CAPTION')
2013-07-05 18:19:42 +04:00
),
2013-09-03 18:00:12 +04:00
array(
"DIV" => "edit3",
"TAB" => GetMessage('ICRM_OPTIONS_ORDER_PROPS_TAB'),
"ICON" => '',
"TITLE" => GetMessage('ICRM_OPTIONS_ORDER_PROPS_CAPTION')
),
2013-07-05 18:19:42 +04:00
);
$tabControl = new CAdminTabControl("tabControl", $aTabs);
$tabControl->Begin();
?>
2013-09-03 18:00:12 +04:00
<?php $APPLICATION->AddHeadString('<script type="text/javascript" src="/bitrix/js/main/jquery/jquery-1.7.min.js"></script>'); ?>
<script type="text/javascript">
$(document).ready(function() {
$('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');
});
});
</script>
2013-07-05 18:19:42 +04:00
<form method="POST" action="<?php echo $uri; ?>" id="FORMACTION">
<?php
echo bitrix_sessid_post();
2013-07-24 14:44:48 +04:00
$tabControl->BeginNextTab();
2013-07-05 18:19:42 +04:00
?>
<input type="hidden" name="tab" value="catalog">
<tr class="heading">
<td colspan="2"><b><?php echo GetMessage('ICRM_CONN_SETTINGS'); ?></b></td>
</tr>
<tr>
<td width="50%" class="adm-detail-content-cell-l"><?php echo GetMessage('ICRM_API_HOST'); ?></td>
<td width="50%" class="adm-detail-content-cell-r"><input type="text" id="api_host" name="api_host" value="<?php echo $api_host; ?>"></td>
</tr>
<tr>
<td width="50%" class="adm-detail-content-cell-l"><?php echo GetMessage('ICRM_API_KEY'); ?></td>
<td width="50%" class="adm-detail-content-cell-r"><input type="text" id="api_key" name="api_key" value="<?php echo $api_key; ?>"></td>
</tr>
2013-09-02 15:48:12 +04:00
<tr>
<td width="50%" class="adm-detail-content-cell-l"><?php echo GetMessage('ICRM_SITES'); ?></td>
<td width="50%" class="adm-detail-content-cell-r">
<select id="sites_ids" name="sites_ids[]" multiple="multiple" size="3">
<?php foreach ($arResult['arSites'] as $site): ?>
<option value="<?php echo $site['LID'] ?>" <?php if(in_array($site['LID'], $optionsSites)) echo 'selected="selected"'; ?>><?php echo $site['NAME'] . ' (' . $site['LID'] . ')' ?></option>
<?php endforeach; ?>
</select>
</td>
</tr>
2013-07-05 18:19:42 +04:00
<?php $tabControl->BeginNextTab(); ?>
<input type="hidden" name="tab" value="catalog">
2013-08-07 14:45:25 +04:00
<tr align="center">
<td colspan="2"><b><?php echo GetMessage('INFO_1'); ?></b></td>
</tr>
2013-07-05 18:19:42 +04:00
<tr class="heading">
<td colspan="2"><b><?php echo GetMessage('DELIVERY_TYPES_LIST'); ?></b></td>
</tr>
<?php foreach($arResult['bitrixDeliveryTypesList'] as $bitrixDeliveryType): ?>
<tr>
<td width="50%" class="adm-detail-content-cell-l" name="<?php echo $bitrixDeliveryType['ID']; ?>">
<?php echo $bitrixDeliveryType['NAME']; ?>
</td>
<td width="50%" class="adm-detail-content-cell-r">
<select name="delivery-type-<?php echo $bitrixDeliveryType['ID']; ?>" class="typeselect">
<option value=""></option>
<?php foreach($arResult['deliveryTypesList'] as $deliveryType): ?>
<option value="<?php echo $deliveryType['code']; ?>" <?php if ($optionsDelivTypes[$bitrixDeliveryType['ID']] == $deliveryType['code']) echo 'selected'; ?>>
<?php echo $APPLICATION->ConvertCharset($deliveryType['name'], 'utf-8', SITE_CHARSET); ?>
</option>
<?php endforeach; ?>
</select>
</td>
</tr>
<?php endforeach; ?>
<tr class="heading">
<td colspan="2"><b><?php echo GetMessage('PAYMENT_TYPES_LIST'); ?></b></td>
</tr>
<?php foreach($arResult['bitrixPaymentTypesList'] as $bitrixPaymentType): ?>
<tr>
<td width="50%" class="adm-detail-content-cell-l" name="<?php echo $bitrixPaymentType['ID']; ?>">
<?php echo $bitrixPaymentType['NAME']; ?>
</td>
<td width="50%" class="adm-detail-content-cell-r">
<select name="payment-type-<?php echo $bitrixPaymentType['ID']; ?>" class="typeselect">
<option value="" selected=""></option>
<?php foreach($arResult['paymentTypesList'] as $paymentType): ?>
<option value="<?php echo $paymentType['code']; ?>" <?php if ($optionsPayTypes[$bitrixPaymentType['ID']] == $paymentType['code']) echo 'selected'; ?>>
<?php echo $APPLICATION->ConvertCharset($paymentType['name'], 'utf-8', SITE_CHARSET); ?>
</option>
<?php endforeach; ?>
</select>
</td>
</tr>
<?php endforeach; ?>
<tr class="heading">
<td colspan="2"><b><?php echo GetMessage('PAYMENT_STATUS_LIST'); ?></b></td>
</tr>
<?php foreach($arResult['bitrixPaymentStatusesList'] as $bitrixPaymentStatus): ?>
<tr>
2013-07-05 18:19:42 +04:00
<td width="50%" class="adm-detail-content-cell-l" name="<?php echo $bitrixPaymentStatus['ID']; ?>">
<?php echo $bitrixPaymentStatus['NAME']; ?>
2013-07-05 18:19:42 +04:00
</td>
<td width="50%" class="adm-detail-content-cell-r">
<select name="payment-status-<?php echo $bitrixPaymentStatus['ID']; ?>" class="typeselect">
<option value=""></option>
<?php foreach($arResult['paymentGroupList'] as $orderStatusGroup): if(!empty($orderStatusGroup['statuses'])) : ?>
<optgroup label="<?php echo $orderStatusGroup['name']; ?>">
<?php foreach($orderStatusGroup['statuses'] as $payment): ?>
<option value="<?php echo $arResult['paymentList'][$payment]['code']; ?>" <?php if ($optionsPayStatuses[$bitrixPaymentStatus['ID']] == $arResult['paymentList'][$payment]['code']) echo 'selected'; ?>>
<?php echo $APPLICATION->ConvertCharset($arResult['paymentList'][$payment]['name'], 'utf-8', SITE_CHARSET); ?>
</option>
<?php endforeach; ?>
</optgroup>
<?php endif; endforeach; ?>
</select>
</td>
</tr>
<?php endforeach; ?>
<tr class="heading">
<td colspan="2"><b><?php echo GetMessage('PAYMENT_LIST'); ?></b></td>
</tr>
<?php foreach($arResult['bitrixPaymentList'] as $bitrixPayment): ?>
<tr>
<td width="50%" class="adm-detail-content-cell-l" name="<?php echo $bitrixPayment['ID']; ?>">
<?php echo $bitrixPayment['NAME']; ?>
</td>
<td width="50%" class="adm-detail-content-cell-r">
<select name="payment-<?php echo $bitrixPayment['ID']; ?>" class="typeselect">
<option value=""></option>
2013-07-05 18:19:42 +04:00
<?php foreach($arResult['paymentStatusesList'] as $paymentStatus): ?>
<option value="<?php echo $paymentStatus['code']; ?>" <?php if ($optionsPayment[$bitrixPayment['ID']] == $paymentStatus['code']) echo 'selected'; ?>>
2013-07-05 18:19:42 +04:00
<?php echo $APPLICATION->ConvertCharset($paymentStatus['name'], 'utf-8', SITE_CHARSET); ?>
</option>
<?php endforeach; ?>
</select>
</td>
</tr>
<?php endforeach; ?>
<tr class="heading">
<td colspan="2"><b><?php echo GetMessage('ORDER_TYPES_LIST'); ?></b></td>
</tr>
<?php foreach($arResult['bitrixOrderTypesList'] as $bitrixOrderType): ?>
<tr>
2013-07-05 21:15:23 +04:00
<td width="50%" class="adm-detail-content-cell-l" name="<?php echo $bitrixOrderType['ID']; ?>">
<?php echo $bitrixOrderType['NAME']; ?>
</td>
<td width="50%" class="adm-detail-content-cell-r">
<select name="order-type-<?php echo $bitrixOrderType['ID']; ?>" class="typeselect">
<option value=""></option>
<?php foreach($arResult['orderTypesList'] as $orderType): ?>
<option value="<?php echo $orderType['code']; ?>" <?php if ($optionsOrderTypes[$bitrixOrderType['ID']] == $orderType['code']) echo 'selected'; ?>>
<?php echo $APPLICATION->ConvertCharset($orderType['name'], 'utf-8', SITE_CHARSET); ?>
</option>
<?php endforeach; ?>
</select>
</td>
</tr>
<?php endforeach; ?>
2013-09-03 18:00:12 +04:00
<?php $tabControl->BeginNextTab(); ?>
<input type="hidden" name="tab" value="catalog">
<tr class="heading">
<td colspan="2"><b><?php echo GetMessage('ORDER_PROPS'); ?></b></td>
</tr>
<?php $countProps = 0; foreach($arResult['orderProps'] as $orderProp): ?>
<?php if($orderProp['ID'] == 'text'): ?>
<tr class="heading">
<td colspan="2">
<b>
<label><input type="radio" name="address-detail" value="0" <?php if(count($optionsOrderProps) < 6) echo "checked"; ?>><?php echo GetMessage('ADDRESS_SHORT'); ?></label>
<label><input type="radio" name="address-detail" value="1" <?php if(count($optionsOrderProps) > 5) echo "checked"; ?>><?php echo GetMessage('ADDRESS_FULL'); ?></label>
</b>
</td>
</tr>
<?php endif; ?>
<tr <?php if ($countProps > 4) echo 'class="address-detail"'; if(($countProps > 4) && (count($optionsOrderProps) < 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 ($optionsOrderProps[$orderProp['ID']] == $arProp['CODE']) echo 'selected'; ?>>
<?php echo $arProp['NAME']; ?>
</option>
<?php endforeach; ?>
</select>
</td>
</tr>
<?php $countProps++; endforeach; ?>
2013-07-05 18:19:42 +04:00
<?php $tabControl->BeginNextTab(); ?>
<?php $tabControl->Buttons(); ?>
<input type="hidden" name="Update" value="Y" />
<input type="submit" title="<?php echo GetMessage('ICRM_OPTIONS_SUBMIT_TITLE'); ?>" value="<?php echo GetMessage('ICRM_OPTIONS_SUBMIT_VALUE'); ?>" name="btn-update" class="adm-btn-save" />
<?php $tabControl->End(); ?>
</form>
2013-07-18 22:55:52 +04:00
<?php } ?>