From 8748b35d2cfcea7d37baeb8a8d893e974bc3ba6f Mon Sep 17 00:00:00 2001
From: Till Brehm <tbrehm@ispconfig.org>
Date: Sat, 15 Feb 2014 13:05:45 -0500
Subject: [PATCH] Fixed: FS#2669 - ISPConig template generator creates date columns with wrong format
---
interface/web/sites/user_quota_stats.php | 48 +++++++++++++++++++++++++-----------------------
1 files changed, 25 insertions(+), 23 deletions(-)
diff --git a/interface/web/sites/user_quota_stats.php b/interface/web/sites/user_quota_stats.php
index 56cc02c..aed8e22 100644
--- a/interface/web/sites/user_quota_stats.php
+++ b/interface/web/sites/user_quota_stats.php
@@ -1,6 +1,6 @@
<?php
-require_once('../../lib/config.inc.php');
-require_once('../../lib/app.inc.php');
+require_once '../../lib/config.inc.php';
+require_once '../../lib/app.inc.php';
/******************************************
* Begin Form configuration
@@ -23,29 +23,30 @@
$monitor_data = array();
if(is_array($tmp_rec)) {
foreach ($tmp_rec as $tmp_mon) {
- $monitor_data = array_merge_recursive($monitor_data,unserialize($app->db->unquote($tmp_mon['data'])));
+ $monitor_data = array_merge_recursive($monitor_data, unserialize($app->db->unquote($tmp_mon['data'])));
}
}
class list_action extends listform_actions {
-
+
function prepareDataRow($rec)
- {
- global $app,$monitor_data;
-
+ {
+ global $app, $monitor_data;
+
$rec = $app->listform->decode($rec);
//* Alternating datarow colors
$this->DataRowColor = ($this->DataRowColor == '#FFFFFF') ? '#EEEEEE' : '#FFFFFF';
$rec['bgcolor'] = $this->DataRowColor;
$username = $rec['system_user'];
-
+
$rec['used'] = $monitor_data['user'][$username]['used'];
+ $rec['used_sort'] = $rec['used'];
$rec['soft'] = $monitor_data['user'][$username]['soft'];
$rec['hard'] = $monitor_data['user'][$username]['hard'];
$rec['files'] = $monitor_data['user'][$username]['files'];
-
+
if (!is_numeric($rec['used'])){
if ($rec['used'][0] > $rec['used'][1]){
$rec['used'] = $rec['used'][0];
@@ -56,48 +57,49 @@
if (!is_numeric($rec['soft'])) $rec['soft']=$rec['soft'][1];
if (!is_numeric($rec['hard'])) $rec['hard']=$rec['hard'][1];
if (!is_numeric($rec['files'])) $rec['files']=$rec['files'][1];
-
+
if($rec['used'] > 1024) {
- $rec['used'] = round($rec['used'] / 1024,2).' MB';
+ $rec['used'] = round($rec['used'] / 1024, 2).' MB';
} else {
if ($rec['used'] != '') $rec['used'] .= ' KB';
}
-
+
if($rec['soft'] > 1024) {
- $rec['soft'] = round($rec['soft'] / 1024,2).' MB';
+ $rec['soft'] = round($rec['soft'] / 1024, 2).' MB';
} else {
$rec['soft'] .= ' KB';
}
-
+
if($rec['hard'] > 1024) {
- $rec['hard'] = round($rec['hard'] / 1024,2).' MB';
+ $rec['hard'] = round($rec['hard'] / 1024, 2).' MB';
} else {
$rec['hard'] .= ' KB';
}
-
+
if($rec['soft'] == " KB") $rec['soft'] = $app->lng('unlimited');
if($rec['hard'] == " KB") $rec['hard'] = $app->lng('unlimited');
-
-
+
+
/*
if(!strstr($rec['used'],'M') && !strstr($rec['used'],'K')) $rec['used'].= ' B';
if(!strstr($rec['soft'],'M') && !strstr($rec['soft'],'K')) $rec['soft'].= ' B';
if(!strstr($rec['hard'],'M') && !strstr($rec['hard'],'K')) $rec['hard'].= ' B';
*/
-
+
if($rec['soft'] == '0 B' || $rec['soft'] == '0 KB' || $rec['soft'] == '0') $rec['soft'] = $app->lng('unlimited');
if($rec['hard'] == '0 B' || $rec['hard'] == '0 KB' || $rec['hard'] == '0') $rec['hard'] = $app->lng('unlimited');
-
+
//* The variable "id" contains always the index variable
$rec['id'] = $rec[$this->idx_key];
return $rec;
}
+
}
$list = new list_action;
-$list->SQLExtWhere = "type = 'vhost'";
-$list->SQLOrderBy = 'ORDER BY domain';
+$list->SQLExtWhere = "web_domain.type = 'vhost'";
+$list->SQLOrderBy = 'ORDER BY web_domain.domain';
$list->onLoad();
-?>
\ No newline at end of file
+?>
--
Gitblit v1.9.1