From 0919c6d11572cd9a881e86144c0ebc38de298a47 Mon Sep 17 00:00:00 2001 From: Alan Garcia Date: Tue, 23 Apr 2013 22:41:07 +0000 Subject: [PATCH] =?UTF-8?q?Corrige=20des=20bugs=20sur=20le=20r=C3=A9cap=20?= =?UTF-8?q?des=20quotas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commence a dégager hippo_bleue.gif --- .gitattributes | 2 +- bureau/admin/{ => images}/hippo_bleue.gif | Bin bureau/admin/quotas_oneuser.php | 22 +++++++++++----------- bureau/admin/quotas_users.php | 10 +++++----- bureau/class/m_quota.php | 11 +++++++++++ 5 files changed, 28 insertions(+), 17 deletions(-) rename bureau/admin/{ => images}/hippo_bleue.gif (100%) diff --git a/.gitattributes b/.gitattributes index 9b32f967..55cc62e6 100644 --- a/.gitattributes +++ b/.gitattributes @@ -150,7 +150,6 @@ bureau/admin/ftp_edit.php -text bureau/admin/ftp_list.php -text bureau/admin/ftp_switch_enable.php -text bureau/admin/head.php -text -bureau/admin/hippo_bleue.gif -text bureau/admin/hta_add.php -text bureau/admin/hta_adduser.php -text bureau/admin/hta_del.php -text @@ -209,6 +208,7 @@ bureau/admin/images/folder.png -text bureau/admin/images/folderhta.png -text bureau/admin/images/ftp.png -text bureau/admin/images/help.png -text +bureau/admin/images/hippo_bleue.gif -text bureau/admin/images/home.png -text bureau/admin/images/ip.png -text bureau/admin/images/lang.png -text diff --git a/bureau/admin/hippo_bleue.gif b/bureau/admin/images/hippo_bleue.gif similarity index 100% rename from bureau/admin/hippo_bleue.gif rename to bureau/admin/images/hippo_bleue.gif diff --git a/bureau/admin/quotas_oneuser.php b/bureau/admin/quotas_oneuser.php index 578dc90d..47105898 100644 --- a/bureau/admin/quotas_oneuser.php +++ b/bureau/admin/quotas_oneuser.php @@ -29,7 +29,7 @@ if (!isset($mode)) { # when included from adm_login, mode is not set - +
@@ -60,7 +60,7 @@ if (!isset($mode)) { # when included from adm_login, mode is not set echo ""; $ms = $quota->get_size_unit($e['size']); if ($totalmail) { - $pc=intval(100*($ms['size']/$totalmail)); + $pc=intval(100*($e['size']/$totalmail)); } else { $pc=0; } @@ -69,7 +69,7 @@ if (!isset($mode)) { # when included from adm_login, mode is not set } elseif ($mode==1) { echo sprintf("%.1f", $pc)." %"; } else { - echo "\"".$pc."%\""; + $quota->quota_displaybar($pc); } echo ""; } @@ -92,7 +92,7 @@ if (!isset($mode)) { # when included from adm_login, mode is not set } elseif ($mode==1) { echo sprintf("%.1f", $tpc)." %"; } else { - echo "\"".$tpc."%\""; + $quota->quota_displaybar($tpc); } echo ""; } @@ -112,11 +112,11 @@ if (!isset($mode)) { # when included from adm_login, mode is not set echo "

"; ?> -
+
- - + + @@ -129,7 +129,7 @@ if (!isset($mode)) { # when included from adm_login, mode is not set echo ">"; $ds = $quota->get_size_unit($d["size"]); if ($totaldb) { - $pc=intval(100*$ds['size']/$totaldb); + $pc=intval(100*$d['size']/$totaldb); } else { $pc=0; } @@ -138,7 +138,7 @@ if (!isset($mode)) { # when included from adm_login, mode is not set } elseif (isset($mode) &&$mode==1) { echo sprintf("%.1f", $pc)." %"; } else { - echo "\"".$pc."%\""; + $quota->quota_displaybar(2*$pc); } echo ""; } @@ -158,7 +158,7 @@ if (!isset($mode)) { # when included from adm_login, mode is not set echo "

"; ?> -
+
@@ -184,7 +184,7 @@ if (!isset($mode)) { # when included from adm_login, mode is not set } elseif ($mode==1) { echo sprintf("%.1f", $pc)." %"; } else { - echo "\"".$pc."%\""; + $quota->quota_displaybar($pc); } echo ""; } diff --git a/bureau/admin/quotas_users.php b/bureau/admin/quotas_users.php index b2881dcb..9f94f44b 100644 --- a/bureau/admin/quotas_users.php +++ b/bureau/admin/quotas_users.php @@ -296,7 +296,7 @@ if ($mode==0) { } elseif ($mode==1) { echo sprintf("%.1f",$pc)." %"; } else { - echo "\"".$pc."%\""; + echo "\"".$pc."%\""; } echo ""; + echo "\"".$pc."%\""; } echo ""; + echo "\"".$pc."%\""; } echo ""; + echo "\"".$pc."%\""; } echo ""; + echo "\"".$pc."%\""; } diff --git a/bureau/class/m_quota.php b/bureau/class/m_quota.php index 877b76de..173a75d9 100644 --- a/bureau/class/m_quota.php +++ b/bureau/class/m_quota.php @@ -520,6 +520,17 @@ class m_quota { } } + // Cette fonction doit disparaitre quand on refera les pages d'affichage du quota + // trop sale + function quota_displaybar($usage) { + $usage_color = '#A0CFEC'; + $usage_color = ((85 < $usage && $usage <= 100) ? '#82CAFF' : $usage_color); // yellow + echo '
'; + echo '
'.$usage.'%
'; + echo '
'; + } + + /* ==== Hook functions ==== */ /* ----------------------------------------------------------------- */