Updated Building Map / added liezen export import script
This commit is contained in:
@@ -397,8 +397,31 @@ class BuildingController extends mfBaseController {
|
||||
$results = BuildingModel::search($filter);
|
||||
|
||||
foreach($results as $building) {
|
||||
$data = $building->data;
|
||||
//$this->log->debug("building status: ".print_r($building->status,true));
|
||||
$data = clone($building->data);
|
||||
$data->id = $building->id;
|
||||
$data->status = "none";
|
||||
$data->type = $building->type->name;
|
||||
$data->popname = ($building->pop_id) ? $building->pop->name : "-";
|
||||
|
||||
$terms = [];
|
||||
foreach($building->terminations as $term) {
|
||||
$building_term = [];
|
||||
$building_term['id'] = $term->id;
|
||||
$building_term['status'] = "none";
|
||||
|
||||
//$this->log->debug("building status: ".print_r($building->status,true));
|
||||
if($term->status->code == TT_TERMSTATUS_CONNECTED) {
|
||||
$building_term['status'] = "connected";
|
||||
$data->status = "connected";
|
||||
} elseif($building->status->code == TT_BUILDINGSTATUS_CONNECTED) {
|
||||
$building_term['status'] = "pipework-done";
|
||||
if($data->status != "connected") $data->status = "pipework-done";
|
||||
}
|
||||
$terms[] = $building_term;
|
||||
}
|
||||
|
||||
$data->terminations = $terms;
|
||||
$buildings[] = $data;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user