Fix: table declaration
Fix: regretion into trigger management
This commit is contained in:
parent
5d2a81a4f0
commit
94cd8debeb
@ -212,21 +212,21 @@ class Categorie extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ($reshook < 0) $error++;
|
else if ($reshook < 0) $error++;
|
||||||
|
|
||||||
// Call trigger
|
// Call trigger
|
||||||
$result=$this->call_trigger('CATEGORY_CREATE',$user);
|
$result=$this->call_trigger('CATEGORY_CREATE',$user);
|
||||||
if ($result < 0) { $error++; }
|
if ($result < 0) { $error++; }
|
||||||
// End call triggers
|
// End call triggers
|
||||||
|
|
||||||
if ( ! $error )
|
if ( ! $error )
|
||||||
{
|
|
||||||
$this->db->rollback();
|
|
||||||
return -3;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
return $id;
|
return $id;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->db->rollback();
|
||||||
|
return -3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -310,7 +310,7 @@ class Categorie extends CommonObject
|
|||||||
|
|
||||||
// Call trigger
|
// Call trigger
|
||||||
$result=$this->call_trigger('CATEGORY_MODIFY',$user);
|
$result=$this->call_trigger('CATEGORY_MODIFY',$user);
|
||||||
if ($result < 0) { $error++; $this->db->rollback(); return -1; }
|
if ($result < 0) { $error++; $this->db->rollback(); return -1; }
|
||||||
// End call triggers
|
// End call triggers
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
@ -430,7 +430,7 @@ class Categorie extends CommonObject
|
|||||||
}
|
}
|
||||||
// Call trigger
|
// Call trigger
|
||||||
$result=$this->call_trigger('CATEGORY_DELETE',$user);
|
$result=$this->call_trigger('CATEGORY_DELETE',$user);
|
||||||
if ($result < 0) { $error++; }
|
if ($result < 0) { $error++; }
|
||||||
// End call triggers
|
// End call triggers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -472,7 +472,7 @@ class Categorie extends CommonObject
|
|||||||
if ($type=='fournisseur') $column_name='societe';
|
if ($type=='fournisseur') $column_name='societe';
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie_".$type." (fk_categorie, fk_".$column_name.")";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie_".$type." (fk_categorie, fk_".$column_name.")";
|
||||||
$sql .= " VALUES (".$this->id.", ".$obj->id.")";
|
$sql .= " VALUES (".$this->id.", ".$obj->id.")";
|
||||||
|
|
||||||
@ -523,7 +523,7 @@ class Categorie extends CommonObject
|
|||||||
|
|
||||||
// Call trigger
|
// Call trigger
|
||||||
$result=$this->call_trigger('CATEGORY_LINK',$user);
|
$result=$this->call_trigger('CATEGORY_LINK',$user);
|
||||||
if ($result < 0) { $error++; }
|
if ($result < 0) { $error++; }
|
||||||
// End call triggers
|
// End call triggers
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
@ -532,11 +532,11 @@ class Categorie extends CommonObject
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -575,7 +575,7 @@ class Categorie extends CommonObject
|
|||||||
$column_name=$type;
|
$column_name=$type;
|
||||||
if ($type=='contact') $column_name='socpeople';
|
if ($type=='contact') $column_name='socpeople';
|
||||||
if ($type=='fournisseur') $column_name='societe';
|
if ($type=='fournisseur') $column_name='societe';
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_".$type;
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_".$type;
|
||||||
@ -590,7 +590,7 @@ class Categorie extends CommonObject
|
|||||||
|
|
||||||
// Call trigger
|
// Call trigger
|
||||||
$result=$this->call_trigger('CATEGORY_UNLINK',$user);
|
$result=$this->call_trigger('CATEGORY_UNLINK',$user);
|
||||||
if ($result < 0) { $error++; }
|
if ($result < 0) { $error++; }
|
||||||
// End call triggers
|
// End call triggers
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
@ -601,7 +601,7 @@ class Categorie extends CommonObject
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -101,7 +101,7 @@ create table llx_accounting_fiscalyear
|
|||||||
statut tinyint DEFAULT 0 NOT NULL,
|
statut tinyint DEFAULT 0 NOT NULL,
|
||||||
entity integer DEFAULT 1 NOT NULL, -- multi company id
|
entity integer DEFAULT 1 NOT NULL, -- multi company id
|
||||||
datec datetime NOT NULL,
|
datec datetime NOT NULL,
|
||||||
tms timestamp NULL,
|
tms timestamp,
|
||||||
fk_user_author integer NULL,
|
fk_user_author integer NULL,
|
||||||
fk_user_modif integer NULL
|
fk_user_modif integer NULL
|
||||||
)ENGINE=innodb;
|
)ENGINE=innodb;
|
||||||
|
|||||||
@ -25,7 +25,7 @@ create table llx_accounting_fiscalyear
|
|||||||
statut tinyint DEFAULT 0 NOT NULL,
|
statut tinyint DEFAULT 0 NOT NULL,
|
||||||
entity integer DEFAULT 1 NOT NULL, -- multi company id
|
entity integer DEFAULT 1 NOT NULL, -- multi company id
|
||||||
datec datetime NOT NULL,
|
datec datetime NOT NULL,
|
||||||
tms timestamp DEFAULT NULL,
|
tms timestamp,
|
||||||
fk_user_author integer DEFAULT NULL,
|
fk_user_author integer DEFAULT NULL,
|
||||||
fk_user_modif integer DEFAULT NULL
|
fk_user_modif integer DEFAULT NULL
|
||||||
)ENGINE=innodb;
|
)ENGINE=innodb;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user