Fix caption inclusion

This commit is contained in:
Romain Neutron
2012-09-14 11:53:04 +02:00
parent a8209d8c1c
commit b2f0c701ea

View File

@@ -91,19 +91,19 @@ class PDF
$this->pdf = $pdf;
switch ($layout) {
case "preview":
$this->print_preview(false);
case self::LAYOUT_PREVIEW:
$this->print_preview(false, false);
break;
case "previewCaption":
$this->print_preview(false);
case self::LAYOUT_PREVIEWCAPTION:
$this->print_preview(false, true);
break;
case "previewCaptionTdm":
$this->print_preview(true);
case self::LAYOUT_PREVIEWCAPTIONTDM:
$this->print_preview(true, true);
break;
case "thumbnailList":
case self::LAYOUT_THUMBNAILLIST:
$this->print_thumbnailList();
break;
case "thumbnailGrid":
case self::LAYOUT_THUMBNAILGRID:
$this->print_thumbnailGrid();
break;
}
@@ -306,7 +306,7 @@ class PDF
$this->pdf->SetLeftMargin($lmargin);
}
protected function print_preview($withtdm)
protected function print_preview($withtdm, $write_caption)
{
$core = \bootstrap::getCore();
$appbox = \appbox::get_instance($core);
@@ -454,10 +454,12 @@ class PDF
$this->pdf->SetXY($lmargin, $y += ( $himg + 5));
$nf = 0;
if ($write_caption) {
foreach ($rec->get_caption()->get_fields() as $field) {
/* @var $field caption_field */
if ($nf > 0)
if ($nf > 0) {
$this->pdf->Write(6, "\n");
}
$this->pdf->SetFont(PhraseaPDF::FONT, 'B', 12);
$this->pdf->Write(5, $field->get_name() . " : ");
@@ -475,6 +477,7 @@ class PDF
$nf++;
}
}
}
return;
}