|
@@ -330,7 +330,8 @@ class ShareByMailProvider implements IShareProvider {
|
|
|
$share->getSendPasswordByTalk(),
|
|
|
$share->getHideDownload(),
|
|
|
$share->getLabel(),
|
|
|
- $share->getExpirationDate()
|
|
|
+ $share->getExpirationDate(),
|
|
|
+ $share->getNote()
|
|
|
);
|
|
|
|
|
|
try {
|
|
@@ -341,7 +342,8 @@ class ShareByMailProvider implements IShareProvider {
|
|
|
$link,
|
|
|
$share->getSharedBy(),
|
|
|
$share->getSharedWith(),
|
|
|
- $share->getExpirationDate()
|
|
|
+ $share->getExpirationDate(),
|
|
|
+ $share->getNote()
|
|
|
);
|
|
|
} catch (HintException $hintException) {
|
|
|
$this->logger->logException($hintException, [
|
|
@@ -377,7 +379,9 @@ class ShareByMailProvider implements IShareProvider {
|
|
|
$link,
|
|
|
$initiator,
|
|
|
$shareWith,
|
|
|
- \DateTime $expiration = null) {
|
|
|
+ \DateTime $expiration = null,
|
|
|
+ $note = ''
|
|
|
+ ) {
|
|
|
$initiatorUser = $this->userManager->get($initiator);
|
|
|
$initiatorDisplayName = ($initiatorUser instanceof IUser) ? $initiatorUser->getDisplayName() : $initiator;
|
|
|
$message = $this->mailer->createMessage();
|
|
@@ -388,6 +392,7 @@ class ShareByMailProvider implements IShareProvider {
|
|
|
'initiator' => $initiatorDisplayName,
|
|
|
'expiration' => $expiration,
|
|
|
'shareWith' => $shareWith,
|
|
|
+ 'note' => $note
|
|
|
]);
|
|
|
|
|
|
$emailTemplate->setSubject($this->l->t('%1$s shared »%2$s« with you', [$initiatorDisplayName, $filename]));
|
|
@@ -395,6 +400,9 @@ class ShareByMailProvider implements IShareProvider {
|
|
|
$emailTemplate->addHeading($this->l->t('%1$s shared »%2$s« with you', [$initiatorDisplayName, $filename]), false);
|
|
|
$text = $this->l->t('%1$s shared »%2$s« with you.', [$initiatorDisplayName, $filename]);
|
|
|
|
|
|
+ if ($note !== '') {
|
|
|
+ $emailTemplate->addBodyText(htmlspecialchars($note), $note);
|
|
|
+ }
|
|
|
$emailTemplate->addBodyText(
|
|
|
htmlspecialchars($text . ' ' . $this->l->t('Click the button below to open it.')),
|
|
|
$text
|
|
@@ -671,7 +679,7 @@ class ShareByMailProvider implements IShareProvider {
|
|
|
* @param \DateTime|null $expirationTime
|
|
|
* @return int
|
|
|
*/
|
|
|
- protected function addShareToDB($itemSource, $itemType, $shareWith, $sharedBy, $uidOwner, $permissions, $token, $password, $sendPasswordByTalk, $hideDownload, $label, $expirationTime) {
|
|
|
+ protected function addShareToDB($itemSource, $itemType, $shareWith, $sharedBy, $uidOwner, $permissions, $token, $password, $sendPasswordByTalk, $hideDownload, $label, $expirationTime, $note = '') {
|
|
|
$qb = $this->dbConnection->getQueryBuilder();
|
|
|
$qb->insert('share')
|
|
|
->setValue('share_type', $qb->createNamedParameter(IShare::TYPE_EMAIL))
|
|
@@ -687,7 +695,8 @@ class ShareByMailProvider implements IShareProvider {
|
|
|
->setValue('password_by_talk', $qb->createNamedParameter($sendPasswordByTalk, IQueryBuilder::PARAM_BOOL))
|
|
|
->setValue('stime', $qb->createNamedParameter(time()))
|
|
|
->setValue('hide_download', $qb->createNamedParameter((int)$hideDownload, IQueryBuilder::PARAM_INT))
|
|
|
- ->setValue('label', $qb->createNamedParameter($label));
|
|
|
+ ->setValue('label', $qb->createNamedParameter($label))
|
|
|
+ ->setValue('note', $qb->createNamedParameter($note));
|
|
|
|
|
|
if ($expirationTime !== null) {
|
|
|
$qb->setValue('expiration', $qb->createNamedParameter($expirationTime, IQueryBuilder::PARAM_DATE));
|