WIP: Implement new role house manager
This commit is contained in:
@@ -134,6 +134,7 @@ class ResponseParser
|
||||
{
|
||||
$groups = [];
|
||||
$isAdmin = $isManager = $isHouseManager = $isTeamer = false;
|
||||
$hotelCode = null;
|
||||
|
||||
foreach ($xml->xpath('selektionsmerkmale/selektionsgruppe') as $item) {
|
||||
$group = new CrmAttributeGroup();
|
||||
@@ -141,14 +142,21 @@ class ResponseParser
|
||||
$attributes = [];
|
||||
|
||||
foreach ($item->xpath('selektion') as $subItem) {
|
||||
$attributeId = (int) $subItem->attributes()['id'];
|
||||
$attributeLabel = (string) $subItem->attributes()['bezeichnung'];
|
||||
$attributeSelected = 'True' === (string) $subItem->attributes()['auswahl'];
|
||||
$attribute = new CrmAttribute();
|
||||
$attribute
|
||||
->setId((int) $subItem->attributes()['id'])
|
||||
->setLabel((string) $subItem->attributes()['bezeichnung'])
|
||||
->setSelected('True' === (string) $subItem->attributes()['auswahl'])
|
||||
->setId($attributeId)
|
||||
->setLabel($attributeLabel)
|
||||
->setSelected($attributeSelected)
|
||||
;
|
||||
$attributes[] = $attribute;
|
||||
|
||||
if (1 === preg_match('/Hausleitung ([A-Z0-9]+)/', $attributeLabel, $matches) && true === $attributeSelected) {
|
||||
$isHouseManager = true;
|
||||
$hotelCode = $matches[1];
|
||||
}
|
||||
if ($this->config['bpn_crm_id_admin'] === $attribute->getId() && true === $attribute->isSelected()) {
|
||||
$isAdmin = true;
|
||||
}
|
||||
@@ -170,6 +178,7 @@ class ResponseParser
|
||||
->setManager($isManager)
|
||||
->setTeamer($isTeamer)
|
||||
->setHouseManager($isHouseManager)
|
||||
->setHotelCode($hotelCode)
|
||||
;
|
||||
|
||||
return $response;
|
||||
|
||||
Reference in New Issue
Block a user