AddressDB Status change UI
This commit is contained in:
@@ -35,6 +35,8 @@ class ADBHausnummer extends mfBaseModel {
|
||||
$this->getGpsCoords();
|
||||
}
|
||||
|
||||
$this->logChanges();
|
||||
|
||||
|
||||
// Statuschange from Rimo statuschange for all units
|
||||
foreach(ADBWohneinheitModel::search(["hausnummer_id" => $this->id]) as $wohneinheit) {
|
||||
@@ -42,6 +44,34 @@ class ADBHausnummer extends mfBaseModel {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function resetSaveNesting() {
|
||||
mfValuecache::singleton()->delete("adbhausnummer-save-nesting-level-" . $this->id);
|
||||
}
|
||||
|
||||
private function logChanges() {
|
||||
$changes = $this->getChangedFields();
|
||||
if(!count($changes)) return true;
|
||||
|
||||
$logstr = "";
|
||||
|
||||
foreach($changes as $key) {
|
||||
if($key == "status_id") {
|
||||
$old_status = new ADBStatus($this->_old_data->status_id);
|
||||
$new_status = new ADBStatus($this->data->status_id);
|
||||
$logstr .= "| '$key' => FROM '".$this->_old_data->$key."' TO '".$this->data->$key."' [".$old_status->code." => ".$new_status->code."]";
|
||||
} else {
|
||||
$logstr .= "| '$key' => FROM '".$this->_old_data->$key."' TO '".$this->data->$key."'";
|
||||
}
|
||||
}
|
||||
|
||||
$me = new User();
|
||||
$me->loadMe();
|
||||
$this->log->info(__CLASS__." Changes: User ".$me->username." $logstr");
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
public function getBuildingType() {
|
||||
|
||||
Reference in New Issue
Block a user