From 06cefbb34b5826e55706a31ccd7d423020f8817c Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Thu, 28 Oct 2010 11:37:29 +0000 Subject: [PATCH] Task #8618: Add send mail form --- htdocs/admin/agenda.php | 1 + htdocs/fourn/facture/fiche.php | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/agenda.php b/htdocs/admin/agenda.php index c62d454e6f9..26b72245514 100644 --- a/htdocs/admin/agenda.php +++ b/htdocs/admin/agenda.php @@ -54,6 +54,7 @@ $eventstolog=array( array('id'=>'ORDER_SUPPLIER_SENTBYMAIL','test'=>$conf->fournisseur->enabled), array('id'=>'BILL_SUPPLIER_VALIDATE', 'test'=>$conf->fournisseur->enabled), array('id'=>'BILL_SUPPLIER_PAYED', 'test'=>$conf->fournisseur->enabled), + array('id'=>'BILL_SUPPLIER_SENTBYMAIL', 'test'=>$conf->fournisseur->enabled), // array('id'=>'PAYMENT_CUSTOMER_CREATE','test'=>$conf->facture->enabled), // array('id'=>'PAYMENT_SUPPLIER_CREATE','test'=>$conf->fournisseur->enabled), array('id'=>'MEMBER_VALIDATE', 'test'=>$conf->adherent->enabled), diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 17a690fb4d7..7bf2c8cf0c4 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -527,7 +527,7 @@ if (! empty($_POST['removedfile'])) /* * Send mail */ -if (($_POST['action'] == 'send' || $_POST['action'] == 'relance') && ! $_POST['addfile'] && ! $_POST['removedfile'] && ! $_POST['cancel']) +if ($_POST['action'] == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile'] && ! $_POST['cancel']) { $langs->load('mails'); @@ -622,7 +622,7 @@ if (($_POST['action'] == 'send' || $_POST['action'] == 'relance') && ! $_POST['a // Appel des triggers include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php"); $interface=new Interfaces($db); - $result=$interface->run_triggers('ORDER_SUPPLIER_SENTBYMAIL',$facturefourn,$user,$langs,$conf); + $result=$interface->run_triggers('BILL_SUPPLIER_SENTBYMAIL',$facturefourn,$user,$langs,$conf); if ($result < 0) { $error++; $this->errors=$interface->errors; } // Fin appel triggers @@ -634,7 +634,7 @@ if (($_POST['action'] == 'send' || $_POST['action'] == 'relance') && ! $_POST['a { // Redirect here // This avoid sending mail twice if going out and then back to page - Header('Location: '.$_SERVER["PHP_SELF"].'?faid='.$facturefourn->id.'&mesg='.urlencode($mesg)); + Header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$facturefourn->id.'&mesg='.urlencode($mesg)); exit; } } @@ -677,7 +677,7 @@ if (($_POST['action'] == 'send' || $_POST['action'] == 'relance') && ! $_POST['a dol_syslog('Unable to read data from the invoice. The invoice file has perhaps not been generated.'); } - $_GET['action'] = 'presend'; + //$_GET['action'] = 'presend'; } /*