bugfix
This commit is contained in:
parent
16892944c7
commit
2e04b0ad5d
@ -48,31 +48,34 @@ else if ($_POST["action"] == 'multiprix_num')
|
|||||||
Header("Location: produit.php");
|
Header("Location: produit.php");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
if ($_POST["action"] == 'multiprix' && $_POST["activate_multiprix"] == 1)
|
if ($_POST["action"] == 'multiprix')
|
||||||
{
|
{
|
||||||
$res=$db -> desc_table(MAIN_DB_PREFIX."product_price","price_level");
|
if ($_POST["activate_multiprix"] == 1)
|
||||||
if(! $db -> fetch_row())
|
|
||||||
{
|
{
|
||||||
// on ajoute le champ price_level dans la table societe
|
$res=$db -> desc_table(MAIN_DB_PREFIX."product_price","price_level");
|
||||||
if(! $db -> add_field(MAIN_DB_PREFIX."societe","price_level",$field_desc))
|
if(! $db -> fetch_row())
|
||||||
{
|
{
|
||||||
dolibarr_print_error($db);
|
// on ajoute le champ price_level dans la table societe
|
||||||
print "<script language='JavaScript'>setTimeout(\"document.location='./produit.php'\",5000);</script>";
|
if(! $db -> add_field(MAIN_DB_PREFIX."societe","price_level",$field_desc))
|
||||||
}
|
{
|
||||||
// on crée la table societe_prices
|
dolibarr_print_error($db);
|
||||||
else
|
print "<script language='JavaScript'>setTimeout(\"document.location='./produit.php'\",5000);</script>";
|
||||||
{
|
}
|
||||||
$table = MAIN_DB_PREFIX."societe_prices";
|
// on crée la table societe_prices
|
||||||
$fields['rowid'] = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment');
|
else
|
||||||
$fields['fk_soc'] = array('type'=>'int','value'=>'11','null'=>'not null','default'=> '0');
|
{
|
||||||
$fields['tms'] = array('type'=>'timestamp','value'=>'14','null'=>'not null');
|
$table = MAIN_DB_PREFIX."societe_prices";
|
||||||
$fields['datec'] = array('type'=>'datetime','default'=> 'null');
|
$fields['rowid'] = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment');
|
||||||
$fields['fk_user_author'] = array('type'=>'int','value'=>'11','default'=> 'null');
|
$fields['fk_soc'] = array('type'=>'int','value'=>'11','null'=>'not null','default'=> '0');
|
||||||
$fields['price_level'] = array('type'=>'tinyint','value'=>'4','default'=> '1');
|
$fields['tms'] = array('type'=>'timestamp','value'=>'14','null'=>'not null');
|
||||||
if(! $db -> create_table($table,$fields,"rowid","InnoDB"))
|
$fields['datec'] = array('type'=>'datetime','default'=> 'null');
|
||||||
{
|
$fields['fk_user_author'] = array('type'=>'int','value'=>'11','default'=> 'null');
|
||||||
dolibarr_print_error($db);
|
$fields['price_level'] = array('type'=>'tinyint','value'=>'4','default'=> '1');
|
||||||
print "<script language='JavaScript'>setTimeout(\"document.location='./produit.php'\",5000);</script>";
|
if(! $db -> create_table($table,$fields,"rowid","InnoDB"))
|
||||||
|
{
|
||||||
|
dolibarr_print_error($db);
|
||||||
|
print "<script language='JavaScript'>setTimeout(\"document.location='./produit.php'\",5000);</script>";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -85,31 +88,33 @@ if ($_POST["action"] == 'multiprix' && $_POST["activate_multiprix"] == 1)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_set_const($db, "PRODUIT_MULTIPRICES", $_POST["activate_multiprix"]);
|
dolibarr_set_const($db, "PRODUIT_MULTIPRICES", $_POST["activate_multiprix"]);
|
||||||
dolibarr_set_const($db, "PRODUIT_MULTIPRICES_LIMIT", "6");
|
|
||||||
Header("Location: produit.php");
|
Header("Location: produit.php");
|
||||||
}
|
}
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else if ($_POST["action"] == 'sousproduits' && $_POST["activate_sousproduits"] == 1)
|
else if ($_POST["action"] == 'sousproduits')
|
||||||
{
|
{
|
||||||
$res=$db -> desc_table(MAIN_DB_PREFIX."product_association");
|
if ($_POST["activate_sousproduits"] == 1)
|
||||||
if(! $db -> fetch_row())
|
{
|
||||||
{
|
$res=$db -> desc_table(MAIN_DB_PREFIX."product_association");
|
||||||
$table = MAIN_DB_PREFIX."product_association";
|
if(! $db -> fetch_row())
|
||||||
$fields['fk_product_pere'] = array('type'=>'int','value'=>'11','null'=> 'not null','default'=> '0');
|
{
|
||||||
$fields['fk_product_fils'] = array('type'=>'int','value'=>'11','null'=> 'not null','default'=> '0');
|
$table = MAIN_DB_PREFIX."product_association";
|
||||||
$fields['qty'] = array('type'=>'double','default'=> 'null');
|
$fields['fk_product_pere'] = array('type'=>'int','value'=>'11','null'=> 'not null','default'=> '0');
|
||||||
$keys['idx_product_association_fk_product_pere'] = "fk_product_pere" ;
|
$fields['fk_product_fils'] = array('type'=>'int','value'=>'11','null'=> 'not null','default'=> '0');
|
||||||
$keys['idx_product_association_fk_product_fils'] = "fk_product_fils" ;
|
$fields['qty'] = array('type'=>'double','default'=> 'null');
|
||||||
if(! $db -> create_table($table,$fields,"","InnoDB","","",$keys))
|
$keys['idx_product_association_fk_product_pere'] = "fk_product_pere" ;
|
||||||
{
|
$keys['idx_product_association_fk_product_fils'] = "fk_product_fils" ;
|
||||||
dolibarr_print_error($db);
|
if(! $db -> create_table($table,$fields,"","InnoDB","","",$keys))
|
||||||
print "<script language='JavaScript'>setTimeout(\"document.location='./produit.php'\",5000);</script>";
|
{
|
||||||
|
dolibarr_print_error($db);
|
||||||
|
print "<script language='JavaScript'>setTimeout(\"document.location='./produit.php'\",5000);</script>";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_set_const($db, "PRODUIT_SOUSPRODUITS", $_POST["activate_sousproduits"]);
|
dolibarr_set_const($db, "PRODUIT_SOUSPRODUITS", $_POST["activate_sousproduits"]);
|
||||||
Header("Location: produit.php");
|
Header("Location: produit.php");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user