Added Linework workflow
This commit is contained in:
@@ -6,6 +6,8 @@ class Termination extends mfBaseModel {
|
||||
private $building;
|
||||
private $status;
|
||||
private $lineworker;
|
||||
private $workflowitems;
|
||||
private $files;
|
||||
private $creator;
|
||||
private $editor;
|
||||
|
||||
@@ -70,7 +72,15 @@ class Termination extends mfBaseModel {
|
||||
return $code;
|
||||
}
|
||||
|
||||
|
||||
public function resetProperties() {
|
||||
$this->building = null;
|
||||
$this->status = null;
|
||||
$this->lineworder = null;
|
||||
$this->workflowitems = null;
|
||||
$this->files = null;
|
||||
$this->creator = null;
|
||||
$this->editor = null;
|
||||
}
|
||||
|
||||
public function getProperty($name) {
|
||||
if($this->$name == null) {
|
||||
@@ -80,6 +90,20 @@ class Termination extends mfBaseModel {
|
||||
return $this->status;
|
||||
}
|
||||
|
||||
if($name == "workflowitems") {
|
||||
foreach(WorkflowitemModel::search(["object_type" => "Termination", "active" => 1]) as $item) {
|
||||
$item->setObjectId($this->id);
|
||||
$this->workflowitems[$item->name] = $item;
|
||||
}
|
||||
//var_dump($this->workflowitems);exit;
|
||||
return $this->workflowitems;
|
||||
}
|
||||
|
||||
if($name == "files") {
|
||||
$this->files = TerminationFileModel::search(["termination_id" => $this->id]);
|
||||
return $this->files;
|
||||
}
|
||||
|
||||
$classname = ucfirst($name);
|
||||
$idfield = $name."_id";
|
||||
$this->$name = new $classname($this->$idfield);
|
||||
|
||||
@@ -105,6 +105,14 @@ class TerminationModel {
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("status_id", $filter)) {
|
||||
$status_id = $filter['status_id'];
|
||||
|
||||
if(is_numeric($status_id) && $status_id > 0) {
|
||||
$where .= " AND Termination.status_id = $status_id";
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("network_id", $filter)) {
|
||||
$network_id = $filter['network_id'];
|
||||
if(is_numeric($network_id)) {
|
||||
@@ -114,6 +122,36 @@ class TerminationModel {
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("networksection_id", $filter)) {
|
||||
$networksection_id = $filter['networksection_id'];
|
||||
if(is_numeric($networksection_id)) {
|
||||
$where .= " AND Building.networksection_id=$networksection_id";
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("code", $filter)) {
|
||||
$code = FronkDB::singleton()->escape($filter['code']);
|
||||
if($code) {
|
||||
$where .= " AND Termination.code LIKE '%$code%'";
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("building_code", $filter)) {
|
||||
$building_code = FronkDB::singleton()->escape($filter['building_code']);
|
||||
if($building_code) {
|
||||
$where .= " AND Building.code LIKE '%$building_code%'";
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("building_street", $filter)) {
|
||||
$building_street = FronkDB::singleton()->escape($filter['building_street']);
|
||||
if($building_street) {
|
||||
$where .= " AND Building.street LIKE '%$building_street%'";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(array_key_exists("status", $filter)) {
|
||||
if(in_array(substr($filter['status'], 1, 2), ["<=", ">="])) {
|
||||
$op = substr($filter['status'], 1, 2);
|
||||
|
||||
Reference in New Issue
Block a user