Skip to content
Snippets Groups Projects
Commit 95a45e8f authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Prepare code to be able to download ODT templates

parent ced1462b
No related branches found
No related tags found
No related merge requests found
...@@ -144,7 +144,25 @@ class doc_generic_order_odt extends ModelePDFCommandes ...@@ -144,7 +144,25 @@ class doc_generic_order_odt extends ModelePDFCommandes
$texte.= '<br></div></div>'; $texte.= '<br></div></div>';
// Scan directories // Scan directories
if (count($listofdir)) $texte.=$langs->trans("NumberOfModelFilesFound").': <b>'.count($listoffiles).'</b>'; $nbofiles=count($listoffiles);
if (! empty($conf->global->COMMANDE_ADDON_PDF_ODT_PATH))
{
$texte.=$langs->trans("NumberOfModelFilesFound").': <b>';
//$texte.=$nbofiles?'<a id="a_'.get_class($this).'" href="#">':'';
$texte.=count($listoffiles);
//$texte.=$nbofiles?'</a>':'';
$texte.='</b>';
}
if ($nbofiles)
{
$texte.='<div id="div_'.get_class($this).'" class="hidden">';
foreach($listoffiles as $file)
{
$texte.=$file['name'].'<br>';
}
$texte.='<div id="div_'.get_class($this).'">';
}
$texte.= '</td>'; $texte.= '</td>';
......
...@@ -145,7 +145,24 @@ class doc_generic_shipment_odt extends ModelePdfExpedition ...@@ -145,7 +145,24 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
$texte.= '<br></div></div>'; $texte.= '<br></div></div>';
// Scan directories // Scan directories
if (count($listofdir)) $texte.=$langs->trans("NumberOfModelFilesFound").': <b>'.count($listoffiles).'</b>'; $nbofiles=count($listoffiles);
if (! empty($conf->global->EXPEDITION_ADDON_PDF_ODT_PATH))
{
$texte.=$langs->trans("NumberOfModelFilesFound").': <b>';
//$texte.=$nbofiles?'<a id="a_'.get_class($this).'" href="#">':'';
$texte.=count($listoffiles);
//$texte.=$nbofiles?'</a>':'';
$texte.='</b>';
}
if ($nbofiles)
{
$texte.='<div id="div_'.get_class($this).'" class="hidden">';
foreach($listoffiles as $file)
{
$texte.=$file['name'].'<br>';
}
$texte.='<div id="div_'.get_class($this).'">';
}
$texte.= '</td>'; $texte.= '</td>';
......
...@@ -144,7 +144,24 @@ class doc_generic_invoice_odt extends ModelePDFFactures ...@@ -144,7 +144,24 @@ class doc_generic_invoice_odt extends ModelePDFFactures
$texte.= '<br></div></div>'; $texte.= '<br></div></div>';
// Scan directories // Scan directories
if (count($listofdir)) $texte.=$langs->trans("NumberOfModelFilesFound").': <b>'.count($listoffiles).'</b>'; $nbofiles=count($listoffiles);
if (! empty($conf->global->FACTURE_ADDON_PDF_ODT_PATH))
{
$texte.=$langs->trans("NumberOfModelFilesFound").': <b>';
//$texte.=$nbofiles?'<a id="a_'.get_class($this).'" href="#">':'';
$texte.=count($listoffiles);
//$texte.=$nbofiles?'</a>':'';
$texte.='</b>';
}
if ($nbofiles)
{
$texte.='<div id="div_'.get_class($this).'" class="hidden">';
foreach($listoffiles as $file)
{
$texte.=$file['name'].'<br>';
}
$texte.='<div id="div_'.get_class($this).'">';
}
$texte.= '</td>'; $texte.= '</td>';
......
...@@ -357,7 +357,25 @@ class doc_generic_project_odt extends ModelePDFProjects ...@@ -357,7 +357,25 @@ class doc_generic_project_odt extends ModelePDFProjects
$texte.= '<br></div></div>'; $texte.= '<br></div></div>';
// Scan directories // Scan directories
if (count($listofdir)) $texte.=$langs->trans("NumberOfModelFilesFound").': <b>'.count($listoffiles).'</b>'; $nbofiles=count($listoffiles);
if (! empty($conf->global->PROJECT_ADDON_PDF_ODT_PATH))
{
$texte.=$langs->trans("NumberOfModelFilesFound").': <b>';
//$texte.=$nbofiles?'<a id="a_'.get_class($this).'" href="#">':'';
$texte.=$nbofiles;
//$texte.=$nbofiles?'</a>':'';
$texte.='</b>';
}
if ($nbofiles)
{
$texte.='<div id="div_'.get_class($this).'" class="hidden">';
foreach($listoffiles as $file)
{
$texte.=$file['name'].'<br>';
}
$texte.='<div id="div_'.get_class($this).'">';
}
$texte.= '</td>'; $texte.= '</td>';
......
...@@ -358,7 +358,25 @@ class doc_generic_task_odt extends ModelePDFTask ...@@ -358,7 +358,25 @@ class doc_generic_task_odt extends ModelePDFTask
$texte.= '<br></div></div>'; $texte.= '<br></div></div>';
// Scan directories // Scan directories
if (count($listofdir)) $texte.=$langs->trans("NumberOfModelFilesFound").': <b>'.count($listoffiles).'</b>'; $nbofiles=count($listoffiles);
if (! empty($conf->global->PROJECT_TASK_ADDON_PDF_ODT_PATH))
{
$texte.=$langs->trans("NumberOfModelFilesFound").': <b>';
//$texte.=$nbofiles?'<a id="a_'.get_class($this).'" href="#">':'';
$texte.=$nbofiles;
//$texte.=$nbofiles?'</a>':'';
$texte.='</b>';
}
if ($nbofiles)
{
$texte.='<div id="div_'.get_class($this).'" class="hidden">';
foreach($listoffiles as $file)
{
$texte.=$file['name'].'<br>';
}
$texte.='<div id="div_'.get_class($this).'">';
}
$texte.= '</td>'; $texte.= '</td>';
......
...@@ -149,9 +149,24 @@ class doc_generic_proposal_odt extends ModelePDFPropales ...@@ -149,9 +149,24 @@ class doc_generic_proposal_odt extends ModelePDFPropales
$texte.= '<br></div></div>'; $texte.= '<br></div></div>';
// Scan directories // Scan directories
if (count($listofdir)) $nbofiles=count($listoffiles);
if (! empty($conf->global->PROPALE_ADDON_PDF_ODT_PATH))
{ {
$texte.=$langs->trans("NumberOfModelFilesFound").': <b>'.count($listoffiles).'</b>'; $texte.=$langs->trans("NumberOfModelFilesFound").': <b>';
//$texte.=$nbofiles?'<a id="a_'.get_class($this).'" href="#">':'';
$texte.=count($listoffiles);
//$texte.=$nbofiles?'</a>':'';
$texte.='</b>';
}
if ($nbofiles)
{
$texte.='<div id="div_'.get_class($this).'" class="hidden">';
foreach($listoffiles as $file)
{
$texte.=$file['name'].'<br>';
}
$texte.='<div id="div_'.get_class($this).'">';
if ($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT > 0) if ($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT > 0)
{ {
......
...@@ -131,7 +131,25 @@ class doc_generic_odt extends ModeleThirdPartyDoc ...@@ -131,7 +131,25 @@ class doc_generic_odt extends ModeleThirdPartyDoc
$texte.= '</table>'; $texte.= '</table>';
// Scan directories // Scan directories
if (count($listofdir)) $texte.=$langs->trans("NumberOfModelFilesFound").': <b>'.count($listoffiles).'</b>'; $nbofiles=count($listoffiles);
if (! empty($conf->global->COMPANY_ADDON_PDF_ODT_PATH))
{
$texte.=$langs->trans("NumberOfModelFilesFound").': <b>';
//$texte.=$nbofiles?'<a id="a_'.get_class($this).'" href="#">':'';
$texte.=$nbofiles;
//$texte.=$nbofiles?'</a>':'';
$texte.='</b>';
}
if ($nbofiles)
{
$texte.='<div id="div_'.get_class($this).'" class="hidden">';
foreach($listoffiles as $file)
{
$texte.=$file['name'].'<br>';
}
$texte.='<div id="div_'.get_class($this).'">';
}
$texte.= '</td>'; $texte.= '</td>';
......
...@@ -149,9 +149,24 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal ...@@ -149,9 +149,24 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
$texte.= '<br></div></div>'; $texte.= '<br></div></div>';
// Scan directories // Scan directories
if (count($listofdir)) $nbofiles=count($listoffiles);
if (! empty($conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_PATH))
{ {
$texte.=$langs->trans("NumberOfModelFilesFound").': <b>'.count($listoffiles).'</b>'; $texte.=$langs->trans("NumberOfModelFilesFound").': <b>';
//$texte.=$nbofiles?'<a id="a_'.get_class($this).'" href="#">':'';
$texte.=count($listoffiles);
//$texte.=$nbofiles?'</a>':'';
$texte.='</b>';
}
if ($nbofiles)
{
$texte.='<div id="div_'.get_class($this).'" class="hidden">';
foreach($listoffiles as $file)
{
$texte.=$file['name'].'<br>';
}
$texte.='<div id="div_'.get_class($this).'">';
if ($conf->global->MAIN_SUPPLIER_PROPOSAL_CHOOSE_ODT_DOCUMENT > 0) if ($conf->global->MAIN_SUPPLIER_PROPOSAL_CHOOSE_ODT_DOCUMENT > 0)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment