diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index 4851d5e09df..f04d7f5c5b7 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -116,7 +116,7 @@ if ($_POST["action"] == 'update' && if ($product->update($product->id, $user) > 0) { $_GET["action"] = ''; - $_GET["id"] = $_POST["id"]; + $_GET["id"] = $_POST["id"]; } else { @@ -128,7 +128,7 @@ if ($_POST["action"] == 'update' && else { $_GET["action"] = 're-edit'; - $_GET["id"] = $_POST["id"]; + $_GET["id"] = $_POST["id"]; $mesg = $langs->trans("ErrorProductBadRefOrLabel"); } } @@ -351,12 +351,12 @@ else $h++; } - if ($conf->fournisseur->enabled) - { - $head[$h][0] = DOL_URL_ROOT."/product/fournisseurs.php?id=".$product->id; - $head[$h][1] = $langs->trans("Suppliers"); - $h++; - } + if ($conf->fournisseur->enabled) + { + $head[$h][0] = DOL_URL_ROOT."/product/fournisseurs.php?id=".$product->id; + $head[$h][1] = $langs->trans("Suppliers"); + $h++; + } } $head[$h][0] = DOL_URL_ROOT."/product/stats/fiche.php?id=".$product->id; @@ -440,7 +440,7 @@ else } else { - print "".$product->stock_reel; + print "".$product->stock_reel; } } print ''; @@ -452,60 +452,60 @@ else print ''.$langs->trans("Duration").''.$product->duration_value.' '; if ($product->duration_value > 1) - { - $dur=array("d"=>$langs->trans("Days"),"w"=>$langs->trans("Weeks"),"m"=>$langs->trans("Months"),"y"=>$langs->trans("Years")); + { + $dur=array("d"=>$langs->trans("Days"),"w"=>$langs->trans("Weeks"),"m"=>$langs->trans("Months"),"y"=>$langs->trans("Years")); + } + else { + $dur=array("d"=>$langs->trans("Day"),"w"=>$langs->trans("Week"),"m"=>$langs->trans("Month"),"y"=>$langs->trans("Year")); } - else { - $dur=array("d"=>$langs->trans("Day"),"w"=>$langs->trans("Week"),"m"=>$langs->trans("Month"),"y"=>$langs->trans("Year")); - } - print $langs->trans($dur[$product->duration_unit])." "; + print $langs->trans($dur[$product->duration_unit])." "; print ''; } print "
\n"; - print "\n"; - } + print "\n"; + } - /* - * Edition du prix - * - */ - if ($_GET["action"] == 'edit_price' && $user->rights->produit->creer) - { - print '
'.$langs->trans("NewPrice").'
'; - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - print '
'.$langs->trans('SellingPrice').'
 '; - print '
'; - print '
'; - } + /* + * Edition du prix + * + */ + if ($_GET["action"] == 'edit_price' && $user->rights->produit->creer) + { + print '
'.$langs->trans("NewPrice").'
'; + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + print '
'.$langs->trans('SellingPrice').'
 '; + print '
'; + print '
'; + } - /* - * Ajouter un fournisseur - * - */ - if ($_GET["action"] == 'ajout_fourn' && $user->rights->produit->creer) - { - $langs->load("suppliers"); + /* + * Ajouter un fournisseur + * + */ + if ($_GET["action"] == 'ajout_fourn' && $user->rights->produit->creer) + { + $langs->load("suppliers"); - print_titre($langs->trans("AddSupplier")); - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - print '
'.$langs->trans("Suppliers").''; + print ''; + print ''; + print ''; + print ''; + print '
'.$langs->trans("Suppliers").''.$langs->trans("Ref").'
 '; + print '
'; + print ''; + } + + /* + * Ajouter une photo + * + */ + if ($_GET["action"] == 'ajout_photo' && $user->rights->produit->creer && $product->isproduct) + { + $langs->load("suppliers"); + + print_titre($langs->trans("AddPhoto")); + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + + print ''; + print '
'.$langs->trans("File").'
 '; + print '
