Correction conflit CVS

This commit is contained in:
Rodolphe Quiedeville 2005-02-28 15:23:33 +00:00
parent 7d06600479
commit f332032fac

View File

@ -114,52 +114,57 @@ class Societe {
$result = $this->verify();
if ($result >= 0)
{
{
$sql = "INSERT INTO ".MAIN_DB_PREFIX."societe (nom, datec, datea, fk_user_creat) ";
$sql .= " VALUES ('".addslashes($this->nom)."', now(), now(), '".$user->id."')";
$result=$this->db->query($sql);
if ($result)
{
{
$this->id = $this->db->last_insert_id();
$this->creation_bit = 1;
$ret = $this->update($this->id);
if ($ret == 0) {
$this->db->commit();
} else {
dolibarr_syslog("Societe::create echec update");
if ($ret == 0)
{
$this->db->commit();
}
else
{
dolibarr_syslog("Societe::create echec update");
$this->db->rollback();
return -3;
}
}
return $ret;
}
}
else
{
if ($this->db->errno() == DB_ERROR_RECORD_ALREADY_EXISTS)
{
{
if ($this->db->errno() == DB_ERROR_RECORD_ALREADY_EXISTS)
{
$this->error=$langs->trans("ErrorCompanyNameAlreadyExists",$this->nom);
}
else {
dolibarr_syslog("Societe::create echec insert sql=$sql");
}
}
else
{
dolibarr_syslog("Societe::create echec insert sql=$sql");
}
$this->db->rollback();
return -2;
}
}
else {
}
}
else
{
$this->db->rollback();
dolibarr_syslog("Societe::Create echec verify sql=$sql");
dolibarr_syslog("Societe::Create echec verify sql=$sql");
return -1;
}
}
}
/**
* \brief Verification lors de la modification
* \return 0 si ok, < 0 en cas d'erreur
@ -300,13 +305,12 @@ class Societe {
$sql .= ",siren = '" . $this->siren ."'";
$sql .= ",siret = '" . $this->siret ."'";
$sql .= ",ape = '" . $this->ape ."'";
$sql .= ",tva_intra = '" . $this->tva_intra ."'";
$sql .= ",capital = '" . $this->capital ."'";
if ($this->prefix_comm)
{ $sql .= ",prefix_comm = '" . $this->prefix_comm ."'"; }
if ($this->tva_intra)
{ $sql .= ",tva_intra = '" . $this->tva_intra ."'"; }
if ($this->capital)
{ $sql .= ",capital = '" . $this->capital ."'"; }
if ($this->effectif_id)
{ $sql .= ",fk_effectif = '" . $this->effectif_id ."'"; }