diff options
Diffstat (limited to 'core/js/shareitemmodel.js')
-rw-r--r-- | core/js/shareitemmodel.js | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/core/js/shareitemmodel.js b/core/js/shareitemmodel.js index 595670faaef..e0d44586613 100644 --- a/core/js/shareitemmodel.js +++ b/core/js/shareitemmodel.js @@ -476,7 +476,7 @@ var itemType = this.get('itemType'); var itemSource = this.get('itemSource'); - $.post( + return $.post( OC.generateUrl('core/ajax/share.php'), { action: state ? 'informRecipients' : 'informRecipientsDisabled', @@ -487,6 +487,7 @@ }, function(result) { if (result.status !== 'success') { + // FIXME: a model should not show dialogs OC.dialogs.alert(t('core', result.data.message), t('core', 'Warning')); } } @@ -494,6 +495,34 @@ }, /** + * Send the link share information by email + * + * @param {string} recipientEmail recipient email address + */ + sendEmailPrivateLink: function(recipientEmail) { + var itemType = this.get('itemType'); + var itemSource = this.get('itemSource'); + var linkShare = this.get('linkShare'); + + return $.post( + OC.generateUrl('core/ajax/share.php'), { + action: 'email', + toaddress: recipientEmail, + link: linkShare.link, + itemType: itemType, + itemSource: itemSource, + file: this.fileInfoModel.get('name'), + expiration: linkShare.expiration || '' + }, + function(result) { + if (!result || result.status !== 'success') { + // FIXME: a model should not show dialogs + OC.dialogs.alert(result.data.message, t('core', 'Error while sending notification')); + } + }); + }, + + /** * @returns {boolean} */ sharePermissionPossible: function() { |