3namespace Bitrix\Sale\Controller;
5use Bitrix\Main\DB\SqlExpression;
6use Bitrix\Main\Engine\Response\DataType\Page;
7use Bitrix\Main\Entity\ExpressionField;
10use Bitrix\Main\UI\PageNavigation;
11use Bitrix\Sale\Result;
12use Bitrix\Main\Entity\ReferenceField;
19 $view = $this->getViewManager()->getView($this);
22 'PROPERTY_VALUE' => $view->prepareFieldInfos($view->getFields()),
28 $shipmentId = isset(
$fields[
'SHIPMENT'][
'ID']) ? (int)
$fields[
'SHIPMENT'][
'ID'] : 0;
31 $this->addError(
new Error(
'Shipment identifier is not specified', 201040400006));
39 $this->addError(
new Error(
'Shipment has not been found', 201040400007));
46 isset(
$fields[
'SHIPMENT'][
'PROPERTY_VALUES'])
47 && is_array(
$fields[
'SHIPMENT'][
'PROPERTY_VALUES'])
49 ?
$fields[
'SHIPMENT'][
'PROPERTY_VALUES']
52 $propertyCollection = $shipment->getPropertyCollection();
54 foreach ($propertyValuesList as $propertyValueItem)
56 $propertyValue = $propertyCollection->getItemByOrderPropertyId($propertyValueItem[
'SHIPMENT_PROPS_ID']);
65 $orderSaveResult = $shipment->getOrder()->save();
66 if (!$orderSaveResult->isSuccess())
68 $this->addError(
new Error(
'Order save error', 201040400008));
74 'PROPERTY_VALUES' => $shipment->toArray()[
'PROPERTIES'],
87 if (!$propertyValueDeleteResult->isSuccess())
89 $this->addError(
new Error(
'Property value delete error', 201040400004));
94 $orderSaveResult =
$propertyValue->getCollection()->getOrder()->save();
95 if (!$orderSaveResult)
97 $this->addError(
new Error(
'Order save error', 201040400005));
114 'PROPERTY_VALUE' => current(
119 return (
int)
$propertyValue->getPropertyId() === (int)$item[
'ORDER_PROPS_ID'];
138 '\Bitrix\Sale\Internals\OrderPropsTable',
140 '=this.ORDER_PROPS_ID' =>
'ref.ID',
144 'join_type' =>
'INNER',
154 'offset' => $pageNavigation->
getOffset(),
155 'limit' => $pageNavigation->
getLimit(),
156 'runtime' => $runtime,
160 return new Page(
'PROPERTY_VALUES', $propertyValues,
static function() use (
$select,
$filter, $runtime)
178 $r->addError(
new Error(
'Access Denied', 200040300020));
191 $r->addError(
new Error(
'Access Denied', 200040300010));
201 if (
$name ===
'modify')
206 return parent::checkPermissionEntity(
$name);
214 $propertyValueClass = $registry->getShipmentPropertyValueClassName();
216 $shipmentPropertiesList = $propertyValueClass::getList([
227 if (!$shipmentPropertyRow = $shipmentPropertiesList->fetch())
229 $this->addError(
new Error(
'Property value has not been found', 201040400001));
235 $orderClass = $registry->getOrderClassName();
238 $shipment = $orderClass::load($shipmentPropertyRow[
'ORDER_ID'])
239 ->getShipmentCollection()
240 ->getItemById($shipmentPropertyRow[
'ENTITY_ID'])
245 $this->addError(
new Error(
'Shipment has not been found', 20104040002));
251 $propertyValue = $shipment->getPropertyCollection()->getItemById($id);
254 $this->addError(
new Error(
'Property value has not been found', 201040400003));
static getList(array $parameters)
checkModifyPermissionEntity()
checkReadPermissionEntity()
modifyAction(array $fields)
listAction(PageNavigation $pageNavigation, array $select=[], array $filter=[], array $order=[])
checkPermissionEntity($name, $arguments=[])
static getInstance($type)
const REGISTRY_TYPE_ORDER
</td ></tr ></table ></td ></tr ><?endif?><? $propertyIndex=0;foreach( $arGlobalProperties as $propertyCode=> $propertyValue
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)