function bug_finish_user($user) { $query = "delete from schedulator.Task " . "where (fValid=0 and sPerson='{$user}') or sPerson=''"; bug_query($query); }
function EstimateTable($where, $my_userix, $persons, $bugs, $xtasks) { $p = array(); $did_bug = array(); $did_xtask = array(); $me = $persons->a[$my_userix]; $res = bug_query("select ixEstimate, ixPerson, fIsBug, ixTask, " . " hrsOrigEst, hrsCurrEst, hrsElapsed, dtResolved " . " from schedulator.Estimate " . " {$where} "); while ($r = mysql_fetch_row($res)) { $isbug = $r[2]; $bugix = $r[3]; $bug = $isbug ? $bugs->a[$bugix] : $xtasks->a[$bugix]; if (!$bug) { // this situation is actually normal: the above query doesn't // know the fixfor of any of the estimates it reads, so it // should just skip any estimate that has an unknown bug; // that bug probably wasn't loaded because it doesn't match // the requested fixfor filter anyway, so skipping the // estimate is the right thing to do. // // print "(WARNING: bug '$isbug'-'$bugix' not found!) "; continue; } $done = $r[5] == $r[6] && $bug->assignto->ix != $my_userix; $e =& new Estimate(0, $done, $r[0], $persons->a[$r[1]], $isbug, $bug, $r[4], $r[5], $r[6], $r[7], $me); $p[$r[0]] = $e; if ($e->isbug) { $did_bug[$bug->ix] = 1; } else { $did_xtask[$bug->ix] = 1; } } foreach ($bugs->a as $bug) { if (!$did_bug[$bug->ix]) { $p[] =& new Estimate(1, $bug->isdone(), "", $me, 1, $bug, "", "", "", $bug->resolvedate, $me); } } foreach ($xtasks->a as $task) { if (!$did_xtask[$task->ix]) { $p[] =& new Estimate(1, $task->isdone(), "", $me, 0, $task, "", "", "", "", $me); } } $this->FogTable($p); $this->do_sort(); }