Gere la suppression

This commit is contained in:
Rodolphe Quiedeville 2007-10-08 11:31:33 +00:00
parent c32983722e
commit 9126d0dce1

View File

@ -60,7 +60,7 @@ class WorkflowTelephonie {
return $res; return $res;
} }
function Notify($module, $statut_id, $numero) function Notify($module, $statut_id, $numero, $commentaire='')
{ {
dolibarr_syslog("WorkflowTelephonie::Notify statut_id=$statut_id",LOG_DEBUG); dolibarr_syslog("WorkflowTelephonie::Notify statut_id=$statut_id",LOG_DEBUG);
@ -73,7 +73,7 @@ class WorkflowTelephonie {
{ {
while ($row = $this->db->fetch_row($resql)) while ($row = $this->db->fetch_row($resql))
{ {
$this->SendMail($row[0],$statut_id, $numero); $this->SendMail($row[0],$statut_id, $numero, $commentaire);
} }
$this->db->free($resql); $this->db->free($resql);
} }
@ -84,7 +84,7 @@ class WorkflowTelephonie {
} }
function SendMail($user_id, $statut_id, $numero) function SendMail($user_id, $statut_id, $numero, $commentaire='')
{ {
dolibarr_syslog("WorkflowTelephonie::SendMail user_id=$user_id,statut_id=$statut_id",LOG_DEBUG); dolibarr_syslog("WorkflowTelephonie::SendMail user_id=$user_id,statut_id=$statut_id",LOG_DEBUG);
@ -103,6 +103,8 @@ class WorkflowTelephonie {
$message .= "Ligne numéro : ".$numero."\n"; $message .= "Ligne numéro : ".$numero."\n";
$message .= "Evénement : ".$ligne->statuts[$statut_id]."\n"; $message .= "Evénement : ".$ligne->statuts[$statut_id]."\n";
if (strlen(trim($commentaire)))
$message .= "Commentaire : ".$commentaire."\n";
$message .= "\n\n--\n"; $message .= "\n\n--\n";
$message .= "Ceci est un message automatique envoyé par Dolibarr\n"; $message .= "Ceci est un message automatique envoyé par Dolibarr\n";
@ -114,6 +116,31 @@ class WorkflowTelephonie {
$message); $message);
$mailfile->sendfile(); $mailfile->sendfile();
} }
/**
*
*
*/
function Delete($module, $user_id, $statut_id)
{
// $module contient une des valeurs du champs de type enum de la table
$sql = "DELETE FROM ".MAIN_DB_PREFIX."telephonie_workflow";
$sql .= " WHERE module='".$module."'";
$sql .= " AND fk_user = '".$user_id."'";
$sql .= " AND fk_statut = '".$statut_id."';";
if ($this->db->query($sql) )
{
$res = 0;
}
else
{
dolibarr_syslog("WorkflowTelephonie::Delete ".$this->db->error,LOG_ERR);
$res = -1;
}
return $res;
}
} }
?> ?>