District now optional freetext in Preorder API

This commit is contained in:
Frank Schubert
2022-11-22 14:49:18 +01:00
parent 5c21e864fa
commit 9fce075b6a
3 changed files with 6 additions and 0 deletions
+1
View File
@@ -145,6 +145,7 @@
<?=($preorder->adb_wohneinheit_id) ? ((string)$preorder->adb_wohneinheit ? $preorder->adb_wohneinheit."<br />" : "") : "<i class='text-pink'>&lt;keine Wohneinheit&gt;</i><br />"?>
<?=$preorder->adb_hausnummer->plz->plz?>
<?=$preorder->adb_hausnummer->strasse->gemeinde->name?>
<?=($preorder->address_district) ? "<br />(".$preorder->address_district.")" : ""?>
</td>
<?php else: ?>
<td></td>
@@ -61,6 +61,7 @@ class PreorderApicontroller extends mfBaseApicontroller {
}
protected function submitPreorder() {
//var_dump($this->post);exit;
if(!$this->campaigns) {
$this->log->debug("disallowed request because no campaign for apikey");
return mfResponse::Forbidden();
@@ -243,6 +244,9 @@ class PreorderApicontroller extends mfBaseApicontroller {
if($address_info) {
$preorder_data['address_info'] = $address_info;
}
if(property_exists($this->post['address'],"district") && $this->post['address']->district) {
$preorder_data['address_district'] = $this->post['address']->district;
}
if($this->post['acceptAgb'] === true) {
$preorder_data['accept_agb'] = 1;
+1
View File
@@ -5,6 +5,7 @@ class PreorderModel {
public $preordercampaign_id;
public $adb_hausnummer_id;
public $adb_wohneinheit_id;
public $address_district;
public $address_info;
public $building_id;
public $termination_id;