Get a nice history for admin_cmd_edit_user

This commit is contained in:
nathangray 2019-03-18 16:32:54 -06:00
parent fa48e1db3c
commit ee70e699e2
3 changed files with 33 additions and 2 deletions

View File

@ -1306,6 +1306,16 @@ abstract class admin_cmd
return [];
}
/**
* Return widget types (indexed by field key) for changes
* Used by historylog widget to show the changes the command recorded.
*/
function get_change_widgets()
{
// TODO: Some kind of regex?
return [];
}
/**
* Read change labels from descriptions in template:
* - <description value="Expires" for="account_expires"/>

View File

@ -233,7 +233,28 @@ class admin_cmd_edit_user extends admin_cmd_change_pw
*/
function get_change_labels()
{
return $this->change_labels_from_template('admin.account');
$labels = $this->change_labels_from_template('admin.account');
$labels += array(
'account_firstname' => 'First name',
'account_lastname' => 'Last name',
'account_email' => 'Email',
'account_passwd_2' => false
);
return $labels;
}
/**
* Return list of widgets to use for displaying changes
*/
function get_change_widgets() {
$widgets = parent::get_change_widgets();
$widgets += array(
'account_primary_group' => 'select-account',
'account_groups' => 'select-account',
'account_expires' => 'date-time'
);
return $widgets;
}
/**

View File

@ -60,7 +60,7 @@
<description/>
</row>
<row>
<description value="Groups" for="groups"/>
<description value="Groups" for="account_groups"/>
<select-account account_type="groups" id="account_groups" multiple="true" class="et2_fullWidth" span="4" tags="true"/>
<description/>
</row>