diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index be89fb2d3f6..4e33fb6d308 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -2137,7 +2137,7 @@ if ($action == 'create') $delallowed = $user->rights->contrat->creer; - print $formfile->showdocuments('contract', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang, '', $object); + print $formfile->showdocuments('contract', $filename, $filedir, $urlsource, $genallowed, $delallowed, ($object->model_pdf ? $object->model_pdf : $conf->global->CONTRACT_ADDON_PDF), 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang, '', $object); // Show links to link elements diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 31681fb072c..e0d96112aec 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -426,7 +426,7 @@ class FormFile if ($modulepart == 'company') { - $showempty = 1; + $showempty = 1; // can have no template active if (is_array($genallowed)) $modellist = $genallowed; else { include_once DOL_DOCUMENT_ROOT.'/core/modules/societe/modules_societe.class.php'; @@ -490,6 +490,7 @@ class FormFile } } elseif ($modulepart == 'contract') { + $showempty = 1; // can have no template active if (is_array($genallowed)) $modellist = $genallowed; else { include_once DOL_DOCUMENT_ROOT.'/core/modules/contract/modules_contract.php'; @@ -553,6 +554,7 @@ class FormFile } } elseif ($modulepart == 'facture_fournisseur' || $modulepart == 'supplier_invoice') { + $showempty = 1; // can have no template active if (is_array($genallowed)) $modellist = $genallowed; else { include_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_invoice/modules_facturefournisseur.php';