You are here

function hosting_get_tasks in Hosting 5

Same name and namespace in other branches
  1. 6.2 task/hosting_task.module \hosting_get_tasks()
  2. 7.4 task/hosting_task.module \hosting_get_tasks()
  3. 7.3 task/hosting_task.module \hosting_get_tasks()

Retrieve tasks with specified criterias

1 call to hosting_get_tasks()
_hosting_task_list in task/hosting_task.module
Theme functions

File

task/hosting_task.module, line 432
Web server node type is defined here.

Code

function hosting_get_tasks($filter_by = null, $filter_value = null, $count = 5, $element = 0) {
  $node = array();
  $args[] = 'task';
  $cond = '';
  if ($filter_by && $filter_value) {
    $cond = ' AND t.' . $filter_by . ' = %d';
    $args[] = $filter_value;
  }
  $result = pager_query(db_rewrite_sql("SELECT *, t.task_status,q.status as queued FROM {node} n left join {hosting_task} t on n.vid=t.vid LEFT JOIN {hosting_task_queue} q ON t.nid=q.nid WHERE type='%s'" . $cond . " ORDER BY n.nid DESC"), $count, $element, NULL, $args);
  while ($row = db_fetch_object($result)) {
    $nodes[] = $row;
  }
  return $nodes;
}