Changeset 6508


Ignore:
Timestamp:
06/14/12 18:31:57 (12 years ago)
Author:
brunocosta
Message:

Ticket #2853 - Exibição de cotas de sub pastas IMAP.

Location:
branches/2.3/expressoMail1_2
Files:
2 edited

Legend:

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

    r6482 r6508  
    43464346 
    43474347            $data = array(); 
    4348             $quota_root = $this->get_quota(array('folder_id' => "INBOX")); 
    4349             $data["quota_root"] = $quota_root; 
     4348                $quota_root = $this->get_quota(array('folder_id' => "INBOX")); 
     4349                $data["quota_root"] = $quota_root; 
    43504350 
    43514351            foreach ($response_array as $idx=>$line) {  
    43524352                    $line2 = str_replace('"', "", $line);  
    43534353                    $line2 = str_replace(" /vendor/cmu/cyrus-imapd/size (value.shared ",";",str_replace("* ANNOTATION ","",$line2));  
    4354                     list($folder,$size) = explode(";",$line2);  
    4355                     $quota_used = str_replace(")","",$size);  
     4354                    list($folder,$size) = explode(";",$line2); 
     4355                    
    43564356                    $quota=$this->get_quotaroot(array('folder' => $folder)); 
     4357                    $isroot=(strpos($quota['quota_root'],$folder)!==false); 
     4358                    $quota_used = $isroot?$quota['quota_used']*1024:str_replace(")","",$size);  
    43574359                    $hasquota=($quota['quota_root']!=""); 
    4358                     $isroot=(strpos($quota['quota_root'],$folder)!==false); 
    4359                     $quotaPercent = ($hasquota?(($quota_used / 1024) / $quota['quota_limit'])*100:0);  
     4360                    $quotaPercent = ($hasquota?(($quota_used / 1024) / $quota['quota_limit'])*100:0);  
    43604361                    $folder = mb_convert_encoding($folder, "ISO_8859-1", "UTF7-IMAP");  
    43614362                    if(!preg_match('/user\\'.$this->imap_delimiter.$this->username.'\\'.$this->imap_delimiter.'/i',$folder)){  
     
    43754376            include_once("class.imapfp.inc.php");             
    43764377            $imapfp = new imapfp();  
    4377  
     4378                 
    43784379            if(!$imapfp->open($this->imap_server,$this->imap_port))  
    43794380                    return $imapfp->get_error();              
     
    43874388            $data = array(); 
    43884389 
    4389             foreach ($response_array as $idx=>$line) {  
    4390                     $line2 = str_replace('"', "", $line);  
     4390            foreach ($response_array as $idx=>$line) { 
     4391                    if($idx == 0) 
     4392                        continue; 
     4393                    $line2 = str_replace('"', "", $line);  
    43914394                    $line2 = str_replace(" /vendor/cmu/cyrus-imapd/size (value.shared ",";",str_replace("* ANNOTATION ","",$line2));  
    4392                     list($folder,$size) = explode(";",$line2);  
    4393                     $quota_used = str_replace(")","",$size);  
     4395                    list($folder,$size) = explode(";",$line2); 
    43944396                    $quota=$this->get_quotaroot(array('folder' => $folder)); 
    4395                     $hasquota=($quota['quota_limit']!=""); 
    43964397                    $isroot=(strpos($quota['quota_root'],$folder)!==false); 
    43974398                    if($isroot){ 
    4398                         $quotaPercent = ($hasquota?(($quota_used / 1024) / $quota['quota_limit'])*100:0);  
    4399                         $folder = mb_convert_encoding($folder, "ISO_8859-1", "UTF7-IMAP");  
    4400                         if(preg_match('/user\\'.$this->imap_delimiter.$this->username.'\\'.$this->imap_delimiter.'/i',$folder)){  
    4401                              $folder = preg_replace('/user\\'.$this->imap_delimiter.$this->username.'\\'.$this->imap_delimiter.'/i','', $folder);  
    4402                              $data[$folder] = array("quota_percent" => ($hasquota?sprintf("%.1f",round($quotaPercent,1)):''), "quota_used" => $quota_used, "quota_limit" => ($isroot && $folder!=$this->functions->getLang("Inbox")?$quota['quota_limit']:''));  
    4403                              return $data; 
    4404                         }  
    4405                          
     4399                        return $quota; 
    44064400                    } 
    44074401            }  
  • branches/2.3/expressoMail1_2/js/draw_api.js

    r6492 r6508  
    34363436            td12.setAttribute("noWrap","true"); 
    34373437            td12.innerHTML += '&nbsp;<span class="boxHeaderText"> de ' + borkb(q_limit*1024)+"</span>"; 
    3438 //            tr2.appendChild(td10); 
    34393438            tr2.appendChild(td11); 
    34403439            tr2.appendChild(td12); 
    3441             //---------------- 
    3442             for(folder in data['quota_folder']){ 
    3443                 folderName = "Arquivo Remoto"; 
    3444                 qFolderUsed = data['quota_folder'][folder]['quota_used']; 
    3445                 qFolderLimit = data['quota_folder'][folder]['quota_limit']; 
    3446                 qfolderPercent = data['quota_folder'][folder]['quota_percent']; 
    3447             } 
    3448              
     3440            folderName = "Arquivo Remoto"; 
     3441            qFolderUsed = data['quota_folder']['quota_used']; 
     3442            qFolderLimit = data['quota_folder']['quota_limit']; 
     3443            qfolderPercent = data['quota_folder']['quota_percent']; 
     3444          
    34493445            td20 = document.createElement("TD"); 
    34503446            td20.setAttribute("noWrap","true"); 
Note: See TracChangeset for help on using the changeset viewer.