Changeset 6340 for branches/2.3


Ignore:
Timestamp:
05/29/12 14:05:15 (12 years ago)
Author:
rafaelraymundo
Message:

Ticket #2809 - Mensagem é apagada da origem caso o desarquivamento não tenha sucesso.

Location:
branches/2.3/expressoMail1_2
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/2.3/expressoMail1_2/imap.py

    r5227 r6340  
    1919    M.login(user,password) 
    2020    flags="" 
    21     M.append(mailbox,flags,date_time,message) 
     21    data = M.append(mailbox,flags,date_time,message) 
     22 
     23    result = data[0]+':'+data[1][0] 
     24     
     25    print result 
     26 
    2227    #print mailbox+flags+date_time+message 
    23     M.logout() 
    2428    #M.close() 
    25     print "no errors" 
     29    #print "no errors" 
    2630except imaplib.IMAP4.error, erro: 
    2731    print erro 
     32finally: 
     33    M.logout() 
  • branches/2.3/expressoMail1_2/inc/class.imap_functions.inc.php

    r6264 r6340  
    40564056            imap_createmailbox($mbox_stream,imap_utf7_encode("{".$imap_server."}".$folder)); 
    40574057        } 
     4058         
     4059        // string date ( string $format [, int $timestamp = time() ] ) 
     4060        // bool imap_append ( resource $imap_stream , string $mailbox , string $message [, string $options = NULL [, string $internal_date = NULL ]] ) 
     4061        // 'd-M-Y H:i:s O' 
     4062         
     4063        $return = array(); 
    40584064        if($timestamp){ 
    40594065            $tempDir = $_SESSION['phpgw_info']['server']['temp_dir']; 
     
    40674073            $return['append'] = imap_append($mbox_stream, "{".$imap_server.":".$imap_port."}".$folder, $source, "\\Seen"); 
    40684074        } 
     4075         
     4076        if (!empty($return['command'])) 
     4077        { 
     4078            list ($result, $msg) = explode(':',$return['command']); 
     4079            if (strtoupper($result) === 'NO') 
     4080            { 
     4081                $return['error'] = $msg; 
     4082                return $return; 
     4083            } 
     4084        } 
     4085         
    40694086        $status = imap_status($mbox_stream, "{".$this->imap_server.":".$this->imap_port."}".$folder, SA_UIDNEXT); 
    40704087 
     
    41824199        $flags = explode("#@#@#@",$params['flags']); 
    41834200        $ids = explode("#@#@#@",$params['id']); 
    4184         $return = array();  
     4201        $return = array(); 
     4202        $archived = array(); 
     4203        $error = array(); 
    41854204 
    41864205        foreach($sources as $index=>$src) 
     
    41904209                $source = $this->treat_base64_from_post($src); 
    41914210                $insert = $this->insert_email($source,$dest_folder,$timestamps[$index],$flags[$index]); 
    4192                 if(!$insert['error']) 
    4193                     $return[] = $ids[$index]; 
     4211                if($insert['error']) 
     4212                { 
     4213                    $error[] = $ids[$index]; 
     4214                } 
     4215                else  
     4216                { 
     4217                    $archived[] = $ids[$index]; 
     4218                } 
    41944219            } 
    41954220        } 
     4221         
     4222        if (!empty($error)) 
     4223        { 
     4224            $return['error'] = $error; 
     4225        } 
     4226        if (!empty($archived)) 
     4227        { 
     4228            $return['archived'] = $archived; 
     4229        } 
    41964230         
    41974231        return $return; 
  • branches/2.3/expressoMail1_2/js/local_messages.js

    r6264 r6340  
    12391239    var handler_unarchive = function(data) 
    12401240    { 
     1241        var archived = typeof (data.archived) == 'undefined' ? Array() : data.archived; 
    12411242        if(preferences.keep_archived_messages == "0") 
    1242              expresso_local_messages.delete_msgs(data.join()); 
     1243             expresso_local_messages.delete_msgs(archived.join()); 
    12431244        if(currentTab != 0) 
    1244             delete_border(currentTab,'false');  
    1245         write_msg(get_lang('All messages are successfully unarchived')); 
    1246  
     1245            delete_border(currentTab,'false'); 
     1246         
     1247        if (!data.error) 
     1248        { 
     1249            write_msg(get_lang('All messages are successfully unarchived')); 
     1250        } 
     1251        else if (!data.archived) 
     1252            { 
     1253                write_msg(get_lang('No messages were unarchived')); 
     1254            } 
     1255            else 
     1256            { 
     1257                write_msg(get_lang("Some messages weren't successfully unarchived")); 
     1258            } 
    12471259    } 
    12481260 
  • branches/2.3/expressoMail1_2/setup/phpgw_pt-br.lang

    r5246 r6340  
    1818all     expressoMail1_2 pt-br   Todas 
    1919All messages are successfully unarchived        expressoMail1_2 pt-br   Mensagens desarquivadas com sucesso 
     20No messages were unarchived     expressoMail1_2 pt-br   Nenhuma mensagem foi desarquivada 
     21Some messages weren't successfully unarchived   expressoMail1_2 pt-br   Algumas mensagens não puderam ser desarquivadas 
    2022Allowed domains for sieve forwarding    admin   pt-br   Domínios permitidos para encaminhamento em filtros 
    2123Also check message against next rule    expressoMail1_2 pt-br   Checar mensagem contra próxima regra também 
Note: See TracChangeset for help on using the changeset viewer.