Ajout les méthode de commande par défaut
This commit is contained in:
parent
a9f2e74d1f
commit
fbb4d994e8
@ -126,6 +126,8 @@ class modFournisseur extends DolibarrModules
|
|||||||
$this->rights[7][3] = 0;
|
$this->rights[7][3] = 0;
|
||||||
|
|
||||||
$sql = array();
|
$sql = array();
|
||||||
|
|
||||||
|
$this->load_datas();
|
||||||
|
|
||||||
return $this->_init($sql);
|
return $this->_init($sql);
|
||||||
}
|
}
|
||||||
@ -140,5 +142,48 @@ class modFournisseur extends DolibarrModules
|
|||||||
|
|
||||||
return $this->_remove($sql);
|
return $this->_remove($sql);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
function load_datas()
|
||||||
|
{
|
||||||
|
$sql = "SELECT count(rowid) FROM ".MAIN_DB_PREFIX."c_methode_commande_fournisseur";
|
||||||
|
|
||||||
|
if ($this->db->query($sql))
|
||||||
|
{
|
||||||
|
$row = $this->db->fetch_row();
|
||||||
|
|
||||||
|
if ($row[0] == 0)
|
||||||
|
{
|
||||||
|
$this->db->free();
|
||||||
|
|
||||||
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."c_methode_commande_fournisseur";
|
||||||
|
$sql .= " (libelle) VALUES ('Courrier')";
|
||||||
|
|
||||||
|
$this->db->query($sql);
|
||||||
|
|
||||||
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."c_methode_commande_fournisseur";
|
||||||
|
$sql .= " (libelle) VALUES ('Fax')";
|
||||||
|
|
||||||
|
$this->db->query($sql);
|
||||||
|
|
||||||
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."c_methode_commande_fournisseur";
|
||||||
|
$sql .= " (libelle) VALUES ('Mail')";
|
||||||
|
|
||||||
|
$this->db->query($sql);
|
||||||
|
|
||||||
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."c_methode_commande_fournisseur";
|
||||||
|
$sql .= " (libelle) VALUES ('Téléphone')";
|
||||||
|
|
||||||
|
$this->db->query($sql);
|
||||||
|
|
||||||
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."c_methode_commande_fournisseur";
|
||||||
|
$sql .= " (libelle) VALUES ('En ligne')";
|
||||||
|
|
||||||
|
$this->db->query($sql);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user