You are here

function hosting_get_tasks in Hostmaster (Aegir) 6

Retrieve tasks with specified criterias

@arg $filter_by string a field to filter the list with, unchecked @arg $filter_value string what to restrict the field to, checked @arg $count integer the number of tasks to return @arg $element integer which element to start from

2 calls to hosting_get_tasks()
hosting_task_queue_block in modules/hosting/task/hosting_task.module
Hosting task list queue block
_hosting_task_list in modules/hosting/task/hosting_task.module
Theme a task list

File

modules/hosting/task/hosting_task.module, line 835
Web server node type is defined here.

Code

function hosting_get_tasks($filter_by = null, $filter_value = null, $count = 5, $element = 0) {
  $nodes = 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 n.*, t.task_status, t.task_type, t.rid FROM {node} n INNER JOIN {hosting_task} t on n.vid=t.vid WHERE type='%s'" . $cond . " ORDER BY n.vid DESC"), $count, $element, NULL, $args);
  while ($row = db_fetch_object($result)) {
    $nodes[] = $row;
  }
  return $nodes;
}