Skip to content

Commit

Permalink
Fix Server hang with long loop when reading specimen pdf and high number
Browse files Browse the repository at this point in the history
of tasks.
  • Loading branch information
eldy committed Aug 17, 2015
1 parent 76ce986 commit fabd751
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion htdocs/core/modules/project/doc/pdf_baleine.modules.php
Expand Up @@ -154,6 +154,11 @@ function write_file($object,$outputlangs)
$task = new Task($this->db);
$tasksarray = $task->getTasksArray(0,0,$object->id);

if (! $object->id > 0) // Special case when used with object = specimen, we may return all lines
{
$tasksarray=array_slice($tasksarray, 0, min(5, count($tasksarray)));
}

$object->lines=$tasksarray;
$nblignes=count($object->lines);

Expand Down Expand Up @@ -230,12 +235,12 @@ function write_file($object,$outputlangs)
$pdf->MultiCell($this->posxprogress-$this->posxworkload, 3, $planned_workload, 0, 'R');
$pdf->SetXY($this->posxprogress, $curY);
$pdf->MultiCell($this->posxdatestart-$this->posxprogress, 3, $progress, 0, 'R');

$pdf->SetXY($this->posxdatestart, $curY);
$pdf->MultiCell($this->posxdateend-$this->posxdatestart, 3, $datestart, 0, 'C');
$pdf->SetXY($this->posxdateend, $curY);
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->posxdateend, 3, $dateend, 0, 'C');


$pageposafter=$pdf->getPage();

$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
Expand Down

0 comments on commit fabd751

Please sign in to comment.