From 1166d62d9be783cb56e0bd8fbfc016447bdbdda4 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Thu, 22 May 2014 14:28:29 +0200 Subject: [PATCH 1/3] fileList needs be be declared before the if-statement --- apps/files_sharing/js/share.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js index 1b04097ccb..ec46bbe44f 100644 --- a/apps/files_sharing/js/share.js +++ b/apps/files_sharing/js/share.js @@ -31,8 +31,8 @@ $(document).ready(function() { // we create a share notification action to inform the user about files // shared with him otherwise we just update the existing share action. var allShared; + var $fileList = $(this); if (oc_appconfig.core.sharingDisabledForUser) { - var $fileList = $(this); allShared = $fileList.find('[data-share-owner]'); var shareNotification = '' + From 11aa2cf74b813800cae5fdee426ed83196a34139 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Thu, 22 May 2014 14:29:23 +0200 Subject: [PATCH 2/3] always check for unique filename, if a file gets added from outside the mount point should be adjusted to ne unique again --- apps/files_sharing/lib/sharedstorage.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/files_sharing/lib/sharedstorage.php b/apps/files_sharing/lib/sharedstorage.php index 07a0acf00a..02a8ebab93 100644 --- a/apps/files_sharing/lib/sharedstorage.php +++ b/apps/files_sharing/lib/sharedstorage.php @@ -517,14 +517,14 @@ class Shared extends \OC\Files\Storage\Common { $parent = dirname($parent); } - $newMountPoint = \OC\Files\Filesystem::normalizePath($parent . '/' . $mountPoint); + $newMountPoint = \OCA\Files_Sharing\Helper::generateUniqueTarget( + \OC\Files\Filesystem::normalizePath($parent . '/' . $mountPoint), + array(), + new \OC\Files\View('/' . \OCP\User::getUser() . '/files') + ); if($newMountPoint !== $share['file_target']) { - $newMountPoint = \OCA\Files_Sharing\Helper::generateUniqueTarget( - $newMountPoint, - array(), - new \OC\Files\View('/' . \OCP\User::getUser() . '/files') - ); + self::updateFileTarget($newMountPoint, $share); $share['file_target'] = $newMountPoint; From 3b279c9056087cada0d9bcc4eb75a15a807b426f Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Fri, 23 May 2014 11:16:22 +0200 Subject: [PATCH 3/3] prevent default action when clicking on the share notification --- apps/files_sharing/js/share.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js index ec46bbe44f..e9889babaa 100644 --- a/apps/files_sharing/js/share.js +++ b/apps/files_sharing/js/share.js @@ -40,8 +40,13 @@ $(document).ready(function() { $(allShared).find('.fileactions').append(function() { var owner = $(this).closest('tr').attr('data-share-owner'); var shareBy = t('files_sharing', 'Shared by {owner}', {owner: owner}); - return shareNotification + ' ' + shareBy + ''; + var $result = $(shareNotification + ' ' + shareBy + ''); + $result.on('click', function() { + return false; + }); + return $result; }); + } else { allShared = $fileList.find('[data-share-owner] [data-Action="Share"]'); allShared.addClass('permanent');