Ignore:
Timestamp:
06/14/12 16:48:52 (12 years ago)
Author:
niltonneto
Message:

Ticket #2507 - Padronizado retorno contendo metadados dos anexos.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sandbox/webservice/api/adapters/MailAdapter.php

    r6495 r6497  
    152152                }                                                
    153153                $msg['msgSubject']  = ($info_msg['subject'] ? mb_convert_encoding($info_msg['subject'],"UTF8", "ISO_8859-1") : "");              
    154                 $msg['msgHasAttachments'] = $info_msg['attachments'] ? "1" : "0";                
    155                 $msg['msgAttachments'] = $info_msg['attachments'];               
     154                $msg['msgHasAttachments'] = "0"; 
     155                if(count($info_msg['attachments']) > 0) { 
     156                        $msg['msgAttachments'] = array(); 
     157                        foreach($info_msg['attachments'] as $i => $attachment){ 
     158                                $msg['msgAttachments'][] = array ( 
     159                                        'attachmentID'                  => "{$attachment['pid']}", 
     160                                        'attachmentIndex'               => "$i", 
     161                                        'attachmentName'                => $attachment['name'], 
     162                                        'attachmentSize'                => $attachment['fsize'], 
     163                                        'attachmentEncoding'    => $attachment['encoding'] 
     164                                ); 
     165                        } 
     166                        $msg['msgHasAttachments'] = "1"; 
     167                } 
    156168                $msg['msgFlagged']      = $info_msg['Flagged'] == "F" ? "1" : "0"; 
    157169                $msg['msgForwarded']= $info_msg['Forwarded'] == "F" ? "1" : "0"; 
Note: See TracChangeset for help on using the changeset viewer.