From 6224f42ed800f72e4bc7228835f07d4eb880b0fe Mon Sep 17 00:00:00 2001 From: Regis Houssin <regis@dolibarr.fr> Date: Fri, 14 Dec 2007 16:01:10 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20suppression=20d=E9finitive=20de=20la=20c?= =?UTF-8?q?onstante=20PRODUIT=5FCHANGE=5FPROD=5FDESC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/admin/produit.php | 21 --------------- htdocs/comm/addpropal.php | 2 +- htdocs/comm/propal.php | 21 +++++++-------- htdocs/commande/fiche.php | 27 +++++++++---------- htdocs/compta/facture.php | 21 +++++++-------- .../modules/pdf/pdf_muscadet.modules.php | 9 +++---- htdocs/includes/modules/modProduit.class.php | 9 +------ htdocs/propal.class.php | 12 ++------- mysql/migration/2.1.0-2.2.0.sql | 2 ++ 9 files changed, 39 insertions(+), 85 deletions(-) diff --git a/htdocs/admin/produit.php b/htdocs/admin/produit.php index 53754ff85cb..58474fa1b24 100644 --- a/htdocs/admin/produit.php +++ b/htdocs/admin/produit.php @@ -99,10 +99,6 @@ else if ($_POST["action"] == 'sousproduits') dolibarr_set_const($db, "PRODUIT_SOUSPRODUITS", $_POST["activate_sousproduits"]); } } -else if ($_POST["action"] == 'changeproductdesc') -{ - dolibarr_set_const($db, "PRODUIT_CHANGE_PROD_DESC", $_POST["activate_changeproductdesc"]); -} else if ($_POST["action"] == 'viewProdDescInForm') { dolibarr_set_const($db, "PRODUIT_DESC_IN_FORM", $_POST["activate_viewProdDescInForm"]); @@ -232,23 +228,6 @@ else print '</tr>'; print '</form>'; - -// Modification description produit activation/desactivation -/* Cet option ne doit pas exister. Les description de lignes doivent toujours etre modifiable. -$var=!$var; -print "<form method=\"post\" action=\"produit.php\">"; -print "<input type=\"hidden\" name=\"action\" value=\"changeproductdesc\">"; -print "<tr ".$bc[$var].">"; -print '<td>'.$langs->trans("ModifyProductDescAbility").'</td>'; -print '<td width="60" align="right">'; -print $html->selectyesno("activate_changeproductdesc",$conf->global->PRODUIT_CHANGE_PROD_DESC,1); -print '</td><td align="right">'; -print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">'; -print "</td>"; -print '</tr>'; -print '</form>'; -*/ - // Visualiser description produit dans les formulaires activation/desactivation $var=!$var; print "<form method=\"post\" action=\"produit.php\">"; diff --git a/htdocs/comm/addpropal.php b/htdocs/comm/addpropal.php index cfae2ed2a2a..b5dffcc891e 100644 --- a/htdocs/comm/addpropal.php +++ b/htdocs/comm/addpropal.php @@ -1,7 +1,7 @@ <?php /* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> * Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net> - * Copyright (C) 2005-2006 Regis Houssin <regis@dolibarr.fr> + * Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 5d366f94445..047b3d33aaa 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1502,19 +1502,16 @@ if ($_GET['propalid'] > 0) } if (! $conf->global->PRODUIT_USE_SEARCH_TO_SELECT) print '<br>'; - if (! $conf->global->PRODUIT_CHANGE_PROD_DESC) + // �diteur wysiwyg + if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS_PERSO) { - // �diteur wysiwyg - if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS_PERSO) - { - require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); - $doleditor=new DolEditor('np_desc','',100,'dolibarr_details'); - $doleditor->Create(); - } - else - { - print '<textarea cols="70" name="np_desc" rows="'.ROWS_2.'" class="flat"></textarea>'; - } + require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); + $doleditor=new DolEditor('np_desc','',100,'dolibarr_details'); + $doleditor->Create(); + } + else + { + print '<textarea cols="70" name="np_desc" rows="'.ROWS_2.'" class="flat"></textarea>'; } print '</td>'; diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index fab72dab264..40d24832d2c 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -1621,21 +1621,18 @@ else } if (! $conf->global->PRODUIT_USE_SEARCH_TO_SELECT) print '<br>'; - - if (! $conf->global->PRODUIT_CHANGE_PROD_DESC) - { - // �diteur wysiwyg - if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS_PERSO) - { - require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); - $doleditor=new DolEditor('np_desc','',100,'dolibarr_details'); - $doleditor->Create(); - } - else - { - print '<textarea cols="70" name="np_desc" rows="'.ROWS_2.'" class="flat"></textarea>'; - } - } + + // �diteur wysiwyg + if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS_PERSO) + { + require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); + $doleditor=new DolEditor('np_desc','',100,'dolibarr_details'); + $doleditor->Create(); + } + else + { + print '<textarea cols="70" name="np_desc" rows="'.ROWS_2.'" class="flat"></textarea>'; + } print '</td>'; print '<td align="right"><input type="text" size="2" name="qty" value="1"></td>'; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 26b8b0a0013..67e59699957 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -2638,19 +2638,16 @@ else if (! $conf->global->PRODUIT_USE_SEARCH_TO_SELECT) print '<br>'; - if (! $conf->global->PRODUIT_CHANGE_PROD_DESC) + // �diteur wysiwyg + if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS_PERSO) { - // �diteur wysiwyg - if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS_PERSO) - { - require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); - $doleditor=new DolEditor('np_desc','',100,'dolibarr_details'); - $doleditor->Create(); - } - else - { - print '<textarea cols="70" name="np_desc" rows="'.ROWS_2.'" class="flat"></textarea>'; - } + require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); + $doleditor=new DolEditor('np_desc','',100,'dolibarr_details'); + $doleditor->Create(); + } + else + { + print '<textarea cols="70" name="np_desc" rows="'.ROWS_2.'" class="flat"></textarea>'; } print '</td>'; diff --git a/htdocs/fourn/commande/modules/pdf/pdf_muscadet.modules.php b/htdocs/fourn/commande/modules/pdf/pdf_muscadet.modules.php index 91ac444405b..1da4a3f2020 100644 --- a/htdocs/fourn/commande/modules/pdf/pdf_muscadet.modules.php +++ b/htdocs/fourn/commande/modules/pdf/pdf_muscadet.modules.php @@ -241,13 +241,10 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $libelleproduitservice=$outputlangs->transnoentities("Product")." ".$com->lignes[$i]->ref_fourn." - ".$libelleproduitservice; // Ajoute description du produit - if ($conf->global->PRODUIT_DESC_IN_FORM && !$conf->global->PRODUIT_CHANGE_PROD_DESC) + if ($com->lignes[$i]->product_desc&&$com->lignes[$i]->product_desc!=$fac->lignes[$i]->libelle&&$com->lignes[$i]->product_desc!=$com->lignes[$i]->desc) { - if ($com->lignes[$i]->product_desc&&$com->lignes[$i]->product_desc!=$fac->lignes[$i]->libelle&&$com->lignes[$i]->product_desc!=$com->lignes[$i]->desc) - { - if ($libelleproduitservice) $libelleproduitservice.="\n"; - $libelleproduitservice.=$com->lignes[$i]->product_desc; - } + if ($libelleproduitservice) $libelleproduitservice.="\n"; + $libelleproduitservice.=$com->lignes[$i]->product_desc; } } if ($com->lignes[$i]->date_start && $com->lignes[$i]->date_end) diff --git a/htdocs/includes/modules/modProduit.class.php b/htdocs/includes/modules/modProduit.class.php index ac96f40d648..9bf52e0397c 100644 --- a/htdocs/includes/modules/modProduit.class.php +++ b/htdocs/includes/modules/modProduit.class.php @@ -80,20 +80,13 @@ class modProduit extends DolibarrModules // Constantes $this->const = array(); $r=0; - - $this->const[$r][0] = "PRODUIT_CHANGE_PROD_DESC"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "0"; - $this->const[$r][3] = "Mettre � 1 pour permettre modification de description d'un produit dans une propale, commande et facture"; - $this->const[$r][4] = 1; - $r++; $this->const[$r][0] = "MAIN_SEARCHFORM_PRODUITSERVICE"; $this->const[$r][1] = "yesno"; $this->const[$r][2] = "1"; $this->const[$r][3] = "Affichage formulaire de recherche des Produits et Services dans la barre de gauche"; $this->const[$r][4] = 0; - $r++; + $r++; // Boxes $this->boxes = array(); diff --git a/htdocs/propal.class.php b/htdocs/propal.class.php index 4f9e007d6f9..a32358bc823 100644 --- a/htdocs/propal.class.php +++ b/htdocs/propal.class.php @@ -142,16 +142,8 @@ class Propal extends CommonObject { $prod=new Product($this->db); $prod->fetch($idproduct); - - // on ajoute la description du produit si l'option est active - if ($conf->global->PRODUIT_CHANGE_PROD_DESC) - { - $productdesc = $prod->description; - } - else - { - $productdesc = ''; - } + + $productdesc = $prod->description; $tva_tx = get_default_tva($mysoc,$this->client,$prod->tva_tx); // multiprix diff --git a/mysql/migration/2.1.0-2.2.0.sql b/mysql/migration/2.1.0-2.2.0.sql index 61e46a0ec94..3ea98fcb4ec 100644 --- a/mysql/migration/2.1.0-2.2.0.sql +++ b/mysql/migration/2.1.0-2.2.0.sql @@ -1162,3 +1162,5 @@ ALTER TABLE llx_societe_remise_except ADD CONSTRAINT fk_societe_remise_fk_factur -- V4.1 update llx_facture set total_ttc = NULL where rowid in (select fk_facture from llx_facturedet where description = '(CREDIT_NOTE)'); -- V4.1 update llx_societe_remise_except as re set re.fk_facture = (select fk_facture from llx_facturedet as fd where fd.rowid = re.fk_facture_line), re.fk_facture_line = NULL where re.fk_facture_line in (select rowid from llx_facturedet where description = '(CREDIT_NOTE)'); -- V4.1 delete from llx_facturedet where description = '(CREDIT_NOTE)'; + +DELETE FROM llx_const WHERE name = 'PRODUIT_CHANGE_PROD_DESC'; \ No newline at end of file -- GitLab