Added pipe-/linework enabled date and by
This commit is contained in:
@@ -146,7 +146,7 @@ class AddressController extends mfBaseController {
|
||||
if($r->billing_type == "sepa") {
|
||||
foreach(['owner', 'iban', 'bic'] as $required) {
|
||||
if(!$r->{"bank_account_$required"}) {
|
||||
$this->layout()->setFlash("Bitte Bankdaten für SEPA ausfüllen.");
|
||||
$this->layout()->setFlash("Bitte Bankdaten für SEPA ausfüllen.", "warn");
|
||||
$this->layout()->set("address", $r);
|
||||
return $this->add();
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ class Building extends mfBaseModel {
|
||||
private $terminations;
|
||||
private $workflowitems;
|
||||
private $files;
|
||||
private $pipework_enabler;
|
||||
|
||||
public function getAddress($singelLine = false) {
|
||||
if(!$this->id) {
|
||||
@@ -161,6 +162,11 @@ class Building extends mfBaseModel {
|
||||
return $this->files;
|
||||
}
|
||||
|
||||
if($name == "pipework_enabler") {
|
||||
$this->pipework_enabler = new User($this->pipework_enabled_by);
|
||||
return $this->pipework_enabler;
|
||||
}
|
||||
|
||||
$classname = ucfirst($name);
|
||||
$idfield = $name."_id";
|
||||
$this->$name = new $classname($this->$idfield);
|
||||
|
||||
@@ -172,18 +172,24 @@ class LineworkController extends mfBaseController {
|
||||
//var_dump($r->get());exit;
|
||||
|
||||
if($this->me->is(["Admin", "netowner","pipeplanner", "lineplanner"])) {
|
||||
if($r->linework_enabled == 1) {
|
||||
if($r->linework_enabled == 1 && $termination->linework_enabled != 1) {
|
||||
$termination->linework_enabled = 1;
|
||||
$termination->linework_enabled_date = date('U');
|
||||
$termination->linework_enabled_by = $this->me->id;
|
||||
if($termination->status_id < 3) {
|
||||
$termination->status_id = 3;
|
||||
}
|
||||
} else {
|
||||
$termination->save();
|
||||
}
|
||||
|
||||
if($r->linework_enabled != 1 && $termination->linework_enabled == 1) {
|
||||
$termination->linework_enabled = 0;
|
||||
$termination->linework_enabled_date = 0;
|
||||
if($termination->status_id == 3) {
|
||||
$termination->status_id = 1;
|
||||
}
|
||||
$termination->save();
|
||||
}
|
||||
$termination->save();
|
||||
}
|
||||
|
||||
if($termination->workflow_comment != $r->workflow_comment) {
|
||||
|
||||
@@ -167,15 +167,22 @@ class PipeworkController extends mfBaseController {
|
||||
//var_dump($r->get());exit;
|
||||
|
||||
if($this->me->is(["Admin", "netowner", "pipeplanner"])) {
|
||||
if($r->pipework_enabled == 1) {
|
||||
if($r->pipework_enabled == 1 && $building->pipework_enabled != 1) {
|
||||
$building->pipework_enabled = 1;
|
||||
$building->pipework_enabled_date = date('U');
|
||||
$building->pipework_enabled_by = $this->me->id;
|
||||
if($building->status_id < 3) {
|
||||
$building->status_id = 3;
|
||||
}
|
||||
} else {
|
||||
$building->pipework_enabled = 0;
|
||||
$building->save();
|
||||
}
|
||||
$building->save();
|
||||
|
||||
if($r->pipework_enabled != 1 && $building->pipework_enabled == 1) {
|
||||
$building->pipework_enabled = 0;
|
||||
$building->pipework_enabled_date = 0;
|
||||
$building->save();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if($building->workflow_comment != $r->workflow_comment) {
|
||||
|
||||
@@ -10,10 +10,12 @@ class Termination extends mfBaseModel {
|
||||
private $cpeprovisioning;
|
||||
private $files;
|
||||
private $patching;
|
||||
private $linework_enabler;
|
||||
private $creator;
|
||||
private $editor;
|
||||
|
||||
|
||||
|
||||
public function getAddress($singelLine = false) {
|
||||
if(!$this->id) {
|
||||
return false;
|
||||
@@ -195,6 +197,21 @@ class Termination extends mfBaseModel {
|
||||
return $this->cpeprovisioning;
|
||||
}
|
||||
|
||||
if($name == "linework_enabler") {
|
||||
$this->linework_enabler = new User($this->linework_enabled_by);
|
||||
return $this->linework_enabler;
|
||||
}
|
||||
|
||||
if($name == "creator") {
|
||||
$this->creator = new User($this->create_by);
|
||||
return $this->creator;
|
||||
}
|
||||
|
||||
if($name == "editor") {
|
||||
$this->editor = new User($this->edit_by);
|
||||
return $this->editor;
|
||||
}
|
||||
|
||||
$classname = ucfirst($name);
|
||||
$idfield = $name."_id";
|
||||
$this->$name = new $classname($this->$idfield);
|
||||
|
||||
Reference in New Issue
Block a user