diff --git a/htdocs/admin/produit.php b/htdocs/admin/produit.php index 7f5979bc58f..6be6e83d343 100644 --- a/htdocs/admin/produit.php +++ b/htdocs/admin/produit.php @@ -1,7 +1,8 @@ * Copyright (C) 2006 Andre Cianfarani - * Copyright (C) 2006 Rodolphe Quiedeville + * Copyright (C) 2006-2007 Rodolphe Quiedeville + * Copyright (C) 2007 Auguria SARL * * 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 @@ -138,6 +139,14 @@ else if ($_POST["action"] == 'viewProdDescInForm') Header("Location: produit.php"); exit; } + +else if ($_POST["action"] == 'ProductCanvasAbility') +{ + dolibarr_set_const($db, "PRODUCT_CANVAS_ABILITY", $_POST["ProductCanvasAbility"]); + Header("Location: produit.php"); + exit; +} + else if ($_POST["action"] == 'usesearchtoselectproduct') { dolibarr_set_const($db, "PRODUIT_USE_SEARCH_TO_SELECT", $_POST["activate_usesearchtoselectproduct"]); @@ -287,52 +296,65 @@ print " ".$langs->trans("ProductSpecial")."\n"; print " ".$langs->trans("Value")."\n"; print "  \n"; +print '
'; +print ''; +print ""; +print ''.$langs->trans("ProductCanvasAbility").''; +print ''; +print $html->selectyesno("ProductCanvasAbility",$conf->global->PRODUCT_CANVAS_ABILITY,1); +print ''; +print ''; +print ""; +print '
'; + require_once(DOL_DOCUMENT_ROOT . "/product.class.php"); $dir = DOL_DOCUMENT_ROOT . "/product/canvas/"; -if(is_dir($dir)) +if ($conf->global->PRODUCT_CANVAS_ABILITY==="1") { - $handle=opendir($dir); - $var=true; - - while (($file = readdir($handle))!==false) + if(is_dir($dir) ) { - if (substr($file, strlen($file) -10) == '.class.php' && substr($file,0,8) == 'product.') - { - $parts = explode('.',$file); - $classname = 'Product'.ucfirst($parts[1]); - require_once($dir.$file); - $module = new $classname(); - - $var=!$var; - print ""; + $handle=opendir($dir); + $var=true; - print $module->description; - - print ''; - - if (defined ("PRODUIT_SPECIAL_LIVRE") && PRODUIT_SPECIAL_LIVRE == 1) + while (($file = readdir($handle))!==false) + { + if (substr($file, strlen($file) -10) == '.class.php' && substr($file,0,8) == 'product.') { - print img_tick(); + $parts = explode('.',$file); + $classname = 'Product'.ucfirst($parts[1]); + require_once($dir.$file); + $module = new $classname(); + + $var=!$var; + print ""; + + print $module->description; + print ''; - print ''.$langs->trans("Disable").''; + + if (defined ("PRODUIT_SPECIAL_LIVRE") && PRODUIT_SPECIAL_LIVRE == 1) + { + print img_tick(); + print ''; + print ''.$langs->trans("Disable").''; + } + else + { + print ' '; + print ''.$langs->trans("Activate").''; + } + + print ''; } - else - { - print ' '; - print ''.$langs->trans("Activate").''; - } - - print ''; } + closedir($handle); + } + else + { + print "ERROR: $dir is not a directory !\n"; } - closedir($handle); } -else -{ - print "ERROR: $dir is not a directory !\n"; -} - print ''; $db->close();