From 5b2e3b652699c0cddf17f3f61bec047e38858692 Mon Sep 17 00:00:00 2001 From: Roland Becker Date: Mon, 13 Aug 2018 22:17:55 +0200 Subject: [PATCH] Enhance user search UI on page manage_user_page.php - Replace label by placeholder - White space fixes - Remove unrelated changes from PR Fixes #12677 --- config_defaults_inc.php | 6 ------ lang/strings_english.txt | 1 + manage_user_page.php | 20 +++++++++----------- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/config_defaults_inc.php b/config_defaults_inc.php index 7a3cbd16cb..3211be2c9b 100644 --- a/config_defaults_inc.php +++ b/config_defaults_inc.php @@ -4876,9 +4876,3 @@ * the attachment is linked to the note. Or 0 for disabling this feature. */ $g_issue_activity_note_attachments_seconds_threshold = 3; - -/** - * If a user submits a note with an attachments (with the specified # of seconds) - * the attachment is linked to the note. Or 0 for disabling this feature. - */ -$g_issue_activity_note_attachments_seconds_threshold = 3; diff --git a/lang/strings_english.txt b/lang/strings_english.txt index dfc3642a44..a634c4b89b 100644 --- a/lang/strings_english.txt +++ b/lang/strings_english.txt @@ -753,6 +753,7 @@ $s_date_created = 'Date Created'; $s_last_visit = 'Last Visit'; $s_last_visit_label = 'Last Visit:'; $s_edit_user_link = 'Edit User'; +$s_search_user_hint = 'Username, Real Name or E-mail'; # manage_custom_field_edit_page.php $s_separate_list_items_by = '(separate list items by "%1$s")'; diff --git a/manage_user_page.php b/manage_user_page.php index 5b6e41f1a2..07ef795b7c 100644 --- a/manage_user_page.php +++ b/manage_user_page.php @@ -64,14 +64,13 @@ $f_filter = mb_strtoupper( gpc_get_string( 'filter', config_get( 'default_manage_user_prefix' ) ) ); $f_page_number = gpc_get_int( 'page_number', 1 ); -if( substr( $f_filter,0,6 ) === "SEARCH" ) { - $f_findname = trim( substr( $f_filter,6 ) ); +if( mb_substr( $f_filter, 0, 6 ) === "SEARCH" ) { + $f_findname = mb_substr( $f_filter, 6 ); } else { $f_findname = gpc_get_string( 'findname', '' ); if( $f_findname <> "" ) { - $f_filter = 'SEARCH'; - $f_filter .= trim( $f_findname ); - } + $f_filter = 'SEARCH' . $f_findname; + } } if( !$f_save && !is_blank( gpc_get_cookie( $t_cookie_name, '' ) ) ) { @@ -195,11 +194,11 @@ $t_where_params = array(); if( $f_filter === 'ALL' ) { $t_where = '(1 = 1)'; -} else if( substr( $f_filter,0,6 ) === 'SEARCH' ) { - $t_pos = strpos($f_findname, '-'); +} else if( mb_substr( $f_filter, 0, 6 ) === 'SEARCH' ) { + $t_pos = mb_strpos( $f_findname, '-' ); if( $t_pos ) { - $t_exclude = trim( substr( $f_findname,$t_pos+1 ) ); - $f_findname = trim( substr( $f_findname, 0,$t_pos-1 ) ); + $t_exclude = trim( mb_substr( $f_findname, $t_pos+1 ) ); + $f_findname = trim( mb_substr( $f_findname, 0, $t_pos-1 ) ); $t_where_params[] = '%' . $f_findname . '%'; $t_where = " ( "; $t_where .= db_helper_like( 'realname' ); @@ -407,8 +406,7 @@
- - +