Qual: Factorize duplicate code

This commit is contained in:
Laurent Destailleur
2008-02-24 17:01:48 +00:00
parent fe62f493e0
commit 6edf6c8100
14 changed files with 110 additions and 324 deletions

View File

@@ -1391,51 +1391,6 @@ class Commande extends CommonObject
}
}
/**
* \brief Mets <20> jour les commentaires priv<69>s
* \param note Commentaire
* \return int <0 si ko, >0 si ok
*/
function update_note($note)
{
$sql = 'UPDATE '.MAIN_DB_PREFIX.'commande';
$sql.= " SET note = '".addslashes($note)."'";
$sql.= " WHERE rowid =". $this->id;
if ($this->db->query($sql))
{
$this->note = $note;
return 1;
}
else
{
$this->error=$this->db->error();
return -1;
}
}
/**
* \brief Mets <20> jour les commentaires publiques
* \param note_public Commentaire
* \return int <0 si ko, >0 si ok
*/
function update_note_public($note_public)
{
$sql = 'UPDATE '.MAIN_DB_PREFIX.'commande';
$sql.= " SET note_public = '".addslashes($note_public)."'";
$sql.= " WHERE rowid =". $this->id;
if ($this->db->query($sql))
{
$this->note_public = $note_public;
return 1;
}
else
{
$this->error=$this->db->error();
return -1;
}
}
/**
* \brief D<>finit une date de livraison