From 7dd1d85d0a38993d4e444a5a974b23544753a759 Mon Sep 17 00:00:00 2001 From: Andre Cianfarani Date: Mon, 20 Feb 2006 10:58:10 +0000 Subject: [PATCH] =?UTF-8?q?possibilit=E9=20activer=20nouvelle=20fonctionna?= =?UTF-8?q?lit=E9=20sous=20produits?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/admin/produit.php | 54 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 52 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/produit.php b/htdocs/admin/produit.php index ff5f40d0c3f..91fe4999e30 100644 --- a/htdocs/admin/produit.php +++ b/htdocs/admin/produit.php @@ -68,7 +68,7 @@ if ($_GET["action"] == 'activate_multiprix') dolibarr_print_error($db); print ""; } - // on crée la table societe_prices + // on crée la table societe_prices else { $table = MAIN_DB_PREFIX."societe_prices"; @@ -108,6 +108,32 @@ else if ($_GET["action"] == 'disable_multiprix') Header("Location: produit.php"); exit; } +else if ($_GET["action"] == 'activate_sousproduits') +{ + $table = MAIN_DB_PREFIX."product_parent_child"; + $fields['rowid'] = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment'); + $fields['tms'] = array('type'=>'timestamp','value'=>'14','null'=>'not null'); + $fields['datec'] = array('type'=>'datetime','default'=> 'null'); + $fields['fk_product_parent'] = array('type'=>'int','value'=>'11','default'=> 'null'); + $fields['fk_product_child'] = array('type'=>'int','value'=>'11','default'=> 'null'); + if(! $db -> create_table($table,$fields,"rowid","MyISAM")) + { + dolibarr_print_error($db); + print ""; + } + else + { + dolibarr_set_const($db, "PRODUIT_SOUSPRODUITS", "1"); + Header("Location: produit.php"); + } +} +else if ($_GET["action"] == 'disable_sousproduits') +{ + dolibarr_del_const($db, "PRODUIT_SOUSPRODUITS"); + Header("Location: produit.php"); + exit; +} + /* * Affiche page @@ -185,7 +211,31 @@ if($conf->global->PRODUIT_MULTIPRICES == 1) print ''; print ''; } - +// sousproduits activation/desactivation +print '
'; +print ''; +print ''; +print ''; +print ''; +print ''; +print "\n"; +print ""; +print ""; +print ""; +print ''; +print ''; +print ""; +print ''; +print '
'.$langs->trans("Name").' '.$langs->trans("Active").'
'.$langs->trans("AssociatedProductsAbility").''; +if($conf->global->PRODUIT_SOUSPRODUITS == 1) + print img_tick(); +print '"; +if($conf->global->PRODUIT_SOUSPRODUITS == 0) +print ''.$langs->trans("Activate").''; +else if($conf->global->PRODUIT_SOUSPRODUITS == 1) + print ''.$langs->trans("Disable").''; +print "
'; +print ''; $db->close();