Merge pull request #13193 from TobiasSekan/NewLinePosOdtTemplate
NEW Support of tag {line_pos} for line numbers for tables in ODT templates
This commit is contained in:
commit
75cddcd2de
@ -536,14 +536,16 @@ abstract class CommonDocGenerator
|
||||
*
|
||||
* @param Object $line Object line
|
||||
* @param Translate $outputlangs Lang object to use for output
|
||||
* @param int $linenumber The number of the line for the substitution of "object_line_pos"
|
||||
* @return array Return a substitution array
|
||||
*/
|
||||
public function get_substitutionarray_lines($line, $outputlangs)
|
||||
public function get_substitutionarray_lines($line, $outputlangs, $linenumber = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$resarray = array(
|
||||
'line_pos' => $linenumber,
|
||||
'line_fulldesc'=>doc_getlinedesc($line, $outputlangs),
|
||||
'line_product_ref'=>$line->product_ref,
|
||||
'line_product_ref_fourn'=>$line->ref_fourn, // for supplier doc lines
|
||||
|
||||
@ -411,9 +411,11 @@ class doc_generic_bom_odt extends ModelePDFBom
|
||||
}
|
||||
if ($foundtagforlines)
|
||||
{
|
||||
$linenumber = 0;
|
||||
foreach ($object->lines as $line)
|
||||
{
|
||||
$tmparray = $this->get_substitutionarray_lines($line, $outputlangs);
|
||||
$linenumber++;
|
||||
$tmparray = $this->get_substitutionarray_lines($line, $outputlangs, $linenumber);
|
||||
complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
|
||||
// Call the ODTSubstitutionLine hook
|
||||
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray, 'line'=>$line);
|
||||
|
||||
@ -427,9 +427,11 @@ class doc_generic_order_odt extends ModelePDFCommandes
|
||||
}
|
||||
if ($foundtagforlines)
|
||||
{
|
||||
$linenumber = 0;
|
||||
foreach ($object->lines as $line)
|
||||
{
|
||||
$tmparray = $this->get_substitutionarray_lines($line, $outputlangs);
|
||||
$linenumber++;
|
||||
$tmparray = $this->get_substitutionarray_lines($line, $outputlangs, $linenumber);
|
||||
complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
|
||||
// Call the ODTSubstitutionLine hook
|
||||
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray, 'line'=>$line);
|
||||
|
||||
@ -408,9 +408,11 @@ class doc_generic_contract_odt extends ModelePDFContract
|
||||
}
|
||||
if ($foundtagforlines)
|
||||
{
|
||||
$linenumber = 0;
|
||||
foreach ($object->lines as $line)
|
||||
{
|
||||
$tmparray = $this->get_substitutionarray_lines($line, $outputlangs);
|
||||
$linenumber++;
|
||||
$tmparray = $this->get_substitutionarray_lines($line, $outputlangs, $linenumber);
|
||||
complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
|
||||
// Call the ODTSubstitutionLine hook
|
||||
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray, 'line'=>$line);
|
||||
|
||||
@ -435,9 +435,11 @@ class doc_generic_invoice_odt extends ModelePDFFactures
|
||||
}
|
||||
if ($foundtagforlines)
|
||||
{
|
||||
$linenumber = 0;
|
||||
foreach ($object->lines as $line)
|
||||
{
|
||||
$tmparray = $this->get_substitutionarray_lines($line, $outputlangs);
|
||||
$linenumber++;
|
||||
$tmparray = $this->get_substitutionarray_lines($line, $outputlangs, $linenumber);
|
||||
complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
|
||||
// Call the ODTSubstitutionLine hook
|
||||
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray, 'line'=>$line);
|
||||
|
||||
@ -418,9 +418,11 @@ class doc_generic_mo_odt extends ModelePDFMo
|
||||
}
|
||||
if ($foundtagforlines)
|
||||
{
|
||||
$linenumber = 0;
|
||||
foreach ($object->lines as $line)
|
||||
{
|
||||
$tmparray = $this->get_substitutionarray_lines($line, $outputlangs);
|
||||
$linenumber++;
|
||||
$tmparray = $this->get_substitutionarray_lines($line, $outputlangs, $linenumber);
|
||||
complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
|
||||
// Call the ODTSubstitutionLine hook
|
||||
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray, 'line'=>$line);
|
||||
|
||||
@ -456,9 +456,11 @@ class doc_generic_proposal_odt extends ModelePDFPropales
|
||||
}
|
||||
if ($foundtagforlines)
|
||||
{
|
||||
$linenumber = 0;
|
||||
foreach ($object->lines as $line)
|
||||
{
|
||||
$tmparray = $this->get_substitutionarray_lines($line, $outputlangs);
|
||||
$linenumber++;
|
||||
$tmparray = $this->get_substitutionarray_lines($line, $outputlangs, $linenumber);
|
||||
complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
|
||||
// Call the ODTSubstitutionLine hook
|
||||
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray, 'line'=>$line);
|
||||
|
||||
@ -421,9 +421,11 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders
|
||||
}
|
||||
if ($foundtagforlines)
|
||||
{
|
||||
$linenumber = 0;
|
||||
foreach ($object->lines as $line)
|
||||
{
|
||||
$tmparray = $this->get_substitutionarray_lines($line, $outputlangs);
|
||||
$linenumber++;
|
||||
$tmparray = $this->get_substitutionarray_lines($line, $outputlangs, $linenumber);
|
||||
complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
|
||||
// Call the ODTSubstitutionLine hook
|
||||
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray, 'line'=>$line);
|
||||
|
||||
@ -445,9 +445,11 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
|
||||
}
|
||||
if ($foundtagforlines)
|
||||
{
|
||||
$linenumber = 0;
|
||||
foreach ($object->lines as $line)
|
||||
{
|
||||
$tmparray = $this->get_substitutionarray_lines($line, $outputlangs);
|
||||
$linenumber++;
|
||||
$tmparray = $this->get_substitutionarray_lines($line, $outputlangs, $linenumber);
|
||||
complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
|
||||
// Call the ODTSubstitutionLine hook
|
||||
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray, 'line'=>$line);
|
||||
|
||||
@ -422,9 +422,11 @@ class doc_generic_myobject_odt extends ModelePDFMyObject
|
||||
}
|
||||
if ($foundtagforlines)
|
||||
{
|
||||
$linenumber = 0;
|
||||
foreach ($object->lines as $line)
|
||||
{
|
||||
$tmparray = $this->get_substitutionarray_lines($line, $outputlangs);
|
||||
$linenumber++;
|
||||
$tmparray = $this->get_substitutionarray_lines($line, $outputlangs, $linenumber);
|
||||
complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
|
||||
// Call the ODTSubstitutionLine hook
|
||||
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray, 'line'=>$line);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user