From aa05823d92c951c5bc6a4f1bea7c3f0d594deea6 Mon Sep 17 00:00:00 2001 From: "J.M" Date: Tue, 31 Dec 2013 15:07:09 +0100 Subject: [PATCH 1/6] Visually highlight active initial in privs table Signed-off-by: J.M --- libraries/server_privileges.lib.php | 7 +++++-- themes/pmahomme/css/common.css.php | 4 ++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/libraries/server_privileges.lib.php b/libraries/server_privileges.lib.php index 4cbed590c8..e94910e26e 100644 --- a/libraries/server_privileges.lib.php +++ b/libraries/server_privileges.lib.php @@ -3174,8 +3174,11 @@ function PMA_getHtmlForDisplayTheInitials($array_initials) if (! empty($tmp_initial)) { if ($initial_was_found) { $html_output .= '' - . '' . $tmp_initial . '' diff --git a/themes/pmahomme/css/common.css.php b/themes/pmahomme/css/common.css.php index 131dddb7bc..a623662215 100644 --- a/themes/pmahomme/css/common.css.php +++ b/themes/pmahomme/css/common.css.php @@ -134,6 +134,10 @@ a:hover { getCssGradient('ffffff', 'cccccc'); ?> } +#initials_table a.active { + getCssGradient('cccccc', 'ffffff'); ?> +} + dfn { font-style: normal; } From ff7fdd0cfb06a480f954a5f69492e27a64e83128 Mon Sep 17 00:00:00 2001 From: "J.M" Date: Tue, 31 Dec 2013 15:08:11 +0100 Subject: [PATCH 2/6] Remove [] around Show all link in initials table Signed-off-by: J.M --- libraries/server_privileges.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/server_privileges.lib.php b/libraries/server_privileges.lib.php index e94910e26e..342b4aaefd 100644 --- a/libraries/server_privileges.lib.php +++ b/libraries/server_privileges.lib.php @@ -3191,7 +3191,7 @@ function PMA_getHtmlForDisplayTheInitials($array_initials) $html_output .= '' . '[' . __('Show all') . ']' . "\n"; + . '" class="nowrap">' . __('Show all') . '' . "\n"; $html_output .= ''; return $html_output; From 2ed160bbe1c0a0d35c8071c4b1e21a0dc87b8763 Mon Sep 17 00:00:00 2001 From: "J.M" Date: Tue, 31 Dec 2013 15:09:29 +0100 Subject: [PATCH 3/6] Remove typo < in table id=initials_table tag Signed-off-by: J.M --- libraries/server_privileges.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/server_privileges.lib.php b/libraries/server_privileges.lib.php index 342b4aaefd..34df063924 100644 --- a/libraries/server_privileges.lib.php +++ b/libraries/server_privileges.lib.php @@ -3168,7 +3168,7 @@ function PMA_getHtmlForDisplayTheInitials($array_initials) uksort($array_initials, "strnatcasecmp"); - $html_output = '' + $html_output = '
' . ''; foreach ($array_initials as $tmp_initial => $initial_was_found) { if (! empty($tmp_initial)) { From 3b8bfb97ac755b4c2a3d45d77c137e5309648ec4 Mon Sep 17 00:00:00 2001 From: "J.M" Date: Tue, 31 Dec 2013 15:11:34 +0100 Subject: [PATCH 4/6] Prevent initials_table from ajax-appearing twice Signed-off-by: J.M --- js/server_privileges.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/server_privileges.js b/js/server_privileges.js index 832ae4f27e..5d45a81990 100644 --- a/js/server_privileges.js +++ b/js/server_privileges.js @@ -661,8 +661,11 @@ AJAX.registerOnload('server_privileges.js', function () { $("#usersForm").hide("medium").remove(); $("#fieldset_add_user").hide("medium").remove(); $("#initials_table") + .prop("id", "initials_table_old") .after(data.message).show("medium") .siblings("h2").not(":first").remove(); + // prevent double initials table + $("#initials_table_old").remove(); } else { PMA_ajaxShowMessage(data.error, false); } From 55ad62a0ac8414412073a0f0efd725ddf4e5e44c Mon Sep 17 00:00:00 2001 From: "J.M" Date: Tue, 31 Dec 2013 15:13:34 +0100 Subject: [PATCH 5/6] Fix hidden initials_table when reloading filtered mode Signed-off-by: J.M --- libraries/server_privileges.lib.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/libraries/server_privileges.lib.php b/libraries/server_privileges.lib.php index 34df063924..94530e3f6b 100644 --- a/libraries/server_privileges.lib.php +++ b/libraries/server_privileges.lib.php @@ -3790,7 +3790,10 @@ function PMA_getHtmlForDisplayUserOverviewPage($pmaThemeImage, $text_dir) . __('Users overview') . "\n" . '' . "\n"; - $sql_query = 'SELECT *,' . + // $sql_query is for the initial-filtered, + // $sql_query_all is for counting the total no. of users + + $sql_query = $sql_query_all = 'SELECT *,' . " IF(`Password` = _latin1 '', 'N', 'Y') AS 'Password'" . ' FROM `mysql`.`user`'; @@ -3799,9 +3802,15 @@ function PMA_getHtmlForDisplayUserOverviewPage($pmaThemeImage, $text_dir) : ''); $sql_query .= ' ORDER BY `User` ASC, `Host` ASC;'; + $sql_query_all .= ' ;'; + $res = $GLOBALS['dbi']->tryQuery( $sql_query, null, PMA_DatabaseInterface::QUERY_STORE ); + $res_all = $GLOBALS['dbi']->tryQuery( + $sql_query_all, null, PMA_DatabaseInterface::QUERY_STORE + ); + if (! $res) { // the query failed! This may have two reasons: @@ -3836,9 +3845,9 @@ function PMA_getHtmlForDisplayUserOverviewPage($pmaThemeImage, $text_dir) /** * Displays the initials - * Also not necassary if there is less than 20 privileges + * Also not necessary if there is less than 20 privileges */ - if ($GLOBALS['dbi']->numRows($res) > 20 ) { + if ($GLOBALS['dbi']->numRows($res_all) > 20) { $html_output .= PMA_getHtmlForDisplayTheInitials($array_initials); } From eea7b800db619c793dc40c2130ea47d2280aa76d Mon Sep 17 00:00:00 2001 From: "J.M" Date: Tue, 31 Dec 2013 15:16:55 +0100 Subject: [PATCH 6/6] Add ChangeLog entry for rfe #1480 Signed-off-by: J.M --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 8ed9f88e1e..b064c5eab6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,7 @@ phpMyAdmin - ChangeLog and removed the extension directive + Added support for scatter charts + rfe #1478 Make Column Headings Sticky ++ rfe #1480 Enhance privileges initials table 4.1.4.0 (not yet released)