Qual: Use a code instead of key.

This commit is contained in:
Laurent Destailleur 2009-06-30 11:59:46 +00:00
parent e518bbc540
commit 9938f159b0
2 changed files with 10 additions and 9 deletions

View File

@ -104,7 +104,7 @@ class InterfaceNotification
{ {
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
$action_notify = 2; $action_notify = 'NOTIFY_VAL_FAC';
$ref = dol_sanitizeFileName($object->ref); $ref = dol_sanitizeFileName($object->ref);
$filepdf = $conf->facture->dir_output . '/' . $ref . '/' . $ref . '.pdf'; $filepdf = $conf->facture->dir_output . '/' . $ref . '/' . $ref . '.pdf';
$mesg = 'La facture '.$object->ref." a été validée.\n"; $mesg = 'La facture '.$object->ref." a été validée.\n";
@ -117,7 +117,7 @@ class InterfaceNotification
{ {
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
$action_notify = 1; $action_notify = 'NOTIFY_VAL_FICHINTER';
$ref = dol_sanitizeFileName($object->ref); $ref = dol_sanitizeFileName($object->ref);
$filepdf = $conf->facture->dir_output . '/' . $ref . '/' . $ref . '.pdf'; $filepdf = $conf->facture->dir_output . '/' . $ref . '/' . $ref . '.pdf';
$mesg = 'La fiche intervention '.$object->ref." a été validée.\n"; $mesg = 'La fiche intervention '.$object->ref." a été validée.\n";
@ -130,7 +130,7 @@ class InterfaceNotification
{ {
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
$action_notify = 3; $action_notify = 'NOTIFY_VAL_ORDER_SUPPLIER';
$ref = dol_sanitizeFileName($object->ref); $ref = dol_sanitizeFileName($object->ref);
$filepdf = $conf->fournisseur->commande->dir_output . '/' . $ref . '/' . $ref . '.pdf'; $filepdf = $conf->fournisseur->commande->dir_output . '/' . $ref . '/' . $ref . '.pdf';
$mesg = 'La commande fournisseur '.$object->ref." a été validée.\n"; $mesg = 'La commande fournisseur '.$object->ref." a été validée.\n";

View File

@ -117,7 +117,8 @@ class Notify
$sql = "SELECT s.nom, c.email, c.rowid, c.name, c.firstname, a.titre,n.rowid"; $sql = "SELECT s.nom, c.email, c.rowid, 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.rowid AND a.rowid = n.fk_action"; $sql .= " WHERE n.fk_contact = c.rowid AND a.rowid = n.fk_action";
$sql .= " AND n.fk_soc = s.rowid AND n.fk_action = ".$action; $sql .= " AND n.fk_soc = s.rowid";
$sql .= " AND a.code = 'NOTIFY_".$action."'";
$sql .= " AND s.rowid = ".$socid; $sql .= " AND s.rowid = ".$socid;
dol_syslog("Notify.class::send $action, $socid, $texte, $objet_type, $objet_id, $file"); dol_syslog("Notify.class::send $action, $socid, $texte, $objet_type, $objet_id, $file");