diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index b08848882aa..0067889163d 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1408,6 +1408,14 @@ class CommonObject { $product_static = new Product($db); + $product_static->type=$line->fk_product_type; + $product_static->id=$line->fk_product; + $product_static->ref=$line->ref; + $product_static->libelle=$line->product_label; + $text=$product_static->getNomUrl(1); + $text.= ' - '.$line->product_label; + $description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($line->description)); + include(DOL_DOCUMENT_ROOT.'/core/tpl/predefinedproductline_view.tpl.php'); } else @@ -1419,72 +1427,14 @@ class CommonObject // Ligne en mode update if ($this->statut == 0 && $_GET["action"] == 'editline' && $user->rights->propale->creer && $_GET["lineid"] == $line->id) { - print '
id.'" method="POST">'; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; // ancre pour retourner sur la ligne if ($line->fk_product > 0) { - print ''; - print ''; - if ($line->fk_product_type==1) print img_object($langs->trans('ShowService'),'service'); - else print img_object($langs->trans('ShowProduct'),'product'); - print ' '.$line->ref.''; - print ' - '.nl2br($line->product_label); - print '
'; + include(DOL_DOCUMENT_ROOT.'/core/tpl/predefinedproductline_edit.tpl.php'); } - - // editeur wysiwyg - $nbrows=ROWS_2; - if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; - require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); - $doleditor=new DolEditor('desc',$line->description,164,'dolibarr_details','',false,true,$conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS,$nbrows,70); - $doleditor->Create(); - - print ''; - - // TODO a déplacer dans classe module marge - //if ($conf->global->PRODUIT_USE_MARKUP) print ''.vatrate($line->marge_tx).'%'; - - print ''; - print $html->select_tva('tva_tx',$line->tva_tx,$mysoc,$societe,'',$line->info_bits); - print ''; - print ''; - print ''; - if (($line->info_bits & 2) != 2) + else { - print ''; + include(DOL_DOCUMENT_ROOT.'/core/tpl/freeproductline_edit.tpl.php'); } - else print ' '; - print ''; - print ''; - if (($line->info_bits & 2) != 2) - { - print '%'; - } - else print ' '; - print ''; - print ''; - print '
'; - print '' . "\n"; - - // Start and end dates selector - if ($conf->service->enabled && $dateSelector) - { - print ''; - print ''.$langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; - print $html->select_date($line->date_start,'date_start',$usehm,$usehm,$line->date_start?0:1,"updateligne"); - print ' '.$langs->trans('to').' '; - print $html->select_date($line->date_end,'date_end',$usehm,$usehm,$line->date_end?0:1,"updateligne"); - print ''; - print ''; - } - - print "
\n"; } } diff --git a/htdocs/core/tpl/freeproductline_edit.tpl.php b/htdocs/core/tpl/freeproductline_edit.tpl.php index 62c9fe7ed01..f3b34339a0a 100644 --- a/htdocs/core/tpl/freeproductline_edit.tpl.php +++ b/htdocs/core/tpl/freeproductline_edit.tpl.php @@ -21,6 +21,61 @@ +
id; ?>" method="POST">'; + + + +"> +> + + + global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; + require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); + $doleditor=new DolEditor('desc',$line->description,164,'dolibarr_details','',false,true,$conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS,$nbrows,70); + $doleditor->Create(); + ?> + + + select_tva('tva_tx',$line->tva_tx,$mysoc,$societe,'',$line->info_bits); ?> + + + + + info_bits & 2) != 2) { ?> + + +   + + + + + info_bits & 2) != 2) { ?> + % + +   + + + + "> +
"> + + +service->enabled && $dateSelector) { ?> +> + trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; ?> + select_date($line->date_start,'date_start',$usehm,$usehm,$line->date_start?0:1,"updateligne"); + echo ' '.$langs->trans('to').' '; + echo $html->select_date($line->date_end,'date_end',$usehm,$usehm,$line->date_end?0:1,"updateligne"); + ?> + + + + +
diff --git a/htdocs/core/tpl/predefinedproductline_edit.tpl.php b/htdocs/core/tpl/predefinedproductline_edit.tpl.php index a26145ef494..a3727a1c4d8 100644 --- a/htdocs/core/tpl/predefinedproductline_edit.tpl.php +++ b/htdocs/core/tpl/predefinedproductline_edit.tpl.php @@ -21,6 +21,70 @@ +
id; ?>" method="POST">'; + + + +"> +> + + + + + + fk_product_type==1) echo img_object($langs->trans('ShowService'),'service'); + else print img_object($langs->trans('ShowProduct'),'product'); + echo ' '.$line->ref.''; + echo ' - '.nl2br($line->product_label); + echo '
'; + + // editeur wysiwyg + $nbrows=ROWS_2; + if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; + require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); + $doleditor=new DolEditor('desc',$line->description,164,'dolibarr_details','',false,true,$conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS,$nbrows,70); + $doleditor->Create(); + ?> + + + select_tva('tva_tx',$line->tva_tx,$mysoc,$societe,'',$line->info_bits); ?> + + + + + info_bits & 2) != 2) { ?> + + +   + + + + + info_bits & 2) != 2) { ?> + % + +   + + + + "> +
"> + + +service->enabled && $dateSelector) { ?> +> + trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; ?> + select_date($line->date_start,'date_start',$usehm,$usehm,$line->date_start?0:1,"updateligne"); + echo ' '.$langs->trans('to').' '; + echo $html->select_date($line->date_end,'date_end',$usehm,$usehm,$line->date_end?0:1,"updateligne"); + ?> + + + + +
diff --git a/htdocs/core/tpl/predefinedproductline_view.tpl.php b/htdocs/core/tpl/predefinedproductline_view.tpl.php index bb085dad6eb..452d030e9f7 100644 --- a/htdocs/core/tpl/predefinedproductline_view.tpl.php +++ b/htdocs/core/tpl/predefinedproductline_view.tpl.php @@ -25,24 +25,16 @@ type=$line->fk_product_type; - $product_static->id=$line->fk_product; - $product_static->ref=$line->ref; - $product_static->libelle=$line->product_label; - $text=$product_static->getNomUrl(1); - $text.= ' - '.$line->product_label; - $description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($line->description)); - echo $html->textwithtooltip($text,$description,3,'','',$i); + echo $html->textwithtooltip($text,$description,3,'','',$i); - // Show range - print_date_range($line->date_start, $line->date_end); + // Show range + print_date_range($line->date_start, $line->date_end); - // Add description in form - if ($conf->global->PRODUIT_DESC_IN_FORM) - { - print ($line->description && $line->description!=$line->product_label)?'
'.dol_htmlentitiesbr($line->description):''; - } + // Add description in form + if ($conf->global->PRODUIT_DESC_IN_FORM) + { + print ($line->description && $line->description!=$line->product_label)?'
'.dol_htmlentitiesbr($line->description):''; + } ?>