This commit is contained in:
Frédéric FRANCE 2020-11-27 20:33:40 +01:00
parent ba352c2374
commit 391e643eb7
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
2 changed files with 26 additions and 13 deletions

View File

@ -118,36 +118,48 @@ class Mailing extends CommonObject
/**
* @var int id of user create
* @deprecated
*/
public $user_creation;
/**
* @var int id of user create
* @deprecated
*/
public $user_creat;
/**
* @var int id of user validate
* @deprecated
*/
public $user_validation;
/**
* @var int id of user validate
* @deprecated
*/
public $user_valid;
/**
* @var integer|string date_creation
* @deprecated
*/
public $date_creat;
/**
* @var integer|string date_creation
*/
public $date_creation;
/**
* @var int date validate
* @deprecated
*/
public $date_valid;
/**
* @var int date validate
*/
public $date_validation;
/**
* @var array extraparams
*/
@ -314,10 +326,14 @@ class Mailing extends CommonObject
$this->email_errorsto = $obj->email_errorsto;
$this->user_creat = $obj->fk_user_creat;
$this->user_creation = $obj->fk_user_creat;
$this->user_valid = $obj->fk_user_valid;
$this->user_validation = $obj->fk_user_valid;
$this->date_creat = $this->db->jdate($obj->date_creat);
$this->date_creation = $this->db->jdate($obj->date_creat);
$this->date_valid = $this->db->jdate($obj->date_valid);
$this->date_validation = $this->db->jdate($obj->date_valid);
$this->date_envoi = $this->db->jdate($obj->date_envoi);
$this->extraparams = (array) json_decode($obj->extraparams, true);

View File

@ -33,8 +33,9 @@ $id = GETPOST('id', 'int');
$langs->load("mails");
// Security check
if (!$user->rights->mailing->lire || $user->socid > 0)
accessforbidden();
if (!$user->rights->mailing->lire || $user->socid > 0) {
accessforbidden();
}
@ -48,8 +49,7 @@ $form = new Form($db);
$object = new Mailing($db);
if ($object->fetch($id) >= 0)
{
if ($object->fetch($id) >= 0) {
$head = emailing_prepare_head($object);
print dol_get_fiche_head($head, 'info', $langs->trans("Mailing"), -1, 'email');
@ -58,13 +58,14 @@ if ($object->fetch($id) >= 0)
$morehtmlright = '';
$nbtry = $nbok = 0;
if ($object->statut == 2 || $object->statut == 3)
{
if ($object->statut == 2 || $object->statut == 3) {
$nbtry = $object->countNbOfTargets('alreadysent');
$nbko = $object->countNbOfTargets('alreadysentko');
$morehtmlright .= ' ('.$nbtry.'/'.$object->nbemail;
if ($nbko) $morehtmlright .= ' - '.$nbko.' '.$langs->trans("Error");
if ($nbko) {
$morehtmlright .= ' - '.$nbko.' '.$langs->trans("Error");
}
$morehtmlright .= ')   ';
}
@ -73,10 +74,6 @@ if ($object->fetch($id) >= 0)
print '<div class="underbanner clearboth"></div><br>';
//print '<table width="100%"><tr><td>';
$object->user_creation = $object->user_creat;
$object->date_creation = $object->date_creat;
$object->user_validation = $object->user_valid;
$object->date_validation = $object->date_valid;
dol_print_object_info($object, 0);
//print '</td></tr></table>';