Ajout les méthode de commande par défaut

This commit is contained in:
Rodolphe Quiedeville 2004-11-30 15:58:38 +00:00
parent a9f2e74d1f
commit fbb4d994e8

View File

@ -127,6 +127,8 @@ class modFournisseur extends DolibarrModules
$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);
}
}
}
} }
?> ?>