function setValuesFromPost($post, $files) { $post = Input\File::getPostWithFiles($post, $files); $result = new Result(); /** @var PropertyValue $property */ foreach ($this->collection as $property) { $r = $property->setValueFromPost($post); if (!$r->isSuccess()) { $result->addErrors($r->getErrors()); } } return $result; }
// 'select' => array('ID', 'NAME', 'LID', 'DOMAIN' => 'SALE.DOMAIN'), // 'order' => array('LID', 'SORT', 'NAME'), //)); $result = CSalePersonType::GetList(array('SORT' => 'ASC', 'NAME' => 'ASC'), array()); while ($row = $result->Fetch()) { $personTypes[$row['ID']] = array('ID' => $row['ID'], 'NAME' => htmlspecialcharsex($row['NAME']), 'LID' => htmlspecialcharsex(implode(", ", $row['LIDS']))); } $errors = array(); $reload = 'reloadForm()'; $variants = array(); // PREPARE PROPERTY, RELATIONS ///////////////////////////////////////////////////////////////////////////////////////// // 1. load property from database if exists $existentProperty = $propertyId ? OrderPropsTable::getById($propertyId)->fetch() : null; // 1. get property from post if ($_SERVER['REQUEST_METHOD'] == 'POST') { $_POST = Input\File::getPostWithFiles($_POST, $_FILES); // // MULTIPLE_DEBUG // if ($_POST['TYPE'] != 'ENUM' && $_POST['TYPE'] != 'FILE') // $_POST['MULTIPLE'] = 'N'; if ($_POST['TYPE'] == $_POST['PREVIOUS-TYPE']) { if ($_POST['TYPE'] == 'ENUM') { foreach ($_POST['VARIANTS'] as $row) { if (($row = array_filter($row, 'strlen')) && $row != array('SORT' => 100)) { $variants[] = $row; } } } } else { $resetInputSettings = true; } $property = $_POST;