From 635b44b9065c111322c74c0d8e1f94529d5952f8 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 10 May 2010 04:50:39 +0000 Subject: [PATCH] Fix: if you rename a module, rename all --- htdocs/admin/dict.php | 4 ++-- htdocs/admin/fckeditor.php | 2 +- htdocs/comm/addpropal.php | 2 +- htdocs/comm/propal.php | 4 ++-- htdocs/commande/fiche.php | 6 +++--- htdocs/compta/facture.php | 8 ++++---- htdocs/core/class/html.form.class.php | 8 ++++---- htdocs/document.php | 2 +- htdocs/ecm/index.php | 2 +- htdocs/ecm/search.php | 2 +- htdocs/expedition/fiche.php | 2 +- htdocs/expedition/shipment.php | 2 +- htdocs/fourn/commande/fiche.php | 10 +++++----- htdocs/fourn/facture/fiche.php | 10 +++++----- htdocs/fourn/fiche.php | 2 +- htdocs/fourn/product/index.php | 2 +- .../includes/barcode/html.formbarcode.class.php | 2 +- htdocs/includes/menus/barre_left/eldy.lib.php | 2 +- htdocs/includes/menus/barre_top/eldy.lib.php | 6 +++--- htdocs/includes/menus/init_menu_auguria.sql | 16 ++++++++-------- .../includes/modules/barcode/admin/barcode.php | 2 +- htdocs/includes/modules/modService.class.php | 2 +- htdocs/index.php | 2 +- htdocs/install/mysql/migration/2.8.0-2.9.0.sql | 1 + htdocs/livraison/fiche.php | 2 +- htdocs/main.inc.php | 4 ++-- htdocs/product/document.php | 2 +- htdocs/product/index.php | 4 ++-- htdocs/product/stats/index.php | 4 ++-- 29 files changed, 59 insertions(+), 58 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 8036b5474d8..5bbf5646513 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -29,7 +29,7 @@ require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/core/class/html.formadmin.class.php"); -require_once(DOL_DOCUMENT_ROOT."/html.formcompany.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formcompany.class.php"); $langs->load("other"); $langs->load("admin"); @@ -235,7 +235,7 @@ $tabcond[10]= true; $tabcond[11]= true; $tabcond[12]= $conf->facture->enabled||$conf->fournisseur->enabled; $tabcond[13]= $conf->facture->enabled||$conf->fournisseur->enabled; -$tabcond[14]= $conf->produit->enabled&&$conf->global->PRODUIT_USE_ECOTAXE; +$tabcond[14]= $conf->product->enabled&&$conf->global->PRODUIT_USE_ECOTAXE; $tabcond[15]= true; $tabcond[16]= $conf->societe->enabled; $tabcond[17]= $conf->deplacement->enabled; diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index 91b873a4bc2..b92c9007bd5 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -48,7 +48,7 @@ $modules = array( $conditions = array( 'USER' => 1, 'SOCIETE' => $conf->societe->enabled, -'PRODUCTDESC' => ($conf->produit->enabled||$conf->service->enabled), +'PRODUCTDESC' => ($conf->product->enabled||$conf->service->enabled), 'MEMBER' => $conf->adherent->enabled, 'MAILING' => $conf->mailing->enabled, 'DETAILS' => ($conf->facture->enabled||$conf->propal->enabled||$conf->commande->enabled), diff --git a/htdocs/comm/addpropal.php b/htdocs/comm/addpropal.php index 6ba20155d5a..872dddf1530 100644 --- a/htdocs/comm/addpropal.php +++ b/htdocs/comm/addpropal.php @@ -274,7 +274,7 @@ if ($_GET["action"] == 'create') if ($conf->global->PRODUCT_SHOW_WHEN_CREATE) { print ''; - if ($conf->produit->enabled || $conf->service->enabled) + if ($conf->product->enabled || $conf->service->enabled) { $lib=$langs->trans("ProductsAndServices"); diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index acfe240a462..b0cfcd70e29 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1758,7 +1758,7 @@ if ($id > 0 || ! empty($ref)) print ''; print $html->select_type_of_lines(isset($_POST["type"])?$_POST["type"]:-1,'type',1); - if ($conf->produit->enabled && $conf->service->enabled) print '
'; + if ($conf->product->enabled && $conf->service->enabled) print '
'; // Editor wysiwyg if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS) @@ -1789,7 +1789,7 @@ if ($id > 0 || ! empty($ref)) print ''; // Ajout de produits/services predefinis - if ($conf->produit->enabled || $conf->service->enabled) + if ($conf->product->enabled || $conf->service->enabled) { if ($conf->global->PRODUIT_USE_MARKUP) { diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 79506be4a65..d59829e83f5 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -1896,7 +1896,7 @@ else else { print $html->select_type_of_lines($objp->product_type,'type',1); - if ($conf->produit->enabled && $conf->service->enabled) print '
'; + if ($conf->product->enabled && $conf->service->enabled) print '
'; } // Editor wysiwyg @@ -1992,7 +1992,7 @@ else print ''; print $html->select_type_of_lines(isset($_POST["type"])?$_POST["type"]:-1,'type',1); - if ($conf->produit->enabled && $conf->service->enabled) print '
'; + if ($conf->product->enabled && $conf->service->enabled) print '
'; // Editor wysiwyg if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS) @@ -2035,7 +2035,7 @@ else print ''; // Ajout de produits/services predefinis - if ($conf->produit->enabled || $conf->service->enabled) + if ($conf->product->enabled || $conf->service->enabled) { print ''; print ''; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 6a3a44f952d..1fecad061cf 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -2940,7 +2940,7 @@ else else { print $html->select_type_of_lines($objp->product_type,'type',1); - if ($conf->produit->enabled && $conf->service->enabled) print '
'; + if ($conf->product->enabled && $conf->service->enabled) print '
'; } // Description - Editor wysiwyg @@ -3040,8 +3040,8 @@ else print ''; print $html->select_type_of_lines(isset($_POST["type"])?$_POST["type"]:-1,'type',1); - if (($conf->produit->enabled && $conf->service->enabled) - || (empty($conf->produit->enabled) && empty($conf->service->enabled))) print '
'; + if (($conf->product->enabled && $conf->service->enabled) + || (empty($conf->product->enabled) && empty($conf->service->enabled))) print '
'; // Editor wysiwyg if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS) @@ -3082,7 +3082,7 @@ else // Predefined services/products form - if ($conf->produit->enabled || $conf->service->enabled) + if ($conf->product->enabled || $conf->service->enabled) { print ''; print ''; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 0656714ea61..479ad0e65a8 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -459,8 +459,8 @@ class Form global $db,$langs,$user,$conf; // If product & services are enabled or both disabled. - if ($forceall || ($conf->produit->enabled && $conf->service->enabled) - || (empty($conf->produit->enabled) && empty($conf->service->enabled))) + if ($forceall || ($conf->product->enabled && $conf->service->enabled) + || (empty($conf->product->enabled) && empty($conf->service->enabled))) { if (empty($hidetext)) print $langs->trans("Type").': '; print ''; //if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); } - if (! $forceall && empty($conf->produit->enabled) && $conf->service->enabled) + if (! $forceall && empty($conf->product->enabled) && $conf->service->enabled) { print ''; } - if (! $forceall && $conf->produit->enabled && empty($conf->service->enabled)) + if (! $forceall && $conf->product->enabled && empty($conf->service->enabled)) { print ''; } diff --git a/htdocs/document.php b/htdocs/document.php index d6e2a323160..99e9f8573ef 100644 --- a/htdocs/document.php +++ b/htdocs/document.php @@ -293,7 +293,7 @@ if ($modulepart) { $accessallowed=1; } - if ($conf->produit->enabled) $original_file=$conf->produit->dir_output.'/'.$original_file; + if ($conf->product->enabled) $original_file=$conf->produit->dir_output.'/'.$original_file; elseif ($conf->service->enabled) $original_file=$conf->service->dir_output.'/'.$original_file; } diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php index d8ef92d5819..e2b2170125a 100644 --- a/htdocs/ecm/index.php +++ b/htdocs/ecm/index.php @@ -198,7 +198,7 @@ $userstatic = new User($db); // Ajout rubriques automatiques $rowspan=0; $sectionauto=array(); -if ($conf->produit->enabled || $conf->service->enabled) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'product', 'test'=>$conf->produit->enabled, 'label'=>$langs->trans("ProductsAndServices"), 'desc'=>$langs->trans("ECMDocsByProducts")); } +if ($conf->product->enabled || $conf->service->enabled) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'product', 'test'=>$conf->product->enabled, 'label'=>$langs->trans("ProductsAndServices"), 'desc'=>$langs->trans("ECMDocsByProducts")); } if ($conf->societe->enabled) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'company', 'test'=>$conf->societe->enabled, 'label'=>$langs->trans("ThirdParties"), 'desc'=>$langs->trans("ECMDocsByThirdParties")); } if ($conf->propal->enabled) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'propal', 'test'=>$conf->propal->enabled, 'label'=>$langs->trans("Prop"), 'desc'=>$langs->trans("ECMDocsByProposals")); } if ($conf->contrat->enabled) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'contract','test'=>$conf->contrat->enabled, 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsByContracts")); } diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php index 13d08c3701b..12d3308f1ff 100644 --- a/htdocs/ecm/search.php +++ b/htdocs/ecm/search.php @@ -104,7 +104,7 @@ $userstatic = new User($db); // Ajout rubriques automatiques $rowspan=0; $sectionauto=array(); -if ($conf->produit->enabled || $conf->service->enabled) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'product', 'test'=>$conf->produit->enabled, 'label'=>$langs->trans("ProductsAndServices"), 'desc'=>$langs->trans("ECMDocsByProducts")); } +if ($conf->product->enabled || $conf->service->enabled) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'product', 'test'=>$conf->product->enabled, 'label'=>$langs->trans("ProductsAndServices"), 'desc'=>$langs->trans("ECMDocsByProducts")); } if ($conf->societe->enabled) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'company', 'test'=>$conf->societe->enabled, 'label'=>$langs->trans("ThirdParties"), 'desc'=>$langs->trans("ECMDocsByThirdParties")); } if ($conf->propal->enabled) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'propal', 'test'=>$conf->propal->enabled, 'label'=>$langs->trans("Prop"), 'desc'=>$langs->trans("ECMDocsByProposals")); } if ($conf->contrat->enabled) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'contract','test'=>$conf->contrat->enabled, 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsByContracts")); } diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index 8f99886fc12..2eed76bf0c3 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -34,7 +34,7 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT."/product/class/html.formproduct.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/product.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/sendings.lib.php"); -if ($conf->produit->enabled || $conf->service->enabled) require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php"); +if ($conf->product->enabled || $conf->service->enabled) require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php"); if ($conf->propal->enabled) require_once(DOL_DOCUMENT_ROOT."/comm/propal/class/propal.class.php"); if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php"); if ($conf->stock->enabled) require_once(DOL_DOCUMENT_ROOT."/product/stock/class/entrepot.class.php"); diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 3513189cf66..66a374f9b7b 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -31,7 +31,7 @@ require_once(DOL_DOCUMENT_ROOT."/expedition/class/expedition.class.php"); require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/order.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/sendings.lib.php"); -if ($conf->produit->enabled || $conf->service->enabled) require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php"); +if ($conf->product->enabled || $conf->service->enabled) require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php"); if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT."/projet/class/project.class.php"); if ($conf->propal->enabled) require_once(DOL_DOCUMENT_ROOT."/comm/propal/class/propal.class.php"); if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php"); diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index fb7277cac2b..6a417714737 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -862,7 +862,7 @@ if ($id > 0 || ! empty($ref)) print ''; print ''; print ''; // ancre pour retourner sur la ligne - if (($conf->produit->enabled || $conf->service->enabled) && $commandline->fk_product > 0) + if (($conf->product->enabled || $conf->service->enabled) && $commandline->fk_product > 0) { print ''; print img_object($langs->trans('ShowProduct'),'product'); @@ -874,7 +874,7 @@ if ($id > 0 || ! empty($ref)) else { print $html->select_type_of_lines($commandline->product_type,'type',1); - if ($conf->produit->enabled && $conf->service->enabled) print '
'; + if ($conf->product->enabled && $conf->service->enabled) print '
'; } // Description - Editor wysiwyg @@ -933,8 +933,8 @@ if ($id > 0 || ! empty($ref)) $forceall=1; print $html->select_type_of_lines(isset($_POST["type"])?$_POST["type"]:-1,'type',1,0,$forceall); - if ($forceall || ($conf->produit->enabled && $conf->service->enabled) - || (empty($conf->produit->enabled) && empty($conf->service->enabled))) print '
'; + if ($forceall || ($conf->product->enabled && $conf->service->enabled) + || (empty($conf->product->enabled) && empty($conf->service->enabled))) print '
'; // Editor wysiwyg if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS) @@ -965,7 +965,7 @@ if ($id > 0 || ! empty($ref)) print ''; // Ajout de produits/services predefinis - if ($conf->produit->enabled || $conf->service->enabled) + if ($conf->product->enabled || $conf->service->enabled) { print ''; print ''; diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 622aee0b561..d523ca0f330 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -978,7 +978,7 @@ else // Show product and description print ''; - if (($conf->produit->enabled || $conf->service->enabled) && $fac->lignes[$i]->fk_product) + if (($conf->product->enabled || $conf->service->enabled) && $fac->lignes[$i]->fk_product) { print ''; $product_static=new ProductFournisseur($db); @@ -991,7 +991,7 @@ else else { print $html->select_type_of_lines($fac->lignes[$i]->product_type,'type',1); - if ($conf->produit->enabled && $conf->service->enabled) print '
'; + if ($conf->product->enabled && $conf->service->enabled) print '
'; } // Description - Editor wysiwyg @@ -1128,8 +1128,8 @@ else $forceall=1; // For suppliers, we always show all types print $html->select_type_of_lines(isset($_POST["type"])?$_POST["type"]:-1,'type',1,0,$forceall); - if ($forceall || ($conf->produit->enabled && $conf->service->enabled) - || (empty($conf->produit->enabled) && empty($conf->service->enabled))) print '
'; + if ($forceall || ($conf->product->enabled && $conf->service->enabled) + || (empty($conf->product->enabled) && empty($conf->service->enabled))) print '
'; // Editor wysiwyg if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS) @@ -1163,7 +1163,7 @@ else print ''; // Ajout de produits/services predefinis - if ($conf->produit->enabled || $conf->service->enabled) + if ($conf->product->enabled || $conf->service->enabled) { print ''; print ''; diff --git a/htdocs/fourn/fiche.php b/htdocs/fourn/fiche.php index c1128e415b3..35f0a71dfed 100644 --- a/htdocs/fourn/fiche.php +++ b/htdocs/fourn/fiche.php @@ -158,7 +158,7 @@ if ( $societe->fetch($socid) ) /* * List of products */ - if ($conf->produit->enabled || $conf->service->enabled) + if ($conf->product->enabled || $conf->service->enabled) { $langs->load("products"); print ''; diff --git a/htdocs/fourn/product/index.php b/htdocs/fourn/product/index.php index 7b1964429e1..39a6d882ea0 100644 --- a/htdocs/fourn/product/index.php +++ b/htdocs/fourn/product/index.php @@ -76,7 +76,7 @@ if ($db->query($sql)) print '
'; print ''; -if ($conf->produit->enabled) +if ($conf->product->enabled) { print ""; print ''; diff --git a/htdocs/includes/barcode/html.formbarcode.class.php b/htdocs/includes/barcode/html.formbarcode.class.php index 8e8fcc106e9..946bfd1446b 100644 --- a/htdocs/includes/barcode/html.formbarcode.class.php +++ b/htdocs/includes/barcode/html.formbarcode.class.php @@ -62,7 +62,7 @@ class FormBarCode $disable = ''; // We check if barcode is already selected by default - if ((($conf->produit->enabled || $conf->service->enabled) && $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE == $code_id) || + if ((($conf->product->enabled || $conf->service->enabled) && $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE == $code_id) || ($conf->societe->enabled && $conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY == $code_id)) { $disable = 'disabled="disabled"'; diff --git a/htdocs/includes/menus/barre_left/eldy.lib.php b/htdocs/includes/menus/barre_left/eldy.lib.php index dd00b45fcc7..a5c5c21dc1a 100644 --- a/htdocs/includes/menus/barre_left/eldy.lib.php +++ b/htdocs/includes/menus/barre_left/eldy.lib.php @@ -565,7 +565,7 @@ function print_left_eldy_menu($db,$menu_array) if ($mainmenu == 'products') { // Products - if ($conf->produit->enabled) + if ($conf->product->enabled) { $newmenu->add(DOL_URL_ROOT."/product/index.php?leftmenu=product&type=0", $langs->trans("Products"), 0, $user->rights->produit->lire); if ($user->societe_id == 0) diff --git a/htdocs/includes/menus/barre_top/eldy.lib.php b/htdocs/includes/menus/barre_top/eldy.lib.php index df36c97361a..1c81e5d1742 100644 --- a/htdocs/includes/menus/barre_top/eldy.lib.php +++ b/htdocs/includes/menus/barre_top/eldy.lib.php @@ -100,7 +100,7 @@ function print_eldy_menu($db,$atarget,$hideifnotallowed) // Products-Services - if ($conf->produit->enabled || $conf->service->enabled) + if ($conf->product->enabled || $conf->service->enabled) { $langs->load("products"); @@ -114,8 +114,8 @@ function print_eldy_menu($db,$atarget,$hideifnotallowed) $classname = 'class="tmenu"'; } $chaine=""; - if ($conf->produit->enabled) { $chaine.=$langs->trans("Products"); } - if ($conf->produit->enabled && $conf->service->enabled) { $chaine.="/"; } + if ($conf->product->enabled) { $chaine.=$langs->trans("Products"); } + if ($conf->product->enabled && $conf->service->enabled) { $chaine.="/"; } if ($conf->service->enabled) { $chaine.=$langs->trans("Services"); } $idsel='products'; diff --git a/htdocs/includes/menus/init_menu_auguria.sql b/htdocs/includes/menus/init_menu_auguria.sql index dfda87a8d34..216a10744d2 100644 --- a/htdocs/includes/menus/init_menu_auguria.sql +++ b/htdocs/includes/menus/init_menu_auguria.sql @@ -14,7 +14,7 @@ delete from llx_menu where menu_handler='auguria'; -- insert into llx_menu (enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('1', 1__+MAX_llx_menu__, 'auguria', 'top', 'home', '', 0, '/index.php?mainmenu=home&leftmenu=', 'Home', -1, '', '', '', 2, 1, __ENTITY__); insert into llx_menu (enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled || $conf->fournisseur->enabled', 2__+MAX_llx_menu__, 'auguria', 'top', 'companies', '', 0, '/index.php?mainmenu=companies&leftmenu=', 'ThirdParties', -1, 'companies', '', '', 2, 2, __ENTITY__); -insert into llx_menu (enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->produit->enabled || $conf->service->enabled', 3__+MAX_llx_menu__, 'auguria', 'top', 'products', '', 0, '/product/index.php?mainmenu=products&leftmenu=', 'Products/Services', -1, 'products', '$user->rights->produit->lire||$user->rights->service->lire', '', 0, 3, __ENTITY__); +insert into llx_menu (enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->product->enabled || $conf->service->enabled', 3__+MAX_llx_menu__, 'auguria', 'top', 'products', '', 0, '/product/index.php?mainmenu=products&leftmenu=', 'Products/Services', -1, 'products', '$user->rights->produit->lire||$user->rights->service->lire', '', 0, 3, __ENTITY__); insert into llx_menu (enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->societe->enabled', 5__+MAX_llx_menu__, 'auguria', 'top', 'commercial', '', 0, '/comm/index.php?mainmenu=commercial&leftmenu=', 'Commercial', -1, 'commercial', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 5, __ENTITY__); insert into llx_menu (enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->compta->enabled || $conf->accounting->enabled || $conf->banque->enabled || $conf->facture->enabled || $conf->deplacement->enabled', 6__+MAX_llx_menu__, 'auguria', 'top', 'accountancy', '', 0, '/compta/index.php?mainmenu=accountancy&leftmenu=', 'MenuFinancial', -1, 'compta', '$user->rights->compta->resultat->lire || $user->rights->accounting->plancompte->lire || $user->rights->commande->lire || $user->rights->facture->lire || $user->rights->banque->lire', '', 2, 6, __ENTITY__); insert into llx_menu (enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->projet->enabled', 7__+MAX_llx_menu__, 'auguria', 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&leftmenu=', 'Projects', -1, 'projects', '$user->rights->projet->lire', '', 0, 7, __ENTITY__); @@ -82,16 +82,16 @@ insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->fournisseur->enabled && $conf->categorie->enabled', 'auguria', 'left', 660__+MAX_llx_menu__, 'companies', '', 2__+MAX_llx_menu__, '/categories/index.php?leftmenu=cat&type=2', 'CustomersProspectsCategoriesShort', 0, 'categories', '$user->rights->categorie>lire', '', 2, 3, __ENTITY__); insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->fournisseur->enabled && $conf->categorie->enabled', 'auguria', 'left', 661__+MAX_llx_menu__, 'companies', '', 660__+MAX_llx_menu__, '/categories/fiche.php?action=create&type=2', 'NewCat', 1, 'categories', '$user->rights->categorie>creer', '', 2, 0, __ENTITY__); -insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->produit->enabled', 'auguria', 'left', 2800__+MAX_llx_menu__, 'products', '', 3__+MAX_llx_menu__, '/product/index.php?leftmenu=product&type=0', 'Products', 0, 'products', '$user->rights->produit->lire', '', 2, 0, __ENTITY__); -insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->produit->enabled', 'auguria', 'left', 2801__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/fiche.php?leftmenu=product&action=create&type=0', 'NewProduct', 1, 'products', '$user->rights->produit->creer', '', 2, 0, __ENTITY__); -insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->produit->enabled', 'auguria', 'left', 2802__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/liste.php?leftmenu=product&type=0', 'ProductList', 1, 'products', '$user->rights->produit->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->produit->enabled', 'auguria', 'left', 2803__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/reassort.php?type=0', 'Stocks', 1, 'products', '$user->rights->produit->lire && $user->rights->stock->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->produit->enabled && $conf->droitpret->enabled', 'auguria', 'left', 2804__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/fiche.php?leftmenu=product&action=create&type=0&canvas=livre@droitpret', 'NewBook', 1, 'products', '$user->rights->produit->creer', '', 2, 2, __ENTITY__); -insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->produit->enabled && $conf->droitpret->enabled', 'auguria', 'left', 2805__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/liste.php?leftmenu=product&type=0&canvas=livre@droitpret', 'BookList', 1, 'products', '$user->rights->produit->lire', '', 2, 3, __ENTITY__); +insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->product->enabled', 'auguria', 'left', 2800__+MAX_llx_menu__, 'products', '', 3__+MAX_llx_menu__, '/product/index.php?leftmenu=product&type=0', 'Products', 0, 'products', '$user->rights->produit->lire', '', 2, 0, __ENTITY__); +insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->product->enabled', 'auguria', 'left', 2801__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/fiche.php?leftmenu=product&action=create&type=0', 'NewProduct', 1, 'products', '$user->rights->produit->creer', '', 2, 0, __ENTITY__); +insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->product->enabled', 'auguria', 'left', 2802__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/liste.php?leftmenu=product&type=0', 'ProductList', 1, 'products', '$user->rights->produit->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->product->enabled', 'auguria', 'left', 2803__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/reassort.php?type=0', 'Stocks', 1, 'products', '$user->rights->produit->lire && $user->rights->stock->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->product->enabled && $conf->droitpret->enabled', 'auguria', 'left', 2804__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/fiche.php?leftmenu=product&action=create&type=0&canvas=livre@droitpret', 'NewBook', 1, 'products', '$user->rights->produit->creer', '', 2, 2, __ENTITY__); +insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->product->enabled && $conf->droitpret->enabled', 'auguria', 'left', 2805__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/liste.php?leftmenu=product&type=0&canvas=livre@droitpret', 'BookList', 1, 'products', '$user->rights->produit->lire', '', 2, 3, __ENTITY__); insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->service->enabled', 'auguria', 'left', 2900__+MAX_llx_menu__, 'products', '', 3__+MAX_llx_menu__, '/product/index.php?leftmenu=service&type=1', 'Services', 0, 'products', '$user->rights->service->lire', '', 2, 1, __ENTITY__); insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->service->enabled', 'auguria', 'left', 2901__+MAX_llx_menu__, 'products', '', 2900__+MAX_llx_menu__, '/product/fiche.php?leftmenu=service&action=create&type=1', 'NewService', 1, 'products', '$user->rights->service->creer', '', 2, 0, __ENTITY__); insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->service->enabled', 'auguria', 'left', 2902__+MAX_llx_menu__, 'products', '', 2900__+MAX_llx_menu__, '/product/liste.php?leftmenu=service&type=1', 'List', 1, 'products', '$user->rights->service->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->produit->enabled || $conf->service->enabled', 'auguria', 'left', 3000__+MAX_llx_menu__, 'products', '', 3__+MAX_llx_menu__, '/product/stats/index.php?leftmenu=stats', 'Statistics', 0, 'main', '$user->rights->service->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->product->enabled || $conf->service->enabled', 'auguria', 'left', 3000__+MAX_llx_menu__, 'products', '', 3__+MAX_llx_menu__, '/product/stats/index.php?leftmenu=stats', 'Statistics', 0, 'main', '$user->rights->service->lire', '', 2, 2, __ENTITY__); insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->propal->enabled', 'auguria', 'left', 3001__+MAX_llx_menu__, 'products', '', 3000__+MAX_llx_menu__, '/product/popuprop.php?leftmenu=stats', 'Popularity', 1, 'main', '$user->rights->produit->lire && $user->rights->produit>lire', '', 2, 0, __ENTITY__); insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->stock->enabled', 'auguria', 'left', 3100__+MAX_llx_menu__, 'products', '', 3__+MAX_llx_menu__, '/product/stock/index.php?leftmenu=stock', 'Stock', 0, 'stocks', '$user->rights->stock->lire', '', 2, 3, __ENTITY__); insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->stock->enabled', 'auguria', 'left', 3101__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/fiche.php?action=create', 'MenuNewWarehouse', 1, 'stocks', '$user->rights->stock->creer', '', 2, 0, __ENTITY__); diff --git a/htdocs/includes/modules/barcode/admin/barcode.php b/htdocs/includes/modules/barcode/admin/barcode.php index c152af29a99..5dc388dc06d 100644 --- a/htdocs/includes/modules/barcode/admin/barcode.php +++ b/htdocs/includes/modules/barcode/admin/barcode.php @@ -266,7 +266,7 @@ if ($conf->societe->enabled) } // Module produits -if ($conf->produit->enabled) +if ($conf->product->enabled) { $var=!$var; print ""; diff --git a/htdocs/includes/modules/modService.class.php b/htdocs/includes/modules/modService.class.php index da4a54b977c..cb6a33fedfb 100644 --- a/htdocs/includes/modules/modService.class.php +++ b/htdocs/includes/modules/modService.class.php @@ -73,7 +73,7 @@ class modService extends DolibarrModules $this->requiredby = array("modContrat"); // Config pages - $this->config_page_url = array("produit.php"); + $this->config_page_url = array("produit.php@produit"); $this->langfiles = array("products","companies","bills"); // Constants diff --git a/htdocs/index.php b/htdocs/index.php index 7df11e683de..02137b3a288 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -118,7 +118,7 @@ if ($user->societe_id == 0) ! empty($conf->societe->enabled) && $user->rights->societe->lire, ! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire, ! empty($conf->adherent->enabled) && $user->rights->adherent->lire, - ! empty($conf->produit->enabled) && $user->rights->produit->lire, + ! empty($conf->product->enabled) && $user->rights->produit->lire, ! empty($conf->service->enabled) && $user->rights->service->lire, ! empty($conf->propal->enabled) && $user->rights->propale->lire, ! empty($conf->commande->enabled) && $user->rights->commande->lire, diff --git a/htdocs/install/mysql/migration/2.8.0-2.9.0.sql b/htdocs/install/mysql/migration/2.8.0-2.9.0.sql index b05f724c470..8f90e304a75 100755 --- a/htdocs/install/mysql/migration/2.8.0-2.9.0.sql +++ b/htdocs/install/mysql/migration/2.8.0-2.9.0.sql @@ -199,3 +199,4 @@ ALTER TABLE llx_menu DROP INDEX idx_menu_uk_menu; ALTER TABLE llx_menu ADD UNIQUE INDEX idx_menu_uk_menu (menu_handler, fk_menu, position, url, entity); +UPDATE llx_const SET name = 'MAIN_MODULE_PRODUCT' WHERE name = 'MAIN_MODULE_PRODUIT'; \ No newline at end of file diff --git a/htdocs/livraison/fiche.php b/htdocs/livraison/fiche.php index 63bffa7f0ac..97a19259cac 100644 --- a/htdocs/livraison/fiche.php +++ b/htdocs/livraison/fiche.php @@ -32,7 +32,7 @@ require_once(DOL_DOCUMENT_ROOT."/livraison/class/livraison.class.php"); require_once(DOL_DOCUMENT_ROOT."/includes/modules/livraison/modules_livraison.php"); require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/sendings.lib.php"); -if ($conf->produit->enabled || $conf->service->enabled) require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php"); +if ($conf->product->enabled || $conf->service->enabled) require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php"); if ($conf->expedition_bon->enabled) require_once(DOL_DOCUMENT_ROOT."/expedition/class/expedition.class.php"); if ($conf->stock->enabled) require_once(DOL_DOCUMENT_ROOT."/product/stock/class/entrepot.class.php"); diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 9e405517aa1..5ab689f8532 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -140,7 +140,7 @@ session_start(); require_once("master.inc.php"); // Force HTTPS if required ($conf->file->main_force_https is 0/1 or https dolibarr root url) -if ($conf->file->main_force_https) +if (! empty($conf->file->main_force_https)) { $newurl=''; if ($conf->file->main_force_https == '1') @@ -1034,7 +1034,7 @@ function left_menu($menu_array, $helppagename='', $moresearchform='') img_object('','contact').' '.$langs->trans("Contacts"), 'contact', 'contactname'); } - if ((($conf->produit->enabled && $user->rights->produit->lire) || ($conf->service->enabled && $user->rights->service->lire)) + if ((($conf->product->enabled && $user->rights->produit->lire) || ($conf->service->enabled && $user->rights->service->lire)) && $conf->global->MAIN_SEARCHFORM_PRODUITSERVICE) { $langs->load("products"); diff --git a/htdocs/product/document.php b/htdocs/product/document.php index 1db755a933b..ecfd18fa1c1 100755 --- a/htdocs/product/document.php +++ b/htdocs/product/document.php @@ -66,7 +66,7 @@ if ($_GET['id'] || $_GET["ref"]) if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]); if ($_GET["id"]) $result = $product->fetch($_GET["id"]); - if ($conf->produit->enabled) $upload_dir = $conf->produit->dir_output.'/'.dol_sanitizeFileName($product->ref); + if ($conf->product->enabled) $upload_dir = $conf->produit->dir_output.'/'.dol_sanitizeFileName($product->ref); elseif ($conf->service->enabled) $upload_dir = $conf->service->dir_output.'/'.dol_sanitizeFileName($product->ref); } $modulepart='produit'; diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 673bece47b6..bdac27aa830 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -60,7 +60,7 @@ if ((isset($_GET["type"]) && $_GET["type"] == 0) || empty($conf->service->enable $transAreaType = $langs->trans("ProductsArea"); $helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'; } -if ((isset($_GET["type"]) && $_GET["type"] == 1) || empty($conf->produit->enabled)) +if ((isset($_GET["type"]) && $_GET["type"] == 1) || empty($conf->product->enabled)) { $transAreaType = $langs->trans("ServicesArea"); $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; @@ -119,7 +119,7 @@ while ($objp = $db->fetch_object($result)) print '
'.$langs->trans("Statistics").'
'.$langs->trans("Products").''.round($prodser[0]).'
'; print ''; -if ($conf->produit->enabled) +if ($conf->product->enabled) { $statProducts = ""; $statProducts.= ''; diff --git a/htdocs/product/stats/index.php b/htdocs/product/stats/index.php index eba32a1e2b7..5bd3622a30e 100644 --- a/htdocs/product/stats/index.php +++ b/htdocs/product/stats/index.php @@ -69,11 +69,11 @@ if ($db->query($sql)) } $db->free(); -if ($conf->produit->enabled && $conf->service->enabled) +if ($conf->product->enabled && $conf->service->enabled) { print_fiche_titre($langs->trans("ProductsAndServicesStatistics"), $mesg); } -elseif ($conf->produit->enabled) +elseif ($conf->product->enabled) { print_fiche_titre($langs->trans("ProductsStatistics"), $mesg); }
'.$langs->trans("Statistics").'
'.$langs->trans("ProductsNotOnSell").''.round($prodser[0][0]).'