Sort websites, mailboxes and databases on dashboard (patch)
Hello all,
with a long list of websites, mailboxes and databases on the dashboard it really gets confusing for admins but also power users as the data is not listed and mainly appears in the order as it is seen in the ISPConfig database tables.
We looked into it in version 3.1.5 applied a simple patch/change. Out of this we created a patch file and would like to request to add this to ISPConfig future releases.
--- quota_lib.inc.php.org 2017-06-30 15:27:25.000000000 +0200
+++ quota_lib.inc.php.new 2017-07-07 01:09:17.000000000 +0200
@@ -14,7 +14,7 @@ class quota_lib {
//print_r($monitor_data);
// select all websites or websites belonging to client
- $sites = $app->db->queryAllRecords("SELECT * FROM web_domain WHERE active = 'y' AND type = 'vhost'".(($clientid != null)?" AND sys_groupid = (SELECT default_group FROM sys_user WHERE client_id=?)":''), $clientid);
+ $sites = $app->db->queryAllRecords("SELECT * FROM web_domain WHERE active = 'y' AND type = 'vhost'".(($clientid != null)?" AND sys_groupid = (SELECT default_group FROM sys_user WHERE client_id=?)":'')." ORDER BY domain", $clientid);
//print_r($sites);
if(is_array($sites) && !empty($sites)){
@@ -237,7 +237,7 @@ class quota_lib {
//print_r($monitor_data);
// select all email accounts or email accounts belonging to client
- $emails = $app->db->queryAllRecords("SELECT * FROM mail_user".(($clientid != null)? " WHERE sys_groupid = (SELECT default_group FROM sys_user WHERE client_id=?)" : ''), $clientid);
+ $emails = $app->db->queryAllRecords("SELECT * FROM mail_user".(($clientid != null)? " WHERE sys_groupid = (SELECT default_group FROM sys_user WHERE client_id=?)" : '')." ORDER BY email", $clientid);
//print_r($emails);
if(is_array($emails) && !empty($emails)){
@@ -301,7 +301,7 @@ class quota_lib {
//print_r($monitor_data);
// select all databases belonging to client
- $databases = $app->db->queryAllRecords("SELECT * FROM web_database".(($clientid != null)? " WHERE sys_groupid = (SELECT default_group FROM sys_user WHERE client_id=?)" : ''), $clientid);
+ $databases = $app->db->queryAllRecords("SELECT * FROM web_database".(($clientid != null)? " WHERE sys_groupid = (SELECT default_group FROM sys_user WHERE client_id=?)" : '')." ORDER BY database_name", $clientid);
//print_r($databases);
if(is_array($databases) && !empty($databases)){
Cheers, Martin