87 if(Placement\Type::isDefined(
88 Placement\Type::resolveId($placementType)))
90 $placement = Placement\Factory::create(Placement\Type::resolveId($placementType), $this->fields->getValues());
92 $link = Admin\Factory::create($placement->getModeType());
94 if($placement->getModeType() == Admin\ModeType::APP_LAYOUT_TYPE)
96 $type = $placement->getType();
97 if($type == Placement\Type::DEFAULT_TOOLBAR)
99 $entityTypeId = $this->
resolveTypeId($placement->getEntityTypeId());
105 $placement->getEntityTypeId(), $placement->getEntityId());
115 CRM\EntityType::DEAL,
'')
118 if($orderId>0 && $dealId>0)
122 ->setField(
'entityId', $dealId)
123 ->setField(
'entityTypeId', CRM\EntityType::DEAL)
124 ->setField(
'ID', $orderId)
125 ->setFilterParams(
false)
135 $message =
Loc::getMessage(
"SALE_ROUTER_ORDER_NOT_FOUND", [
'#PLACEMENT_ENTITY_ID#'=>$placement->getEntityId()]);
137 ->setPage(
'/bitrix/services/sale/b24integration/500/rest-app-warning.php')
138 ->setField(
'message', urlencode($message))
139 ->setField(
'title', $title)
145 ->setPage(
'/bitrix/services/sale/b24integration/500/rest-app-warning.php')
146 ->setField(
'message', urlencode($message))
147 ->setField(
'title', $title)
153 elseif($type == Placement\Type::DEAL_DETAIL_TOOLBAR)
159 ->setField(
'entityId', $placement->getEntityId())
160 ->setField(
'entityTypeId', $placement->getEntityTypeId())
161 ->setFilterParams(
false)
162 ->setField(
'SITE', SITE_ID)
171 ->setField(
'entityId', $placement->getEntityId())
172 ->setField(
'entityTypeId', $placement->getEntityTypeId())
173 ->setFilterParams(
'&set_filter=Y&filter_is_sync_b24=N')
181 $link = Admin\Factory::create(Admin\ModeType::APP_LAYOUT_TYPE);
185 ->setPage(
'/bitrix/services/sale/b24integration/500/rest-app-warning.php')
186 ->setField(
'message', urlencode($message))
187 ->setField(
'title', $title)
208 protected function getBySourceEntity($sourceEntityTypeId=
'', $sourceEntityId=
'', $destinationEntityTypeId=
'', $destinationEntityId=
'')
210 $relation = Relation\Relation::getByEntity(
211 $sourceEntityTypeId, $sourceEntityId,
212 $destinationEntityTypeId, $destinationEntityId);
214 return isset($relation[
'SRC_ENTITY_ID'])? $relation[
'SRC_ENTITY_ID']:0;
217 protected function getByDestinationEntity($sourceEntityTypeId=
'', $sourceEntityId=
'', $destinationEntityTypeId=
'', $destinationEntityId=
'')
219 $relation = Relation\Relation::getByEntity(
220 $sourceEntityTypeId, $sourceEntityId,
221 $destinationEntityTypeId, $destinationEntityId);
223 return isset($relation[
'DST_ENTITY_ID'])? $relation[
'DST_ENTITY_ID']:0;