summaryrefslogtreecommitdiffstats
path: root/core/js/shareitemmodel.js
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-09-14 18:03:44 +0200
committerVincent Petry <pvince81@owncloud.com>2015-09-16 07:23:29 +0200
commitaeee19b3f24eb60252ba55b89be745027ed39faf (patch)
tree0a6b14dec787b7cd6edf4c3a7b4001ede063e560 /core/js/shareitemmodel.js
parente0a2004f4ca647f7d20ec885045ec9e2e899ea03 (diff)
downloadnextcloud-server-aeee19b3f24eb60252ba55b89be745027ed39faf.tar.gz
nextcloud-server-aeee19b3f24eb60252ba55b89be745027ed39faf.zip
Implement "notify by email" checkbox in share dialog
Diffstat (limited to 'core/js/shareitemmodel.js')
-rw-r--r--core/js/shareitemmodel.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/core/js/shareitemmodel.js b/core/js/shareitemmodel.js
index 877b3cb230d..595670faaef 100644
--- a/core/js/shareitemmodel.js
+++ b/core/js/shareitemmodel.js
@@ -466,6 +466,34 @@
},
/**
+ * Sends an email notification for the given share
+ *
+ * @param {int} shareType share type
+ * @param {string} shareWith recipient
+ * @param {bool} state whether to set the notification flag or remove it
+ */
+ sendNotificationForShare: function(shareType, shareWith, state) {
+ var itemType = this.get('itemType');
+ var itemSource = this.get('itemSource');
+
+ $.post(
+ OC.generateUrl('core/ajax/share.php'),
+ {
+ action: state ? 'informRecipients' : 'informRecipientsDisabled',
+ recipient: shareWith,
+ shareType: shareType,
+ itemSource: itemSource,
+ itemType: itemType
+ },
+ function(result) {
+ if (result.status !== 'success') {
+ OC.dialogs.alert(t('core', result.data.message), t('core', 'Warning'));
+ }
+ }
+ );
+ },
+
+ /**
* @returns {boolean}
*/
sharePermissionPossible: function() {