mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-03 12:39:25 +01:00
* Admin: Add bulk changes as a context menu action for user list
This commit is contained in:
parent
c51f77a9dd
commit
fdb9040f3f
@ -66,6 +66,28 @@ class admin_passwordreset
|
|||||||
*/
|
*/
|
||||||
function index(array $content=null, $msg='')
|
function index(array $content=null, $msg='')
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// Setup if opened as a dialog
|
||||||
|
$content['dialog'] = $_GET['dialog'];
|
||||||
|
if($content['dialog'] && !$content['users'] && isset($_GET['ids']))
|
||||||
|
{
|
||||||
|
$content['users'] = $_GET['ids'];
|
||||||
|
|
||||||
|
$query = Api\Cache::getSession('admin', 'account_list');
|
||||||
|
if($_GET['select_all'] == 'true')
|
||||||
|
{
|
||||||
|
@set_time_limit(0); // switch off the execution time limit, as it's for big selections to small
|
||||||
|
$query['num_rows'] = -1; // all
|
||||||
|
$readonlys = null;
|
||||||
|
$content['users'] = [];
|
||||||
|
$rows = [];
|
||||||
|
admin_ui::get_users($query, $rows);
|
||||||
|
foreach($rows as $row)
|
||||||
|
{
|
||||||
|
$content['users'][] = $row['account_id'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!($account_repository = $GLOBALS['egw_info']['server']['account_repository']) &&
|
if (!($account_repository = $GLOBALS['egw_info']['server']['account_repository']) &&
|
||||||
!($account_repository = $GLOBALS['egw_info']['server']['auth_type']))
|
!($account_repository = $GLOBALS['egw_info']['server']['auth_type']))
|
||||||
{
|
{
|
||||||
|
@ -183,6 +183,17 @@ class admin_ui
|
|||||||
$actions['add']['url'] .= ($actions['edit']['url'] ? '&' : '').$name.'='.$val;
|
$actions['add']['url'] .= ($actions['edit']['url'] ? '&' : '').$name.'='.$val;
|
||||||
}
|
}
|
||||||
++$group;
|
++$group;
|
||||||
|
$config = Api\Config::read('admin');
|
||||||
|
$reset = new admin_passwordreset();
|
||||||
|
$actions['change'] = array(
|
||||||
|
'caption' => 'Bulk changes',
|
||||||
|
'allowOnMultiple' => true,
|
||||||
|
'group' => $group,
|
||||||
|
'nm_action' => 'popup',
|
||||||
|
'url' => 'menuaction=admin.admin_passwordreset.index&dialog=true&ids=$id&select_all=$select_all',
|
||||||
|
'width' => 750,
|
||||||
|
'height' => 600
|
||||||
|
);
|
||||||
// supporting both old way using $GLOBALS['menuData'] and new just returning data in hook
|
// supporting both old way using $GLOBALS['menuData'] and new just returning data in hook
|
||||||
$apps = array_unique(array_merge(array('admin'), Api\Hooks::implemented('edit_user')));
|
$apps = array_unique(array_merge(array('admin'), Api\Hooks::implemented('edit_user')));
|
||||||
foreach($apps as $app)
|
foreach($apps as $app)
|
||||||
@ -385,6 +396,7 @@ class admin_ui
|
|||||||
{
|
{
|
||||||
$params['account_id'] = (array)$query['account_id'];
|
$params['account_id'] = (array)$query['account_id'];
|
||||||
}
|
}
|
||||||
|
Api\Cache::setSession('admin', 'account_list', $query);
|
||||||
|
|
||||||
$rows = array_values(self::$accounts->search($params));
|
$rows = array_values(self::$accounts->search($params));
|
||||||
//error_log(__METHOD__."() accounts->search(".array2string($params).") total=".self::$accounts->total);
|
//error_log(__METHOD__."() accounts->search(".array2string($params).") total=".self::$accounts->total);
|
||||||
|
@ -1785,8 +1785,6 @@ class AdminApp extends EgwApp
|
|||||||
data, this.egw
|
data, this.egw
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
app.classes.admin = AdminApp;
|
app.classes.admin = AdminApp;
|
@ -180,6 +180,7 @@ bi-dir passthrough admin en bi-dir passthrough
|
|||||||
bi-directional admin en bi-directional
|
bi-directional admin en bi-directional
|
||||||
blocking after wrong password admin en Blocking after wrong password
|
blocking after wrong password admin en Blocking after wrong password
|
||||||
bottom admin en Bottom
|
bottom admin en Bottom
|
||||||
|
bulk changes admin en Bulk changes
|
||||||
bulk password reset admin en Bulk password reset
|
bulk password reset admin en Bulk password reset
|
||||||
by admin en By
|
by admin en By
|
||||||
by selecting a user or group you effectively delete the mail account for all other users!\n\nare you really sure you want to do that? admin en By selecting a user or group you effectively delete the mail account for all other users!<br>Are you really sure you want to do that?
|
by selecting a user or group you effectively delete the mail account for all other users!\n\nare you really sure you want to do that? admin en By selecting a user or group you effectively delete the mail account for all other users!<br>Are you really sure you want to do that?
|
||||||
|
@ -9,12 +9,12 @@
|
|||||||
<column/>
|
<column/>
|
||||||
</columns>
|
</columns>
|
||||||
<rows>
|
<rows>
|
||||||
<row>
|
<row disabled="@dialog">
|
||||||
<et2-description value="Select users"></et2-description>
|
<et2-description value="Select users"></et2-description>
|
||||||
<et2-description></et2-description>
|
<et2-description></et2-description>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<et2-select-account id="users" rows="15" multiple="1">
|
<et2-select-account id="users" rows="15" multiple="1" hidden="@dialog">
|
||||||
<!--<option value="~all~">All users</option>-->
|
<!--<option value="~all~">All users</option>-->
|
||||||
</et2-select-account>
|
</et2-select-account>
|
||||||
</row>
|
</row>
|
||||||
@ -59,7 +59,7 @@
|
|||||||
</grid>
|
</grid>
|
||||||
</et2-vbox>
|
</et2-vbox>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<et2-button label="Start" id="start" noSubmit="true" onclick="app.admin.bulkPasswordReset"></et2-button>
|
<et2-button label="Start" id="start" noSubmit="true" onclick="app.admin.bulkPasswordReset"></et2-button>
|
||||||
<!--<et2-button label="Download CSV" id="download_csv" onclick="widget.getInstanceManager().postSubmit()" noSubmit="true"></et2-button>-->
|
<!--<et2-button label="Download CSV" id="download_csv" onclick="widget.getInstanceManager().postSubmit()" noSubmit="true"></et2-button>-->
|
||||||
</row>
|
</row>
|
||||||
|
Loading…
Reference in New Issue
Block a user