Read Receipt in module emailing

This commit is contained in:
FHenry 2012-02-22 20:49:55 +01:00
parent bb9a63c12b
commit 229176ea65
6 changed files with 55 additions and 1 deletions

View File

@ -515,6 +515,7 @@ if ($mil->fetch($id) >= 0)
print '<td align="right" nowrap="nowrap">';
if ($obj->statut==-1) print $langs->trans("MailingStatusError").' '.img_error();
if ($obj->statut==1) print $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut6');
if ($obj->statut==2) print $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut6');
print '</td>';
}
print '</tr>';

View File

@ -40,6 +40,7 @@ $message = '';
$substitutionarray=array(
'__ID__' => 'IdRecord',
'__EMAIL__' => 'EMail',
'__CHECK_READ__' => 'CheckMailIsRead',
'__LASTNAME__' => 'Lastname',
'__FIRSTNAME__' => 'Firstname',
'__OTHER1__' => 'Other1',
@ -51,6 +52,7 @@ $substitutionarray=array(
$substitutionarrayfortest=array(
'__ID__' => 'TESTIdRecord',
'__EMAIL__' => 'TESTEMail',
'__CHECK_READ__' => 'TESTCheckMailIsRead',
'__LASTNAME__' => 'TESTLastname',
'__FIRSTNAME__' => 'TESTFirstname',
'__OTHER1__' => 'TESTOther1',
@ -178,6 +180,7 @@ if ($_REQUEST["action"] == 'sendallconfirmed' && $_REQUEST['confirm'] == 'yes')
$substitutionarray=array(
'__ID__' => $obj->source_id,
'__EMAIL__' => $obj->email,
'__CHECK_READ__' => '<IMG SRC="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?mail_cbl_id='.$obj->rowid.'&mail='.$obj->email.'" style="width:0px;height:0px" border="0"/>',
'__LASTNAME__' => $obj->nom,
'__FIRSTNAME__' => $obj->prenom,
'__OTHER1__' => $other1,
@ -186,7 +189,7 @@ if ($_REQUEST["action"] == 'sendallconfirmed' && $_REQUEST['confirm'] == 'yes')
'__OTHER4__' => $other4,
'__OTHER5__' => $other5
);
$substitutionisok=true;
complete_substitutions_array($substitutionarray, $langs);
$newsubject=make_substitutions($subject,$substitutionarray);
@ -1026,6 +1029,7 @@ else
print '<br><i>'.$langs->trans("CommonSubstitutions").':<br>';
print '__ID__ = '.$langs->trans("IdRecord").'<br>';
print '__EMAIL__ = '.$langs->trans("EMail").'<br>';
print '__CHECK_READ__ = '.$langs->trans("CheckRead").'<br>';
print '__LASTNAME__ = '.$langs->trans("Lastname").'<br>';
print '__FIRSTNAME__ = '.$langs->trans("Firstname").'<br>';
print '__OTHER1__ = '.$langs->trans("Other").'1<br>';

View File

@ -39,6 +39,7 @@ MailingStatusDraft=Draft
MailingStatusValidated=Validated
MailingStatusApproved=Approved
MailingStatusSent=Sent
MailingStatusRead=Read
MailingStatusSentPartialy=Sent partialy
MailingStatusSentCompletely=Sent completely
MailingStatusError=Error

View File

@ -39,6 +39,7 @@ MailingStatusDraft=Brouillon
MailingStatusValidated=Validé
MailingStatusApproved=Approuvé
MailingStatusSent=Envoyé
MailingStatusRead=Lu
MailingStatusSentPartialy=Envoyé partiellement
MailingStatusSentCompletely=Envoyé complètement
MailingStatusError=Erreur

View File

@ -0,0 +1,46 @@
#!/usr/bin/php
<?php
/*
* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file scripts/emailings/mailing-read.php
* \ingroup mailing
* \brief Script use to update mail status if destinaries read it (if images during mail read are display)
*/
define("NOLOGIN",1); // This means this output page does not require to be logged.
define("NOCSRFCHECK",1); // We accept to go on this page from external web site.
require("../../main.inc.php");
$id=GETPOST('mail_cbl_id');
$mail_reader=GETPOST('mail');
$statut='2';
$sql = "UPDATE ".MAIN_DB_PREFIX."mailing_cibles SET statut=".$statut." WHERE rowid=".$id." AND email='".$mail_reader."'";
dol_syslog("public/emailing/mailing-read.php : Mail read : ".$sql, LOG_DEBUG);
$resql=$db->query($sql);
$db->close();
?>

View File

@ -135,6 +135,7 @@ if ($resql)
$substitutionarray=array(
'__ID__' => $obj->source_id,
'__EMAIL__' => $obj->email,
'__CHECK_READ__' => '<IMG SRC="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?mail_cbl_id='.$obj->rowid.'&mail='.$obj->email.'" style="width:0px;height:0px" border="0"/>',
'__LASTNAME__' => $obj->lastname,
'__FIRSTNAME__' => $obj->firstname,
'__OTHER1__' => $other1,