Added status to Adressdb export; added loading indicator in Preorder
detail view
This commit is contained in:
@@ -50,6 +50,8 @@ class Preorder extends mfBaseModel {
|
||||
|
||||
// Cascade status changes down to adb_hausnummer and adb_wohneinheit
|
||||
$this->cascadeStatus();
|
||||
// Cascade status changes down all active preorders with the same hausnummer
|
||||
$this->cascadeStatusToPreorders();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -138,6 +140,31 @@ class Preorder extends mfBaseModel {
|
||||
|
||||
}
|
||||
|
||||
private function cascadeStatusToPreorders() {
|
||||
$status = new Preorderstatus($this->status_id);
|
||||
if(!$status->id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if($this->adb_hausnummer_id) {
|
||||
foreach(PreorderModel::search(["deleted" => 0, "adb_hausnummer_id" => $this->adb_hausnummer_id, "<status_code" => $status->code]) as $preorder) {
|
||||
if($preorder->id == $this->id) continue;
|
||||
|
||||
/*if(!$preorder->status->code || !$status->code) {
|
||||
$this->log->debug("Preorder->status->code". print_r($preorder->status, true));
|
||||
$this->log->debug("Status->code". print_r($status->code, true));
|
||||
}*/
|
||||
|
||||
if($preorder->status->code < $status->code && $status->code <= 244) {
|
||||
$preorder->status_id = $this->status_id;
|
||||
$preorder->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function setOrCreateOaid($oaid_attributes = false) {
|
||||
$campaign = new Preordercampaign($this->preordercampaign_id);
|
||||
//var_dump($campaign);exit;
|
||||
|
||||
Reference in New Issue
Block a user