diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index e5666446a5f..80e81b0d049 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -39,13 +39,15 @@ if (!$user->admin) $modules = array( 'SOCIETE' => 'FCKeditorForCompany', 'PRODUCTDESC' => 'FCKeditorForProductDescription', -'DETAILS' => 'FCKeditorForDetails', +'PRODUCTNOTE' => 'FCKeditorForProductNote', +'DETAILS' => 'FCKeditorForProductDetails', 'MAILING' => 'FCKeditorForMailing' ); // Conditions pour que l'option soit proposée $conditions = array( 'SOCIETE' => $conf->societe->enabled, 'PRODUCTDESC' => ($conf->produit->enabled||$conf->service->enabled), +'PRODUCTNOTE' => ($conf->produit->enabled||$conf->service->enabled), 'DETAILS' => ($conf->facture->enabled||$conf->propal->enabled||$conf->commande->enabled), 'MAILING' => $conf->mailing->enabled ); @@ -83,13 +85,6 @@ $head[$h][1] = $langs->trans("Activation"); $hselected=$h; $h++; -/* -En attendant d'avoir quelquechose de gérer par cette page, je commente -$head[$h][0] = DOL_URL_ROOT."/admin/fckeditor_cfg.php"; -$head[$h][1] = $langs->trans("Setup"); -$h++; -*/ - dolibarr_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); /* diff --git a/htdocs/admin/fckeditor_cfg.php b/htdocs/admin/fckeditor_cfg.php deleted file mode 100644 index eb7af592ddf..00000000000 --- a/htdocs/admin/fckeditor_cfg.php +++ /dev/null @@ -1,102 +0,0 @@ - - * Copyright (C) 2006 Andre Cianfarani - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - * $Source$ - */ - -/** - \file htdocs/admin/fckeditor_cfg.php - \ingroup fckeditor - \brief Page de configuration du module FCKeditor - \version $Revision$ -*/ - -require("./pre.inc.php"); - -$langs->load("admin"); -$langs->load("fckeditor"); - -if (!$user->admin) - accessforbidden(); - - - -if ($_GET["action"] == 'activate_sending') -{ - dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1"); - Header("Location: confexped.php"); - exit; -} -else if ($_GET["action"] == 'disable_sending') -{ - dolibarr_del_const($db, "MAIN_SUBMODULE_EXPEDITION"); - Header("Location: confexped.php"); - exit; -} -else if ($_GET["action"] == 'activate_delivery') -{ - dolibarr_set_const($db, "MAIN_SUBMODULE_LIVRAISON", "1"); - Header("Location: confexped.php"); - exit; -} -else if ($_GET["action"] == 'disable_delivery') -{ - dolibarr_del_const($db, "MAIN_SUBMODULE_LIVRAISON"); - Header("Location: confexped.php"); - exit; -} - - -/* - * Affiche page - */ - -llxHeader("",""); - -$html=new Form($db); - -$h = 0; - -$head[$h][0] = DOL_URL_ROOT."/admin/fckeditor.php"; -$head[$h][1] = $langs->trans("Activation"); -$h++; - -$head[$h][0] = DOL_URL_ROOT."/admin/fckeditor_cfg.php"; -$head[$h][1] = $langs->trans("Setup"); -$hselected=$h; -$h++; - - -dolibarr_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); - - -print ''; -print ''; -print ''; -print ''; -print ''; -print "\n"; -print '
'.$langs->trans("Feature").' '.$langs->trans("Action").'
'; - - - -$db->close(); - -llxFooter(); -?> diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 07e804be908..f482da65b6c 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -687,8 +687,9 @@ DeliveriesOrderAbility=Products deliveries receipt ability ##### FCKeditor ##### ActivateFCKeditor=Activate FCKeditor for: FCKeditorForCompany=WYSIWIG creation/edition of companies description and note -FCKeditorForProductDescription=WYSIWIG creation/edition of products/services description and note -FCKeditorForDetails=WYSIWIG creation/edition of details lines for all entities (proposals, orders, invoices, etc...) +FCKeditorForProductDescription=WYSIWIG creation/edition of products/services description +FCKeditorForProductNote=WYSIWIG creation/edition of products/services note +FCKeditorForProductDetails=WYSIWIG creation/edition of details lines for all entities (proposals, orders, invoices, etc...) FCKeditorForMailing=WYSIWIG creation/edition of mailings ##### OSCommerce 1 ##### OSCommerceErrorConnectOkButWrongDatabase=Connection succeeded but database doesn't look to be an OSCommerce database. diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index abc8ec1984d..0a9b96a5e00 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -688,8 +688,9 @@ DeliveriesOrderAbility=Prise en charge des bons de r ##### FCKeditor ##### ActivateFCKeditor=Activer FCKeditor pour : FCKeditorForCompany=Création/édition WYSIWIG des descriptions et notes des tiers -FCKeditorForProductDescription=Création/édition WYSIWIG des notes des produits/services -FCKeditorForDetails=Création/édition WYSIWIG des lignes details des produits (sur commandes, propales, factures, etc...) +FCKeditorForProductDescription=Création/édition WYSIWIG des descriptions des produits/services +FCKeditorForProductNote=Création/édition WYSIWIG des notes des produits/services +FCKeditorForProductDetails=Création/édition WYSIWIG des lignes details des produits (sur commandes, propales, factures, etc...) FCKeditorForMailing=Création/édition WYSIWIG des mailings ##### OSCommerce 1 ##### OSCommerceErrorConnectOkButWrongDatabase=La connexion a réussie mais la base ne semble pas etre une base OSCommerce. diff --git a/htdocs/product.class.php b/htdocs/product.class.php index 59abcbb53d5..46ff4bde1e4 100644 --- a/htdocs/product.class.php +++ b/htdocs/product.class.php @@ -423,20 +423,27 @@ class Product */ function delete($id) { - global $user; + global $conf,$user; if ($user->rights->produit->supprimer) { $prod_use = $this->verif_prod_use($id); if ($prod_use == 0) { - $sqld = "DELETE from ".MAIN_DB_PREFIX."product "; - $sqld.= " WHERE rowid = ".$id; - $result = $this->db->query($sqld); + $sqla = "DELETE from ".MAIN_DB_PREFIX."product "; + $sqla.= " WHERE rowid = ".$id; + $resulta = $this->db->query($sqla); - $sqlc = "DELETE from ".MAIN_DB_PREFIX."product_price "; - $sqlc.= " WHERE fk_product = ".$id; - $result = $this->db->query($sqlc); + $sqlb = "DELETE from ".MAIN_DB_PREFIX."product_price "; + $sqlb.= " WHERE fk_product = ".$id; + $resultb = $this->db->query($sqlb); + + if ($conf->global->MAIN_MULTILANGS) + { + $sqlc = "DELETE from ".MAIN_DB_PREFIX."product_det "; + $sqlc.= " WHERE fk_product = ".$id; + $resultc = $this->db->query($sqlc); + } return 0; } @@ -458,48 +465,48 @@ class Product $current_lang = $langs->getDefaultLang(); foreach ($langs_available as $value) - { - $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."product_det"; - $sql.= " WHERE fk_product=".$this->id." AND lang='".$value."'"; + { + $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."product_det"; + $sql.= " WHERE fk_product=".$this->id." AND lang='".$value."'"; - $result = $this->db->query($sql); + $result = $this->db->query($sql); - if ($value == $current_lang) + if ($value == $current_lang) { - if (mysql_num_rows($result)) // si aucune ligne dans la base - { - $sql2 = "UPDATE ".MAIN_DB_PREFIX."product_det"; - $sql2.= " SET label='".addslashes($this->libelle)."',"; - $sql2.= " description='".addslashes($this->description)."',"; - $sql2.= " note='".addslashes($this->note)."'"; - $sql2.= " WHERE fk_product=".$this->id." AND lang='".$value."'"; - } + if ($this->db->num_rows($result)) // si aucune ligne dans la base + { + $sql2 = "UPDATE ".MAIN_DB_PREFIX."product_det"; + $sql2.= " SET label='".addslashes($this->libelle)."',"; + $sql2.= " description='".addslashes($this->description)."',"; + $sql2.= " note='".addslashes($this->note)."'"; + $sql2.= " WHERE fk_product=".$this->id." AND lang='".$value."'"; + } else - { - $sql2 = "INSERT INTO ".MAIN_DB_PREFIX."product_det (fk_product, lang, label, description, note)"; - $sql2.= " VALUES(".$this->id.",'".$value."','". addslashes($this->libelle); - $sql2.= "','".addslashes($this->description); - $sql2.= "','".addslashes($this->note)."')"; - } + { + $sql2 = "INSERT INTO ".MAIN_DB_PREFIX."product_det (fk_product, lang, label, description, note)"; + $sql2.= " VALUES(".$this->id.",'".$value."','". addslashes($this->libelle); + $sql2.= "','".addslashes($this->description); + $sql2.= "','".addslashes($this->note)."')"; + } if (!$this->db->query($sql2)) return -1; } - else + else { - if (mysql_num_rows($result)) // si aucune ligne dans la base - { - $sql2 = "UPDATE ".MAIN_DB_PREFIX."product_det"; - $sql2.= " SET label='".addslashes($this->multilangs["$value"]["libelle"])."',"; - $sql2.= " description='".addslashes($this->multilangs["$value"]["description"])."',"; - $sql2.= " note='".addslashes($this->multilangs["$value"]["note"])."'"; - $sql2.= " WHERE fk_product=".$this->id." AND lang='".$value."'"; - } + if ($this->db->num_rows($result)) // si aucune ligne dans la base + { + $sql2 = "UPDATE ".MAIN_DB_PREFIX."product_det"; + $sql2.= " SET label='".addslashes($this->multilangs["$value"]["libelle"])."',"; + $sql2.= " description='".addslashes($this->multilangs["$value"]["description"])."',"; + $sql2.= " note='".addslashes($this->multilangs["$value"]["note"])."'"; + $sql2.= " WHERE fk_product=".$this->id." AND lang='".$value."'"; + } else - { - $sql2 = "INSERT INTO ".MAIN_DB_PREFIX."product_det (fk_product, lang, label, description, note)"; - $sql2.= " VALUES(".$this->id.",'".$value."','". addslashes($this->multilangs["$value"]["libelle"]); - $sql2.= "','".addslashes($this->multilangs["$value"]["description"]); - $sql2.= "','".addslashes($this->multilangs["$value"]["note"])."')"; - } + { + $sql2 = "INSERT INTO ".MAIN_DB_PREFIX."product_det (fk_product, lang, label, description, note)"; + $sql2.= " VALUES(".$this->id.",'".$value."','". addslashes($this->multilangs["$value"]["libelle"]); + $sql2.= "','".addslashes($this->multilangs["$value"]["description"]); + $sql2.= "','".addslashes($this->multilangs["$value"]["note"])."')"; + } // on ne sauvegarde pas des champs vides if ( $this->multilangs["$value"]["libelle"] || $this->multilangs["$value"]["description"] || $this->multilangs["$value"]["note"] ) diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index 87e909ef745..4cf01e62a65 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -495,7 +495,7 @@ if ($_GET["action"] == 'create' && $user->rights->produit->creer) // Description (utilisé dans facture, propale...) print ''.$langs->trans("Description").''; - if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS) + 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); @@ -529,7 +529,7 @@ if ($_GET["action"] == 'create' && $user->rights->produit->creer) // Note (invisible sur facture, propales...) print ''.$langs->trans("NoteNotVisibleOnBill").''; - if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC) + if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_PRODUCTNOTE) { require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); $doleditor=new DolEditor('note','',200,'dolibarr_notes','',false); @@ -846,7 +846,7 @@ if ($_GET["id"] || $_GET["ref"]) // Description (utilisé dans facture, propale...) print ''.$langs->trans("Description").''; print "\n"; - if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS) + if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC) { require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); $doleditor=new DolEditor('desc',$product->description,160,'dolibarr_notes','',false); @@ -886,7 +886,7 @@ if ($_GET["id"] || $_GET["ref"]) // Note print ''.$langs->trans("NoteNotVisibleOnBill").''; - if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC) + if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_PRODUCTNOTE) { require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); $doleditor=new DolEditor('note',$product->note,200,'dolibarr_notes','',false); diff --git a/htdocs/product/traduction.php b/htdocs/product/traduction.php index 39d67870ac2..fc8d764b73f 100644 --- a/htdocs/product/traduction.php +++ b/htdocs/product/traduction.php @@ -172,8 +172,30 @@ if ($_GET["action"] == 'edit') print "
$key :
"; print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print '
'.$langs->trans('Label').'
'.$langs->trans('Description').'
'.$langs->trans('Note').'
'.$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-'.$key.'',$product->multilangs[$key]["description"],160,'dolibarr_notes','',false); + $doleditor->Create(); + } + else + { + print ''; + } + print '
'.$langs->trans('Note').''; + if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_PRODUCTNOTE) + { + require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); + $doleditor=new DolEditor('note-'.$key.'',$product->multilangs[$key]["note"],160,'dolibarr_notes','',false); + $doleditor->Create(); + } + else + { + print ''; + } + print '
'; }