Added Preorder cancel request UI changes
This commit is contained in:
@@ -24,6 +24,8 @@ class Preorder extends mfBaseModel {
|
||||
private $citycomoan; // ONT data
|
||||
private $ctags; // network-keyed array of Ctags
|
||||
private $statusjournals;
|
||||
private $cancel_request_status;
|
||||
private $cancel_request_creator;
|
||||
|
||||
protected function beforeUpdate($data) {
|
||||
if(!array_key_exists("edit_by", $data)) {
|
||||
@@ -1573,19 +1575,6 @@ class Preorder extends mfBaseModel {
|
||||
|
||||
}
|
||||
|
||||
if($name == "creator") {
|
||||
$user = mfValuecache::singleton()->get("Worker-id-" . $this->create_by);
|
||||
if($user) {
|
||||
$this->creator = $user;
|
||||
return $this->creator;
|
||||
}
|
||||
$this->creator = new User($this->create_by);
|
||||
if($this->creator->id) {
|
||||
mfValuecache::singleton()->set("Worker-id-" . $this->create_by, $this->creator);
|
||||
}
|
||||
return $this->creator;
|
||||
}
|
||||
|
||||
if($name === 'fcp') {
|
||||
if(!$this->adb_hausnummer->fcp_id) return null;
|
||||
return ADBRimoFcp::get($this->adb_hausnummer->fcp_id);
|
||||
@@ -1605,8 +1594,69 @@ class Preorder extends mfBaseModel {
|
||||
return $this->ctags;
|
||||
}
|
||||
|
||||
if($name == "cancel_request_status") {
|
||||
if(!$this->cancel_request_status_code) return null;
|
||||
|
||||
$this->cancel_request_status = mfValuecache::singleton()->get("mfObjectmodel-Preorderstatus-code-" . $this->cancel_request_status_code);
|
||||
if(!$this->cancel_request_status) {
|
||||
$cancel_request_status = PreorderstatusModel::getFirst(["code" => $this->cancel_request_status_code]);
|
||||
if($cancel_request_status) {
|
||||
mfValuecache::singleton()->set("mfObjectmodel-Preorderstatus-code-" . $this->cancel_request_status_code, $cancel_request_status);
|
||||
$this->cancel_request_status = $cancel_request_status;
|
||||
}
|
||||
}
|
||||
return $this->cancel_request_status;
|
||||
}
|
||||
|
||||
if($name == "cancel_request_creator") {
|
||||
$user = mfValuecache::singleton()->get("Worker-id-" . $this->cancel_request_by);
|
||||
if($user) {
|
||||
$this->cancel_request_creator = $user;
|
||||
return $this->cancel_request_creator;
|
||||
}
|
||||
$this->cancel_request_creator = new User($this->cancel_request_by);
|
||||
if($this->cancel_request_creator->id) {
|
||||
mfValuecache::singleton()->set("Worker-id-" . $this->cancel_request_by, $this->cancel_request_creator);
|
||||
}
|
||||
return $this->cancel_request_creator;
|
||||
}
|
||||
|
||||
if($name == "cancel_approver") {
|
||||
$user = mfValuecache::singleton()->get("Worker-id-" . $this->cancel_approved_by);
|
||||
if($user) {
|
||||
$this->cancel_approver = $user;
|
||||
return $this->cancel_approver;
|
||||
}
|
||||
$this->cancel_approver = new User($this->cancel_approved_by);
|
||||
if($this->cancel_approver->id) {
|
||||
mfValuecache::singleton()->set("Worker-id-" . $this->cancel_approved_by, $this->cancel_approver);
|
||||
}
|
||||
return $this->editor;
|
||||
}
|
||||
|
||||
if($name == "creator") {
|
||||
$user = mfValuecache::singleton()->get("Worker-id-" . $this->create_by);
|
||||
if($user) {
|
||||
$this->creator = $user;
|
||||
return $this->creator;
|
||||
}
|
||||
$this->creator = new User($this->create_by);
|
||||
if($this->creator->id) {
|
||||
mfValuecache::singleton()->set("Worker-id-" . $this->create_by, $this->creator);
|
||||
}
|
||||
return $this->creator;
|
||||
}
|
||||
|
||||
if($name == "editor") {
|
||||
$user = mfValuecache::singleton()->get("Worker-id-" . $this->edit_by);
|
||||
if($user) {
|
||||
$this->editor = $user;
|
||||
return $this->editor;
|
||||
}
|
||||
$this->editor = new User($this->edit_by);
|
||||
if($this->editor->id) {
|
||||
mfValuecache::singleton()->set("Worker-id-" . $this->edit_by, $this->editor);
|
||||
}
|
||||
return $this->editor;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user