1
0
Fork 0
mirror of synced 2025-04-11 05:00:55 +00:00
Добавление опции синхронизации интегрированных оплат
This commit is contained in:
Ivan Chaplygin 2024-01-15 12:20:13 +03:00
parent b8ac495a37
commit b2b073aac7
5 changed files with 37 additions and 1 deletions

View file

@ -137,3 +137,5 @@ $MESS ['DELETE_MATCHED'] = 'Delete';
$MESS ['LOCATION_LABEL'] = 'Location';
$MESS ['TEXT_ADDRESS_LABEL'] = 'Address (line)';
$MESS ['SYNC_INTEGRATION_PAYMENT'] = 'Activate synchronization of integrated payments';

View file

@ -196,3 +196,5 @@ $MESS ['DELETE_MATCHED'] = 'Удалить';
$MESS ['LOCATION_LABEL'] = 'Местоположение (LOCATION)';
$MESS ['TEXT_ADDRESS_LABEL'] = 'Адрес (строкой)';
$MESS ['SYNC_INTEGRATION_PAYMENT'] = 'Активировать синхронизацию интегрированных оплат';

View file

@ -1171,6 +1171,16 @@ class ConfigProvider
return static::getOption(Constants::RECEIVE_TRACK_NUMBER_DELIVERY);
}
public static function getSyncIntegrationPayment()
{
return static::getOption(Constants::SYNC_INTEGRATION_PAYMENT);
}
public static function setSyncIntegrationPayment($syncIntegrationPayment)
{
static::setOption(Constants::SYNC_INTEGRATION_PAYMENT, $syncIntegrationPayment);
}
/**
* @return string
*/

View file

@ -108,4 +108,5 @@ class Constants
public const MATCHED_CUSTOM_USER_FIELDS = 'matched_custom_field';
public const USE_CRM_ORDER_METHODS = 'use_crm_order_methods';
public const CRM_ORDER_METHODS = 'crm_order_methods';
public const SYNC_INTEGRATION_PAYMENT = 'sync_integration_payment';
}

View file

@ -835,6 +835,17 @@ if (isset($_POST['Update']) && ($_POST['Update'] === 'Y')) {
ConfigProvider::setTrackNumberStatus(htmlspecialchars(trim($_POST['track-number'])) ?: 'N');
$syncIntegrationPayment = htmlspecialchars(trim($_POST['sync-integration-payment'])) ?: 'N';
if ($syncIntegrationPayment === 'Y') {
ConfigProvider::setSyncIntegrationPayment($syncIntegrationPayment);
}
ConfigProvider::setSyncIntegrationPayment
(
htmlspecialchars(trim($_POST['sync-integration-payment'])) ?: 'N'
);
COption::SetOptionString(
$mid,
$CRM_COUPON_FIELD,
@ -1149,6 +1160,7 @@ if (isset($_POST['Update']) && ($_POST['Update'] === 'Y')) {
$optionsOrderNumbers = COption::GetOptionString($mid, $CRM_ORDER_NUMBERS, 0);
$optionsOrderVat = COption::GetOptionString($mid, $CRM_ORDER_VAT, 0);
$optionsOrderTrackNumber = ConfigProvider::getTrackNumberStatus();
$optionsSyncIntegrationPayment = ConfigProvider::getSyncIntegrationPayment();
$canselOrderArr = unserialize(COption::GetOptionString($mid, $CRM_CANSEL_ORDER, 0));
$sendPickupPointAddress = COption::GetOptionString($mid, Constants::CRM_SEND_PICKUP_POINT_ADDRESS, 'N');
@ -2820,6 +2832,15 @@ if (isset($_POST['Update']) && ($_POST['Update'] === 'Y')) {
</b>
</td>
</tr>
<tr>
<td colspan="2" class="option-head option-other-top option-other-bottom">
<b>
<label><input class="addr" type="checkbox" name="sync-integration-payment" value="Y" <?php if ($optionsSyncIntegrationPayment === 'Y') {
echo "checked";
} ?>> <?php echo GetMessage('SYNC_INTEGRATION_PAYMENT'); ?></label>
</b>
</td>
</tr>
<tr>
<td colspan="2" class="option-head option-other-top option-other-bottom">
<b>
@ -3318,4 +3339,4 @@ if (isset($_POST['Update']) && ($_POST['Update'] === '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>
<?php } ?>
<?php } ?>