Skip to content

Commit

Permalink
Поле обязательное к заполнению
Browse files Browse the repository at this point in the history
Поле обязательное к заполнению
  • Loading branch information
alorian authored Mar 13, 2020
2 parents 353f61e + c0df46e commit 427a503
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
/** @var string $templateFolder */
/** @var string $componentPath */
/** @var OpenSourceOrderComponent $component */

?>
<form action="" method="post" name="os-order-form" id="os-order-form">

Expand All @@ -27,7 +28,13 @@
<?php foreach ($arResult['PROPERTIES'] as $propCode => $arProp): ?>
<tr>
<td>
<label for="<?= $arProp['FORM_LABEL'] ?>"><?= $arProp['NAME'] ?></label>
<label for="<?= $arProp['FORM_LABEL'] ?>">
<?= $arProp['NAME'] ?>
<?php if($arProp['IS_REQUIRED']) printf(
'<span class="required" style="color: red;" title="%s">*</span>',
Loc::getMessage('OPEN_SOURCE_ORDER_TEMPLATE_FIELD_REQUIRED')
); ?>
</label>
<? foreach ($arProp['ERRORS'] as $error):
/** @var Error $error */
?>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
$MESS['OPEN_SOURCE_ORDER_TEMPLATE_FIELD_REQUIRED'] = 'Поле обязательно к заполнению';
$MESS['OPEN_SOURCE_ORDER_TEMPLATE_PROPERTIES_TITLE'] = 'Свойства заказа';
$MESS['OPEN_SOURCE_ORDER_TEMPLATE_DELIVERIES_TITLE'] = 'Службы доставки';
$MESS['OPEN_SOURCE_ORDER_TEMPLATE_PAY_SYSTEMS_TITLE'] = 'Платежные системы';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
$arProp['TYPE'] = $prop->getType();
$arProp['NAME'] = $prop->getName();
$arProp['VALUE'] = $prop->getValue();
$arProp['IS_REQUIRED'] = $prop->isRequired();
$arProp['ERRORS'] = $component->errorCollection->getAllErrorsByCode('PROPERTIES[' . $prop->getField('CODE') . ']');

switch ($prop->getType()) {
Expand Down

0 comments on commit 427a503

Please sign in to comment.