public static function get_list($_FORM) { /* * * Get a list of task history items with sophisticated filtering and somewhat sophisticated output * * (n.b., the output from this generally needs to be post-processed to handle the semantic meaning of changes in various fields) * */ $filter = audit::get_list_filter($_FORM); if (is_array($filter) && count($filter)) { $where_clause = " WHERE " . implode(" AND ", $filter); } if ($_FORM["projectID"]) { $entity = new project(); $entity->set_id($_FORM["projectID"]); $entity->select(); } else { if ($_FORM["taskID"]) { $entity = new task(); $entity->set_id($_FORM["taskID"]); $entity->select(); } } $q = "SELECT *\n FROM audit\n {$where_clause}\n ORDER BY dateChanged"; $db = new db_alloc(); $db->query($q); $items = array(); while ($row = $db->next_record()) { $audit = new audit(); $audit->read_db_record($db); $rows[] = $row; } return $rows; }