Fixed not creating OAID in rimo-import when requested

This commit is contained in:
Frank Schubert
2025-01-15 18:12:14 +01:00
parent 9333f50c27
commit dcf3ebbea4
5 changed files with 80 additions and 3 deletions
+14
View File
@@ -20,6 +20,7 @@ $me = new \User(TT_RIMO_IMPORT_USER_ID);
define("INTERNAL_USER_ID", $me->id);
define("INTERNAL_USER_USERNAME", $me->username);
define("MFBASE_BYPASS_LOGIN", true);
$mainlog = \mfLoghandler::singleton();
$log = new \mfLog_File();
@@ -311,6 +312,12 @@ foreach ($clusters as $cluster_data) {
if (!$unit->save()) {
die("Error saving new unit\n" . print_r($unit, true));
}
if(!$unit->oaid && $adb_netzgebiet->unit_create_oaid) {
$unit->oaid = $unit->getNewOAID();
if(!$unit->save()) {
die("Error saving new unit OAID\n" . print_r($unit, true));
}
}
}
}
@@ -348,6 +355,13 @@ foreach ($clusters as $cluster_data) {
if (!$unit->save()) {
die("Error saving new unit\n" . print_r($home, true));
}
if(!$unit->oaid && $adb_netzgebiet->unit_create_oaid) {
$unit->oaid = $unit->getNewOAID();
if(!$unit->save()) {
die("Error saving new unit OAID\n" . print_r($unit, true));
}
}
$unit = new \ADBWohneinheit($unit->id);
\mfValuecache::singleton()->set("adbhausnummer-save-nesting-level-".$hausnummer->id, 0);
\mfValuecache::singleton()->set("adbwohneinheit-save-nesting-level-".$unit->id, 0);