Doc: Commentaires doxygen

This commit is contained in:
Laurent Destailleur 2005-07-14 13:03:20 +00:00
parent 46c291bacd
commit 7991dee770

View File

@ -18,7 +18,6 @@
* *
* $Id$ * $Id$
* $Source$ * $Source$
*
*/ */
/** /**
@ -37,6 +36,8 @@ class Notify
{ {
var $id; var $id;
var $db; var $db;
var $error;
var $socidp; var $socidp;
var $author; var $author;
var $ref; var $ref;
@ -45,20 +46,27 @@ class Notify
var $note; var $note;
var $projet_id; var $projet_id;
/**
* \brief Constructeur
* \param DB Handler accès base
*/
function Notify($DB) function Notify($DB)
{ {
$this->db = $DB ; $this->db = $DB ;
include_once(DOL_DOCUMENT_ROOT."/lib/CMailFile.class.php"); include_once(DOL_DOCUMENT_ROOT."/lib/CMailFile.class.php");
} }
/*
* /**
* * \brief Envoi mail et sauve trace
* *
*/ */
function send($action, $socid, $texte, $objet_type, $objet_id, $file="") function send($action, $socid, $texte, $objet_type, $objet_id, $file="")
{ {
global $conf,$langs;
$sql = "SELECT s.nom, c.email, c.idp, c.name, c.firstname, a.titre,n.rowid"; $sql = "SELECT s.nom, c.email, c.idp, c.name, c.firstname, a.titre,n.rowid";
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as c, ".MAIN_DB_PREFIX."action_def as a, ".MAIN_DB_PREFIX."notify_def as n, ".MAIN_DB_PREFIX."societe as s"; $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as c, ".MAIN_DB_PREFIX."action_def as a, ".MAIN_DB_PREFIX."notify_def as n, ".MAIN_DB_PREFIX."societe as s";
$sql .= " WHERE n.fk_contact = c.idp AND a.rowid = n.fk_action"; $sql .= " WHERE n.fk_contact = c.idp AND a.rowid = n.fk_action";
@ -68,7 +76,7 @@ class Notify
$result = $this->db->query($sql); $result = $this->db->query($sql);
if ($result) if ($result)
{ {
$num = $this->db->num_rows(); $num = $this->db->num_rows($result);
$i = 0; $i = 0;
while ($i < $num) while ($i < $num)
{ {
@ -78,10 +86,10 @@ class Notify
if (strlen($sendto)) if (strlen($sendto))
{ {
$subject = "Notification Dolibarr"; $subject = $langs->trans("DolibarrNotififcation");
$message = $texte; $message = $texte;
$filename = split("/",$file); $filename = split("/",$file);
$replyto = MAIN_MAIL_FROM; $replyto = $conf->email_from;
$mailfile = new CMailFile($subject, $mailfile = new CMailFile($subject,
$sendto, $sendto,
@ -98,17 +106,15 @@ class Notify
$sql = "INSERT INTO ".MAIN_DB_PREFIX."notify (daten, fk_action, fk_contact, objet_type, objet_id)"; $sql = "INSERT INTO ".MAIN_DB_PREFIX."notify (daten, fk_action, fk_contact, objet_type, objet_id)";
$sql .= " VALUES (now(), $action ,$obj->idp , '$objet_type', $objet_id);"; $sql .= " VALUES (now(), $action ,$obj->idp , '$objet_type', $objet_id);";
$db2 = $this->db->dbclone(); if (! $db->query($sql) )
if (! $db2->query($sql) )
{ {
print $db2->error(); dolibarr_print_error($db);
print "<p>$sql</p>";
} }
} }
else else
{ {
print "envoi failed"; $this->error=$mailfile->error;
} }
} }
$i++; $i++;
@ -116,13 +122,11 @@ class Notify
} }
else else
{ {
print $this->db->error(); $this->error=$this->db->error();
}
/*
* Insertion dans la base de la trace
*/
} }
} }
}
?> ?>