diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index 646c2132fff..58ce9eb921d 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -1092,7 +1092,20 @@ class Form $opt.= price2num($objp->price_ttc,'MU').' '.$langs->trans("Currency".$conf->monnaie).' '.$langs->trans("TTC"); } - if ($objp->duration) $opt.= ' - '.$objp->duration; + if ($objp->duration) + { + $duration_value = substr($objp->duration,0,strlen($objp->duration)-1); + $duration_unit = substr($objp->duration,-1); + if ($duration_value > 1) + { + $dur=array("h"=>$langs->trans("Hours"),"d"=>$langs->trans("Days"),"w"=>$langs->trans("Weeks"),"m"=>$langs->trans("Months"),"y"=>$langs->trans("Years")); + } + else + { + $dur=array("h"=>$langs->trans("Hour"),"d"=>$langs->trans("Day"),"w"=>$langs->trans("Week"),"m"=>$langs->trans("Month"),"y"=>$langs->trans("Year")); + } + $opt.= ' - '.$duration_value.' '.$langs->trans($dur[$duration_unit]); + } $opt.= "\n"; print $opt; diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index 00773bc95be..c7361ce195c 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -487,44 +487,45 @@ if ($_GET["action"] == 'create' && $user->rights->produit->creer) print ''; print ''; - if ($_GET["type"] != 1 && $conf->stock->enabled) + if ($_GET["type"] != 1 && $conf->stock->enabled) { print 'Seuil stock'; print ''; print ''; } - else + else { print ''; } - // Description (utilisé dans facture, propale...) - print ''.$langs->trans("Description").''; + // Description (utilisé dans facture, propale...) + print ''.$langs->trans("Description").''; - if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC) + if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC) { require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); $doleditor=new DolEditor('desc','',160,'dolibarr_notes','',false); $doleditor->Create(); } - else + else { print ''; } - print ""; + print ""; - if ($_GET["type"] == 1) + if ($_GET["type"] == 1) { 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 ''; } - else + else { // Le poids et le volume ne concerne que les produits et pas les services print ''.$langs->trans("Weight").''; @@ -537,15 +538,15 @@ if ($_GET["action"] == 'create' && $user->rights->produit->creer) print ''; } - // Note (invisible sur facture, propales...) - print ''.$langs->trans("NoteNotVisibleOnBill").''; - if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC) + // Note (invisible sur facture, propales...) + 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','',200,'dolibarr_notes','',false); $doleditor->Create(); } - else + else { print ''; @@ -766,11 +767,11 @@ if ($_GET["id"] || $_GET["ref"]) 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("h"=>$langs->trans("Hours"),"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")); + $dur=array("h"=>$langs->trans("Hour"),"d"=>$langs->trans("Day"),"w"=>$langs->trans("Week"),"m"=>$langs->trans("Month"),"y"=>$langs->trans("Year")); } print $langs->trans($dur[$product->duration_unit])." "; @@ -881,6 +882,8 @@ if ($_GET["id"] || $_GET["ref"]) { print ''.$langs->trans("Duration").''; print '  '; + print 'duration_unit=='h'?' checked':'').'>'.$langs->trans("Hour"); + print '  '; print 'duration_unit=='d'?' checked':'').'>'.$langs->trans("Day"); print '  '; print 'duration_unit=='w'?' checked':'').'>'.$langs->trans("Week");