';
+ $texttitle=$langs->trans("ListOfDirectories");
+ $listofdir=explode(',',preg_replace('/[\r\n]+/',',',trim($conf->global->STOCK_ADDON_PDF_ODT_PATH)));
+ $listoffiles=array();
+ foreach($listofdir as $key=>$tmpdir)
+ {
+ $tmpdir=trim($tmpdir);
+ $tmpdir=preg_replace('/DOL_DATA_ROOT/',DOL_DATA_ROOT,$tmpdir);
+ if (! $tmpdir) {
+ unset($listofdir[$key]); continue;
+ }
+ if (! is_dir($tmpdir)) $texttitle.=img_warning($langs->trans("ErrorDirNotFound",$tmpdir),0);
+ else
+ {
+ $tmpfiles=dol_dir_list($tmpdir,'files',0,'\.(ods|odt)');
+ if (count($tmpfiles)) $listoffiles=array_merge($listoffiles,$tmpfiles);
+ }
+ }
+ $texthelp=$langs->trans("ListOfDirectoriesForModelGenODT");
+ // Add list of substitution keys
+ $texthelp.=' '.$langs->trans("FollowingSubstitutionKeysCanBeUsed").' ';
+ $texthelp.=$langs->transnoentitiesnoconv("FullListOnOnlineDocumentation"); // This contains an url, we don't modify it
+
+ $texte.= $form->textwithpicto($texttitle,$texthelp,1,'help','',1);
+ $texte.= '';
+
+ // Scan directories
+ if (count($listofdir))
+ {
+ $texte.=$langs->trans("NumberOfModelFilesFound").': '.count($listoffiles).'';
+
+ /*if ($conf->global->MAIN_STOCK_CHOOSE_ODT_DOCUMENT > 0)
+ {
+ // Model for creation
+ $liste=ModelePDFStock::liste_modeles($this->db);
+ $texte.= '';
+ $texte.= '';
+ $texte.= '| '.$langs->trans("DefaultModelPropalCreate").' | ';
+ $texte.= '';
+ $texte.= $form->selectarray('value2',$liste,$conf->global->STOCK_ADDON_PDF_ODT_DEFAULT);
+ $texte.= " | ";
+
+ $texte.= '';
+ $texte.= '| '.$langs->trans("DefaultModelPropalToBill").' | ';
+ $texte.= '';
+ $texte.= $form->selectarray('value3',$liste,$conf->global->STOCK_ADDON_PDF_ODT_TOBILL);
+ $texte.= " | ";
+ $texte.= '';
+
+ $texte.= '| '.$langs->trans("DefaultModelPropalClosed").' | ';
+ $texte.= '';
+ $texte.= $form->selectarray('value4',$liste,$conf->global->STOCK_ADDON_PDF_ODT_CLOSED);
+ $texte.= " | ";
+ $texte.= ' ';
+ }*/
+ }
+
+ $texte.= ' | ';
+
+ $texte.= '';
+ $texte.= $langs->trans("ExampleOfDirectoriesForModelGen");
+ $texte.= ' | ';
+ $texte.= '
';
+
+ $texte.= '