mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
Fix #1479 : Add validation duration in mail body
This commit is contained in:
@@ -19,6 +19,8 @@ class MailInfoValidationRequest extends AbstractMailWithLink
|
||||
private $title;
|
||||
/** @var \User_Adapter */
|
||||
private $user;
|
||||
/** @var integer */
|
||||
private $duration;
|
||||
|
||||
/**
|
||||
* Sets the title of the validation
|
||||
@@ -40,6 +42,11 @@ class MailInfoValidationRequest extends AbstractMailWithLink
|
||||
$this->user = $user;
|
||||
}
|
||||
|
||||
public function setDuration($duration)
|
||||
{
|
||||
$this->duration = (int) $duration;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
@@ -60,6 +67,14 @@ class MailInfoValidationRequest extends AbstractMailWithLink
|
||||
*/
|
||||
public function getMessage()
|
||||
{
|
||||
if (0 < $this->duration) {
|
||||
if (1 < $this->duration) {
|
||||
return $this->message . "\n\n" . "You have 1 day to validate the selection.";
|
||||
} else {
|
||||
return $this->message . "\n\n" . sprintf(_("You have %d days to validate the selection.", $this->duration));
|
||||
}
|
||||
}
|
||||
|
||||
return $this->message;
|
||||
}
|
||||
|
||||
@@ -68,7 +83,7 @@ class MailInfoValidationRequest extends AbstractMailWithLink
|
||||
*/
|
||||
public function getButtonText()
|
||||
{
|
||||
return _('Validate');
|
||||
return _('Start validation');
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user