Menu

#12 Sorting task log by id and not by date

open
nobody
Reports (3)
5
2004-02-29
2003-11-21
No

Hi,

In the reports page, you are sorting task log by Id and
not by date. So when you do the grouping with the day
of the task log It shows wrong summaries.

To fix the bug, I have written a function in
job.inc.php that return task in a bidemntionnal array
(date,id) then sorting this array and get the id from
the sorted array.

//2003-11-20 FME Return the start date of job to be
able to sort chronologicaly
function getListDate($order="start",$desc="DESC") {
global $dbInst,$toolInst,$loginInst;

if (!$loginInst->hasAccess("job.getList")) return
false;

$array = array();
$query = "select start, id from
".$dbInst->config['table_job']." ".$this->setFilter()."
order by ".$order." ".$desc;

$result = $dbInst->query($query);
$i = 0;
while($row = $dbInst->fetchArray($result[0])) {
$array[$i]['start'] = $row['start'];
$array[$i]['id'] = $row['id'];
$i++;
}
$this->matches = $result[1];
return $array;
}

And use the array in reports.php
$jobInst->activate($element['id']); //2003-11-20 FME
Take the id field in the multidimensional array

I do not know if what iI done is correct but know
reports is now well grouping.

Regards,
Francois.

Discussion

  • Tom Meinlschmidt

    • labels: --> Reports
     
  • Nobody/Anonymous

    Logged In: NO

    done

     

Log in to post a comment.

MongoDB Logo MongoDB