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:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user