enhanced preorder filter; fixed fixing wrong oaid origin
This commit is contained in:
@@ -42,17 +42,26 @@ class Preorder extends mfBaseModel {
|
||||
|
||||
if($this->oaid) {
|
||||
// If current OAID is from correct Origin then do nothing
|
||||
$current_oaid = OpenAccessIdModel::getFirstOaid($this->oaid);
|
||||
if(!$current_oaid) {
|
||||
return true; // this is a thetool oaid, so do nothing
|
||||
}
|
||||
if($campaign->oaid_origin == $current_oaid->origin) {
|
||||
// also check if wohneinheit has no oaid and set it
|
||||
if(!$wohneinheit->oaid) {
|
||||
$wohneinheit->oaid = $current_oaid->oaid;
|
||||
$wohneinheit->save();
|
||||
if($campaign->oaid_origin == "thetool") {
|
||||
$current_oaid = OpenAccessIdModel::getFirstOaid($this->oaid);
|
||||
if($current_oaid) {
|
||||
$this->log->warning("OAID of Preorder ".$this->id." should be thetool, but is OFAA");
|
||||
}
|
||||
} elseif($campaign->oaid_origin == "ofaa") {
|
||||
$current_oaid = OpenAccessIdModel::getFirstOaid($this->oaid);
|
||||
if(!$current_oaid) {
|
||||
$this->log->error("OAID of Preorder ".$this->id." not found in OpenAccessIds");
|
||||
// assume it's from a different origin
|
||||
} else {
|
||||
if($campaign->oaid_origin == $current_oaid->origin) {
|
||||
// also check if wohneinheit has no oaid and set it
|
||||
if(!$wohneinheit->oaid) {
|
||||
$wohneinheit->oaid = $current_oaid->oaid;
|
||||
$wohneinheit->save();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user