From d1374ef47fe78c26403892538c0f23095d785c8a Mon Sep 17 00:00:00 2001 From: aynsix Date: Fri, 24 Jan 2020 11:48:51 +0300 Subject: [PATCH] don't print fiels with attribute gui_visible false --- lib/Alchemy/Phrasea/Out/Module/PDFRecords.php | 51 ++++++++++--------- 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/lib/Alchemy/Phrasea/Out/Module/PDFRecords.php b/lib/Alchemy/Phrasea/Out/Module/PDFRecords.php index 43abee8bc1..3c72b25e20 100644 --- a/lib/Alchemy/Phrasea/Out/Module/PDFRecords.php +++ b/lib/Alchemy/Phrasea/Out/Module/PDFRecords.php @@ -354,18 +354,20 @@ class PDFRecords extends PDF $this->pdf->SetY($y + 2); foreach ($rec->get_caption()->get_fields() as $field) { - $this->pdf->SetFont(PhraseaPDF::FONT, 'B', 12); - $this->pdf->Write(5, $field->get_name() . " : "); + if ($field->get_databox_field()->get_gui_visible()) { + $this->pdf->SetFont(PhraseaPDF::FONT, 'B', 12); + $this->pdf->Write(5, $field->get_name() . " : "); - $this->pdf->SetFont(PhraseaPDF::FONT, '', 12); - $t = str_replace( - ["<", ">", "&"] - , ["<", ">", "&"] - , strip_tags($field->get_serialized_values()) - ); - $this->pdf->Write(5, $t); + $this->pdf->SetFont(PhraseaPDF::FONT, '', 12); + $t = str_replace( + ["<", ">", "&"] + , ["<", ">", "&"] + , strip_tags($field->get_serialized_values()) + ); + $this->pdf->Write(5, $t); - $this->pdf->Write(6, "\n"); + $this->pdf->Write(6, "\n"); + } } $this->pdf->SetY($this->pdf->GetY() + 10); } @@ -679,24 +681,27 @@ class PDFRecords extends PDF $this->pdf->Write(12, "\n"); foreach ($rec->get_caption()->get_fields() as $field) { /* @var $field caption_field */ - if ($nf > 0) { - $this->pdf->Write(6, "\n"); - } - $this->pdf->SetFont(PhraseaPDF::FONT, 'B', 12); - $this->pdf->Write(5, $field->get_name() . " : "); + if ($field->get_databox_field()->get_gui_visible()) { + if ($nf > 0) { + $this->pdf->Write(6, "\n"); + } - $this->pdf->SetFont(PhraseaPDF::FONT, '', 12); + $this->pdf->SetFont(PhraseaPDF::FONT, 'B', 12); + $this->pdf->Write(5, $field->get_name() . " : "); - $t = str_replace( - ["<", ">", "&"] - , ["<", ">", "&"] - , strip_tags($field->get_serialized_values()) - ); + $this->pdf->SetFont(PhraseaPDF::FONT, '', 12); - $this->pdf->Write(5, $t); + $t = str_replace( + ["<", ">", "&"] + , ["<", ">", "&"] + , strip_tags($field->get_serialized_values()) + ); - $nf++; + $this->pdf->Write(5, $t); + + $nf++; + } } } }