guest [201.29.178.171]  Sun, 24 Feb 2013 02:41:09 +0000

Modified page: http://wiki.horde.org/AltH5Imp6Quota
New Revision:  5
Change log:  Fix to Command.php, lib/Quota.php, lib/Ui/Quota.php

@@ -27,9 +27,9 @@
 || imp/lib/Ajax/Queue.php || m, p, l, add ||
 || imp/js/dimpbase.js (IMP 6.0.3) || quotaV, quotaH, quotaCallback ||
 || imp/js/dimpbase.js (IMP 6.0.4) || quotaV, quotaH, quotaCallback ||

-//Last updated 2013-02-18//
+//Last updated 2013-02-23//
 ----
 +++ Descriptions
 ----
 ++++ Configuration example (imp/config/backends.php)
@@ -88,9 +88,9 @@
  * @license  http://www.horde.org/licenses/gpl GPL
  * @package  IMP
  *
  * Modified by Mauricio Jose T. Tecles <[email protected]>
- * Updated 2013 January 16
+ * Updated 2013 February 19
  */
 class IMP_Quota_Command extends IMP_Quota
 {
     /**
@@ -170,15 +170,13 @@
             */

             if (ereg("none$", $quota_data[0])) {
                 /*
-                * Quota not defined or user does not own any files.
+                * Quota not defined.
                 */
-                if (empty($this->_params['dev_fldrs'])) {
- return array('usagehome' => -1, 'limithome' => -1, 'usagevar' => 0, 'limitvar' => 0);
-                } else {
- return array('usagehome' => 0, 'limithome' => 0, 'usagevar' => 0, 'limitvar' => 0);
-                }
+
+ return array('usagehome' => 0, 'limithome' => 0, 'usagevar' => 0, 'limitvar' => 0);
+
             } else {
                 /*
                 * Quota defined
                 */
@@ -202,13 +200,11 @@
                     * or user owns file in only one file system.
                     */
                     if (ereg($this->_params['dev_inbx'], $quota_data[2])) {
$quotavar = split("[[:blank:]]+", trim($quota_data[2]));
-                        if (!empty($this->_params['dev_fldrs'])) {
- return array('usagehome' => 0, 'limithome' => 0, 'usagevar' => $quotavar[1] * $blocksize, 'limitvar' => $quotavar[2] * $blocksize);
-                        } else {
- return array('usagehome' => -1, 'limithome' => -1, 'usagevar' => $quotavar[1] * $blocksize, 'limitvar' => $quotavar[2] * $blocksize);
-                        }
+
+ return array('usagehome' => 0, 'limithome' => 0, 'usagevar' => $quotavar[1] * $blocksize, 'limitvar' => $quotavar[2] * $blocksize);
+
                     } elseif (!empty($this->_params['dev_fldrs'])) {
if (ereg($this->_params['dev_fldrs'], $quota_data[2])) { $quotahome = split("[[:blank:]]+", trim($quota_data[2])); return array('usagehome' => $quotahome[1] * $blocksize, 'limithome' => $quotahome[2] * $blocksize, 'usagevar' => 0, 'limitvar' => 0);
@@ -262,13 +258,11 @@
                     */
                     $quotavar = split("[[:blank:]]+", trim($quota_data[2]));
                     $quotavar[1] = ereg_replace ("\*", "", $quotavar[1]);
                     $quotavar[4] = ereg_replace ("days", "", $quotavar[4]);
-                    if (!empty($this->_params['dev_fldrs'])) {
- return array('usagehome' => 0, 'limithome' => 0, 'usagevar' => $quotavar[1] * $blocksize, 'limitvar' => $quotavar[2] * $blocksize, 'gracevar' => $quotavar[4]);
-                    } else {
- return array('usagehome' => -1, 'limithome' => -1, 'usagevar' => $quotavar[1] * $blocksize, 'limitvar' => $quotavar[2] * $blocksize, 'gracevar' => $quotavar[4]);
-                    }
+
+ return array('usagehome' => 0, 'limithome' => 0, 'usagevar' => $quotavar[1] * $blocksize, 'limitvar' => $quotavar[2] * $blocksize, 'gracevar' => $quotavar[4]);
+
                 } else {
                     /*
                     * Quota exceeded in dev_fldrs
                     */
@@ -299,18 +293,21 @@

         $this->_params['format'] = array(
             'shortv' => isset($this->_params['format']['short'])
                 ? $this->_params['format']['short']
-                : _("Inbox: %.0f%% of %.1f %s"),
+                : _("Entrada: %.0f%% of %.1f %s"),
             'shorth' => isset($this->_params['format']['shorth'])
                 ? $this->_params['format']['shorth']
-                : _(" - Folders: %.0f%% de %.1f %s"),
+                : _(" - Pastas: %.0f%% de %.1f %s"),
+            'sshorth' => isset($this->_params['format']['sshorth'])
+                ? $this->_params['format']['sshorth']
+                : _("Pastas: %.0f%% de %.1f %s"),
'nolimit_shortv' => isset($this->_params['format']['nolimit_short'])
                 ? $this->_params['format']['nolimit_short']
-                : _("Inbox: %.0f %s"),
+                : _("Entrada: %.1f %s"),
'nolimit_shorth' => isset($this->_params['format']['nolimit_shorth'])
                 ? $this->_params['format']['nolimit_shorth']
-                : _(" - Folders: %.1f %s"),
+                : _(" - Pastas: %.1f %s"),
         );
     }
 </code>
 ----
@@ -382,9 +379,9 @@
  * @license  http://www.horde.org/licenses/gpl GPL
  * @package  IMP
  *
  * Modified by Mauricio Jose T. Tecles <[email protected]>
- * Updated 2013 January 16
+ * Updated 2013 February 23
  */
 class IMP_Ui_Quota
 {
     /**
@@ -434,17 +431,22 @@
                        } elseif ($ret['percenthome'] >= 90) {
                 $ret['classhome'] = 'quotawarn';
             }

- $ret['messagehome'] = sprintf($strings['shorth'], $ret['percenthome'], $quota['limithome'], $unit);
-            $ret['percenthome'] = sprintf("%.2f", $ret['percenthome']);
+                       if ($quota['usagevar'] != 0) {
+ $ret['messagehome'] = sprintf($strings['shorth'], $ret['percenthome'], $quota['limithome'], $unit);
+                $ret['percenthome'] = sprintf("%.2f", $ret['percenthome']);
+                       } else {
+ $ret['messagehome'] = sprintf($strings['sshorth'], $ret['percenthome'], $quota['limithome'], $unit);
+                $ret['percenthome'] = sprintf("%.2f", $ret['percenthome']);
+                       }

         } else {
             if ($quota['usagehome'] != 0) {
                 $quota['usagehome'] = $quota['usagehome'] / $calc;
$ret['messagehome'] = sprintf($strings['nolimit_shorth'], $quota['usagehome'], $unit);
             } else {
-                $ret['messagehome'] = _("No limit");
+                $ret['messagehome'] = _(" ");
             }
         }

         /* Quota for dev_inbx */
@@ -467,9 +469,9 @@
                 $quota['usagevar'] = $quota['usagevar'] / $calc;

$ret['messagevar'] = sprintf($strings['nolimit_shortv'], $quota['usagevar'], $unit);
             } else {
-                $ret['messagevar'] = _("No limit");
+                $ret['messagevar'] = _(" ");
             }
         }

         return $ret;

--
commits mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
To unsubscribe, mail: [email protected]

Reply via email to