Mise à jours des infos lors de la creation
This commit is contained in:
parent
c76648cc24
commit
1af7db0e33
@ -48,20 +48,45 @@ class ProductLivre extends Product
|
|||||||
$this->description = "Gestion des livres";
|
$this->description = "Gestion des livres";
|
||||||
$this->active = PRODUIT_SPECIAL_LIVRE;
|
$this->active = PRODUIT_SPECIAL_LIVRE;
|
||||||
$this->menu_new = 'NewBook';
|
$this->menu_new = 'NewBook';
|
||||||
|
$this->menu_clear = 1;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* \brief Creation
|
* \brief Creation
|
||||||
* \param id Id livre ('' par defaut)
|
* \param id Id livre
|
||||||
*/
|
*/
|
||||||
function CreateCanvas($id)
|
function CreateCanvas($user,$datas)
|
||||||
{
|
{
|
||||||
|
$id = $this->create($user);
|
||||||
|
|
||||||
|
|
||||||
$sql = " INSERT INTO ".MAIN_DB_PREFIX."product_cnv_livre (rowid)";
|
$sql = " INSERT INTO ".MAIN_DB_PREFIX."product_cnv_livre (rowid)";
|
||||||
$sql.= " VALUES ('".$id."');";
|
$sql.= " VALUES ('".$id."');";
|
||||||
|
|
||||||
$result = $this->db->query($sql) ;
|
$result = $this->db->query($sql) ;
|
||||||
|
|
||||||
$sql = " INSERT INTO ".MAIN_DB_PREFIX."product_cnv_livre_contrat (fk_cnv_livre)";
|
if ( $result )
|
||||||
$sql.= " VALUES ('".$id."');";
|
{
|
||||||
|
$sql = " INSERT INTO ".MAIN_DB_PREFIX."product_cnv_livre_contrat (fk_cnv_livre)";
|
||||||
|
$sql.= " VALUES ('".$id."');";
|
||||||
|
|
||||||
|
$result = $this->db->query($sql) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( $result )
|
||||||
|
{
|
||||||
|
$this->UpdateCanvas($datas);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $id;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* \brief Supression
|
||||||
|
* \param id Id livre
|
||||||
|
*/
|
||||||
|
function DeleteCanvas($id)
|
||||||
|
{
|
||||||
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."product_cnv_livre ";
|
||||||
|
$sql.= " WHERE rowid = '".$id."';";
|
||||||
|
|
||||||
$result = $this->db->query($sql) ;
|
$result = $this->db->query($sql) ;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user