'; + print '
'; } - print '
'.$langs->trans("Ref").'
 '; - print '
'; - print ''; - } } - /* - * Fiche en mode edition - */ + /* + * + * Fiche en mode edition + * + */ if (($_GET["action"] == 'edit' || $_GET["action"] == 're-edit') && $user->rights->produit->creer) { print_fiche_titre('Edition de la fiche '.$types[$product->type].' : '.$product->ref, ""); - if ($mesg) { - print '
'.$mesg.'

'; + if ($mesg) { + print '
'.$mesg.'

'; } print "
\n"; @@ -581,14 +605,14 @@ else if ($product->type == 1) { print ''.$langs->trans("Duration").''; - print '  '; - print 'duration_unit=='d'?' checked':'').'>'.$langs->trans("Day"); - print '  '; - print 'duration_unit=='w'?' checked':'').'>'.$langs->trans("Week"); - print '  '; - print 'duration_unit=='m'?' checked':'').'>'.$langs->trans("Month"); - print '  '; - print 'duration_unit=='y'?' checked':'').'>'.$langs->trans("Year"); + print '  '; + print 'duration_unit=='d'?' checked':'').'>'.$langs->trans("Day"); + print '  '; + print 'duration_unit=='w'?' checked':'').'>'.$langs->trans("Week"); + print '  '; + print 'duration_unit=='m'?' checked':'').'>'.$langs->trans("Month"); + print '  '; + print 'duration_unit=='y'?' checked':'').'>'.$langs->trans("Year"); print ''; } @@ -616,21 +640,32 @@ print "\n
\n"; if ($_GET["action"] == '') { - if ($product->type == 0 && $user->rights->produit->commander && $num_fournisseur == 1) + if ($product->type == 0 && $user->rights->produit->commander && $num_fournisseur == 1) { - print ''.$langs->trans("Order").''; + print ''; + print $langs->trans("Order").''; } - if ( $user->rights->produit->creer) + + if ( $user->rights->produit->creer && $product->isproduct) { - print ''.$langs->trans("UpdatePrice").''; + print ''; + print $langs->trans("AddPhoto").''; } - if ( $user->rights->produit->creer) + + if ( $user->rights->produit->creer) { - print ''.$langs->trans("Edit").''; + print ''; + print $langs->trans("UpdatePrice").''; } - if ($product->type == 0 && $conf->stock->enabled) + + if ( $user->rights->produit->creer) { - print ''.$langs->trans("CorrectStock").''; + print ''.$langs->trans("Edit").''; + } + + if ($product->type == 0 && $conf->stock->enabled) + { + print ''.$langs->trans("CorrectStock").''; } } @@ -689,25 +724,25 @@ if ($_GET["id"] && $_GET["action"] == '' && $product->envente) } print ''; - print ''; + print ''; - $otherprop = $propal->liste_array(1, '<>'.$user->id); - if (sizeof($otherprop)) - { - print ''; - print ''; - print ''; - print "".''; - print '
Autres Propositions'; - $htmls->select_array("propalid", $otherprop); - print ''; - print 'Rem.'; - print '%'; - print ''; - print ''; - print '
'; - } - print ''; + $otherprop = $propal->liste_array(1, '<>'.$user->id); + if (sizeof($otherprop)) + { + print '
'; + print ''; + print ''; + print "".''; + print '
Autres Propositions'; + $htmls->select_array("propalid", $otherprop); + print ''; + print 'Rem.'; + print '%'; + print ''; + print ''; + print '
'; + } + print ''; print ''; } @@ -762,7 +797,7 @@ if ($_GET["id"] && $_GET["action"] == '' && $product->envente) dolibarr_print_error($db); } print ''; - // \todo Ajouter liste des factures autres + // \todo Ajouter liste des factures autres print ''; } }