Merge branch 'AddressDB/add-new-tool-type-field' into 'master'
added new tool type field See merge request fronk/thetool!1392
This commit is contained in:
@@ -237,6 +237,17 @@ class ADBHausnummerModel {
|
||||
$where .= " AND Hausnummer.`oaid` = '$oaid'";
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("tool_building_type", $filter)) {
|
||||
$tool_building_type = $filter['tool_building_type'];
|
||||
if(is_numeric($tool_building_type)) {
|
||||
$where .= " AND Hausnummer.tool_building_type=$tool_building_type";
|
||||
} elseif(is_array($tool_building_type) && count($tool_building_type)) {
|
||||
$where .= " AND Hausnummer.tool_building_type IN (". implode(",", $tool_building_type).")";
|
||||
} elseif($tool_building_type === null) {
|
||||
$where .= " AND Hausnummer.tool_building_type IS NULL";
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("oaid%", $filter)) {
|
||||
$oaid = FronkDB::singleton()->escape($filter['oaid%']);
|
||||
|
||||
@@ -470,6 +470,8 @@ class AddressDB {
|
||||
$hausnummer_data['grund_nr'] = $data['grund_nr'];
|
||||
$hausnummer_data['gdaeigenschaft'] = $data['gdaeigenschaft'];
|
||||
$hausnummer_data['meridian'] = $data['meridian'];
|
||||
$hausnummer_data['tool_building_type'] = $data['tool_building_type'] ?? '0';
|
||||
$hausnummer_data['tool_building_type_override'] = $data['tool_building_type_override'] ?? '0';
|
||||
$hausnummer_data['rw'] = ($data['rw']) ? str_replace(",",".", $data['rw']) : null;
|
||||
$hausnummer_data['hw'] = ($data['hw']) ? str_replace(",",".", $data['hw']) : null;
|
||||
|
||||
|
||||
@@ -294,7 +294,7 @@ class AddressDBController extends mfBaseController {
|
||||
if(!$this->me->is("Admin")) {
|
||||
$required[] = "netzgebiet_id";
|
||||
}
|
||||
foreach(['adrcd','extref','rimo_id','netzgebiet_id','strasse','hausnummer','stiege','plz','ortschaft','gemeinde','grund_nr','gdaeigenschaft','meridian','rw','hw','gps_lat','gps_long','unit_count','visibility'] as $field) {
|
||||
foreach(['adrcd','extref','rimo_id','netzgebiet_id','strasse','hausnummer','stiege','plz','ortschaft','gemeinde','grund_nr','gdaeigenschaft','meridian','rw','hw','gps_lat','gps_long','unit_count','visibility','tool_building_type', 'tool_building_type_override'] as $field) {
|
||||
if(in_array($field, $required)) {
|
||||
if(!trim($r->$field)) {
|
||||
$this->layout()->setFlash("'".ucfirst($field)."' darf nicht leer sein!", "error");
|
||||
|
||||
Reference in New Issue
Block a user