diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index ade26bbafdd..62779230379 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -189,6 +189,23 @@ else if ($action == 'set_FICHINTER_DRAFT_WATERMARK') } } +elseif ($action == 'set_FICHINTER_PRINT_PRODUCTS') +{ + $val = GETPOST('FICHINTER_PRINT_PRODUCTS','alpha'); + $res = dolibarr_set_const($db, "FICHINTER_PRINT_PRODUCTS",($val == 'on'),'bool',0,'',$conf->entity); + + if (! $res > 0) $error++; + + if (! $error) + { + $mesg = "".$langs->trans("SetupSaved").""; + } + else + { + $mesg = "".$langs->trans("Error").""; + } +} + /* * View @@ -469,6 +486,22 @@ print ''; print ''; print "\n"; + +// print products on fichinter +$var=! $var; +print '
'; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index b29e9da546d..6501dd94ef8 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3913,6 +3913,11 @@ class Form if ($object->photo) $file=get_exdir($id, 2).'photos/'.$object->photo; if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility $email=$object->email; + }else { + $dir=$conf->$modulepart->dir_output; + if ($object->photo) $file=get_exdir($id, 2).'photos/'.$object->photo; + if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility + $email=$object->email; } if ($dir) diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index 67b3a93b4ee..a6a1291734b 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -202,12 +202,10 @@ else if ($action == 'add' && $user->rights->ficheinter->creer) { $product_type=($lines[$i]->product_type?$lines[$i]->product_type:0); - if ($product_type == 1) { //only services + if ($product_type == 1 || !empty($conf->global->FICHINTER_PRINT_PRODUCTS)) { //only services except if config includes products // service prédéfini if ($lines[$i]->fk_product > 0) { - $product_static = new Product($db); - // Define output language if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { @@ -230,15 +228,8 @@ else if ($action == 'add' && $user->rights->ficheinter->creer) $label = $lines[$i]->product_label; } - $product_static->type=$lines[$i]->fk_product_type; - $product_static->id=$lines[$i]->fk_product; - $product_static->ref=$lines[$i]->ref; - $product_static->libelle=$label; - $desc=$product_static->getNomUrl(0); - $desc.= ' - '.$label; + $desc = $label; $desc .= ' ('.$langs->trans('Quantity').': '.$lines[$i]->qty.')'; - if ($conf->global->PRODUIT_DESC_IN_FORM) - $desc .= ($lines[$i]->desc && $lines[$i]->desc!=$lines[$i]->libelle)?'