mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-04-29 04:39:56 +03:00
fixes #171 ability to filter user list on a specific user
This commit is contained in:
parent
33f7849bf0
commit
3ee277f8e0
4 changed files with 9 additions and 5 deletions
|
@ -2061,8 +2061,10 @@ function update_user_list() {
|
|||
per_page: per_page,
|
||||
exclude: [guest_id]
|
||||
}
|
||||
if ($("#user_search").val().length != 0) {
|
||||
update_data["filter"] = $("#user_search").val();
|
||||
const userSearchVal = $("#user_search").val();
|
||||
if (userSearchVal) {
|
||||
const matches = userSearchVal.match(/^id:(\d+)$/);
|
||||
update_data[matches ? "user_id" : "filter"] = matches ? matches[1] : userSearchVal;
|
||||
}
|
||||
if ($(".advanced-filter").hasClass('advanced-filter-open')) {
|
||||
update_data["status"] = $(".advanced-filter-select[name=filter_status]").val();
|
||||
|
|
|
@ -279,8 +279,8 @@ $(document).ready(function() {
|
|||
{*This input (#user_search2) is used to bait the chrome autocomplete tool. It is hidden in navigator and is not meant to be seen.*}
|
||||
<input id="user_search2" class='search-input2' type='text' placeholder='{'Search'|@translate}'>
|
||||
<span class='icon-search search-icon'> </span>
|
||||
<span class="icon-cancel search-cancel"></span>
|
||||
<input id="user_search" class='search-input' type='text' placeholder='{'Search'|@translate}'>
|
||||
<span class="icon-cancel search-cancel"{if isset($search_input)} style="display:inline"{/if}></span>
|
||||
<input id="user_search" class='search-input' type='text' placeholder='{'Search'|@translate}'{if isset($search_input)} value="{$search_input}"{/if}>
|
||||
</div>
|
||||
<div class="advanced-filter">
|
||||
<div class="advanced-filter-header">
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
*/
|
||||
|
||||
check_input_parameter('group', $_GET, false, PATTERN_ID);
|
||||
check_input_parameter('user_id', $_GET, false, PATTERN_ID);
|
||||
|
||||
// +-----------------------------------------------------------------------+
|
||||
// | tabs |
|
||||
|
@ -133,6 +134,7 @@ $template->assign(
|
|||
'password_protected_users' => implode(',', array_unique($password_protected_users)),
|
||||
'guest_user' => $conf['guest_id'],
|
||||
'filter_group' => (isset($_GET['group']) ? $_GET['group'] : null),
|
||||
'search_input' => (isset($_GET['user_id']) ? 'id:'.$_GET['user_id'] : null),
|
||||
'connected_user' => $user["id"],
|
||||
'connected_user_status' => $user['status'],
|
||||
'owner' => $conf['webmaster_id'],
|
||||
|
|
|
@ -215,7 +215,7 @@ SELECT id
|
|||
if ($notify_admin and 'none' != $conf['email_admin_on_new_user'])
|
||||
{
|
||||
include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');
|
||||
$admin_url = get_absolute_root_url().'admin.php?page=user_list&username='.$login;
|
||||
$admin_url = get_absolute_root_url().'admin.php?page=user_list&user_id='.$user_id;
|
||||
|
||||
$keyargs_content = array(
|
||||
get_l10n_args('User: %s', stripslashes($login) ),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue