Added municipality for district_is_city campaigns
This commit is contained in:
@@ -66,7 +66,7 @@
|
||||
|
||||
<div class="col-2">
|
||||
<div class="<?=(array_key_exists("network_id", $filter) && $filter['network_id'] == "null") ? "hidden" : ""?>" id="filter-ortschaft-id">
|
||||
<label class="form-label" for="filter_ortschaft_id">Ortsteil</label>
|
||||
<label class="form-label" for="filter_ortschaft_id">Ortschaft/Ortsteil</label>
|
||||
<select name="filter[ortschaft_id]" id="filter_ortschaft_id" class="form-control">
|
||||
<option></option>
|
||||
<?php foreach($ortschaften as $ortschaft): ?>
|
||||
@@ -153,15 +153,13 @@
|
||||
<th>extref</th>
|
||||
<th>PLZ</th>
|
||||
<th>Gemeinde</th>
|
||||
<th>Ortsteil</th>
|
||||
<th>Ortschaft</th>
|
||||
<th>Straße</th>
|
||||
<th>Hausnummer</th>
|
||||
<th>Wohneinheiten</th>
|
||||
<th>Rollout Jahr</th>
|
||||
<th>Rollout Info</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
<?php foreach($addresses as $address): ?>
|
||||
<tr>
|
||||
@@ -174,11 +172,9 @@
|
||||
<td><?=$address->ortschaft->name?></td>
|
||||
<td><?=$address->strasse->name?></td>
|
||||
<td><?=$address->hausnummer?></td>
|
||||
<td><?=count($address->wohneinheiten)?></td>
|
||||
<td><?=$address->rollout?></td>
|
||||
<td><?=$address->rollout_info?></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td style="text-align: left; letter-spacing: 4px; font-size: 1.1em;">
|
||||
<?php if($me->is("Admin")): ?>
|
||||
<a href="<?=self::getUrl("AddressDB", "edit", ["id" => $address->id])?>"><i class="far fa-edit" title="Adresse Bearbeiten"></i></a>
|
||||
|
||||
@@ -6,6 +6,7 @@ class ADBHausnummer extends mfBaseModel {
|
||||
private $strasse;
|
||||
private $plz;
|
||||
private $freigaben = [];
|
||||
private $wohneinheiten = [];
|
||||
|
||||
protected function init() {
|
||||
$this->db = FronkDB::singleton(ADDRESSDB_DBHOST, ADDRESSDB_DBUSER, ADDRESSDB_DBPASS, ADDRESSDB_DBNAME);
|
||||
@@ -105,6 +106,17 @@ class ADBHausnummer extends mfBaseModel {
|
||||
}
|
||||
return $this->plz;
|
||||
}
|
||||
|
||||
if($name == "wohneinheiten") {
|
||||
$this->wohneinheiten = mfValuecache::singleton()->get("adbWohneinheiten-hausnummer-".$this->id);
|
||||
if($this->wohneinheiten === null) {
|
||||
$this->wohneinheiten = ADBWohneinheitModel::search(['hausnummer_id' => $this->id]);
|
||||
if($this->wohneinheiten) {
|
||||
mfValuecache::singleton()->set("adbWohneinheiten-hausnummer-".$this->id, $this->wohneinheiten);
|
||||
}
|
||||
}
|
||||
return $this->wohneinheiten;
|
||||
}
|
||||
|
||||
$classname = ucfirst($name);
|
||||
$idfield = $name."_id";
|
||||
|
||||
@@ -378,7 +378,8 @@ class AddressdbApicontroller extends mfBaseApicontroller {
|
||||
'oaid' => $data->hausnummer_oaid,
|
||||
'cluster_id' => $data->netzgebiet_extref,
|
||||
'zip' => $data->plz,
|
||||
'city' => ($this->district_is_city) ? $data->ortschaft : $data->gemeinde,
|
||||
'city' => $data->gemeinde,
|
||||
"municipality" => "",
|
||||
'district' => $data->ortschaft,
|
||||
'street' => $data->strasse,
|
||||
'housenumber' => $housenumber,
|
||||
@@ -391,6 +392,12 @@ class AddressdbApicontroller extends mfBaseApicontroller {
|
||||
'preorderTypes' => $ptypes,
|
||||
'units' => []
|
||||
];
|
||||
if($this->district_is_city) {
|
||||
$tmp_addresses[$address_key]['city'] = $data->ortschaft;
|
||||
$tmp_addresses[$address_key]['municipality'] = $data->gemeinde;
|
||||
} else {
|
||||
unset($tmp_addresses[$address_key]['municipality']);
|
||||
}
|
||||
}
|
||||
|
||||
$tmp_addresses[$address_key]['units'][] = [
|
||||
@@ -493,6 +500,9 @@ class AddressdbApicontroller extends mfBaseApicontroller {
|
||||
$new_address['housenumber'] = $ta['housenumber'];
|
||||
$new_address['zip'] = $ta['zip'];
|
||||
$new_address['city'] = $ta['city'];
|
||||
if(array_key_exists("municipality", $ta)) {
|
||||
$new_address['municipality'] = $ta['municipality'];
|
||||
}
|
||||
$new_address['district'] = $ta['district'];
|
||||
$new_address['lot_number'] = $ta['lot_number'];
|
||||
$new_address['building_unit_count'] = $ta['building_unit_count'];
|
||||
@@ -612,7 +622,8 @@ class AddressdbApicontroller extends mfBaseApicontroller {
|
||||
'oaid' => $data->hausnummer_oaid,
|
||||
'cluster_id' => $data->netzgebiet_extref,
|
||||
'zip' => $data->plz,
|
||||
'city' => ($this->district_is_city) ? $data->ortschaft : $data->gemeinde,
|
||||
'city' => $data->gemeinde,
|
||||
"municipality" => "",
|
||||
'district' => $data->ortschaft,
|
||||
'street' => $data->strasse,
|
||||
'housenumber' => $housenumber,
|
||||
@@ -625,6 +636,12 @@ class AddressdbApicontroller extends mfBaseApicontroller {
|
||||
'preorderTypes' => $ptypes,
|
||||
'units' => []
|
||||
];
|
||||
if($this->district_is_city) {
|
||||
$tmp_addresses[$address_key]['city'] = $data->ortschaft;
|
||||
$tmp_addresses[$address_key]['municipality'] = $data->gemeinde;
|
||||
} else {
|
||||
unset($tmp_addresses[$address_key]['municipality']);
|
||||
}
|
||||
}
|
||||
|
||||
$tmp_addresses[$address_key]['units'][] = [
|
||||
@@ -655,6 +672,9 @@ class AddressdbApicontroller extends mfBaseApicontroller {
|
||||
$new_address['housenumber'] = $ta['housenumber'];
|
||||
$new_address['zip'] = $ta['zip'];
|
||||
$new_address['city'] = $ta['city'];
|
||||
if(array_key_exists("municipality", $ta)) {
|
||||
$new_address['municipality'] = $ta['municipality'];
|
||||
}
|
||||
$new_address['district'] = $ta['district'];
|
||||
$new_address['lot_number'] = $ta['lot_number'];
|
||||
$new_address['building_unit_count'] = $ta['building_unit_count'];
|
||||
|
||||
@@ -319,7 +319,7 @@ class PreorderApicontroller extends mfBaseApicontroller {
|
||||
} else {
|
||||
// if all unit values are empty try to find the unit with all empty values
|
||||
// failure is not an error, but must be checked by a human at some point
|
||||
$where = "hausnummer_id=".$address->hausnummer_id." AND (block = '' OR block IS NULL) AND (stiege = '' OR stiege IS NULL) AND (stock = '' OR stock IS NULL) AND (tuer = '' OR tuer IS NULL) AND (bezeichner = '' OR bezeichner IS NLL)";
|
||||
$where = "hausnummer_id=".$address->hausnummer_id." AND (block = '' OR block IS NULL) AND (stiege = '' OR stiege IS NULL) AND (stock = '' OR stock IS NULL) AND (tuer = '' OR tuer IS NULL) AND (bezeichner = '' OR bezeichner IS NULL)";
|
||||
if($zusatz) {
|
||||
$where .= " AND zusatz='$zusatz'";
|
||||
} else {
|
||||
|
||||
@@ -42,6 +42,8 @@ class Preorder extends mfBaseModel {
|
||||
|
||||
$hausnummer = $this->getProperty("adb_hausnummer");
|
||||
$wohneinheit = $this->getProperty("adb_wohneinheit");
|
||||
$campaign = $this->getProperty("campaign");
|
||||
|
||||
|
||||
$a = [];
|
||||
$a['code'] = strtoupper($this->ucode);
|
||||
@@ -65,6 +67,7 @@ class Preorder extends mfBaseModel {
|
||||
$address['housenumber'] = $hausnummer->hausnummer;
|
||||
$address['zip'] = $hausnummer->plz->plz;
|
||||
$address['city'] = $hausnummer->strasse->gemeinde->name;
|
||||
$address['municipality'] = "";
|
||||
$address['district'] = $hausnummer->ortschaft->name;
|
||||
$address['block'] = ($wohneinheit->block) ? $wohneinheit->block : null;
|
||||
$address['stock'] = ($wohneinheit->stock) ? $wohneinheit->stock : null;
|
||||
@@ -73,6 +76,13 @@ class Preorder extends mfBaseModel {
|
||||
$address['unit_string'] = ($wohneinheit->bezeichner) ? $wohneinheit->bezeichner : null;
|
||||
$address['is_shipping'] = ($this->shipping_address == "address") ? true : false;
|
||||
|
||||
if($campaign->district_is_city) {
|
||||
$address['city'] = $hausnummer->ortschaft->name;
|
||||
$address['municipality'] = $hausnummer->strasse->gemeinde->name;
|
||||
} else {
|
||||
unset($address['municipality']);
|
||||
}
|
||||
|
||||
$customer = [];
|
||||
$customer['company'] = ($this->company) ? $this->company : null;
|
||||
$customer['uid'] = ($this->uid) ? $this->uid : null;
|
||||
|
||||
@@ -683,8 +683,12 @@ components:
|
||||
example: 9999
|
||||
city:
|
||||
type: string
|
||||
description: Ort
|
||||
example: Beispielhausen
|
||||
description: Ortschaft
|
||||
example: Ortschaft
|
||||
municipality:
|
||||
type: string
|
||||
description: Gemeinde
|
||||
example: Gemeinde
|
||||
district:
|
||||
type: string
|
||||
description: Ortsteil
|
||||
@@ -787,8 +791,12 @@ components:
|
||||
example: 9999
|
||||
city:
|
||||
type: string
|
||||
description: Ort
|
||||
example: Beispielhausen
|
||||
description: Ortschaft
|
||||
example: Ortschaft
|
||||
municipality:
|
||||
type: string
|
||||
description: Gemeinde
|
||||
example: Gemeinde
|
||||
district:
|
||||
type: string
|
||||
description: Ortsteil
|
||||
@@ -875,6 +883,9 @@ components:
|
||||
city:
|
||||
type: string
|
||||
description: Ort der Anschlussadresse
|
||||
municipality:
|
||||
type: string
|
||||
description: Gemeinde der Anschlussadresse
|
||||
block:
|
||||
type: string
|
||||
description: Block der Anschlussadresse
|
||||
|
||||
Reference in New Issue
Block a user