File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -143,13 +143,16 @@ function onShowEnd() {
143143 $ global_config = $ app ->getconf ->get_global_config ();
144144 $ app ->tpl ->setVar ('show_delete_on_forms ' , $ global_config ['misc ' ]['show_delete_on_forms ' ]);
145145
146- # Fetch current disk usage.
147- $ app ->uses ('quota_lib ' );
148- $ clientid = $ app ->db ->queryOneRecord ('SELECT `client_id` FROM `sys_group` WHERE `groupid` = ? ' , $ this ->dataRecord ['sys_groupid ' ]);
149- $ monitor_data = $ app ->quota_lib ->get_mailquota_data ($ clientid , FALSE , $ this ->dataRecord ['email ' ]);
150- $ app ->tpl ->setVar ("used_percentage " , round ($ monitor_data ['used ' ] * 100 / $ this ->dataRecord ['quota ' ]));
151- $ app ->tpl ->setVar ('used ' , $ app ->functions ->formatBytes ($ monitor_data ['used ' ], 0 ));
152-
146+ if ($ this ->id > 0 ) {
147+ # Fetch current disk usage.
148+ $ app ->uses ('quota_lib ' );
149+ $ clientid = $ app ->db ->queryOneRecord ('SELECT `client_id` FROM `sys_group` WHERE `groupid` = ? ' , $ this ->dataRecord ['sys_groupid ' ]);
150+ $ monitor_data = $ app ->quota_lib ->get_mailquota_data ($ clientid , FALSE , $ this ->dataRecord ['email ' ]);
151+ if ($ this ->dataRecord ['quota ' ] != 0 ) {
152+ $ app ->tpl ->setVar ("used_percentage " , round ($ monitor_data ['used ' ] * 100 / $ this ->dataRecord ['quota ' ]));
153+ }
154+ $ app ->tpl ->setVar ('used ' , $ app ->functions ->formatBytes ($ monitor_data ['used ' ], 0 ));
155+ }
153156 parent ::onShowEnd ();
154157 }
155158
You can’t perform that action at this time.
0 commit comments