Fix: supprimait les autres modles si on leur avait donn le mme nom
This commit is contained in:
parent
c8c3a10e0d
commit
caac021d2e
@ -55,7 +55,9 @@ if ($_GET["action"] == 'set')
|
|||||||
|
|
||||||
if ($_GET["action"] == 'del')
|
if ($_GET["action"] == 'del')
|
||||||
{
|
{
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom='".$_GET["value"]."'";
|
$type='creditnote';
|
||||||
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
|
||||||
|
$sql .= " WHERE nom = '".$_GET["value"]."' AND type = '".$type."'";
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -75,7 +77,8 @@ if ($_GET["action"] == 'setdoc')
|
|||||||
|
|
||||||
// On active le modele
|
// On active le modele
|
||||||
$type='creditnote';
|
$type='creditnote';
|
||||||
$sql_del = "delete from ".MAIN_DB_PREFIX."document_model where nom = '".$_GET["value"]."'";
|
$sql_del = "delete from ".MAIN_DB_PREFIX."document_model";
|
||||||
|
$sql_del .= " WHERE nom = '".$_GET["value"]."' AND type = '".$type."'";
|
||||||
$result1=$db->query($sql_del);
|
$result1=$db->query($sql_del);
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom,type) VALUES ('".$_GET["value"]."','".$type."')";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom,type) VALUES ('".$_GET["value"]."','".$type."')";
|
||||||
$result2=$db->query($sql);
|
$result2=$db->query($sql);
|
||||||
|
|||||||
@ -58,7 +58,9 @@ if ($_GET["action"] == 'set')
|
|||||||
|
|
||||||
if ($_GET["action"] == 'del')
|
if ($_GET["action"] == 'del')
|
||||||
{
|
{
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom='".$_GET["value"]."'";
|
$type='order';
|
||||||
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
|
||||||
|
$sql .= " WHERE nom = '".$_GET["value"]."' AND type = '".$type."'";
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -78,7 +80,8 @@ if ($_GET["action"] == 'setdoc')
|
|||||||
|
|
||||||
// On active le modele
|
// On active le modele
|
||||||
$type='order';
|
$type='order';
|
||||||
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model where nom = '".$_GET["value"]."'";
|
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
|
||||||
|
$sql_del .= " WHERE nom = '".$_GET["value"]."' AND type = '".$type."'";
|
||||||
$result1=$db->query($sql_del);
|
$result1=$db->query($sql_del);
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom,type) VALUES ('".$_GET["value"]."','".$type."')";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom,type) VALUES ('".$_GET["value"]."','".$type."')";
|
||||||
$result2=$db->query($sql);
|
$result2=$db->query($sql);
|
||||||
|
|||||||
@ -58,7 +58,9 @@ if ($_GET["action"] == 'set')
|
|||||||
|
|
||||||
if ($_GET["action"] == 'del')
|
if ($_GET["action"] == 'del')
|
||||||
{
|
{
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom='".$_GET["value"]."'";
|
$type='shipping';
|
||||||
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
|
||||||
|
$sql .= " WHERE nom = '".$_GET["value"]."' AND type = '".$type."'";
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -78,7 +80,8 @@ if ($_GET["action"] == 'setdoc')
|
|||||||
|
|
||||||
// On active le modele
|
// On active le modele
|
||||||
$type='shipping';
|
$type='shipping';
|
||||||
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model where nom = '".$_GET["value"]."'";
|
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
|
||||||
|
$sql_del .= " WHERE nom = '".$_GET["value"]."' AND type = '".$type."'";
|
||||||
$result1=$db->query($sql_del);
|
$result1=$db->query($sql_del);
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom,type) VALUES ('".$_GET["value"]."','".$type."')";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom,type) VALUES ('".$_GET["value"]."','".$type."')";
|
||||||
$result2=$db->query($sql);
|
$result2=$db->query($sql);
|
||||||
|
|||||||
@ -58,7 +58,9 @@ if ($_GET["action"] == 'set')
|
|||||||
|
|
||||||
if ($_GET["action"] == 'del')
|
if ($_GET["action"] == 'del')
|
||||||
{
|
{
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom='".$_GET["value"]."'";
|
$type='invoice';
|
||||||
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
|
||||||
|
$sql .= " WHERE nom = '".$_GET["value"]."' AND type = '".$type."'";
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -78,7 +80,8 @@ if ($_GET["action"] == 'setdoc')
|
|||||||
|
|
||||||
// On active le modele
|
// On active le modele
|
||||||
$type='invoice';
|
$type='invoice';
|
||||||
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model where nom = '".$_GET["value"]."'";
|
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
|
||||||
|
$sql_del .= " WHERE nom = '".$_GET["value"]."' AND type = '".$type."'";
|
||||||
$result1=$db->query($sql_del);
|
$result1=$db->query($sql_del);
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom,type) VALUES ('".$_GET["value"]."','".$type."')";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom,type) VALUES ('".$_GET["value"]."','".$type."')";
|
||||||
$result2=$db->query($sql);
|
$result2=$db->query($sql);
|
||||||
|
|||||||
@ -56,7 +56,9 @@ if ($_GET["action"] == 'set')
|
|||||||
|
|
||||||
if ($_GET["action"] == 'del')
|
if ($_GET["action"] == 'del')
|
||||||
{
|
{
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom='".$_GET["value"]."'";
|
$type='ficheinter';
|
||||||
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
|
||||||
|
$sql .= " WHERE nom = '".$_GET["value"]."' AND type = '".$type."'";
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -76,7 +78,8 @@ if ($_GET["action"] == 'setdoc')
|
|||||||
|
|
||||||
// On active le modele
|
// On active le modele
|
||||||
$type='ficheinter';
|
$type='ficheinter';
|
||||||
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model where nom = '".$_GET["value"]."'";
|
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
|
||||||
|
$sql_del .= " WHERE nom = '".$_GET["value"]."' AND type = '".$type."'";
|
||||||
$result1=$db->query($sql_del);
|
$result1=$db->query($sql_del);
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom,type) VALUES ('".$_GET["value"]."','".$type."')";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom,type) VALUES ('".$_GET["value"]."','".$type."')";
|
||||||
$result2=$db->query($sql);
|
$result2=$db->query($sql);
|
||||||
|
|||||||
@ -58,7 +58,9 @@ if ($_GET["action"] == 'set')
|
|||||||
|
|
||||||
if ($_GET["action"] == 'del')
|
if ($_GET["action"] == 'del')
|
||||||
{
|
{
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom='".$_GET["value"]."'";
|
$type='supplier_order';
|
||||||
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
|
||||||
|
$sql .= " WHERE nom = '".$_GET["value"]."' AND type = '".$type."'";
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -78,7 +80,8 @@ if ($_GET["action"] == 'setdoc')
|
|||||||
|
|
||||||
// On active le modele
|
// On active le modele
|
||||||
$type='supplier_order';
|
$type='supplier_order';
|
||||||
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model where nom = '".$_GET["value"]."'";
|
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
|
||||||
|
$sql_del .= " WHERE nom = '".$_GET["value"]."' AND type = '".$type."'";
|
||||||
$result1=$db->query($sql_del);
|
$result1=$db->query($sql_del);
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom,type) VALUES ('".$_GET["value"]."','".$type."')";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom,type) VALUES ('".$_GET["value"]."','".$type."')";
|
||||||
$result2=$db->query($sql);
|
$result2=$db->query($sql);
|
||||||
|
|||||||
@ -58,7 +58,9 @@ if ($_GET["action"] == 'set')
|
|||||||
|
|
||||||
if ($_GET["action"] == 'del')
|
if ($_GET["action"] == 'del')
|
||||||
{
|
{
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom='".$_GET["value"]."'";
|
$type='delivery';
|
||||||
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
|
||||||
|
$sql .= " WHERE nom = '".$_GET["value"]."' AND type = '".$type."'";
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -78,7 +80,8 @@ if ($_GET["action"] == 'setdoc')
|
|||||||
|
|
||||||
// On active le modele
|
// On active le modele
|
||||||
$type='delivery';
|
$type='delivery';
|
||||||
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model where nom = '".$_GET["value"]."'";
|
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
|
||||||
|
$sql_del .= " WHERE nom = '".$_GET["value"]."' AND type = '".$type."'";
|
||||||
$result1=$db->query($sql_del);
|
$result1=$db->query($sql_del);
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom,type) VALUES ('".$_GET["value"]."','".$type."')";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom,type) VALUES ('".$_GET["value"]."','".$type."')";
|
||||||
$result2=$db->query($sql);
|
$result2=$db->query($sql);
|
||||||
|
|||||||
@ -76,7 +76,9 @@ if ($_GET["action"] == 'set')
|
|||||||
}
|
}
|
||||||
if ($_GET["action"] == 'del')
|
if ($_GET["action"] == 'del')
|
||||||
{
|
{
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom='".$_GET["value"]."'";
|
$type='propal';
|
||||||
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
|
||||||
|
$sql .= " WHERE nom = '".$_GET["value"]."' AND type = '".$type."'";
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -96,7 +98,8 @@ if ($_GET["action"] == 'setdoc')
|
|||||||
|
|
||||||
// On active le modele
|
// On active le modele
|
||||||
$type='propal';
|
$type='propal';
|
||||||
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model where nom = '".$_GET["value"]."'";
|
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
|
||||||
|
$sql_del .= " WHERE nom = '".$_GET["value"]."' AND type = '".$type."'";
|
||||||
$result1=$db->query($sql_del);
|
$result1=$db->query($sql_del);
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom,type) VALUES ('".$_GET["value"]."','".$type."')";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom,type) VALUES ('".$_GET["value"]."','".$type."')";
|
||||||
$result2=$db->query($sql);
|
$result2=$db->query($sql);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user