diff --git a/htdocs/admin/produit.php b/htdocs/admin/produit.php index 017ccfad393..72efdcbcc15 100644 --- a/htdocs/admin/produit.php +++ b/htdocs/admin/produit.php @@ -111,6 +111,7 @@ else if ($_POST["action"] == 'confirmDeleteProdLineInForm') else if ($_POST["action"] == 'ProductCanvasAbility') { dolibarr_set_const($db, "PRODUCT_CANVAS_ABILITY", $_POST["ProductCanvasAbility"]); + dolibarr_set_const($db, "MAIN_NEED_SMARTY", $_POST["ProductCanvasAbility"]); // Create temp directory for smarty if (! empty($dolibarr_smarty_compile)) create_exdir($dolibarr_smarty_compile); if (! empty($dolibarr_smarty_cache)) create_exdir($dolibarr_smarty_cache); diff --git a/htdocs/lib/product.lib.php b/htdocs/lib/product.lib.php index 6a1cd99e4bb..1e730baf8e6 100644 --- a/htdocs/lib/product.lib.php +++ b/htdocs/lib/product.lib.php @@ -124,7 +124,7 @@ function product_prepare_head($product, $user) if ($values[2]) $langs->load($values[2]); $head[$h][0] = eregi_replace('__ID__',$product->id,$values[3]); $head[$h][1] = $langs->trans($values[1]); - $head[$h][2] = 'module'.$i; + $head[$h][2] = 'tab'.$values[1]; $h++; } } diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 679a91d7d8a..68f4c0940d2 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -507,23 +507,22 @@ else // Si utilisateur externe // Only rodolphe and auguria menu manage canvas menu (auguria not correctly yet) if (! eregi('^rodolphe',$conf->left_menu) && ! eregi('^auguria',$conf->left_menu)) $conf->global->PRODUCT_CANVAS_ABILITY=0; -// Si besoin de smarty -if ($conf->global->PRODUCT_CANVAS_ABILITY) + +// For modules using Smarty +if ($conf->global->MAIN_NEED_SMARTY) { // SMARTY // Definit dans le fichier de conf // $dolibarr_smarty_libs_dir="/home/www/dolibarr/external-libs/smarty/libs/"; // $dolibarr_smarty_compile="/home/www/dolibarr/documents/smarty/templates/temp"; // $dolibarr_smarty_cache="/home/www/dolibarr/documents/smarty/cache/temp"; - - if (empty($dolibarr_smarty_libs_dir)) $dolibarr_smarty_libs_dir=$dolibarr_main_document_root.'/../external-libs/smarty/libs/'; - if (empty($dolibarr_smarty_compile)) $dolibarr_smarty_compile=$dolibarr_main_data_root.'/smarty/templates/temp'; - if (empty($dolibarr_smarty_cache)) $dolibarr_smarty_cache=$dolibarr_main_data_root.'/smarty/cache/temp'; - + if (empty($dolibarr_smarty_libs_dir)) $dolibarr_smarty_libs_dir=DOL_DATA_ROOT.'/../external-libs/smarty/libs/'; + if (empty($dolibarr_smarty_compile)) $dolibarr_smarty_compile=DOL_DATA_ROOT.'/smarty/templates/temp'; + if (empty($dolibarr_smarty_cache)) $dolibarr_smarty_cache=DOL_DATA_ROOT.'/smarty/cache/temp'; + $smarty_libs = $dolibarr_smarty_libs_dir. "Smarty.class.php"; if (file_exists ($smarty_libs)) { - require_once($smarty_libs); $smarty = new Smarty(); $smarty->compile_dir = $dolibarr_smarty_compile;