-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
471 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,180 @@ | ||
<?php | ||
/** | ||
* @global $arRequest | ||
* @global $arOptions | ||
* @global $sPropertyCode | ||
*/ | ||
|
||
use Bitrix\Main\Localization\Loc; | ||
use Ylab\Ddata\LoadUnits; | ||
|
||
Loc::loadMessages(__FILE__); | ||
|
||
$oRequest = \Bitrix\Main\Application::getInstance()->getContext()->getRequest(); | ||
$sEntityID = $oRequest->get('generator'); | ||
$oClasses = new LoadUnits(); | ||
$arClassesData = $oClasses->getDataUnits(); | ||
|
||
$arEntity = []; | ||
foreach ($arClassesData as $arClass) { | ||
if ($arClass['ID'] == $sEntityID) { | ||
$arData = $arClass; | ||
} | ||
} | ||
|
||
$oData = new $arData['CLASS']($sProfileID, $sPropertyCode, $sGeneratorID); | ||
$arCode = $oData->arCode; | ||
$arNumbersStart = $oData->arStart; | ||
$arNumbersFinish = $oData->arFinish; | ||
$sCountryCode = $oData->sCountryCode; | ||
$sGenerationOption = $oData->sGenerationOption; | ||
$arRangeNumbers = $oData->arRangeNumbers; | ||
?> | ||
<script type='text/javascript'> | ||
BX.ready(function () { | ||
var inputOptions = BX.findChild( | ||
BX(document), | ||
{ | ||
attribute: { | ||
'name': '<?= $sPropertyName ?>[<?= $sGeneratorID ?>]' | ||
} | ||
}, | ||
true, | ||
true | ||
)[0]; | ||
if (inputOptions) { | ||
var optionsValue = JSON.parse(inputOptions.value); | ||
} | ||
if (inputOptions != undefined) { | ||
Object.keys(optionsValue).forEach(function (key, item) { | ||
var optionsForm = BX.findChild( | ||
BX('WindowEntityDataForm'), | ||
{ | ||
attribute: { | ||
'name': 'option[' + key + ']' | ||
} | ||
}, | ||
true, | ||
true | ||
)[0]; | ||
if (optionsForm) { | ||
optionsForm.value = optionsValue[key]; | ||
} | ||
}); | ||
} | ||
var generationConstructorWrapper = BX.findChild( | ||
document, | ||
{ | ||
attribute: { | ||
'class': 'generation-constructor' | ||
} | ||
}, | ||
true, | ||
true | ||
); | ||
var generationRangeWrapper = BX.findChild( | ||
document, | ||
{ | ||
attribute: { | ||
'class': 'generation-range' | ||
} | ||
}, | ||
true, | ||
true | ||
); | ||
BX.bind(BX('generation'), 'change', function () { | ||
changeGenerationOption(this.value) | ||
}); | ||
changeGenerationOption(BX('generation').value); | ||
function changeGenerationOption(sOption) { | ||
if (sOption === 'constructor') { | ||
generationRangeWrapper.forEach(function (value) { | ||
BX.style(value, 'display', 'none') | ||
}); | ||
generationConstructorWrapper.forEach(function (value) { | ||
BX.style(value, 'display', 'table-row') | ||
}); | ||
} else if (sOption === 'range') { | ||
generationRangeWrapper.forEach(function (value) { | ||
BX.style(value, 'display', 'table-row') | ||
}); | ||
generationConstructorWrapper.forEach(function (value) { | ||
BX.style(value, 'display', 'none') | ||
}); | ||
} else { | ||
generationRangeWrapper.forEach(function (value) { | ||
BX.style(value, 'display', 'none') | ||
}); | ||
generationConstructorWrapper.forEach(function (value) { | ||
BX.style(value, 'display', 'none') | ||
}); | ||
} | ||
} | ||
}); | ||
</script> | ||
<table class="adm-detail-content-table edit-table"> | ||
<tbody> | ||
<tr> | ||
<td width="40%" class="adm-detail-content-cell-l"><?= Loc::getMessage("YLAB_SMS_MOBILE_NUMBER_COUNTRY_CODE") ?></td> | ||
<td width="60%" class="adm-detail-content-cell-r"> | ||
<input type="text" name="option[country-code]" value="<?= $sCountryCode ?>"> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td width="40%" class="adm-detail-content-cell-l"><?= Loc::getMessage("YLAB_SMS_MOBILE_NUMBER_GENERATION_OPTION") ?></td> | ||
<td width="60%" class="adm-detail-content-cell-r"> | ||
<select name="option[generation-option]" id="generation"> | ||
<option value=""><?= Loc::getMessage("YLAB_DDATA_MOBILE_NUMBER_CHOOSE_VALUE") ?></option> | ||
<option value="constructor" <?= $sGenerationOption == 'constructor' ? 'selected' : '' ?>><?= Loc::getMessage("YLAB_SMS_MOBILE_NUMBER_GENERATION_OPTION_CONSTRUCTOR") ?></option> | ||
<option value="range" <?= $sGenerationOption == 'range' ? 'selected' : '' ?>><?= Loc::getMessage("YLAB_SMS_MOBILE_NUMBER_GENERATION_OPTION_RANGE") ?></option> | ||
</select> | ||
</td> | ||
</tr> | ||
<tr class="generation-constructor" style="display: <?= $sGenerationOption == 'constructor' ? 'table-row' : 'none' ?>"> | ||
<td width="40%" class="adm-detail-content-cell-l"><?= Loc::getMessage("YLAB_DDATA_MOBILE_NUMBER_CODE") ?></td> | ||
<td width="60%" class="adm-detail-content-cell-r"> | ||
<?= Loc::getMessage("YLAB_DDATA_MOBILE_NUMBER_FROM") ?> | ||
<input type="text" class="data-option" name="option[code-from]" maxlength="3" value="<?= $arCode[0] ?>"/> | ||
<?= Loc::getMessage("YLAB_DDATA_MOBILE_NUMBER_TO") ?> | ||
<input type="text" class="data-option" name="option[code-to]" maxlength="3" value="<?= $arCode[1] ?>"/> | ||
</td> | ||
</tr> | ||
<tr class="generation-constructor" style="display: <?= $sGenerationOption == 'constructor' ? 'table-row' : 'none' ?>"> | ||
<td width="40%" class="adm-detail-content-cell-l"><?= Loc::getMessage("YLAB_DDATA_MOBILE_NUMBER_START_NUMBERS") ?></td> | ||
<td width="60%" class="adm-detail-content-cell-r"> | ||
<?= Loc::getMessage("YLAB_DDATA_MOBILE_NUMBER_FROM") ?> | ||
<input type="text" class="data-option" name="option[number-start-from]" maxlength="3" value="<?= $arNumbersStart[0] ?>"/> | ||
<?= Loc::getMessage("YLAB_DDATA_MOBILE_NUMBER_TO") ?> | ||
<input type="text" class="data-option" name="option[number-start-to]" maxlength="3" value="<?= $arNumbersStart[1] ?>"/> | ||
</td> | ||
</tr> | ||
<tr class="generation-constructor" style="display: <?= $sGenerationOption == 'constructor' ? 'table-row' : 'none' ?>"> | ||
<td width="40%" class="adm-detail-content-cell-l"><?= Loc::getMessage("YLAB_DDATA_MOBILE_NUMBER_FINISH_NUMBERS") ?></td> | ||
<td width="60%" class="adm-detail-content-cell-r"> | ||
<?= Loc::getMessage("YLAB_DDATA_MOBILE_NUMBER_FROM") ?> | ||
<input type="text" class="data-option" name="option[number-finish-from]" maxlength="4" value="<?= $arNumbersFinish[0] ?>"/> | ||
<?= Loc::getMessage("YLAB_DDATA_MOBILE_NUMBER_TO") ?> | ||
<input type="text" class="data-option" name="option[number-finish-to]" maxlength="4" value="<?= $arNumbersFinish[1] ?>"/> | ||
</td> | ||
</tr> | ||
<tr class="generation-range" style="display: <?= $sGenerationOption == 'range' ? 'table-row' : 'none' ?>"> | ||
<td width="40%" class="adm-detail-content-cell-l"><?= Loc::getMessage("YLAB_SMS_MOBILE_NUMBER_RANGE_NUMBERS") ?></td> | ||
<td width="60%" class="adm-detail-content-cell-r"> | ||
<?= Loc::getMessage("YLAB_DDATA_MOBILE_NUMBER_FROM") ?> | ||
<input type="text" class="data-option" name="option[range-from]" minlength="10" value="<?= $arRangeNumbers[0] ?>"/> | ||
<?= Loc::getMessage("YLAB_DDATA_MOBILE_NUMBER_TO") ?> | ||
<input type="text" class="data-option" name="option[range-to]" minlength="10" value="<?= $arRangeNumbers[1] ?>"/> | ||
</td> | ||
</tr> | ||
<td colspan="2" align="center"> | ||
<div class="adm-info-message-wrap" align="center"> | ||
<div class="adm-info-message"> | ||
<p><?= Loc::getMessage("YLAB_DDATA_MOBILE_NUMBER_HELPER_1") ?></p> | ||
<p><?= Loc::getMessage("YLAB_DDATA_MOBILE_NUMBER_HELPER_2") ?></p> | ||
<p><?= Loc::getMessage("YLAB_DDATA_MOBILE_NUMBER_HELPER_3") ?></p> | ||
<p><?= Loc::getMessage("YLAB_DDATA_MOBILE_NUMBER_HELPER_4") ?></p> | ||
</div> | ||
</div> | ||
</td> | ||
</tbody> | ||
</table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
|
||
$arModuleVersion = array( | ||
'VERSION' => '0.7.1', | ||
'VERSION_DATE' => '2018-11-08' | ||
'VERSION' => '0.8.0', | ||
'VERSION_DATE' => '2018-11-15' | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
lang/ru/admin/fragments/random_mobile_number_prepare_form.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<? | ||
$MESS["YLAB_DDATA_MOBILE_NUMBER_CODE"] = "Код города / сети :"; | ||
$MESS["YLAB_DDATA_MOBILE_NUMBER_START_NUMBERS"] = "Диапазон первых 3 чисел номера: "; | ||
$MESS["YLAB_DDATA_MOBILE_NUMBER_FINISH_NUMBERS"] = "Диапазон оставшихся чисел номера: "; | ||
$MESS["YLAB_DDATA_MOBILE_NUMBER_FROM"] = " от "; | ||
$MESS["YLAB_DDATA_MOBILE_NUMBER_TO"] = " до "; | ||
$MESS["YLAB_SMS_MOBILE_NUMBER_COUNTRY_CODE"] = "Код страны"; | ||
$MESS["YLAB_SMS_MOBILE_NUMBER_GENERATION_OPTION"] = "Вариант генерации"; | ||
$MESS["YLAB_SMS_MOBILE_NUMBER_GENERATION_OPTION_CONSTRUCTOR"] = "Конструктор номера"; | ||
$MESS["YLAB_SMS_MOBILE_NUMBER_GENERATION_OPTION_RANGE"] = "Диапазон номеров"; | ||
$MESS["YLAB_SMS_MOBILE_NUMBER_RANGE_NUMBERS"] = "Диапазон номеров"; | ||
$MESS["YLAB_DDATA_MOBILE_NUMBER_CHOOSE_VALUE"] = "Выберите значение"; | ||
$MESS["YLAB_DDATA_MOBILE_NUMBER_HELPER_1"] = "Для использования данного генератора доступны 2 варианта: "; | ||
$MESS["YLAB_DDATA_MOBILE_NUMBER_HELPER_2"] = "Конструктор номера - данные генерируются на основе введённых данных конструктора"; | ||
$MESS["YLAB_DDATA_MOBILE_NUMBER_HELPER_3"] = "Диапазон номеров - данные генерируются из диапазона указанных номеров"; | ||
$MESS["YLAB_DDATA_MOBILE_NUMBER_HELPER_4"] = "Поле Код страны является необязательным."; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<? | ||
$MESS["YLAB_DDATA_RANDOM_MOBILE_NUMBER_NAME"] = "Генератор случайного номера мобильного телефона"; | ||
$MESS["YLAB_DDATA_DATA_UNIT_MOBILE_NUMBER_EXCEPTION_STATIC"] = "Метод getValue вызван статически"; |
Oops, something went wrong.