diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index 170d365e778..eecbee63c52 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -130,6 +130,8 @@ if ($_POST["action"] == 'add' && ($user->rights->produit->creer || $user->rights $product=new Product($db); $usecanvas=$_POST["canvas"]; + if (empty($conf->global->MAIN_USE_CANVAS)) $usecanvas=0; + if (! empty($usecanvas)) // Overwrite product here { $canvas = new Canvas($db,$user); @@ -216,6 +218,8 @@ if ($_POST["action"] == 'update' && ($user->rights->produit->creer || $user->rig $product=new Product($db); $usecanvas=$_POST["canvas"]; + if (empty($conf->global->MAIN_USE_CANVAS)) $usecanvas=0; + if (! empty($usecanvas)) // Overwrite product here { $canvas = new Canvas($db,$user); @@ -625,12 +629,179 @@ if ($_GET["action"] == 'create' && ($user->rights->produit->creer || $user->righ llxHeader('',$langs->trans("CardProduct".$_GET["type"]),$helpurl); $usecanvas=$_GET["canvas"]; + if (empty($conf->global->MAIN_USE_CANVAS)) $usecanvas=0; + if (empty($usecanvas)) { - // TODO Restore simple code here + print '
'; + print ''; + print ''; + print ''."\n"; + if ($_GET["type"]==1) $title=$langs->trans("NewService"); + else $title=$langs->trans("NewProduct"); + print_fiche_titre($title); + print ''; + print ''; + print ''; + // Label + print ''; + + // Status + print ''; + + // Stock min level + if ($_GET["type"] != 1 && $conf->stock->enabled) + { + print ''; + } + else + { + print ''; + } + + // Description (used in invoice, propal...) + print '"; + + // Nature + if ($_GET["type"] != 1) + { + print ''; + } + + //Duration + if ($_GET["type"] == 1) + { + print ''; + } + + if ($_GET["type"] != 1) // Le poids et le volume ne concerne que les produits et pas les services + { + // Weight + print ''; + // Length + print ''; + // Surface + print ''; + // Volume + print ''; + } + + // Hidden + if (($_GET["type"] != 1 && $user->rights->produit->hidden) + || ($_GET["type"] == 1 && $user->rights->service->hidden)) + { + print ''; + } + else + { + print ''; + } + + // Note (invisible sur facture, propales...) + print '"; + print '
'.$langs->trans("Ref").''; + if ($_error == 1) + { + print $langs->trans("RefAlreadyExists"); + } + print '
'.$langs->trans("Label").'
'.$langs->trans("Status").''; + $statutarray=array('1' => $langs->trans("OnSell"), '0' => $langs->trans("NotOnSell")); + $html->select_array('statut',$statutarray,$_POST["statut"]); + print '
'.$langs->trans("StockLimit").''; + print ''; + print '
'.$langs->trans("Description").''; + + if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC) + { + require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); + $doleditor=new DolEditor('desc',$_POST["desc"],160,'dolibarr_notes','',false); + $doleditor->Create(); + } + else + { + print ''; + } + + print "
'.$langs->trans("Nature").''; + $statutarray=array('1' => $langs->trans("Finished"), '0' => $langs->trans("RowMaterial")); + $html->select_array('finished',$statutarray,$_POST["finished"]); + print '
'.$langs->trans("Duration").'  '; + print ''.$langs->trans("Hour").' '; + print ''.$langs->trans("Day").' '; + print ''.$langs->trans("Week").' '; + print ''.$langs->trans("Month").' '; + print ''.$langs->trans("Year").' '; + print '
'.$langs->trans("Weight").''; + print ''; + print $formproduct->select_measuring_units("weight_units","weight"); + print '
'.$langs->trans("Length").''; + print ''; + print $formproduct->select_measuring_units("size_units","size"); + print '
'.$langs->trans("Surface").''; + print ''; + print $formproduct->select_measuring_units("surface_units","surface"); + print '
'.$langs->trans("Volume").''; + print ''; + print $formproduct->select_measuring_units("volume_units","volume"); + print '
'.$langs->trans("Hidden").''; + print $html->selectyesno('hidden',$product->hidden); + print '
'.$langs->trans("Hidden").''; + print yn("No"); + print '
'.$langs->trans("NoteNotVisibleOnBill").''; + if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC) + { + require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); + $doleditor=new DolEditor('note',$_POST["note"],180,'dolibarr_notes','',false); + $doleditor->Create(); + } + else + { + print ''; + } + print "
'; + + print '
'; + + if ($conf->global->PRODUIT_MULTIPRICES) + { + // We do no show price array on create when multiprices enabled. + // We must set them on prices tab. + } + else + { + print ''; + + // PRIX + print ''; + print ''; + + // MIN PRICE + print ''; + print ''; + + // VAT + print ''; + + print '
'.$langs->trans("SellingPrice").''; + print $html->select_PriceBaseType($product->price_base_type, "price_base_type"); + print '
'.$langs->trans("MinPrice").''; + print '
'.$langs->trans("VATRate").''; + print $html->select_tva("tva_tx",$conf->defaulttx,$mysoc,''); + print '
'; + + print '
'; + } + + print '
'; + + print '
'; } else { @@ -655,6 +826,7 @@ if ($_GET["id"] || $_GET["ref"]) $productstatic = new Product($db); $result = $productstatic->getCanvas($_GET["id"],$_GET["ref"]); $usecanvas=$productstatic->canvas; + if (empty($conf->global->MAIN_USE_CANVAS)) $usecanvas=0; if (empty($usecanvas)) {