From f5c2ba52c8a9b13674697b366128f2ab9d070b4f Mon Sep 17 00:00:00 2001 From: nathangray Date: Thu, 22 Aug 2019 15:56:46 -0600 Subject: [PATCH] Addressbook - sharing actions only available to contacts, not groups --- addressbook/js/app.js | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/addressbook/js/app.js b/addressbook/js/app.js index 0d8ad8113b..0d70895dc2 100644 --- a/addressbook/js/app.js +++ b/addressbook/js/app.js @@ -1284,6 +1284,29 @@ app.classes.addressbook = AppJS.extend( var data = egw.dataGetUIDdata(row.id); return data && data.data.account_id; }).length <= 1; - } + }, + /** + * Check if the share action is enabled for this entry + * This only works for single contacts + * + * @param {egwAction} _action + * @param {egwActionObject[]} _entries + * @param {egwActionObject} _target + * @returns {boolean} if action is enabled + */ + is_share_enabled: function is_share_enabled(_action, _entries, _target) + { + var enabled = true; + var id = ''; + for( var i = 0; i < _entries.length; i++) + { + id = _entries[i].id.split('::'); + if(isNaN(id[1])) + { + return false; + } + } + return enabled; + } });