From b4daebfaff3a7cfb84f5700de0fda1c4dc943a03 Mon Sep 17 00:00:00 2001
From: xaver <xaver@ispconfig3>
Date: Tue, 28 Feb 2012 15:26:42 +0000
Subject: [PATCH] added file count in Website quota #2105

---
 interface/web/sites/lib/lang/de_user_quota_stats_list.lng | 2 +-
 interface/web/sites/lib/lang/en_user_quota_stats_list.lng | 1 +
 interface/web/sites/templates/user_quota_stats_list.htm   | 5 ++++-
 interface/web/sites/user_quota_stats.php                  | 2 ++
 server/lib/classes/monitor_tools.inc.php                  | 2 ++
 5 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/interface/web/sites/lib/lang/de_user_quota_stats_list.lng b/interface/web/sites/lib/lang/de_user_quota_stats_list.lng
index 716760b172..d9822c1703 100644
--- a/interface/web/sites/lib/lang/de_user_quota_stats_list.lng
+++ b/interface/web/sites/lib/lang/de_user_quota_stats_list.lng
@@ -4,5 +4,5 @@ $wb['domain_txt'] = 'Domain / Website';
 $wb['system_user_txt'] = 'Linux user';
 $wb['used_txt'] = 'Used space';
 $wb['hard_txt'] = 'Hard limit';
-$wb['soft_txt'] = 'Soft limit';
+$wb["files_txt"] = 'Dateien';
 ?>
diff --git a/interface/web/sites/lib/lang/en_user_quota_stats_list.lng b/interface/web/sites/lib/lang/en_user_quota_stats_list.lng
index 1d4290856c..1e04b0fa3d 100644
--- a/interface/web/sites/lib/lang/en_user_quota_stats_list.lng
+++ b/interface/web/sites/lib/lang/en_user_quota_stats_list.lng
@@ -5,4 +5,5 @@ $wb["system_user_txt"] = 'Linux user';
 $wb["used_txt"] = 'Used space';
 $wb["hard_txt"] = 'Hard limit';
 $wb["soft_txt"] = 'Soft limit';
+$wb["files_txt"] = 'Single files';
 ?>
\ No newline at end of file
diff --git a/interface/web/sites/templates/user_quota_stats_list.htm b/interface/web/sites/templates/user_quota_stats_list.htm
index b005d60cd8..a2cce3a7a2 100644
--- a/interface/web/sites/templates/user_quota_stats_list.htm
+++ b/interface/web/sites/templates/user_quota_stats_list.htm
@@ -12,6 +12,7 @@
 			<th class="tbl_col_system_user" scope="col" style="text-align:right;"><tmpl_var name="used_txt"></th>
 			<th class="tbl_col_system_user" scope="col" style="text-align:right;"><tmpl_var name="soft_txt"></th>
 			<th class="tbl_col_system_user" scope="col" style="text-align:right;"><tmpl_var name="hard_txt"></th>
+			<th class="tbl_col_system_user" scope="col" style="text-align:right;"><tmpl_var name="files_txt"></th>
             <th class="tbl_col_buttons" scope="col">&nbsp;</th>
           </tr>
           <tr>
@@ -20,6 +21,7 @@
 			<td class="tbl_col_system_user">&nbsp;</td>
 			<td class="tbl_col_system_user">&nbsp;</td>
 			<td class="tbl_col_system_user">&nbsp;</td>
+			<td class="tbl_col_system_user">&nbsp;</td>
             <td class="tbl_col_buttons"><div class="buttons"><button type="button" class="icons16 icoFilter" name="Filter" id="Filter" value="{tmpl_var name="filter_txt"}" onClick="submitForm('pageForm','sites/user_quota_stats.php');"><span>{tmpl_var name="filter_txt"}</span></button></div></td>
           </tr>
         </thead>
@@ -31,6 +33,7 @@
 			<td class="tbl_col_used" style="text-align:right;"><a href="#" onClick="loadContent('sites/web_domain_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="used"}</a></td>
 			<td class="tbl_col_soft" style="text-align:right;"><a href="#" onClick="loadContent('sites/web_domain_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="soft"}</a></td>
 			<td class="tbl_col_hard" style="text-align:right;"><a href="#" onClick="loadContent('sites/web_domain_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="hard"}</a></td>
+			<td class="tbl_col_files" style="text-align:right;"><a href="#" onClick="loadContent('sites/web_domain_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="files"}</a></td>
             <td class="tbl_col_buttons">
               <div class="buttons icons16">    
                 &nbsp;
@@ -41,7 +44,7 @@
         </tbody>
         <tfoot>
           <tr>
-            <td class="tbl_footer tbl_paging" colspan="6"><tmpl_var name="paging"></td>
+            <td class="tbl_footer tbl_paging" colspan="7"><tmpl_var name="paging"></td>
           </tr>
         </tfoot>
       </table>
diff --git a/interface/web/sites/user_quota_stats.php b/interface/web/sites/user_quota_stats.php
index 8b88d84e57..0b23b1a162 100644
--- a/interface/web/sites/user_quota_stats.php
+++ b/interface/web/sites/user_quota_stats.php
@@ -44,10 +44,12 @@ class list_action extends listform_actions {
 		$rec['used'] = $monitor_data['user'][$username]['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'])) $rec['used']=$rec['used'][1];
 		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';
diff --git a/server/lib/classes/monitor_tools.inc.php b/server/lib/classes/monitor_tools.inc.php
index dab75b5aa9..a8a4025997 100644
--- a/server/lib/classes/monitor_tools.inc.php
+++ b/server/lib/classes/monitor_tools.inc.php
@@ -241,10 +241,12 @@ class monitor_tools {
 						$data['user'][$username]['used'] += $s[2];
 						$data['user'][$username]['soft'] += $s[3];
 						$data['user'][$username]['hard'] += $s[4];
+						$data['user'][$username]['files'] += $s[5];
 					} else {
 						$data['user'][$username]['used'] = $s[2];
 						$data['user'][$username]['soft'] = $s[3];
 						$data['user'][$username]['hard'] = $s[4];
+						$data['user'][$username]['files'] = $s[5];
 					}
 				}
 			}
-- 
GitLab