Skip to content

Commit

Permalink
Enhance user search UI on page manage_user_page.php
Browse files Browse the repository at this point in the history
- Replace label by placeholder
- White space fixes
- Remove unrelated changes from PR

Fixes #12677
  • Loading branch information
atrol committed Aug 30, 2018
1 parent 98c4550 commit 5b2e3b6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 17 deletions.
6 changes: 0 additions & 6 deletions config_defaults_inc.php
Expand Up @@ -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;
1 change: 1 addition & 0 deletions lang/strings_english.txt
Expand Up @@ -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")';
Expand Down
20 changes: 9 additions & 11 deletions manage_user_page.php
Expand Up @@ -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, '' ) ) ) {
Expand Down Expand Up @@ -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' );
Expand Down Expand Up @@ -407,8 +406,7 @@
<div id="manage-user-edit-div" class="form-inline pull-left">
<form method="get" action="manage_user_page.php">
<?php # CSRF protection not required here - form does not result in modifications ?>
<label class="inline" for="findname"><?php echo lang_get( 'realname' ) ?></label>
<input id="findname" type="text" name="findname" class="input-sm" value="" />
<input id="findname" type="text" size="30" name="findname" class="input-sm" value="" placeholder="<?php echo lang_get( 'search_user_hint' ) ?>"/>
<input type="submit" class="btn btn-primary btn-sm btn-white btn-round" value="<?php echo lang_get( 'search' ) ?>" />
</form> </div>
<div class="btn-toolbar pull-right">
Expand Down

0 comments on commit 5b2e3b6

Please sign in to comment.