allow to document account deletion

This commit is contained in:
Ralf Becker 2018-08-23 12:11:33 +02:00
parent 28781956fe
commit 51166dc338
5 changed files with 33 additions and 13 deletions

View File

@ -260,7 +260,7 @@ class admin_account
} }
if ($content['delete']) if ($content['delete'])
{ {
$cmd = new admin_cmd_delete_account($content['account_id'], $content['new_owner'], true); $cmd = new admin_cmd_delete_account($content['account_id'], $content['new_owner'], true, $content['admin_cmd']);
$msg = $cmd->run(); $msg = $cmd->run();
if ($content['contact_id']) if ($content['contact_id'])
{ {

View File

@ -23,8 +23,9 @@ class admin_cmd_delete_account extends admin_cmd
* @param string|int|array $account account name or id, or array with all parameters * @param string|int|array $account account name or id, or array with all parameters
* @param string $new_user =null if specified, account to transfer the data to (users only) * @param string $new_user =null if specified, account to transfer the data to (users only)
* @param string $is_user =true type of the account: true=user, false=group * @param string $is_user =true type of the account: true=user, false=group
* @param array $extra =array() values for requested(_email), comment, ...
*/ */
function __construct($account,$new_user=null,$is_user=true) function __construct($account, $new_user=null, $is_user=true, array $extra=array())
{ {
if (!is_array($account)) if (!is_array($account))
{ {
@ -32,7 +33,7 @@ class admin_cmd_delete_account extends admin_cmd
'account' => $account, 'account' => $account,
'new_user' => $new_user, 'new_user' => $new_user,
'is_user' => $is_user, 'is_user' => $is_user,
); )+$extra;
} }
admin_cmd::__construct($account); admin_cmd::__construct($account);
} }
@ -74,6 +75,9 @@ class admin_cmd_delete_account extends admin_cmd
{ {
Api\Hooks::single($GLOBALS['hook_values'],$app); Api\Hooks::single($GLOBALS['hook_values'],$app);
} }
// store old content at time of deletion
$this->old = $GLOBALS['egw']->accounts->read($account_id);
$GLOBALS['egw']->accounts->delete($account_id); $GLOBALS['egw']->accounts->delete($account_id);
if ($account_id < 0) if ($account_id < 0)

View File

@ -2,17 +2,27 @@
<!DOCTYPE overlay PUBLIC "-//EGroupware GmbH//eTemplate 2//EN" "http://www.egroupware.org/etemplate2.dtd"> <!DOCTYPE overlay PUBLIC "-//EGroupware GmbH//eTemplate 2//EN" "http://www.egroupware.org/etemplate2.dtd">
<!-- $Id$ --> <!-- $Id$ -->
<overlay> <overlay>
<template id="admin.account.delete" template="" lang="" group="0" version="1.9.003"> <template id="admin.account.delete" template="" lang="" group="0" version="18.1.001">
<vbox class="admin_account_delete">
<box class="dialogHeader"> <box class="dialogHeader">
<select-account id="account_id" readonly="true" label="Delete account %s"/> <select-account id="account_id" readonly="true" label="Delete account %s"/>
</box> </box>
<description value="Who would you like to transfer ALL records owned by the deleted user to?" class="dialogHeader2"/> <tabbox id="tabs" width="99%">
<select-account id="new_owner" empty_label="Delete all records" class="dialogHeader3"/> <tabs>
<tab id="main" label="Delete"/>
</tabs>
<tabpanels>
<template template="admin.account.delete.delete" width="99%"/>
</tabpanels>
</tabbox>
<hbox class="dialogFooterToolbar"> <hbox class="dialogFooterToolbar">
<button id="delete" label="Delete"/> <button id="delete" label="Delete"/>
<button id="cancel" label="Cancel" onclick="window.close()"/> <button id="cancel" label="Cancel" onclick="window.close()"/>
</hbox> </hbox>
</template>
<template id="admin.account.delete.delete" template="" lang="" group="0" version="18.1.001">
<vbox class="admin_account_delete">
<description value="Who would you like to transfer ALL records owned by the deleted user to?" class="dialogHeader2"/>
<select-account id="new_owner" empty_label="Delete all records" class="dialogHeader3"/>
</vbox> </vbox>
</template> </template>
</overlay> </overlay>

View File

@ -61,6 +61,9 @@ td.admin_userAgent span {
.admin_account_delete > * { .admin_account_delete > * {
padding: 8px; padding: 8px;
} }
form#admin-account-delete div.dialogHeader > label {
font-size: 120%;
}
/* Global Category classes*/ /* Global Category classes*/
.globalCat_confirmDelete { .globalCat_confirmDelete {
position: absolute; position: absolute;

View File

@ -69,6 +69,9 @@ td.admin_userAgent span {
.admin_account_delete > * { .admin_account_delete > * {
padding: 8px; padding: 8px;
} }
form#admin-account-delete div.dialogHeader > label {
font-size: 120%;
}
/* Global Category classes*/ /* Global Category classes*/
.globalCat_confirmDelete { .globalCat_confirmDelete {
position: absolute; position: absolute;
@ -189,8 +192,8 @@ select#admin-mailaccount_ident_id {
} }
@media all { @media all {
div.dhtmlxTree td.standartTreeRow span.selectedTreeRow { div.dhtmlxTree td.standartTreeRow span.selectedTreeRow {
background-color: #ffdd73; background-color: #FFDD73;
color: #1e1e1e; color: #1E1E1E;
} }
/* ############################################################################# /* #############################################################################
// iframe // iframe