forked from extern/egroupware
deleting of groups
This commit is contained in:
parent
88943fb682
commit
1b13b10bf6
@ -181,7 +181,7 @@ class admin_account
|
||||
{
|
||||
$content = array('account_id' => (int)$_GET['account_id']);
|
||||
}
|
||||
error_log(__METHOD__."() \$_GET[account_id]=$_GET[account_id], \$_GET[contact_id]=$_GET[contact_id] content=".array2string($content));
|
||||
//error_log(__METHOD__."() \$_GET[account_id]=$_GET[account_id], \$_GET[contact_id]=$_GET[contact_id] content=".array2string($content));
|
||||
}
|
||||
if ($GLOBALS['egw']->acl->check('account_access',32,'admin') || !($content['account_id'] > 0) ||
|
||||
$GLOBALS['egw_info']['user']['account_id'] == $content['account_id'])
|
||||
@ -205,4 +205,17 @@ class admin_account
|
||||
$tpl = new etemplate_new('admin.account.delete');
|
||||
$tpl->exec('admin_account::delete', $content, array(), array(), $content, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a group via ajax
|
||||
*
|
||||
* @param int $account_id
|
||||
*/
|
||||
public static function ajax_delete_group($account_id)
|
||||
{
|
||||
$cmd = new admin_cmd_delete_account(accounts::id2name(accounts::id2name($account_id)), null, false);
|
||||
$msg = $cmd->run();
|
||||
|
||||
egw_json_response::get()->call('egw.refresh', $msg, 'admin', $account_id, 'delete');
|
||||
}
|
||||
}
|
||||
|
@ -105,6 +105,24 @@ app.classes.admin = AppJS.extend(
|
||||
{
|
||||
var refresh_done = false;
|
||||
|
||||
// group deleted, added or updated
|
||||
if (_app === 'admin' && _id < 0)
|
||||
{
|
||||
var tree = this.et2.getWidgetById('tree');
|
||||
switch(_type)
|
||||
{
|
||||
case 'delete':
|
||||
tree.deleteItem('/groups/'+_id, false);
|
||||
break;
|
||||
|
||||
case 'edit':
|
||||
case 'update':
|
||||
case 'add':
|
||||
tree.refreshItem('/groups');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Try for intelligent et2 refresh inside iframe
|
||||
var node = _app && _id && this.iframe ? this.iframe.getDOMNode(this.iframe) : null;
|
||||
if(node && node.contentWindow && node.contentWindow.etemplate2)
|
||||
@ -245,14 +263,18 @@ app.classes.admin = AppJS.extend(
|
||||
break;
|
||||
|
||||
case 'edit':
|
||||
case 'delete':
|
||||
this.splitter.dock();
|
||||
this.iframe.set_src(egw.link('/index.php', {
|
||||
menuaction: _action.id == 'edit' ? 'admin.uiaccounts.edit_group' : 'admin.uiaccounts.delete_group',
|
||||
menuaction: 'admin.uiaccounts.edit_group',
|
||||
account_id: _senders[0].id.split('/')[2]
|
||||
}));
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
var account_id = _senders[0].id.split('/')[2];
|
||||
this.egw.json('admin_account::ajax_delete_group', [account_id]).sendRequest();
|
||||
break;
|
||||
|
||||
case 'acl':
|
||||
this.splitter.dock();
|
||||
this.iframe.set_src(egw.link('/index.php', {
|
||||
|
Loading…
Reference in New Issue
Block a user