diff --git a/htdocs/admin/produit.php b/htdocs/admin/produit.php
index 8d2d2264e45..53754ff85cb 100644
--- a/htdocs/admin/produit.php
+++ b/htdocs/admin/produit.php
@@ -234,6 +234,7 @@ print '';
// Modification description produit activation/desactivation
+/* Cet option ne doit pas exister. Les description de lignes doivent toujours etre modifiable.
$var=!$var;
print "
';
+*/
// Visualiser description produit dans les formulaires activation/desactivation
$var=!$var;
diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php
index 23989a57077..e6d625e8b51 100644
--- a/htdocs/comm/propal.php
+++ b/htdocs/comm/propal.php
@@ -536,16 +536,9 @@ if ($_POST['action'] == "addligne" && $user->rights->propale->creer)
}
}
- // La description de la ligne est celle saisie ou
- // celle du produit si PRODUIT_CHANGE_PROD_DESC est défini
- if ($conf->global->PRODUIT_CHANGE_PROD_DESC)
- {
- $desc = $prod->description;
- }
- else
- {
- $desc = $_POST['np_desc'];
- }
+ $desc = $prod->description;
+ $desc.= $prod->description && $_POST['np_desc'] ? "\n" : "";
+ $desc.= $_POST['np_desc'];
}
else
{
@@ -1085,30 +1078,19 @@ if ($_GET['propalid'] > 0)
print '';
print ''; // ancre pour retourner sur la ligne
$text = '';
+
+ // Affiche ligne produit
+ $text = '';
if ($objp->fk_product_type==1) $text.= img_object($langs->trans('ShowService'),'service');
else $text.= img_object($langs->trans('ShowProduct'),'product');
$text.= ' '.$objp->ref.'';
- $text.= ' - '.nl2br(stripslashes($objp->product));
- if ($conf->global->PRODUIT_DESC_IN_FORM)
- {
- print $text;
- }
- else
- {
- print $html->textwithtooltip($text,$objp->description,4,'','',$i,500,100,$objp->ref.' - '.nl2br(stripslashes($objp->product)));
- }
+ $text.= ' - '.$objp->product;
+ $description=($conf->global->PRODUIT_DESC_IN_FORM?'':$objp->description);
+ print $html->textwithtooltip($text,$description,3,'','',$i);
print_date_range($objp->date_start,$objp->date_end);
-
if ($conf->global->PRODUIT_DESC_IN_FORM)
{
- if ($conf->global->PRODUIT_CHANGE_PROD_DESC)
- {
- print ($objp->description && $objp->description!=$objp->product)?' '.stripslashes(nl2br($objp->description)):'';
- }
- else
- {
- print ' '.nl2br($objp->product_desc);
- }
+ print ($objp->description && $objp->description!=$objp->product)?' '.stripslashes(nl2br($objp->description)):'';
}
print ' | ';
diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php
index 69fd86617c4..206dff04ea9 100644
--- a/htdocs/commande/fiche.php
+++ b/htdocs/commande/fiche.php
@@ -20,7 +20,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
- * $Source$
*/
/**
@@ -352,18 +351,9 @@ if ($_POST['action'] == 'addligne' && $user->rights->commande->creer)
}
}
- // La description de la ligne est celle saisie ou
- // celle du produit si PRODUIT_CHANGE_PROD_DESC est défini
- $libelle = $prod->libelle;
- if ($conf->global->PRODUIT_CHANGE_PROD_DESC)
- {
- $desc = $prod->description;
- }
- else
- {
- $desc = $_POST['np_desc'];
- }
-
+ $desc = $prod->description;
+ $desc.= $prod->description && $_POST['np_desc'] ? "\n" : "";
+ $desc.= $_POST['np_desc'];
}
else
{
@@ -1343,32 +1333,20 @@ else
{
print '';
print ''; // ancre pour retourner sur la ligne
+
+ // Affiche ligne produit
$text = '';
if ($objp->fk_product_type==1) $text.= img_object($langs->trans('ShowService'),'service');
else $text.= img_object($langs->trans('ShowProduct'),'product');
$text.= ' '.$objp->ref.'';
- $text.= ' - '.nl2br(stripslashes($objp->product));
- if ($conf->global->PRODUIT_DESC_IN_FORM)
- {
- print $text;
- }
- else
- {
- print $html->textwithtooltip($text,$objp->description,4,'','',$i,$objp->ref.' - '.nl2br(stripslashes($objp->product)));
- }
+ $text.= ' - '.$objp->product;
+ $description=($conf->global->PRODUIT_DESC_IN_FORM?'':$objp->description);
+ print $html->textwithtooltip($text,$description,3,'','',$i);
// Todo: voir si on insert ou pas en option les dates de début et de fin de service
//print_date_range($objp->date_start,$objp->date_end);
-
if ($conf->global->PRODUIT_DESC_IN_FORM)
{
- if ($conf->global->PRODUIT_CHANGE_PROD_DESC)
- {
- print ($objp->description && $objp->description!=$objp->product)?' '.nl2br(stripslashes($objp->description)):'';
- }
- else
- {
- print ' '.nl2br($objp->product_desc);
- }
+ print ($objp->description && $objp->description!=$objp->product)?' '.stripslashes(nl2br($objp->description)):'';
}
print ' | ';
diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index e61ee964064..4bab896c421 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -802,16 +802,9 @@ if (($_POST['action'] == 'addligne' || $_POST['action'] == 'addligne_predef') &&
}
}
- // La description de la ligne est celle saisie ou
- // celle du produit si PRODUIT_CHANGE_PROD_DESC défini
- if ($conf->global->PRODUIT_CHANGE_PROD_DESC)
- {
- $desc = $prod->description;
- }
- else
- {
- $desc=$_POST['np_desc'];
- }
+ $desc = $prod->description;
+ $desc.= $prod->description && $_POST['np_desc'] ? "\n" : "";
+ $desc.= $_POST['np_desc'];
}
else
{
@@ -2248,31 +2241,19 @@ else
{
print '';
print ''; // ancre pour retourner sur la ligne
+
+ // Affiche ligne produit
$text = '';
if ($objp->fk_product_type==1) $text.= img_object($langs->trans('ShowService'),'service');
else $text.= img_object($langs->trans('ShowProduct'),'product');
$text.= ' '.$objp->ref.'';
- $text.= ' - '.nl2br(stripslashes($objp->product));
- if ($conf->global->PRODUIT_DESC_IN_FORM)
- {
- print $text;
- }
- else
- {
- print $html->textwithtooltip($text,$objp->description,4,'','',$i,$objp->ref.' - '.nl2br(stripslashes($objp->product)));
- }
+ $text.= ' - '.$objp->product;
+ $description=($conf->global->PRODUIT_DESC_IN_FORM?'':$objp->description);
+ print $html->textwithtooltip($text,$description,3,'','',$i);
print_date_range($objp->date_start,$objp->date_end);
-
if ($conf->global->PRODUIT_DESC_IN_FORM)
{
- if ($conf->global->PRODUIT_CHANGE_PROD_DESC)
- {
- print ($objp->description && $objp->description!=$objp->product)?' '.stripslashes(nl2br($objp->description)):'';
- }
- else
- {
- print ' '.nl2br($objp->product_desc);
- }
+ print ($objp->description && $objp->description!=$objp->product)?' '.stripslashes(nl2br($objp->description)):'';
}
print ' | ';
diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php
index f0901a55393..67c2bec31c2 100644
--- a/htdocs/fourn/commande/fiche.php
+++ b/htdocs/fourn/commande/fiche.php
@@ -116,14 +116,9 @@ if ($_POST['action'] == 'addligne' && $user->rights->fournisseur->commande->cree
$libelle = $prod->libelle;
- // La description de la ligne est celle saisie ou
- // celle du produit si (non saisi + PRODUIT_CHANGE_PROD_DESC défini)
- // \todo Ne faut-il pas rendre $conf->global->PRODUIT_CHANGE_PROD_DESC toujours a on
- $desc=$_POST['np_desc'];
- if (! $desc && $conf->global->PRODUIT_CHANGE_PROD_DESC)
- {
- $desc = $prod->description;
- }
+ $desc = $prod->description;
+ $desc.= $prod->description && $_POST['np_desc'] ? "\n" : "";
+ $desc.= $_POST['np_desc'];
$tva_tx = get_default_tva($soc,$mysoc,$prod->tva_tx);
}
diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php
index df0b95e47b4..647b505a0c4 100644
--- a/htdocs/html.form.class.php
+++ b/htdocs/html.form.class.php
@@ -65,15 +65,15 @@ class Form
/**
- \brief Affiche un texte+picto avec tooltip sur texte ou sur picto
- \param text Texte à afficher
- \param htmltext Contenu html du tooltip, codé en html
- \param tooltipon 1=tooltip sur texte, 2=tooltip sur picto, 3=tooltip sur les 2, 4=tooltip Ajax
- \param direction -1=Le picto est avant, 0=pas de picto, 1=le picto est après
- \param img Code img du picto
- \return string Code html du texte,picto
+ \brief Affiche un texte+picto avec tooltip sur texte ou sur picto
+ \param text Texte à afficher
+ \param htmltext Contenu html du tooltip, codé en html
+ \param tooltipon 1=tooltip sur texte, 2=tooltip sur picto, 3=tooltip sur les 2, 4=tooltip sur les 2 et forcé en Ajaxa
+ \param direction -1=Le picto est avant, 0=pas de picto, 1=le picto est après
+ \param img Code img du picto
+ \return string Code html du texte,picto
*/
- function textwithtooltip($text,$htmltext,$tooltipon=1,$direction=0,$img='',$i=1,$width='200',$shiftX='10',$option='')
+ function textwithtooltip($text,$htmltext,$tooltipon=1,$direction=0,$img='',$i=1,$width='200',$shiftX='10')
{
global $conf;
@@ -96,7 +96,7 @@ class Form
$s.= ''."\n";
$s.= ''."\n";
}
else
diff --git a/mysql/migration/2.1.0-2.2.0.sql b/mysql/migration/2.1.0-2.2.0.sql
index f40eaa58f09..97130e064bb 100644
--- a/mysql/migration/2.1.0-2.2.0.sql
+++ b/mysql/migration/2.1.0-2.2.0.sql
@@ -1061,4 +1061,6 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (10
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (105,10, '15','0','TVA 12% Majoré à 25% (15%)',1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (106,10, '22.5','0','VAT 18% Majoré à 25% (22.5%)',1);
-ALTER TABLE llx_bank_account MODIFY iban_prefix varchar(50);
\ No newline at end of file
+ALTER TABLE llx_bank_account MODIFY iban_prefix varchar(50);
+
+delete from llx_const where name='PRODUIT_CHANGE_PROD_DESC';