diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index 8184cf82f5b..d254f920e3b 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -39,15 +39,34 @@ $user->getrights('propale'); $user->getrights('facture'); $mesg = ''; -if (!$user->rights->produit->lire) -{ - accessforbidden(); -} +if (!$user->rights->produit->lire) accessforbidden(); $types[0] = $langs->trans("Product"); $types[1] = $langs->trans("Service"); +/* + * + */ + +if ( $_POST["sendit"] && defined('MAIN_UPLOAD_DOC') && MAIN_UPLOAD_DOC == 1) +{ + if ($_GET["id"]) + { + $product = new Product($db); + $result = $product->fetch($_GET["id"]); + + // if (doliMoveFileUpload($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'])) + + // var_dump($_FILES); + + $product->add_photo($conf->produit->dir_output, $_FILES['photofile']); + } +} +/* + * + */ + if ($_GET["action"] == 'fastappro') { @@ -357,6 +376,11 @@ else $head[$h][1] = $langs->trans("Suppliers"); $h++; } + + $head[$h][0] = DOL_URL_ROOT."/product/photos.php?id=".$product->id; + $head[$h][1] = $langs->trans("Photos"); + $h++; + } $head[$h][0] = DOL_URL_ROOT."/product/stats/fiche.php?id=".$product->id; @@ -517,8 +541,10 @@ else } } - print '