Merge branch 'fronkdev' into 'master'

Updating contact in Preorder now triggers Rimo Workorder Update

See merge request fronk/thetool!701
This commit is contained in:
Frank Schubert
2024-11-06 15:16:07 +00:00
2 changed files with 79 additions and 0 deletions

View File

@@ -84,7 +84,28 @@ class Preorder extends mfBaseModel {
}
public function updateRimoWorkorderContact() {
$contact_fields = [
"company",
"uid",
"firstname",
"lastname",
"phone",
"email"
];
$changed_fields = $this->getChangedFields();
$update = [];
foreach($changed_fields as $field) {
if(in_array($field, $contact_fields)) {
$update[$field] = $this->data->$field;
}
}
foreach($this->getProperty("adb_wohneinheit")->rimo_workorders as $workorder) {
Rimoapi::updateWorkorder($workorder->rimo_id, $update);
}
return true;
}
public function createHistoryEntry() {