Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Forth commit into mail_quota fixed behaviour (ticket #337)

  • Loading branch information...
commit 271e200acc36711b6c3495a9cdffd184d02d4d0d 1 parent aa58d60
@aseques aseques authored
View
6 gui/public/client/mail_accounts.php
@@ -259,6 +259,7 @@ function gen_page_dmn_mail_list($tpl, $dmn_id, $dmn_name) {
}
$txt_quota = "---";
+ $localeinfo=localeconv();
if ($is_mailbox) {
$complete_email = $mail_acc . '@' . $show_dmn_name;
@@ -282,9 +283,9 @@ function gen_page_dmn_mail_list($tpl, $dmn_id, $dmn_name) {
}
if ($userquotamax == 0) {
$userquotamax=tr('unlimited');
- $userquotapercent = "0.000";
+ $userquotapercent = "0".$localeinfo['decimal_point']."000";
} else {
- $userquotapercent = number_format((($userquota/$userquotamax)*100), 3, '.', '');
+ $userquotapercent = number_format((($userquota/$userquotamax)*100), 3, $localeinfo['decimal_point'], '');
$userquotamax = formatBytes($userquotamax);
}
$userquota= formatBytes($userquota);
@@ -773,6 +774,7 @@ function count_default_mails($dmn_id) {
'TR_MAIL' => tr('Mail'),
'TR_TYPE' => tr('Type'),
'TR_STATUS' => tr('Status'),
+ 'TR_QUOTA' => tr('Quota'),
'TR_ACTION' => tr('Action'),
'TR_AUTORESPOND' => tr('Auto respond'),
'TR_DMN_MAILS' => tr('Domain mails'),
View
13 gui/public/client/mail_quota.php
@@ -97,11 +97,11 @@ function client_UpdateMailAccount($mailAccountData)
// Quota data validation
$quotaValue = 0;
- $quotaUpdate = false;
+ $quotaUpdate = 0;
if (!empty($_POST['quota']) || $_POST['quota'] == 0) {
- if($_POST['quota'] != $mailAccountData['quota']) {
+ if($_POST['quota'] != floor($mailAccountData['quota'] / 1024 /1024)) {
if(is_numeric($_POST['quota'])) {
- $quotaUpdate = true;
+ $quotaUpdate = 1;
$quotaValue = $_POST['quota'] * 1024 * 1024;
} else {
set_page_message(tr('Quota must be number'), 'error');
@@ -111,7 +111,7 @@ function client_UpdateMailAccount($mailAccountData)
set_page_message(tr('Quota must have a value'), 'error');
}
- if (!Zend_Session::namespaceIsset('pageMessages') && $quotaUpdate) {
+ if ((!Zend_Session::namespaceIsset('pageMessages')) && ($quotaUpdate!=0)) {
iMSCP_Events_Manager::getInstance()->dispatch(
iMSCP_Events::onBeforeEditMail, array('mailId' => $mailAccountData['mail_id'])
);
@@ -136,7 +136,8 @@ function client_UpdateMailAccount($mailAccountData)
write_log("{$_SESSION['user_logged']}: updated mail quota: {$mailAccountData['mail_addr']}", E_USER_NOTICE);
return true;
} else {
- set_page_message(tr("Nothing's been changed."), 'info');
+ set_page_message(tr("Nothing has been changed."), 'info');
+ return true;
}
return false;
@@ -212,7 +213,7 @@ function client_generateQuotaForm($tpl, $mailAccountData)
'TR_PAGE_TITLE' => tr('i-MSCP - Client / Manage mail / Edit quota'),
'THEME_CHARSET' => tr('encoding'),
'ISP_LOGO' => layout_getUserLogo(),
- 'TR_EDIT_MAIL_ACCOUNT' => tr('Edit mail quota'),
+ 'TR_EDIT_MAIL_QUOTA' => tr('Edit mail quota'),
'TR_QUOTA' => tr('Quota in MB (0 unlimited)'),
'QUOTA' => $quotaValue,
'TR_HELP' => tr('help'),
View
2  gui/themes/default/client/mail_accounts.tpl
@@ -19,7 +19,7 @@
<th>{TR_MAIL}</th>
<th>{TR_TYPE}</th>
<th>{TR_STATUS}</th>
- <th>{TR_QUOTA_USE}</th>
+ <th>{TR_QUOTA}</th>
<th>{TR_ACTION}</th>
</tr>
</thead>
View
6 gui/themes/default/client/navigation.xml
@@ -199,6 +199,12 @@
<visible>0</visible>
<title_class>email</title_class>
</mail_account_edit_link>
+ <mail_account_quota_link>
+ <label>Edit mail quota</label>
+ <uri>/client/mail_quota.php</uri>
+ <visible>0</visible>
+ <title_class>email</title_class>
+ </mail_account_quota_link>
<enable_autoresponder_link>
<label>Enable auto responder</label>
<uri>/client/mail_autoresponder_enable.php</uri>
Please sign in to comment.
Something went wrong with that request. Please try again.