Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/p#119563 link address #944

Merged
merged 5 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions plugin/AddressList.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,6 @@ private function fillAddressesById(array $records)
$elements = $address['elements'];

$additionalContactData = $this->collectAdditionalContactData($elements);
unset($elements['id']);
$this->_addressesById[$address['id']] = array_merge($elements, $additionalContactData);
}
}
Expand Down Expand Up @@ -580,8 +579,10 @@ public function generateImageAlt(int $addressId): string
public function getAddressLink(string $addressId): string
{
$pageId = $this->_pEnvironment->getDataAddressDetailViewHandler()
->getAddressDetailView()->getPageId();

->getAddressDetailView()->getPageId();
if($pageId == 0) {
return "";
}
$currentAddress = $this->getAddressById($addressId);
$firstName = $currentAddress['Vorname'] ?? '';
$lastName = $currentAddress['Name'] ?? '';
Expand Down
10 changes: 9 additions & 1 deletion plugin/EstateDetail.php
Original file line number Diff line number Diff line change
Expand Up @@ -330,5 +330,13 @@ public function getShowEstateMarketingStatus(): bool
{
return $this->getDataView()->getShowStatus();
}

/**
* Returns addresslink for given addressid
* @param string $id
* @return string
*/
public function getAddressLink(string $id) : string
{
return $this->getEnvironment()->getAddressList()->getAddressLink($id);
}
}
2 changes: 1 addition & 1 deletion templates.dist/address/default_detail.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<div class="oo-address-fieldlist">
<?php
foreach ($escapedValues as $field => $value) {
if (in_array($field, $addressName) || empty($value)) {
if (in_array($field, $addressName) || empty($value) || $field == 'id') {
continue;
}
echo '<div class="oo-address-field">';
Expand Down
2 changes: 2 additions & 0 deletions tests/TestClassAddressList.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,13 @@ class TestClassAddressList
'01234567890',
'01122334455',
],
'id' => 13
),
37 => array(
'Name' => 'Fleißig',
'KdNr' => 12,
'Vorname' => 'Heinrich',
'id' => 37
),
];

Expand Down
Loading