Changeset 1747


Ignore:
Timestamp:
12/04/09 11:47:00 (14 years ago)
Author:
rafaelraymundo
Message:

Ticket #605 - Implementação de preferência sobre uid ou cn nas pastas compratilhadas.

Location:
trunk/expressoMail1_2
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoMail1_2/inc/class.imap_functions.inc.php

    r1740 r1747  
    14991499                                $result[$i]['folder_name'] = array_pop($tmp_folder_parent); 
    15001500                                $result[$i]['folder_name'] = $result[$i]['folder_name'] == 'INBOX' ? 'Inbox' : $result[$i]['folder_name']; 
    1501                                 if (substr($folder_id,0,4) == 'user' && is_numeric($result[$i]['folder_name'])) { 
     1501                                if ($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['uid2cn'] && substr($folder_id,0,4) == 'user')       { 
    15021502                                        //$this->ldap = new ldap_functions(); 
    15031503                                        if ($cn = $this->ldap->uid2cn($result[$i]['folder_name'])){ 
     
    22322232        } 
    22332233        //Este bloco tem a finalidade de transformar o CPF das pastas compartilhadas em common name 
    2234         if (substr($new_folder_name,0,4) == 'user'){ 
    2235                 $this->ldap = new ldap_functions(); 
    2236                 $tmp_folder_name = explode($this->imap_delimiter, $new_folder_name); 
    2237                         $return['new_folder_name'] = array_pop($tmp_folder_name); 
    2238                         if (is_numeric($return['new_folder_name'])) 
    2239                                 if( $cn = $this->ldap->uid2cn($return['new_folder_name'])) 
    2240                                         $return['new_folder_name'] = $cn; 
     2234        if ($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['uid2cn']){ 
     2235            if (substr($new_folder_name,0,4) == 'user'){ 
     2236                $this->ldap = new ldap_functions(); 
     2237                $tmp_folder_name = explode($this->imap_delimiter, $new_folder_name); 
     2238                $return['new_folder_name'] = array_pop($tmp_folder_name); 
     2239                if( $cn = $this->ldap->uid2cn($return['new_folder_name'])) 
     2240                { 
     2241                    $return['new_folder_name'] = $cn; 
     2242                } 
     2243            } 
    22412244        } 
    22422245 
     
    30853088                    $filter = $this->remove_accents($filter); 
    30863089                    //Este bloco tem a finalidade de transformar o login (quando numerico) das pastas compartilhadas em common name 
    3087                     $folder_name = explode($this->imap_delimiter,$name_box); 
    3088                     if (is_numeric($folder_name[1])) 
     3090                    if ($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['uid2cn'] && substr($name_box,0,4) == 'user') 
    30893091                    { 
     3092                        $folder_name = explode($this->imap_delimiter,$name_box); 
    30903093                        $this->ldap = new ldap_functions(); 
    30913094                        if ($cn = $this->ldap->uid2cn($folder_name[1])) 
     
    30933096                            $folder_name[1] = $cn; 
    30943097                        } 
     3098                        $folder_name = implode($this->imap_delimiter,$folder_name); 
    30953099                    } 
    3096                     $folder_name = implode($this->imap_delimiter,$folder_name); 
     3100                    else 
     3101                    { 
     3102                        $folder_name = mb_convert_encoding(utf8_decode($name_box), "UTF7-IMAP", "ISO_8859-1" ); 
     3103                    } 
    30973104 
    30983105                    if(!is_resource($mbox_stream)) 
  • trunk/expressoMail1_2/inc/hook_settings.inc.php

    r1611 r1747  
    6161}'); 
    6262//} 
     63$default = false; 
     64create_check_box('Do you want to show common name instead of UID?','uid2cn',$default, 
     65        'Do you want to show common name instead of UID?'); 
    6366 
    6467$default = array( 
  • trunk/expressoMail1_2/js/draw_api.js

    r1723 r1747  
    1919var currentTab,numBox = 0; // Open Tab and num of mailboxes opened at context 
    2020 
     21// Objeto Map, talvez o ideal fosse adicionar este objeto à Api do egroupware, e carregá-lo 
     22// aqui no expressoMail. 
     23function Map() 
     24{ 
     25    this.keys = new Array(); 
     26    this.values = new Array(); 
     27} 
     28 
     29Map.prototype.add = function(key, value) 
     30{ 
     31    this.keys.push(key); 
     32    this.values.push(value); 
     33} 
     34 
     35Map.prototype.get = function(key) 
     36{ 
     37    result = new Array(); 
     38    for (i = 0; i < this.keys.length; i++) 
     39    { 
     40        if (this.keys[i] == key) 
     41        { 
     42            result.push(this.values[i]); 
     43        } 
     44    } 
     45 
     46    if (result.length == 0) 
     47    { 
     48        return null; 
     49    } 
     50 
     51    return result; 
     52} 
     53 
     54var translatedFolders = new Map(); 
     55 
    2156function draw_tree_folders(folders){ 
    2257        // Check if the tree folders alredy exist. 
     58        translatedFolders = new Map(); 
    2359        if (Element('dftree_tree_folders')){ 
    2460                if (!expresso_offline) { 
     
    162198                                         
    163199                                        if (!tree_folders.getNodeById('user')){ 
     200                                                tmpFolderId = folders[i].folder_id.split(cyrus_delimiter).pop(); 
     201                                                if (tmpFolderId != folders[i].folder_name) 
     202                                                { 
     203                                                    translatedFolders.add(tmpFolderId, folders[i].folder_name); 
     204                                                } 
    164205                                                var n_root_shared_folders = new dNode({id:'user', caption:get_lang("Shared folders"), plusSign:true});  
    165206                                                tree_folders.add(n_root_shared_folders,'root'); 
  • trunk/expressoMail1_2/js/local_messages.js

    r1666 r1747  
    779779                } 
    780780                sql += ") and ("; 
    781                 for (var z=0;z<friendly_filters.length-1;z++) { 
     781                for (var z=0;z<friendly_filters.length;z++) { 
    782782                    if (z != 0) { 
    783783                        if (sFilter.indexOf('ALL') != -1) 
     
    808808                while(rs.isValidRow()) { 
    809809                    var header = connector.unserialize(rs.field(0)); 
    810                     retorno+="##"+"local_"+rs.field(1)+"--"+"local_"+rs.field(1)+"--"+header["from"]["name"]+"--"+header["subject"]+"--"+header["udate"]+"--"+this.aux_convert_size(rs.field(3))+"--"+header["Unseen"]+header["Recent"]+header["Flagged"]+header["Draft"]+"--"+rs.field(2)+"##"; 
     810                    retorno+="##"+"local_"+rs.field(1)+"--"+header["from"]["name"]+"--"+header["subject"]+"--"+header["udate"]+"--"+this.aux_convert_size(rs.field(3))+"--"+header["Unseen"]+header["Recent"]+header["Flagged"]+header["Draft"]+"--"+rs.field(2)+"##"; 
    811811                    rs.next(); 
    812812                } 
  • trunk/expressoMail1_2/js/search.js

    r1631 r1747  
    482482                                         
    483483                                        var td1  = get_lang(td1).substr(get_lang(td1).length-1) == "*"?td1:get_lang(td1); 
     484                                        if ((tmp = translatedFolders.get(td1))) 
     485                                        { 
     486                                            td1 = tmp; 
     487                                        } 
    484488 
    485489                                        if(proxy_mensagens.is_local_folder(td1)) { 
  • trunk/expressoMail1_2/setup/phpgw_en.lang

    r1622 r1747  
    8282Do you want to block this e-mail?       expressoMail1_2 en      Do you want to block this e-mail? 
    8383Do you want to log the sent messages?   admin   en      Do you want to log the sent messages? 
     84Do you want to show common name instead of UID? expressoMail1_2 en      Do you want to show common name instead of UID? 
    8485Do you want to use the spam filter?     admin   en      Do you want to use the spam filter? 
    8586Do you wish to exclude the folder       expressoMail1_2 en      Do you wish to exclude the folder  
Note: See TracChangeset for help on using the changeset viewer.