Changeset 3064


Ignore:
Timestamp:
07/16/10 16:24:28 (14 years ago)
Author:
amuller
Message:

Ticket #1035 - Corrigindo visualização das quotas com borkb

Location:
branches/2.2/expressoMail1_2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/expressoMail1_2/inc/class.imap_functions.inc.php

    r3057 r3064  
    29862986 
    29872987                if(count($quota) && $quota['limit']) { 
    2988                         $quota_limit = (($quota['limit']/1024)* 100 + .5 )* .01; 
    2989                         $quota_used  = (($quota['usage']/1024)* 100 + .5 )* .01; 
     2988                        $quota_limit = $quota['limit']; 
     2989                        $quota_used  = $quota['usage']; 
    29902990                        if($quota_used >= $quota_limit) 
    29912991                        { 
     
    29992999                        return array( 
    30003000                                'quota_percent' => floor($quotaPercent), 
    3001                                 'quota_used' => floor($quota_used), 
    3002                                 'quota_limit' =>  floor($quota_limit) 
     3001                                'quota_used' => $quota_used, 
     3002                                'quota_limit' =>  $quota_limit 
    30033003                        ); 
    30043004                } 
  • branches/2.2/expressoMail1_2/js/common_functions.js

    r3018 r3064  
    871871} 
    872872 
    873 function borkb(size){  
    874         kbyte = 1024;  
    875         mbyte = kbyte*1024;  
    876         gbyte = mbyte*1024;  
    877         if (!size)  
    878                 size = 0;  
    879         if (size < kbyte)  
    880                 return size + ' B';  
    881         else if (size < mbyte)  
    882                 return parseInt(size/kbyte) + ' KB';  
    883         else if (size < gbyte)  
    884                 if (size/mbyte > 100)  
    885                         return (size/mbyte).toFixed(0) + ' MB';  
    886                 else  
    887                         return (size/mbyte).toFixed(1) + ' MB';  
    888         else  
    889                 return parseInt(size/gbyte).toFixed(1) + ' GB';  
    890 }  
     873function borkb(size){ 
     874        kbyte = 1024; 
     875        mbyte = kbyte*1024; 
     876        gbyte = mbyte*1024; 
     877        if (!size) 
     878                size = 0; 
     879        if (size < kbyte) 
     880                return size + ' B'; 
     881        else if (size < mbyte) 
     882                return parseInt(size/kbyte) + ' KB'; 
     883        else if (size < gbyte) 
     884                if (size/mbyte > 100) 
     885                        return (size/mbyte).toFixed(0) + ' MB'; 
     886                else 
     887                        return (size/mbyte).toFixed(1) + ' MB'; 
     888        else 
     889                return (size/gbyte).toFixed(1) + ' GB'; 
     890} 
    891891 
    892892function validate_date(date){ 
  • branches/2.2/expressoMail1_2/js/draw_api.js

    r3057 r3064  
    27282728        td11.align="center"; 
    27292729        td11.setAttribute("noWrap","true"); 
    2730         td11.innerHTML += '&nbsp;<span class="boxHeaderText">' + value+"% ("+q_used+"M/"+q_limit+"M)</span>"; 
     2730        td11.innerHTML += '&nbsp;<span class="boxHeaderText">' + value+"% ("+borkb(q_used*1024)+"/"+borkb(q_limit*1024)+")</span>"; 
    27312731        //tr1.appendChild(td11); 
    27322732 
Note: See TracChangeset for help on using the changeset viewer.