mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-25 09:23:28 +01:00
* Addressbook - Disable merge contacts action if more than one account is selected
This commit is contained in:
parent
baa2807606
commit
835ad5b322
@ -585,7 +585,8 @@ class addressbook_ui extends addressbook_bo
|
|||||||
'hint' => 'Merge into first or account, deletes all other!',
|
'hint' => 'Merge into first or account, deletes all other!',
|
||||||
'allowOnMultiple' => 'only',
|
'allowOnMultiple' => 'only',
|
||||||
'group' => $group,
|
'group' => $group,
|
||||||
'hideOnMobile' => true
|
'hideOnMobile' => true,
|
||||||
|
'enabled' => 'javaScript:app.addressbook.can_merge'
|
||||||
);
|
);
|
||||||
// Duplicates view
|
// Duplicates view
|
||||||
$actions['merge_duplicates'] = array(
|
$actions['merge_duplicates'] = array(
|
||||||
|
@ -1247,5 +1247,20 @@ app.classes.addressbook = AppJS.extend(
|
|||||||
var geo_url = egw.config('geolocation_url');
|
var geo_url = egw.config('geolocation_url');
|
||||||
if (geo_url) geo_url = geo_url[0];
|
if (geo_url) geo_url = geo_url[0];
|
||||||
return geo_url || default_url;
|
return geo_url || default_url;
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check to see if the selection contains at most one account
|
||||||
|
*
|
||||||
|
* @param {egwAction} action
|
||||||
|
* @param {egwActionObject[]} selected Selected rows
|
||||||
|
*/
|
||||||
|
can_merge: function(action, selected)
|
||||||
|
{
|
||||||
|
return selected.filter(function (row) {
|
||||||
|
var data = egw.dataGetUIDdata(row.id);
|
||||||
|
return data && data.data.account_id;
|
||||||
|
}).length <= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user