dolibarr  9.0.0
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 subtitution key => subtitution value. More...
 
 get_substitutionarray_mysoc ($mysoc, $outputlangs)
 Define array with couple subtitution key => subtitution value. More...
 
 get_substitutionarray_thirdparty ($object, $outputlangs)
 Define array with couple subtitution key => subtitution value. More...
 
 get_substitutionarray_contact ($object, $outputlangs, $array_key='object')
 Define array with couple subtitution key => subtitution value. More...
 
 get_substitutionarray_other ($outputlangs)
 Define array with couple subtitution key => subtitution value. More...
 
 get_substitutionarray_object ($object, $outputlangs, $array_key='object')
 Define array with couple substitution key => substitution value. More...
 
 get_substitutionarray_lines ($line, $outputlangs)
 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=true)
 Define array with couple subtitution key => subtitution 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 colums 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...
 
 getColumnStatus ($colKey)
 get column status from column key More...
 

Detailed Description

Parent class for documents generators.

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

Constructor & Destructor Documentation

◆ __construct()

CommonDocGenerator::__construct (   $db)

Constructor.

Parameters
DoliDB$dbDatabase handler

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

Member Function Documentation

◆ columnSort()

CommonDocGenerator::columnSort (   $a,
  $b 
)

uasort callback function to Sort colums fields

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

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

◆ fill_substitutionarray_with_extrafields()

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 733 of file commondocgenerator.class.php.

◆ get_substitutionarray_contact()

CommonDocGenerator::get_substitutionarray_contact (   $object,
  $outputlangs,
  $array_key = 'object' 
)

Define array with couple subtitution key => subtitution value.

Parameters
Contact$objectcontact
Translate$outputlangsobject for output
array$array_keyName of the key for return array
Returns
array Array of substitution key->code

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

◆ get_substitutionarray_each_var_object()

CommonDocGenerator::get_substitutionarray_each_var_object ( $object,
  $outputlangs,
  $recursive = true 
)

Define array with couple subtitution key => subtitution value.

Parameters
Object$objectDolibarr Object
Translate$outputlangsLanguage object for output
boolean$recursiveWant to fetch child array or child object
Returns
array Array of substitution key->code

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

◆ get_substitutionarray_lines()

CommonDocGenerator::get_substitutionarray_lines (   $line,
  $outputlangs 
)

Define array with couple substitution key => substitution value.

Parameters
Object$lineObject line
Translate$outputlangsLang object to use for output
Returns
array Return a substitution array

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

◆ get_substitutionarray_mysoc()

CommonDocGenerator::get_substitutionarray_mysoc (   $mysoc,
  $outputlangs 
)

Define array with couple subtitution key => subtitution value.

Parameters
Societe$mysocObject thirdparty
Translate$outputlangsLanguage object for output
Returns
array Array of substitution key->code

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

◆ get_substitutionarray_object()

CommonDocGenerator::get_substitutionarray_object (   $object,
  $outputlangs,
  $array_key = 'object' 
)

Define array with couple substitution key => substitution value.

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

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

◆ get_substitutionarray_other()

CommonDocGenerator::get_substitutionarray_other (   $outputlangs)

Define array with couple subtitution key => subtitution value.

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

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

◆ get_substitutionarray_shipment()

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 591 of file commondocgenerator.class.php.

◆ get_substitutionarray_shipment_lines()

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 653 of file commondocgenerator.class.php.

◆ get_substitutionarray_thirdparty()

CommonDocGenerator::get_substitutionarray_thirdparty (   $object,
  $outputlangs 
)

Define array with couple subtitution key => subtitution value.

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

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

◆ get_substitutionarray_user()

CommonDocGenerator::get_substitutionarray_user (   $user,
  $outputlangs 
)

Define array with couple subtitution key => subtitution value.

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

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

◆ getColumnContentWidth()

CommonDocGenerator::getColumnContentWidth (   $colKey)

get column content width from column key

Parameters
string$colKeythe column key
Returns
float width in mm

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

◆ getColumnContentXStart()

CommonDocGenerator::getColumnContentXStart (   $colKey)

get column content X (abscissa) left position from column key

Parameters
string$colKeythe column key
Returns
float X position in mm

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

◆ getColumnRank()

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 957 of file commondocgenerator.class.php.

Referenced by insertNewColumnDef().

◆ getColumnStatus()

CommonDocGenerator::getColumnStatus (   $colKey)

get column status from column key

Parameters
string$colKeythe column key
Returns
float width in mm

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

◆ insertNewColumnDef()

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 972 of file commondocgenerator.class.php.

References getColumnRank().

◆ prepareArrayColumnField()

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 856 of file commondocgenerator.class.php.

◆ printRect()

CommonDocGenerator::printRect (   $pdf,
  $x,
  $y,
  $l,
  $h,
  $hidetop = 0,
  $hidebottom = 0 
)

Rect pdf.

Parameters
TCPDF$pdfObject PDF
float$xAbscissa of first point
float$yOrdinate of first point
float$l??
float$h??
int$hidetop1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title
int$hidebottomHide bottom
Returns
void

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

◆ printStdColumnContent()

CommonDocGenerator::printStdColumnContent (   $pdf,
$curY,
  $colKey,
  $columnText = '' 
)

print standard column content

Parameters
PDF$pdfpdf object
float$curYcurent Y position
string$colKeythe column key
string$columnTextcolumn text
Returns
int new rank on success and -1 on error

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


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