From 16dafa9cac162f3dcf00998f6e2ffb2b6ee70813 Mon Sep 17 00:00:00 2001 From: Tom Needham Date: Sat, 9 Aug 2014 00:08:45 +0100 Subject: [PATCH 1/2] Fix link to files and folders in internal share emails --- lib/private/share/mailnotifications.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/private/share/mailnotifications.php b/lib/private/share/mailnotifications.php index cb74dcf8b9..62ab210b99 100644 --- a/lib/private/share/mailnotifications.php +++ b/lib/private/share/mailnotifications.php @@ -99,12 +99,11 @@ class MailNotifications { } } + // Link to folder, or root folder if a file if ($itemType === 'folder') { - $foldername = "/Shared/" . $filename; + $foldername = $filename; } else { - // if it is a file we can just link to the Shared folder, - // that's the place where the user will find the file - $foldername = "/Shared"; + $foldername = "/"; } $link = \OCP\Util::linkToAbsolute('files', 'index.php', array("dir" => $foldername)); From aeef10eb47a9b72ada5b8fde7d0667bff069de92 Mon Sep 17 00:00:00 2001 From: Tom Needham Date: Sat, 9 Aug 2014 00:21:29 +0100 Subject: [PATCH 2/2] Add scrollto to the url if sharing a file for long file lists --- lib/private/share/mailnotifications.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/private/share/mailnotifications.php b/lib/private/share/mailnotifications.php index 62ab210b99..1f4645eed9 100644 --- a/lib/private/share/mailnotifications.php +++ b/lib/private/share/mailnotifications.php @@ -100,13 +100,19 @@ class MailNotifications { } // Link to folder, or root folder if a file + if ($itemType === 'folder') { - $foldername = $filename; + $args = array( + 'dir' => $filename, + ); } else { - $foldername = "/"; + $args = array( + 'dir' => '/', + 'scrollto' => $filename, + ); } - $link = \OCP\Util::linkToAbsolute('files', 'index.php', array("dir" => $foldername)); + $link = \OCP\Util::linkToAbsolute('files', 'index.php', $args); list($htmlMail, $alttextMail) = $this->createMailBody($filename, $link, $expiration);