Fixed Termination and Building Workflowitem loading
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user