Fixed Termination and Building Workflowitem loading

This commit is contained in:
Frank Schubert
2022-02-17 21:34:53 +01:00
parent b63640e232
commit 08630e9942
6 changed files with 63 additions and 43 deletions

View File

@@ -137,6 +137,8 @@ class Workflowvalue extends mfBaseModel {
if(!$this->item) {
$this->item = new Workflowitem($this->item_id);
if($this->item->id) {
$item = $this->item;
$item->unsetObjectId();
mfValuecache::singleton()->set("wfItem-id-".$this->item->id, $this->item);
}
}

View File

@@ -94,7 +94,12 @@ class WorkflowvalueModel {
$db = FronkDB::singleton();
$where = self::getSqlFilter($filter);
$res = $db->select("Workflowvalue", "*", $where);
$sql = "SELECT Workflowvalue.* FROM Workflowvalue
LEFT JOIN Workflowitem ON (Workflowitem.id = Workflowvalue.item_id)
WHERE $where";
$res = $db->query($sql);
if($db->num_rows($res)) {
while($data = $db->fetch_object($res)) {
$items[] = new Workflowvalue($data);
@@ -137,6 +142,16 @@ class WorkflowvalueModel {
}
}
if(array_key_exists("object_type", $filter)) {
$object_type = $filter["object_type"];
if(strtolower($object_type) == "termination") {
$where .= " AND Workflowitem.object_type = 'Termination' ";
}
if(strtolower($object_type) == "building") {
$where .= " AND Workflowitem.object_type = 'Building' ";
}
}
//var_dump($filter, $where);exit;