mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-03-01 00:31:42 +01:00
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']);
|
$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) ||
|
if ($GLOBALS['egw']->acl->check('account_access',32,'admin') || !($content['account_id'] > 0) ||
|
||||||
$GLOBALS['egw_info']['user']['account_id'] == $content['account_id'])
|
$GLOBALS['egw_info']['user']['account_id'] == $content['account_id'])
|
||||||
@ -205,4 +205,17 @@ class admin_account
|
|||||||
$tpl = new etemplate_new('admin.account.delete');
|
$tpl = new etemplate_new('admin.account.delete');
|
||||||
$tpl->exec('admin_account::delete', $content, array(), array(), $content, 2);
|
$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;
|
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
|
// Try for intelligent et2 refresh inside iframe
|
||||||
var node = _app && _id && this.iframe ? this.iframe.getDOMNode(this.iframe) : null;
|
var node = _app && _id && this.iframe ? this.iframe.getDOMNode(this.iframe) : null;
|
||||||
if(node && node.contentWindow && node.contentWindow.etemplate2)
|
if(node && node.contentWindow && node.contentWindow.etemplate2)
|
||||||
@ -245,14 +263,18 @@ app.classes.admin = AppJS.extend(
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'edit':
|
case 'edit':
|
||||||
case 'delete':
|
|
||||||
this.splitter.dock();
|
this.splitter.dock();
|
||||||
this.iframe.set_src(egw.link('/index.php', {
|
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]
|
account_id: _senders[0].id.split('/')[2]
|
||||||
}));
|
}));
|
||||||
break;
|
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':
|
case 'acl':
|
||||||
this.splitter.dock();
|
this.splitter.dock();
|
||||||
this.iframe.set_src(egw.link('/index.php', {
|
this.iframe.set_src(egw.link('/index.php', {
|
||||||
|
Loading…
Reference in New Issue
Block a user