676
edits
No edit summary Tag: 2017 source edit |
No edit summary Tag: 2017 source edit |
||
| Line 65: | Line 65: | ||
*Open the new template '''pdf_my_template.modules.php''' | *Open the new template '''pdf_my_template.modules.php''' | ||
*Look for the last '''require_one''' lines ate the beginning of the template | *Look for the last '''require_one''' lines ate the beginning of the template | ||
*Add the line | *Add the line <source lang="php">require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'</source>[[File:Add_extrafields_in_pdf_1.png|none|thumb]] | ||
== Module complementary attribute == | |||
*Find the <source lang="php">function write_file'''</source> | |||
*Just before the <source lang="php">// Affiche notes'''</source> | |||
*Add the code to load extrafield array in object <source lang="php"> | |||
$extrafields = new ExtraFields($db); | |||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element); | |||
</source> | |||
*Add the code to load extrafield into object <source lang="php"> | |||
$object->fetch($rowid); | |||
$object->fetch_optionals($rowid,$extralabels); | |||
</source> | |||
*Add the code to display the extrafiled | |||
<source lang="php"> | |||
$pdf->MultiCell (190,3, $outputlangs->convToOutputCharset($object->array_options ['options_my_extra']),0,'L'); ); | |||
</source> | |||
edits