feat: multiple hotelcodes assignable to users
This commit is contained in:
@@ -142,7 +142,7 @@ class ResponseParser
|
||||
{
|
||||
$groups = [];
|
||||
$isAdmin = $isManager = $isHouseManager = $isTeamer = false;
|
||||
$hotelCode = null;
|
||||
$hotelCodes = [];
|
||||
|
||||
foreach ($xml->selektionsmerkmale->selektionsgruppe as $item) {
|
||||
$group = new CrmAttributeGroup();
|
||||
@@ -164,7 +164,7 @@ class ResponseParser
|
||||
|
||||
if (1 === preg_match('/^Hausleitung ([A-Z0-9]+)$/', $attributeLabel, $matches) && true === $attribute->isSelected()) {
|
||||
$isHouseManager = true;
|
||||
$hotelCode = $matches[1];
|
||||
$hotelCodes[] = $matches[1];
|
||||
}
|
||||
if ($this->config['bpn_crm_id_admin'] === $attribute->getId() && true === $attribute->isSelected()) {
|
||||
$isAdmin = true;
|
||||
@@ -183,7 +183,7 @@ class ResponseParser
|
||||
// Apply additional role and hotel code for testing purposes when provided
|
||||
if ($isAdmin && null !== $this->config['bpn_default_hotel_code']) {
|
||||
$isHouseManager = true;
|
||||
$hotelCode = $this->config['bpn_default_hotel_code'];
|
||||
$hotelCodes[] = $this->config['bpn_default_hotel_code'];
|
||||
}
|
||||
|
||||
$response = new CrmAttributesResponse();
|
||||
@@ -193,7 +193,7 @@ class ResponseParser
|
||||
->setManager($isManager)
|
||||
->setTeamer($isTeamer)
|
||||
->setHouseManager($isHouseManager)
|
||||
->setHotelCode($hotelCode)
|
||||
->setHotelCodes($hotelCodes)
|
||||
;
|
||||
|
||||
return $response;
|
||||
|
||||
Reference in New Issue
Block a user