importing and displaying Rimo Building userLabel

This commit is contained in:
Frank Schubert
2026-02-02 12:26:44 +01:00
parent d79b7bdb1d
commit 00926fe3bd
4 changed files with 45 additions and 0 deletions

View File

@@ -75,6 +75,9 @@
</tr><tr>
<th>Rimo Operational State</th>
<td><?=$address->rimo_op_state?></td>
</tr><tr>
<th>Rimo User Label</th>
<td><?=$address->rimo_user_label?></td>
</tr>
<?php if($address->vlan_stag): ?>
<tr>

View File

@@ -506,6 +506,9 @@
</tr><tr>
<th>Building External ID:</th>
<td class="text-monospace"><?=$preorder->adb_hausnummer->rimo_id?>
</tr><tr>
<th>User Label:</th>
<td class="text-monospace"><?=$preorder->adb_hausnummer->rimo_user_label?>
</tr><tr>
<th>Building Execution State:</th>
<td class="text-monospace"><?=$preorder->adb_hausnummer->rimo_ex_state?>

View File

@@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class AdbHausnummerAddRimoUserLabel extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
}
if($this->getEnvironment() == "addressdb") {
$table = $this->table("Hausnummer");
$table->addColumn("rimo_user_label", "string", ["null" => true, "default" => null, "after" => "rimo_op_state", "limit" => 255]);
$table->update();
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
}
if($this->getEnvironment() == "addressdb") {
}
}
}

View File

@@ -354,6 +354,14 @@ foreach ($clusters as $cluster_data) {
$hausnummer_changed = true;
}
if(!$building->userLabel && $hausnummer->rimo_user_label) {
$hausnummer->rimo_user_label = null;
$hausnummer_changed = true;
} elseif($building->userLabel != $hausnummer->rimo_user_label) {
$hausnummer->rimo_user_label = $building->userLabel;
$hausnummer_changed = true;
}
if($hausnummer_changed) {
$hausnummer->save();
$hausnummer->resetSaveNesting();