dolibarr  16.0.1
Public Member Functions | List of all members
CommonDocGenerator Class Reference

Parent class for documents generators. More...

+ Inheritance diagram for CommonDocGenerator:

Public Member Functions

 __construct ($db)
 Constructor. More...
 
 get_substitutionarray_user ($user, $outputlangs)
 Define array with couple substitution key => substitution value. More...
 
 getSubstitutionarrayMember ($member, $outputlangs)
 Define array with couple substitution key => substitution value. More...
 
 get_substitutionarray_mysoc ($mysoc, $outputlangs)
 Define array with couple substitution key => substitution value. More...
 
 get_substitutionarray_thirdparty ($object, $outputlangs, $array_key= 'company')
 Define array with couple substitution key => substitution value For example {company_name}, {company_name_alias}. More...
 
 get_substitutionarray_contact ($object, $outputlangs, $array_key= 'object')
 Define array with couple substitution key => substitution value. More...
 
 get_substitutionarray_other ($outputlangs)
 Define array with couple substitution key => substitution value. More...
 
 get_substitutionarray_object ($object, $outputlangs, $array_key= 'object')
 Define array with couple substitution key => substitution value. More...
 
 get_substitutionarray_lines ($line, $outputlangs, $linenumber=0)
 Define array with couple substitution key => substitution value. More...
 
 get_substitutionarray_shipment ($object, $outputlangs, $array_key= 'object')
 Define array with couple substitution key => substitution value. More...
 
 get_substitutionarray_shipment_lines ($line, $outputlangs)
 Define array with couple substitution key => substitution value. More...
 
 get_substitutionarray_each_var_object (&$object, $outputlangs, $recursive=1)
 Define array with couple substitution key => substitution value. More...
 
 fill_substitutionarray_with_extrafields ($object, $array_to_fill, $extrafields, $array_key, $outputlangs)
 Fill array with couple extrafield key => extrafield value. More...
 
 printRect ($pdf, $x, $y, $l, $h, $hidetop=0, $hidebottom=0)
 Rect pdf. More...
 
 columnSort ($a, $b)
 uasort callback function to Sort columns fields More...
 
 prepareArrayColumnField ($object, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
 Prepare Array Column Field. More...
 
 getColumnContentWidth ($colKey)
 get column content width from column key More...
 
 getColumnContentXStart ($colKey)
 get column content X (abscissa) left position from column key More...
 
 getColumnRank ($colKey)
 get column position rank from column key More...
 
 insertNewColumnDef ($newColKey, $defArray, $targetCol=false, $insertAfterTarget=false)
 get column position rank from column key More...
 
 printStdColumnContent ($pdf, &$curY, $colKey, $columnText= '')
 print standard column content More...
 
 printColDescContent ($pdf, &$curY, $colKey, $object, $i, $outputlangs, $hideref=0, $hidedesc=0, $issupplierline=0)
 print description column content More...
 
 getExtrafieldContent ($object, $extrafieldKey, $outputlangs=null)
 get extrafield content for pdf writeHtmlCell compatibility usage for PDF line columns and object note block More...
 
 getColumnStatus ($colKey)
 get column status from column key More...
 
 pdfTabTitles (&$pdf, $tab_top, $tab_height, $outputlangs, $hidetop=0)
 Print standard column content. More...
 
 defineColumnExtrafield ($object, $outputlangs, $hidedetails=0)
 Define Array Column Field for extrafields. More...
 

Detailed Description

Parent class for documents generators.

Definition at line 36 of file commondocgenerator.class.php.

Constructor & Destructor Documentation

CommonDocGenerator::__construct (   $db)

Constructor.

Parameters
DoliDB$dbDatabase handler

Definition at line 94 of file commondocgenerator.class.php.

References db.

Member Function Documentation

CommonDocGenerator::columnSort (   $a,
  $b 
)

uasort callback function to Sort columns fields

Parameters
array$aPDF lines array fields configs
array$bPDF lines array fields configs
Returns
int Return compare result

Definition at line 997 of file commondocgenerator.class.php.

CommonDocGenerator::defineColumnExtrafield (   $object,
  $outputlangs,
  $hidedetails = 0 
)
CommonDocGenerator::fill_substitutionarray_with_extrafields (   $object,
  $array_to_fill,
  $extrafields,
  $array_key,
  $outputlangs 
)

Fill array with couple extrafield key => extrafield value.

Parameters
Object$objectObject with extrafields (must have $object->array_options filled)
array$array_to_fillSubstitution array
Extrafields$extrafieldsExtrafields object
string$array_keyPrefix for name of the keys into returned array
Translate$outputlangsLang object to use for output
Returns
array Substitution array

Definition at line 885 of file commondocgenerator.class.php.

References db, dol_include_once(), dol_print_date(), price(), and price2num().

Referenced by get_substitutionarray_contact(), get_substitutionarray_lines(), doc_generic_project_odt\get_substitutionarray_object(), doc_generic_task_odt\get_substitutionarray_object(), get_substitutionarray_object(), doc_generic_project_odt\get_substitutionarray_tasks(), doc_generic_task_odt\get_substitutionarray_tasks(), get_substitutionarray_thirdparty(), get_substitutionarray_user(), and getSubstitutionarrayMember().

CommonDocGenerator::get_substitutionarray_contact (   $object,
  $outputlangs,
  $array_key = 'object' 
)
CommonDocGenerator::get_substitutionarray_each_var_object ( $object,
  $outputlangs,
  $recursive = 1 
)
CommonDocGenerator::get_substitutionarray_lines (   $line,
  $outputlangs,
  $linenumber = 0 
)

Define array with couple substitution key => substitution value.

Parameters
Object$lineObject line
Translate$outputlangsLang object to use for output
int$linenumberThe number of the line for the substitution of "object_line_pos"
Returns
array Return a substitution array

Definition at line 602 of file commondocgenerator.class.php.

References $resql, db, doc_getlinedesc(), dol_print_date(), fill_substitutionarray_with_extrafields(), price(), price2num(), and vatrate().

Referenced by doc_generic_asset_odt\write_file(), doc_generic_contract_odt\write_file(), doc_generic_supplier_order_odt\write_file(), doc_generic_recruitmentjobposition_odt\write_file(), doc_generic_bom_odt\write_file(), doc_generic_invoice_odt\write_file(), doc_generic_order_odt\write_file(), doc_generic_myobject_odt\write_file(), doc_generic_supplier_proposal_odt\write_file(), and doc_generic_proposal_odt\write_file().

CommonDocGenerator::get_substitutionarray_mysoc (   $mysoc,
  $outputlangs 
)
CommonDocGenerator::get_substitutionarray_object (   $object,
  $outputlangs,
  $array_key = 'object' 
)
CommonDocGenerator::get_substitutionarray_other (   $outputlangs)
CommonDocGenerator::get_substitutionarray_shipment (   $object,
  $outputlangs,
  $array_key = 'object' 
)

Define array with couple substitution key => substitution value.

Parameters
Expedition$objectMain object to use as data source
Translate$outputlangsLang object to use for output
array$array_keyName of the key for return array
Returns
array Array of substitution

Definition at line 718 of file commondocgenerator.class.php.

References dol_include_once(), dol_print_date(), measuringUnitString(), and price().

Referenced by doc_generic_shipment_odt\write_file().

CommonDocGenerator::get_substitutionarray_shipment_lines (   $line,
  $outputlangs 
)

Define array with couple substitution key => substitution value.

Parameters
ExpeditionLigne$lineObject line
Translate$outputlangsLang object to use for output
Returns
array Substitution array

Definition at line 783 of file commondocgenerator.class.php.

References db, doc_getlinedesc(), dol_include_once(), measuringUnitString(), price(), and vatrate().

Referenced by doc_generic_shipment_odt\write_file().

CommonDocGenerator::get_substitutionarray_thirdparty (   $object,
  $outputlangs,
  $array_key = 'company' 
)
CommonDocGenerator::get_substitutionarray_user (   $user,
  $outputlangs 
)
CommonDocGenerator::getColumnContentWidth (   $colKey)

get column content width from column key

Parameters
string$colKeythe column key
Returns
float width in mm

Definition at line 1093 of file commondocgenerator.class.php.

Referenced by pdf_storm\write_file().

CommonDocGenerator::getColumnContentXStart (   $colKey)
CommonDocGenerator::getColumnRank (   $colKey)

get column position rank from column key

Parameters
string$colKeythe column key
Returns
int rank on success and -1 on error

Definition at line 1118 of file commondocgenerator.class.php.

CommonDocGenerator::getColumnStatus (   $colKey)
CommonDocGenerator::getExtrafieldContent (   $object,
  $extrafieldKey,
  $outputlangs = null 
)

get extrafield content for pdf writeHtmlCell compatibility usage for PDF line columns and object note block

Parameters
object$objectCommon object
string$extrafieldKeyThe extrafield key
Translate$outputlangsThe output langs (if value is __(XXX)__ we use it to translate it).
Returns
string

Definition at line 1263 of file commondocgenerator.class.php.

References db, dol_string_nohtmltag(), and setEventMessages().

Referenced by pdf_standard_myobject\write_file(), pdf_espadon\write_file(), pdf_storm\write_file(), pdf_cornas\write_file(), pdf_eagle_proforma\write_file(), pdf_standard_asset\write_file(), pdf_cyan\write_file(), pdf_eratosthene\write_file(), and pdf_sponge\write_file().

CommonDocGenerator::getSubstitutionarrayMember (   $member,
  $outputlangs 
)

Define array with couple substitution key => substitution value.

Parameters
Adherent$memberMember
Translate$outputlangsLanguage object for output
Returns
array Array of substitution key->code

Definition at line 150 of file commondocgenerator.class.php.

References dol_print_date(), fill_substitutionarray_with_extrafields(), and get_exdir().

Referenced by doc_generic_member_odt\write_file().

CommonDocGenerator::insertNewColumnDef (   $newColKey,
  $defArray,
  $targetCol = false,
  $insertAfterTarget = false 
)

get column position rank from column key

Parameters
string$newColKeythe new column key
array$defArraya single column definition array
string$targetColtarget column used to place the new column beside
bool$insertAfterTargetinsert before or after target column ?
Returns
int new rank on success and -1 on error

Definition at line 1135 of file commondocgenerator.class.php.

CommonDocGenerator::pdfTabTitles ( $pdf,
  $tab_top,
  $tab_height,
  $outputlangs,
  $hidetop = 0 
)
CommonDocGenerator::prepareArrayColumnField (   $object,
  $outputlangs,
  $hidedetails = 0,
  $hidedesc = 0,
  $hideref = 0 
)

Prepare Array Column Field.

Parameters
object$objectcommon object
Translate$outputlangslangs
int$hidedetailsDo not show line details
int$hidedescDo not show desc
int$hiderefDo not show ref
Returns
null

Definition at line 1021 of file commondocgenerator.class.php.

Referenced by pdf_standard_myobject\write_file(), pdf_espadon\write_file(), pdf_standard_recruitmentjobposition\write_file(), pdf_storm\write_file(), pdf_vinci\write_file(), pdf_cornas\write_file(), pdf_eagle_proforma\write_file(), pdf_standard_asset\write_file(), pdf_cyan\write_file(), pdf_eratosthene\write_file(), and pdf_sponge\write_file().

CommonDocGenerator::printColDescContent (   $pdf,
$curY,
  $colKey,
  $object,
  $i,
  $outputlangs,
  $hideref = 0,
  $hidedesc = 0,
  $issupplierline = 0 
)

print description column content

Parameters
TCPDF$pdfpdf object
float$curYcurent Y position
string$colKeythe column key
object$objectCommonObject
int$ithe $object->lines array key
Translate$outputlangsOutput language
int$hiderefhide ref
int$hidedeschide desc
int$issupplierlineif object need supplier product
Returns
null

Definition at line 1226 of file commondocgenerator.class.php.

References pdf_writelinedesc().

Referenced by pdf_standard_myobject\write_file(), pdf_espadon\write_file(), pdf_standard_recruitmentjobposition\write_file(), pdf_cornas\write_file(), pdf_eagle_proforma\write_file(), pdf_standard_asset\write_file(), pdf_cyan\write_file(), pdf_eratosthene\write_file(), and pdf_sponge\write_file().

CommonDocGenerator::printRect (   $pdf,
  $x,
  $y,
  $l,
  $h,
  $hidetop = 0,
  $hidebottom = 0 
)
CommonDocGenerator::printStdColumnContent (   $pdf,
$curY,
  $colKey,
  $columnText = '' 
)

print standard column content

Parameters
TCPDF$pdfpdf object
float$curYcurent Y position
string$colKeythe column key
string$columnTextcolumn text
Returns
null

Definition at line 1180 of file commondocgenerator.class.php.

References setEventMessages().

Referenced by pdf_espadon\_tableau_tot(), pdf_standard_myobject\write_file(), pdf_espadon\write_file(), pdf_storm\write_file(), pdf_vinci\write_file(), pdf_cornas\write_file(), pdf_eagle_proforma\write_file(), pdf_standard_asset\write_file(), pdf_cyan\write_file(), pdf_eratosthene\write_file(), and pdf_sponge\write_file().


The documentation for this class was generated from the following file: