diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index 8c99d631b01..f8d68ddfabd 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -903,8 +903,10 @@ if ($id > 0 || ! empty($ref)) print ''; print ''; - print $html->select_type_of_lines(isset($_POST["type"])?$_POST["type"]:-1,'type',1); - if ($conf->produit->enabled && $conf->service->enabled) print '
'; + $forceall=1; + print $html->select_type_of_lines(isset($_POST["type"])?$_POST["type"]:-1,'type',1,0,$forceall); + if ($forceall || ($conf->produit->enabled && $conf->service->enabled) + || (empty($conf->produit->enabled) && empty($conf->service->enabled))) print '
'; // Editor wysiwyg if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS) diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 3855d11f501..a4379ced733 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -1065,8 +1065,9 @@ else print ''; print ''; - print $html->select_type_of_lines(isset($_POST["type"])?$_POST["type"]:-1,'type',1); - if (($conf->produit->enabled && $conf->service->enabled) + $forceall=1; // For suppliers, we always show all types + print $html->select_type_of_lines(isset($_POST["type"])?$_POST["type"]:-1,'type',1,0,$forceall); + if ($forceall || ($conf->produit->enabled && $conf->service->enabled) || (empty($conf->produit->enabled) && empty($conf->service->enabled))) print '
'; // Editor wysiwyg diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index 135b644d705..94b167ec0cd 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -394,15 +394,17 @@ class Form /** * \brief Return list of types of lines (product or service) * \param selected Preselected type - * \param htmlname Name of field in form + * \param htmlname Name of field in html form * \param showempty Add an empty field + * \param hidetext Do not show label before combo box + * \param forceall Force to show products and services in combo list, whatever are activated modules */ - function select_type_of_lines($selected='',$htmlname='type',$showempty=0,$hidetext=0) + function select_type_of_lines($selected='',$htmlname='type',$showempty=0,$hidetext=0,$forceall=0) { global $db,$langs,$user,$conf; // If product & services are enabled or both disabled. - if (($conf->produit->enabled && $conf->service->enabled) + if ($forceall || ($conf->produit->enabled && $conf->service->enabled) || (empty($conf->produit->enabled) && empty($conf->service->enabled))) { if (empty($hidetext)) print $langs->trans("Type").': '; @@ -425,11 +427,11 @@ class Form print ''; //if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); } - if (empty($conf->produit->enabled) && $conf->service->enabled) + if (! $forceall && empty($conf->produit->enabled) && $conf->service->enabled) { print ''; } - if ($conf->produit->enabled && empty($conf->service->enabled)) + if (! $forceall && $conf->produit->enabled && empty($conf->service->enabled)) { print ''; } diff --git a/htdocs/html.formfile.class.php b/htdocs/html.formfile.class.php index a70fbe6d83b..296bccb3c03 100644 --- a/htdocs/html.formfile.class.php +++ b/htdocs/html.formfile.class.php @@ -335,11 +335,18 @@ class FormFile } print ''; print ''; - print ''; + print ''; + if (is_array($modellist) && ! sizeof($modellist)) + { + $langs->load("errors"); + print ' '.img_warning($langs->trans("WarningNoDocumentModelActivated")); + } print ''; } - // Recupe liste des fichiers + // Get list of files $png = ''; $filter = ''; if ($iconPDF==1) @@ -359,12 +366,12 @@ class FormFile print ''; } - // Boucle sur chaque ligne trouvee + // Loop on each file found foreach($file_list as $i => $file) { $var=!$var; - // Defini chemin relatif par rapport au module pour lien download + // Define relative path for download link (depends on module) $relativepath=$file["name"]; // Cas general if ($filename) $relativepath=$filename."/".$file["name"]; // Cas propal, facture... // Autre cas @@ -373,7 +380,7 @@ class FormFile if (!$iconPDF) print ""; - // Affiche nom fichier avec lien download + // Show file name with link to download if (!$iconPDF) print '
'; print ''; if (!$iconPDF) diff --git a/htdocs/includes/modules/project/modules_project.php b/htdocs/includes/modules/project/modules_project.php index 93ffbec831a..7dbcb9c7e4f 100644 --- a/htdocs/includes/modules/project/modules_project.php +++ b/htdocs/includes/modules/project/modules_project.php @@ -171,7 +171,7 @@ class ModeleNumRefProjects */ function project_pdf_create($db, $comid, $modele,$outputlangs) { - global $langs; + global $conf,$langs; $langs->load("projects"); $dir = DOL_DOCUMENT_ROOT."/includes/modules/project/pdf/"; diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 749f4e745ac..93ad9868914 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -60,4 +60,5 @@ ErrorWrongValueForField=Wrong value for field number %s (value '%s ErrorsOnXLines=Errors on %s source lines WarningsOnXLines=Warnings on %s source lines ErrorFileIsInfectedWithAVirus=The antivirus program was not able to validate the file (file might be infected by a virus) -ErrorSpecialCharNotAllowedForField=Special characters are not allowed for field "%s" \ No newline at end of file +ErrorSpecialCharNotAllowedForField=Special characters are not allowed for field "%s" +WarningNoDocumentModelActivated=No model, for document generation, has been activated. A model will be choosed by default until you check your module setup. diff --git a/htdocs/langs/fr_FR/errors.lang b/htdocs/langs/fr_FR/errors.lang index f4fc27ac6d1..75f5e9c3808 100644 --- a/htdocs/langs/fr_FR/errors.lang +++ b/htdocs/langs/fr_FR/errors.lang @@ -61,4 +61,5 @@ ErrorWrongValueForField=Mauvaise valeur pour le champ numéro %s (la vale ErrorsOnXLines=Erreurs sur %s lignes sources WarningsOnXLines=Alertes sur %s lignes sources ErrorFileIsInfectedWithAVirus=L'antivirus n'a pas pu valider ce fichier (il est probablement infecté par un virus) ! -ErrorSpecialCharNotAllowedForField=Les caractères spéciaux ne sont pas admins pour le champ "%s" \ No newline at end of file +ErrorSpecialCharNotAllowedForField=Les caractères spéciaux ne sont pas admins pour le champ "%s" +WarningNoDocumentModelActivated=Aucun modèle, pour la génération de document, n'a été activé. Un modèle sera pris par défaut en attendant la correction de configuration du module.