Changeset 6528 for trunk


Ignore:
Timestamp:
06/15/12 17:00:17 (12 years ago)
Author:
gustavo
Message:

Ticket #2766 - Merge do branch das novas funcionalidaes para o trunk

Location:
trunk
Files:
45 edited
227 copied

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/.htaccess

    r6098 r6528  
    126126RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK|OPTIONS|HEAD)$ [NC] 
    127127RewriteRule ^.*$ - [F]  
     128RewriteRule ^rest(.*)$ prototype/rest/$1 [QSA,L] 
     129 
    128130 
    129131# 
  • trunk/admin/inc/class.uiconfig.inc.php

    r5988 r6528  
    1111  \**************************************************************************/ 
    1212 
     13require_once('prototype/api/config.php'); 
     14use prototype\api\Config as Config; 
    1315 
    1416        class uiconfig 
     
    337339                        /* Seta o valor padrão para a configuração de número máximo de marcadores */ 
    338340                        $current_config['expressoMail_limit_labels'] = (isset($current_config['expressoMail_limit_labels']) && !!$current_config['expressoMail_limit_labels'] ) ? $current_config['expressoMail_limit_labels'] : 20; 
     341                        //Pegar os todos os Atributos LDAP mapeados no arquivo user.ini 
     342                        $map = Config::get('user', 'OpenLDAP.mapping'); 
     343                        $validate = false;       
     344                        $options = "<option value=''>".lang('None')."</option>"; 
     345                        foreach($map as $value){ 
     346                                $options .= "<option value='".$value."'"; 
     347                                if($current_config['expressoMail_ldap_identifier_recipient'] == $value){ 
     348                                        $validate = true; 
     349                                        $options .= " selected='selected'"; 
     350                                } 
     351                                $options .= ">". $value . "</option>"; 
     352                        } 
     353 
     354                        if(!$validate){ 
     355                                // Limpa Atributo LDAP do banco de dados caso a atribuição não exista mais.      
     356                                $db = ''; 
     357                                $db = $db ? $db : $GLOBALS['phpgw']->db;        // this is to allow setup to set the db 
     358                                $db->query("DELETE FROM phpgw_config WHERE config_app = '".$appname."' AND config_name = 'expressoMail_ldap_identifier_recipient'"); 
     359                        } 
    339360                        /* Recupera o número mínimo de marcadores que pode ser definido */ 
    340361                        $db = ''; 
     
    420441                        $t->set_var('min_labels',$cont_labels); 
    421442                         
     443                        $t->set_var('rows_ldap_identifier',$options); 
    422444                        $t->pfp('out','body'); 
    423445 
  • trunk/admin/setup/phpgw_pt-br.lang

    r5988 r6528  
    565565There are users with an quantity greater than of markers. Respect the minimum number indicated. admin   pt-br   Existem usuários com uma quantidade superior de marcadores. Respeito o número mínimo indicado. 
    566566Minimum number of labels allowed        admin   pt-br   Número mínimo de marcadores permitido 
     567Identifier of the recipient of a message        admin   pt-br   Identificador do destinatário de uma mensagem 
     568LDAP attribute used to replacement      admin   pt-br   Atributo LDAP utilizado para substituição 
     569None    admin   pt-br   Nenhum 
  • trunk/expressoMail1_2/inc/class.db_functions.inc.php

    r6331 r6528  
    2424        include_once(PHPGW_API_INC.'/class.db.inc.php');  
    2525}  
    26 include_once('class.dynamic_contacts.inc.php'); 
    2726         
    2827class db_functions 
     
    249248 
    250249        //Gera lista de contatos para ser gravado e acessado pelo expresso offline. 
    251         function get_dropdown_contacts_to_cache() { 
     250        /*function get_dropdown_contacts_to_cache() { 
    252251                return $this->get_dropdown_contacts(); 
    253252        } 
     
    275274                } 
    276275                return $stringDropDownContacts;  
    277         } 
     276        }*/ 
    278277        function getUserByEmail($params){        
    279278                // Follow the referral 
     
    308307                return $result; 
    309308        } 
    310          
     309        /* 
    311310        function get_dynamic_contacts() 
    312311        {                                
     
    333332                return $contacts; 
    334333        } 
     334        */ 
     335        /* 
    335336        function update_contacts($contacts=array()) 
    336337        {                        
     
    364365                } 
    365366                return $contacts; 
    366         }        
     367        }       */ 
     368         
    367369        function update_preferences($params){ 
    368370                $string_serial = urldecode($params['prefe_string']);                             
     
    377379        } 
    378380         
     381        /* 
    379382        function insert_contact($contact)        
    380383        { 
     
    396399                $this->db->delete('phpgw_expressomail_contacts',$where,$line,$file);     
    397400        } 
    398          
     401        */  
    399402        function import_vcard($params){ 
    400403            include_once('class.imap_functions.inc.php'); 
  • trunk/expressoMail1_2/inc/class.imap_functions.inc.php

    r6487 r6528  
    30873087                    error_log("$now - $userip - $sent [$subject] - $userid => $addrs\r\n", 3, "/home/expressolivre/mail_senders.log"); 
    30883088                } 
    3089                 if ($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_dynamic_contacts']) { 
    3090                     $contacts = new dynamic_contacts(); 
    3091                     $new_contacts = $contacts->add_dynamic_contacts($toaddress . "," . $ccaddress . "," . $ccoaddress); 
    3092                     return array("success" => true, "new_contacts" => $new_contacts); 
    3093                 } 
    3094                  
    3095                    if($params['uids_save'] ) 
    3096                         $this->delete_msgs(array('folder'=> $params['save_folder'] , 'msgs_number' => $params['uids_save'])); 
     3089                if($params['uids_save'] ) 
     3090                                        $this->delete_msgs(array('folder'=> $params['save_folder'] , 'msgs_number' => $params['uids_save'])); 
    30973091                        
    3098                  
    30993092                //return array("success" => true, "folder" => $folder_list); 
    31003093                                return array("success" => true, "load" => $has_new_folder); 
  • trunk/expressoMail1_2/inc/class.ldap_functions.inc.php

    r6459 r6528  
    564564                        '<tr class="quicksearchcontacts_unselected">' . 
    565565                                '<td class="cc" width="1%">' . 
    566                                         '<a title="'.$this->functions->getLang("Write message").'" onClick="javascript:QuickSearchUser.create_new_message(\''.$contacts_result["cn"].'\', \''.$contacts_result["mail"].'\')">' . 
     566                                        '<a title="'.$this->functions->getLang("Write message").'" onClick="javascript:QuickSearchUser.create_new_message(\''.$contacts_result["cn"].'\', \''.$contacts_result["mail"].'\', \''.$contacts_result["uid"].'\')">' . 
    567567                                                $photo_link . 
    568568                                        '</a>' . 
     
    570570                                '<td class="cc">' . 
    571571                                        '<span name="cn">' . ($empNumber != "" ? $empNumber : $uid) . $contacts_result['cn'] . '</span>' . '<br>' . 
    572                                         '<a title="'.$functions->getLang("Write message").'" onClick="javascript:QuickSearchUser.create_new_message(\''.$contacts_result["cn"].'\', \''.$contacts_result["mail"].'\')">' . 
     572                                        '<a title="'.$functions->getLang("Write message").'" onClick="javascript:QuickSearchUser.create_new_message(\''.$contacts_result["cn"].'\', \''.$contacts_result["mail"].'\', \''.$contacts_result["uid"].'\')">' . 
    573573                                                '<font color=blue>' . 
    574574                                                '<span name="mail">' . $contacts_result['mail'] . '</span></a></font>'. 
  • trunk/expressoMail1_2/index.php

    r6487 r6528  
    3838                <script src="../prototype/plugins/farbtastic/farbtastic.js" language="javascript"></script> 
    3939                <script src="../prototype/api/datalayer.js" language="javascript"></script>                                      
     40                <script src="../prototype/api/rest.js" language="javascript"></script>                                   
    4041                <script type="text/javascript" src="../prototype/plugins/scrollto/jquery.scrollTo.js"></script> 
    41                 <script language="javascript">DataLayer.dispatchPath = "../prototype/";</script>                                         
     42                <script language="javascript"> 
     43                        DataLayer.dispatchPath = "../prototype/"; 
     44                        REST.dispatchPath = "../prototype/"; 
     45                        REST.load(""); 
     46                </script>                                        
    4247                <script src="../library/ckeditor/ckeditor.js" language="javascript" charset="utf-8"></script>  
    4348                <script src="../library/ckeditor/adapters/jquery.js" language="javascript"></script>  
     
    5661                <script type="text/javascript" src="../prototype/plugins/datejs/sugarpak.js"></script> 
    5762                <script type="text/javascript" src="../prototype/plugins/datejs/parser.js"></script> 
     63                <script type="text/javascript" src="../prototype/plugins/jq-raty/js/jquery.raty.min.js"></script> 
    5864 
    5965                <script type="text/javascript" src="../prototype/plugins/watermark/jquery.watermarkinput.js"></script> 
     
    7177                <script type="text/javascript" src="../prototype/modules/calendar/js/calendar.date.js"></script> 
    7278                <script type="text/javascript" src="../prototype/modules/calendar/js/calendar.codecs.js"></script> 
    73                  
    7479                <link rel="stylesheet" type="text/css" href="../prototype/plugins/freeow/style/freeow/freeow.css" > 
    7580                <script type="text/javascript" src="../prototype/plugins/freeow/jquery.freeow.min.js"></script> 
    7681                <script type="text/javascript" src="../prototype/plugins/freeow/jquery.freeow.js"></script> 
     82 
    7783 
    7884                <script src="js/rich_text_editor.js" type="text/javascript"></script> 
     
    197203        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['telephone_number'] = $GLOBALS['phpgw_info']['user']['telephonenumber']; 
    198204        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_cache'] = $current_config['expressoMail_enable_cache']; 
     205        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['expressoMail_ldap_identifier_recipient'] = $current_config['expressoMail_ldap_identifier_recipient']; 
    199206        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_x_origin'] = $current_config['expressoMail_use_x_origin']; 
    200207        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['number_of_contacts'] = $current_config['expressoMail_Number_of_dynamic_contacts'] ? $current_config['expressoMail_Number_of_dynamic_contacts'] : "0"; 
     
    218225        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['auto_create_local'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['auto_create_local'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['auto_create_local'] : "0"; 
    219226        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['return_recipient_deafault'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['return_recipient_deafault'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['return_recipient_deafault'] : "0"; 
    220  
    221227        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['quick_search_default'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['quick_search_default'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['quick_search_default'] : 1; 
    222228        //      ACL for block edit Personal Data. 
     
    277283    $_SESSION['phpgw_info']['server']['expressomail']['expressoMail_use_spam_filter'] = $current_config['expressoMail_use_spam_filter'];    
    278284    echo '<script> var use_spam_filter = \''.$current_config['expressoMail_use_spam_filter'].'\' 
    279            var sieve_forward_domains = \''.$current_config['expressoMail_sieve_forward_domains'].'\' </script>'; 
     285           var sieve_forward_domains = \''.$current_config['expressoMail_sieve_forward_domains'].'\'  
     286                  </script>'; 
    280287        // End Set Anti-Spam options. 
    281288 
  • trunk/expressoMail1_2/js/QuickCatalogSearch.js

    r6480 r6528  
    290290                        var signal = "+"; 
    291291                        var btnClass = "add"; 
    292                         var emailList = content.find(field_).val(); 
    293                         var emails_adicionados = emailList.split(","); 
     292                        emails_adicionados = ""; 
     293                        var emailList = content.find(field_).filter("input").parent().find("div input"); 
     294                        //      var array = content.find(".to-tr").find(".box"); 
     295                        $.each(emailList, function(index, value){ 
     296                                emails_adicionados += $(value).val() + ","; 
     297                        }); 
     298                        emails_adicionados = emails_adicionados.split(","); 
    294299                        for(aux=0; aux<emails_adicionados.length -1; aux++) { 
    295300                                if(emails_adicionados[aux].match(/<([^<]*)>[\s]*$/)){ 
     
    697702                var nome = $(contact).clone().find('.name').text(); 
    698703                var email = $(contact).clone().find('.email').text(); 
    699                  
    700704                if(email == get_lang("No mail")){ 
    701705                        alert(get_lang("It is not possible to add this contact as a recipient because it does not have email")); 
     
    704708                        return; 
    705709                } 
    706                  
    707710                verifyEmails(email, divs); 
    708                  
    709                 final_contact = "\""+nome +"\" <"+email+">, "; 
    710                  
    711                 var emailList      = content.find(field_).val(); 
    712                 //remove os caracteres da busca 
    713                 emailList = emailList.substr(0,emailList.lastIndexOf(',')+1);  
    714                  
    715         if (emailList[0] != '"' && emailList.indexOf(",") < 0) 
    716                         emailList = emailList.substr(end_); 
    717         if(emailList.lastIndexOf(",") > 0){ 
    718                 if(emailList.substr(emailList.length-1, emailList.length) == "," || emailList.substr(emailList.length-2, 1) == ","){ 
    719                         emailList = emailList.substr(0, emailList.lastIndexOf(",") + 1); 
    720                 } else { 
    721                         emailList = emailList.substr(0, emailList.lastIndexOf("") + 1);          
    722                         final_contact = ","+final_contact; 
     711                final_contact = "\""+nome +"\" <"+email+">"; 
     712 
     713                final_contact = final_contact.replace(/\/n/, "");  
     714                var index = parseInt(divs.split("_")[1])-1; 
     715                if(data_[index].type_contact == "G"){ 
     716                        var ldap_id = preferences.expressoMail_ldap_identifier_recipient; 
     717                        if(ldap_id){ 
     718                                draw_email_box( 
     719                                        (data_[index][ldap_id.toLowerCase()] ? data_[index][ldap_id.toLowerCase()][0] : final_contact) 
     720                                        , content.find(field_).filter("input") 
     721                                ); 
     722                        }else{ 
     723                                draw_email_box(final_contact, content.find(field_).filter("input")); 
     724                        } 
     725                }else{ 
     726                        draw_email_box((data_[index].id_contact ? data_[index].id_contact : data_[index].id), content.find(field_).filter("input"), (data_[index].id_contact ? true : "G")); 
    723727                } 
    724         } 
    725  
    726                 final_contact = final_contact.replace(/\/n/, ""); 
    727                 new_emailList = emailList + final_contact;     
    728         content.find(field_).val(new_emailList); 
    729                  
    730                 content.find(field_).trigger("update"); 
    731                  
    732728                button.onclick = function(){ 
    733729                        remove_contact_field(document.getElementById(divs).innerHTML, button, divs); 
    734730                }; 
    735731                var div = document.getElementById(divs); 
    736                  
    737732                div.ondblclick = function(){ 
    738733                        remove_contact_field(div.innerHTML, button, divs); 
    739734                }; 
    740                  
    741735                button.innerHTML = '<span class="ui-button-text" style="">x</span>'; 
    742736    } 
     
    748742        function remove_contact_field(contact, button, divs) { 
    749743                var email = $(contact).clone().find('.email').text(); 
    750                 var exist = false; 
    751                  
    752                 var emailList = content.find(field_).val(); 
    753                 var emails_adicionados = emailList.split(","); 
    754                  
    755                 verifyEmails(email, divs); 
    756                  
    757                 for(i=0; i<emails_adicionados.length -1; i++) { 
    758  
    759                         if(emails_adicionados[i].match(/<([^<]*)>[\s]*$/)){ 
    760                                 if(emails_adicionados[i].match(/<([^<]*)>[\s]*$/)[1].toLowerCase() == email.toLowerCase()) { 
    761                                         emails_adicionados[i] = "%"; 
    762                                         exist = true; 
    763                                 } 
    764                         }else{ 
    765                                 if(emails_adicionados[i].toLowerCase() == email.toLowerCase()) { 
    766                                         emails_adicionados[i] = "%"; 
    767                                         exist = true; 
    768                                 } 
    769                         } 
    770                 } 
    771                  
    772                 if (exist == false)  
    773                         return false; 
    774                 var novos_contatos = emails_adicionados.join(",");   
    775                 novos_contatos = novos_contatos.replace(/%,/g, ""); 
    776                 content.find(field_).val(novos_contatos); 
    777                  
     744                var array = content.find(field_).parent().find("div input"); 
     745                $.each(array, function(index, value){ 
     746                        var validated_email = $(value).val(); 
     747                        if(validated_email.match(/<([^<]*)>[\s]*$/)){ 
     748                                if(validated_email.match(/<([^<]*)>[\s]*$/)[1].toLowerCase() == email.toLowerCase()) { 
     749                                        $(value).parent().remove(); 
     750                                } 
     751                        } 
     752                }); 
     753         
    778754                button.onclick = function(){ 
    779755                        add_contact_field(document.getElementById(divs).innerHTML, button, divs); 
    780756                }; 
    781                  
    782757                var div = document.getElementById(divs); 
    783                  
    784758                div.ondblclick = function(){ 
    785759                        add_contact_field(div.innerHTML, button, divs); 
    786760                }; 
    787                  
    788                 content.find(field_).trigger("update"); 
    789761                button.innerHTML = '<span class="ui-button-text" style="">+</span>'; 
    790762        } 
  • trunk/expressoMail1_2/js/QuickSearchUser.js

    r5477 r6528  
    5353        } 
    5454         
    55         emQuickSearchUser.prototype.create_new_message = function (cn, mail) 
     55        emQuickSearchUser.prototype.create_new_message = function (cn, mail, uid) 
    5656        { 
    5757                QuickSearchUser.closeWindow(); 
     58                var ldap_id = preferences.expressoMail_ldap_identifier_recipient; 
    5859                 
    59                 if (openTab.type[currentTab] != 4) 
    60                 { 
    61                         Element("msg_number").value = "\""+cn+"\" <"+mail+">"; 
     60                if (openTab.type[currentTab] != 4){ 
    6261                        new_message("new","null"); 
    6362                } 
    64                 else 
    65                 { 
    66                         var ToField = Element('to_'+currentTab); 
    67                         ToField.value = ToField.value +"\""+cn+"\" <"+mail+">,"; 
     63                 
     64                if(ldap_id){ 
     65                        draw_email_box(uid, $("#content_id_"+currentTab).find(".to").filter("input"));  
     66                }else{ 
     67                        draw_email_box("\""+cn+"\" <"+mail+">", $("#content_id_"+currentTab).find(".to").filter("input"));  
    6868                } 
    6969        } 
  • trunk/expressoMail1_2/js/ccQuickAdd.js

    r6341 r6528  
    3333                                                                                data = data + $(this).find('#quickAddOne_firstName').val() + ','; 
    3434                                                                                data = data + $(this).find('#quickAddOne_lastName').val() + ',,'; 
    35                                                                                 data = data + $(this).find('#quickAddOne_email').val();  
     35                                                                                data = data + $(this).find('#quickAddOne_email').val(); 
    3636                                                                                if(ccQuickAddOne.send(data)) 
    3737                                                                                        $(this).dialog("close"); 
     
    102102                 
    103103                connector.newRequest('cQuickAdd.Send', CC_url+'quick_add', 'POST', handler, sdata); 
     104                 
     105                updateDynamicPersonalContacts(); 
     106                updateDynamicContactList(); 
    104107                return true; 
    105108        } 
  • trunk/expressoMail1_2/js/common_functions.js

    r6291 r6528  
    775775} 
    776776 
    777 function search_emails(value){ 
     777function search_emails(value, data){ 
    778778        var resize = false; 
    779779        resize = resize_borders(); 
     
    815815        connector.loadScript("search"); 
    816816        if (typeof(EsearchE) == 'undefined' || typeof(ttree) == 'undefined'){ 
    817                 setTimeout("search_emails('"+value+"')",500); 
     817                setTimeout("search_emails('"+value+"', '"+data+"')",500); 
    818818                return false; 
    819819        } 
    820         EsearchE.showForms(value); 
     820        EsearchE.showForms(value, data); 
    821821        $("#em_message_search").val(""); 
    822822        } 
  • trunk/expressoMail1_2/js/doiMenuData.js

    r5866 r6528  
    195195        items: menuToolsItems 
    196196}); 
    197  
     197var reComplexEmail = /<([^<]*)>[\s]*$/; 
     198$.contextMenu({ 
     199        selector: ".box", 
     200        autoHide:true, 
     201        items: { 
     202                "add" : {name:"Adicao Rapida", icon : "quick-add",callback: function(key, opt){ var fname = $(opt.$trigger).find("input").val().split('"')[1];ccQuickAddOne.showList(','+fname+', ,'+$.trim($(opt.$trigger).find("input").val()).match(reComplexEmail)[1]); }}, 
     203                "remove" : {name:"Remover Destinatario", icon:"delete-box",callback: function(key, opt){ $(opt.$trigger).remove(); }}, 
     204                "sep1": "---------", 
     205                "quick_search" : {name:"Busca Rapida de Mensagens", icon: "quick-search-contact",callback: function(key, opt){ search_emails($.trim($(opt.$trigger).find("input").val()).match(reComplexEmail)[1]); }}, 
     206                "full_search" : {name:"Buscar Mensagens de ...", icon: "quick-search-contact",callback: function(key, opt){ search_emails("", $.trim($(opt.$trigger).find("input").val()).match(reComplexEmail)[1]);}}           
     207        } 
     208}); 
    198209 
    199210function updateLabelsColumn(messageInfo) { 
     
    294305} 
    295306 
    296  
    297  
    298  
    299  
    300  
    301  
     307function loadExtraLDAPBox(data, element){ 
     308        menuItensLabel = {}; 
     309        menuItensLabel["Name"] = {name: "<b>"+data[0].value+"</b>", disabled: true};             
     310        menuItensLabel["Email"] = {name: data[1].value, disabled: true};         
     311        if(data[2].value){ 
     312                menuItensLabel["TelefoneLabel"] = {name: "<b>Telefone</b>", disabled: true}; 
     313                menuItensLabel["TelefoneValue"] = {name: data[2].value, disabled: true}; 
     314        } 
     315        $.contextMenu({ 
     316                selector: "#content_id_"+currentTab+" "+element+" .box-info", 
     317                trigger: 'hover', 
     318                delay:100, 
     319                autoHide:true, 
     320                items: menuItensLabel 
     321        });      
     322} 
     323 
     324function loadGroupBox(data, element){ 
     325        menuItensLabel = {}; 
     326        menuItensLabel["ContactGroupLabelAll"] = {name:"<b>Contatos do Grupo</b>", disabled: true}; 
     327        menuItensLabel["sep1"] = "---------"; 
     328        if(data.itens){ 
     329                var aux = 0; 
     330                for(var item in data.itens){ 
     331                        if(parseInt(item) <= 4){ 
     332                                menuItensLabel["ContactGroupLabel"+item] = {name: "<b>"+data.itens[item].data[0].value+"</b>", disabled: true}; 
     333                                menuItensLabel["ContactGroupValue"+item] = {name: data.itens[item].data[2].value, disabled: true}; 
     334                        }else{ 
     335                                aux++; 
     336                                if(aux == 1) 
     337                                        menuItensLabel["MoreContactGroupValue"] = {name : "E mais "+aux+" contato...", disabled: true }; 
     338                                else 
     339                                        menuItensLabel["MoreContactGroupValue"] = {name : "E mais "+aux+" contatos...", disabled: true }; 
     340                        } 
     341                } 
     342        } 
     343        $.contextMenu({ 
     344                selector: "#content_id_"+currentTab+" "+element+" .box-info", 
     345                trigger: 'hover', 
     346                delay:100, 
     347                autoHide:true, 
     348                items: menuItensLabel 
     349        });      
     350} 
     351 
     352 
     353 
     354 
     355 
  • trunk/expressoMail1_2/js/draw_api.js

    r6487 r6528  
    14951495                if ((headers_msgs.Forwarded == 'F')  || (headers_msgs.Draft == 'X' && headers_msgs.Answered == 'A')){ 
    14961496                        td_element21.onclick=function(){search_emails(headers_msgs.subject.replace(/^(re: ?|fw: ?|enc: ?|res: ?|fwd: ?)*/gi,''),true);}; 
    1497                         td_element21.innerHTML = "<img src ='templates/"+template+"/images/forwarded.gif' title='"+get_lang('Forwarded')+"'>"; 
     1497                        td_element21.innerHTML = "<img src ='templates/"+template+"/images/forwarded.png' title='"+get_lang('Forwarded')+"'>"; 
    14981498                        headers_msgs.Draft = '' 
    14991499                        headers_msgs.Answered = ''; 
     
    15011501                } 
    15021502                else if (headers_msgs.Draft == 'X') 
    1503                         td_element21.innerHTML = "<img src ='templates/"+template+"/images/draft.gif' title='"+get_lang('Draft')+"'>"; 
     1503                        td_element21.innerHTML = "<img src ='templates/"+template+"/images/draft.png' title='"+get_lang('Draft')+"'>"; 
    15041504                else if (headers_msgs.Answered == 'A'){ 
    15051505                        td_element21.onclick=function(){search_emails(headers_msgs.subject.replace(/^(re: ?|fw: ?|enc: ?|res: ?|fwd: ?)*/gi,''),true);}; 
    1506                         td_element21.innerHTML = "<img src ='templates/"+template+"/images/answered.gif' title='"+get_lang('Answered')+"'>"; 
     1506                        td_element21.innerHTML = "<img src ='templates/"+template+"/images/answered.png' title='"+get_lang('Answered')+"'>"; 
    15071507                    }else 
    15081508                        td_element21.innerHTML = "&nbsp;&nbsp;&nbsp;"; 
     
    35403540} 
    35413541 
    3542 function input_binds(input, ID){ 
    3543         var mySource = new Array(); 
    3544         var myArray = contacts.split(","); 
    3545         for(var i in myArray){ 
    3546                 var teste = myArray[i].split(";"); 
    3547                 if(teste.length > 1) 
    3548                         mySource.push({name : teste[0], email: teste[1], value : (teste[0] +" - "+teste[1])}); 
    3549                 else 
    3550                         mySource.push({name : "", email: teste[0], value :teste[0]}); 
    3551         } 
    3552         input.bind( "keydown", function( event ) { 
    3553                 if ( event.keyCode === $.ui.keyCode.TAB && $( this ).data( "autocomplete" ).menu.active ) { 
    3554                         event.preventDefault(); 
    3555                 } 
    3556                 if((event.keyCode) == 120){ 
     3542//DESENHO DAS CAIXA DE EMAIL 
     3543function draw_email_box(input_data, location, personal){ 
     3544        if($.trim(input_data) != ""){ 
     3545                var box_data = valid_emails(input_data); 
     3546                DataLayer.render("../prototype/modules/mail/templates/emailBox.ejs", box_data, function(html){ 
     3547                        var newBox = location.before(html).prev(); 
     3548                        box_actions(newBox); 
     3549                        if((preferences.expressoMail_ldap_identifier_recipient || personal)&& $(newBox).hasClass("invalid-email-box")){ 
     3550                                //$(newBox).find(".loading").css("background-image", "../prototype/modules/mail/img/ajax-loader.gif"); 
     3551                                show_detais(newBox, input_data, personal); 
     3552                        }else{ 
     3553                                $(newBox).find(".box-loading").remove(); 
     3554                        } 
     3555                }); 
     3556        } 
     3557} 
     3558 
     3559function valid_emails(email){ 
     3560        var ContactBox = {name:"", email:"", valid : false}; 
     3561        var reSimpleEmail = /^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[_a-z0-9-]+(\.[_a-z0-9-]+)+$/; 
     3562        var reComplexEmail = /<([^<]*)>[\s]*$/; 
     3563        var validation = email.split('"'); 
     3564         
     3565        //FUNÇÃO QUE VALIDA OS DADOS QUANDO O EMAIL É DIGITADO COM ("NOME SOBRENOME" <Email@dominio.com>) 
     3566        var complexValidation = function(complexMail){ 
     3567                var Objct = {}; 
     3568                if($.trim(complexMail[1]).match(reComplexEmail)){ 
     3569                        if($.trim(complexMail[1]).match(reComplexEmail).length){ 
     3570                                Objct['email'] = $.trim(complexMail[1]).match(reComplexEmail)[1]; 
     3571                        } 
     3572                }else{ 
     3573                        Objct['email'] = $.trim(complexMail[1]); 
     3574                } 
     3575                Objct['name'] = complexMail[0]; 
     3576                Objct['valid'] = reSimpleEmail.test(Objct['email'].toLowerCase()); 
     3577                return Objct; 
     3578        } 
     3579        switch (validation.length) { 
     3580                //PEGA TODO O CONTEUDO E SETA COMO SE FOSSE O EMAIL 
     3581                case 1: 
     3582                        validation.unshift(""); 
     3583                        ContactBox = complexValidation(validation); 
     3584                        break; 
     3585                //CORRIGI ERRO DE DIGITAÇÃO COMO ( huahua"<huhau@hauhau.com>) ou (hahahaha"huahua@email.com) ou ainda (hahahaha"huahua@ema  il.com) 
     3586                case 2:  
     3587                        ContactBox = complexValidation(validation); 
     3588                        break; 
     3589                //RECEBE O EMAIL CORRETAMENTE SÓ VALIDA POSSIVEIS ERROS COMO O DE CIMA E OS CORRIGI CASO ACONTEÇAM 
     3590                case 3: 
     3591                        //RETIRA O PRIMEIRO INDICE QUE FICOU "INUTIL" 
     3592                        validation.shift(); 
     3593                        ContactBox = complexValidation(validation); 
     3594                        break; 
     3595                //SE EXISTIREM MAIS DO QUE 2 (") 
     3596                default: 
     3597                        if($.trim(validation[validation.length-1]).match(reComplexEmail)){ 
     3598                                if($.trim(validation[validation.length-1]).match(reComplexEmail).length){ 
     3599                                        ContactBox.mail = $.trim(validation[validation.length-1]).match(reComplexEmail)[1]; 
     3600                                } 
     3601                        }else{ 
     3602                                ContactBox.mail = $.trim(complexMail[1]); 
     3603                        } 
     3604                        ContactBox.valid = reSimpleEmail.test(ContactBox.mail.toLowerCase());    
     3605        } 
     3606        return ContactBox; 
     3607} 
     3608 
     3609//EVENTO DOS INPUTS PARA - CC - CCO 
     3610function input_keydowns(input, ID){ 
     3611        var f9 = false; 
     3612        input.keydown(function(e){ 
     3613                f9 = false; 
     3614                var focusing = input.parent().find(".email-text"); 
     3615                //SE OS CONTATOS DINAMICOS ESTAO ATIVOS 
     3616                if(parseInt(preferences.use_dynamic_contacts) && !input.hasClass("box-input")){ 
     3617                        //SELECIONA O CONTATO E EVITA OUTROS COMANDOS 
     3618                        if ( e.keyCode === $.ui.keyCode.TAB && $( this ).data( "catcomplete" ).menu.active ) { 
     3619                                e.preventDefault(); 
     3620                                return false; 
     3621                        }                
     3622                         
     3623                        //FECHA OS CONTATOS DINÂMICOS 
     3624                        if( (e.keyCode == 27) && $( this ).data( "catcomplete" ).menu.active ){ 
     3625                                   e.stopPropagation(); 
     3626                                   e.preventDefault(); 
     3627                        } 
     3628                         
     3629                        //SELECIONA O CONTATO E EVITA OUTROS COMANDOS 
     3630                        if(e.keyCode == $.ui.keyCode.ENTER && $( this ).data( "catcomplete" ).menu.active){ 
     3631                                e.preventDefault(); 
     3632                                return false; 
     3633                        } 
     3634                         
     3635                        if(e.keyCode == $.ui.keyCode.DELETE && $( this ).data( "catcomplete" ).menu.active){ 
     3636                                if($($( this ).data( "catcomplete" ).menu.element).find(".ui-state-hover").parents("li:first").hasClass("dynamic-recent")) 
     3637                                        $($( this ).data( "catcomplete" ).menu.element).find(".ui-state-hover").next().trigger("click"); 
     3638                                return false; 
     3639                        } 
     3640                } 
     3641                //BUSCA COM A TECLA F9 
     3642                if((e.keyCode) == 120){ 
     3643                        f9 = true; 
    35573644                        emQuickSearch($(this).val(), "."+$(this).parents("tr:first").attr('class').split("-")[0], ID, undefined, true); 
    3558                 }else if( (event.keyCode == 27) && $( this ).data( "autocomplete" ).menu.active ){ 
    3559                            event.stopPropagation(); 
    3560                event.preventDefault(); 
    3561                 } 
    3562         }).autocomplete({ 
    3563                 minLength: 0,                    
    3564                 source: function( request, response ) { 
    3565                         response( $.ui.autocomplete.filter( 
    3566                                 mySource, extractLast( request.term ) ) ); 
     3645                        e.preventDefault(); 
     3646                        return false; 
     3647                } 
     3648 
     3649                //AO DIGITAR ENTER, ";", "," "  " 
     3650                if(e.keyCode == 13 || e.keyCode == 9 || (e.keyCode == 188 && !e.shiftKey) || (e.keyCode == 191 && !e.shiftKey) ){ 
     3651                        if(e.keyCode == 13){ 
     3652                                e.preventDefault(); 
     3653                        } 
     3654                        if(input.val() != ""){ 
     3655                                if(e.keyCode != 9) 
     3656                                        e.preventDefault(); 
     3657                                draw_email_box(input.val(), input); 
     3658                                if(input.hasClass("box-input")){ 
     3659                                        input.remove(); 
     3660                                        focusing.focus(); 
     3661                                        return; 
     3662                                } 
     3663                        } 
     3664                        if(input.length) 
     3665                                input.val(""); 
     3666                } 
     3667                if((e.keyCode == 8 || e.keyCode == 37) && input.val() == "" && input.prev().hasClass("box")){ 
     3668                        e.preventDefault(); 
     3669                        input.prev().focus(); 
     3670                        return; 
     3671                } 
     3672                //AO DIGITAR " " 
     3673                if(e.keyCode == 32){ 
     3674                        if(!input.val().length){ 
     3675                                e.preventDefault(); 
     3676                                return; 
     3677                        }else{ 
     3678                                var texto = input.val(); 
     3679                                texto = texto.substring(0, getPosition(input[0])); 
     3680                                if(texto.split('"').length-1 == 0){ 
     3681                                        if(input.val().split('"').length-1 == 0){ 
     3682                                                e.preventDefault(); 
     3683                                                e.stopPropagation(); 
     3684                                                draw_email_box(input.val(), input); 
     3685                                                input.val(""); 
     3686                                                if(input.hasClass("box-input")){ 
     3687                                                        input.remove(); 
     3688                                                        focusing.focus(); 
     3689                                                        return; 
     3690                                                } 
     3691                                                return; 
     3692                                        } 
     3693                                } 
     3694                        } 
     3695                } 
     3696                //AO DIGITAR ">" 
     3697                if(e.keyCode == 190 && e.shiftKey && input.val().length == getPosition(input[0])){ 
     3698                        input.val(input.val()+">"); 
     3699                        draw_email_box(input.val(), input); 
     3700                        e.preventDefault(); 
     3701                        input.val(""); 
     3702                        if(input.hasClass("box-input")){ 
     3703                                input.remove(); 
     3704                                focusing.focus(); 
     3705                                return; 
     3706                        } 
     3707                } 
     3708                 
     3709                //INPUT AUTO RESIZE      
     3710                setTimeout(function(){ 
     3711                        input.css("width", 15+(input.val().length * 9));         
     3712                        input.parent().scrollTo(":last");        
     3713                }, 100); 
     3714        }) 
     3715        //AO SAIR DO FOCO MONTAGEM DA CAIXA DE EMAIL 
     3716        .focusout(function(){ 
     3717                if(!$(this).data('is_open')){ 
     3718                        if(!(f9 || $(this).parents("tr:first").find("button").hasClass("ui-state-active"))){ 
     3719                                if($(input).val() != "") 
     3720                                        draw_email_box(input.val(), input); 
     3721                                if(input.hasClass("box-input")) 
     3722                                        input.remove(); 
     3723                        } 
     3724                 
     3725                        input_search = $(input).val(); 
     3726                        $(input).val(""); 
     3727                } 
     3728        }) 
     3729        //AO COLAR UM TEXTO NO CAMPO 
     3730        .bind("paste", function(e){ 
     3731                $(this).trigger("keydown"); 
     3732                var pthis = $(this); 
     3733                setTimeout(function() { 
     3734                        var str = pthis.val().replace(/[,;\t\n]/gi, ","); 
     3735                        str = str.split(","); 
     3736                        $.each(str, function(index, value){ 
     3737                                draw_email_box(value, pthis); 
     3738                        }); 
     3739                        pthis.val(""); 
     3740                }, 50); 
     3741        }); 
     3742        //SE FOR EDIÇÃO DE EMAILS RECALCULA O INPUT E SETA O FOCO 
     3743        if(input.hasClass("box-input")){ 
     3744                input.trigger("keydown"); 
     3745                input.focus(); 
     3746        } 
     3747} 
     3748var input_search = ""; 
     3749//EVENTOS DA CAIXA 
     3750function box_actions(box){ 
     3751        //AO PRESSIONAR UMA TECLA COM A CAIXA SELECIONADA        
     3752        box.keydown(function(e){ 
     3753                switch (e.keyCode) { 
     3754                        case $.ui.keyCode.LEFT: 
     3755                                //VERIFICA SE EXISTE ALGUMA CAIXA A ESQUERDA 
     3756                                if($(this).prev().hasClass("box")) 
     3757                                        $(this).removeClass("box-selected").prev().focus(); 
     3758                                break; 
     3759                        case $.ui.keyCode.RIGHT: 
     3760                                //VERIFICA SE EXISTE ALGUMA CAIXA A DIREITA  
     3761                                if($(this).next().hasClass("box")) 
     3762                                        $(this).removeClass("box-selected").next().focus(); 
     3763                                //SENAO FOCO O INPUT DO EMAIL 
     3764                                else 
     3765                                        $(this).removeClass("box-selected").next().focus(); 
     3766                                break; 
     3767                        case $.ui.keyCode.HOME: 
     3768                                //SELECIONO A PRIMEIRA CAIXA 
     3769                                e.preventDefault(); 
     3770                                $(this).parents(".email-area").find("div:first").focus(); 
     3771                                break; 
     3772                        case $.ui.keyCode.END: 
     3773                                //SELECIONO A ULTIMA CAIXA 
     3774                                e.preventDefault(); 
     3775                                $(this).parents(".email-area").find("div:last").focus(); 
     3776                                break; 
     3777                        case $.ui.keyCode.DELETE: 
     3778                                //VERIFICA SE EXISTE ALGUMA CAIXA A DIREITA 
     3779                                if($(this).next().hasClass("box")) 
     3780                                        $(this).next().focus(); 
     3781                                //SENAO FOCO O INPUT DO EMAIL 
     3782                                else 
     3783                                        $(this).next().focus(); 
     3784                                //REMOVO ESTA CAIXA 
     3785                                $(this).remove(); 
     3786                                break; 
     3787                        case $.ui.keyCode.BACKSPACE: 
     3788                                //VERIFICA SE EXISTE ALGUMA CAIXA A ESQUERDA 
     3789                                if($(this).prev().hasClass("box")) 
     3790                                        $(this).removeClass("box-selected").prev().focus(); 
     3791                                //SENAO HOUVER VERIFICA SE EXISTE ALGUMA CAIXA A DIREITA 
     3792                                else if($(this).next().hasClass("box")) 
     3793                                        $(this).next().focus(); 
     3794                                //SENAO HOUVER NEM A DIREITA NEM A ESQUERDA SETO O FOCO NO INPUT DO EMAIL 
     3795                                else 
     3796                                        $(this).next().focus(); 
     3797                                //REMOVO ESTA CAIXA      
     3798                                $(this).remove(); 
     3799                                e.preventDefault(); 
     3800                                break; 
     3801                        case $.ui.keyCode.ENTER: 
     3802                                e.preventDefault(); 
     3803                                $(this).trigger("dblclick"); 
     3804                                break; 
     3805                } 
     3806        }) 
     3807        //AO FAZER UM DUPLO CLICK NA CAIXA 
     3808        .dblclick(function(e){ 
     3809                var input = $(this).find("input").clone(); 
     3810                input.css("display" , "inline-block"); 
     3811                $(this).before(input); 
     3812                input_keydowns(input, currentTab); 
     3813                $(this).remove(); 
     3814        //CLICK SIMPLES NA CAIXA 
     3815        }).click(function(){ 
     3816                $(this).focus(); 
     3817        //AO DAR O FOCO NA CAIXA 
     3818        }).focus(function(){ 
     3819                $(this).parent().find("div").removeClass("box-selected"); 
     3820                $(this).addClass("box-selected"); 
     3821        }).focusout(function(){ 
     3822                $(this).removeClass("box-selected"); 
     3823        }).draggable({ 
     3824                revert: 'invalid', 
     3825                helper : 'clone', 
     3826                stack: "body", 
     3827                containment : ".new-msg-head-data", 
     3828                start: function(e, ui){ 
     3829                        $(this).parent().droppable( "disable" ); 
    35673830                }, 
    3568                 focus: function() { 
    3569                         return false; 
    3570                 }, 
    3571                 select: function( event, ui ) { 
    3572                         var terms = mySplit( this.value ); 
    3573                         terms.pop(); 
    3574                         terms.push( (ui.item.name != "" ? "\""+ui.item.name+"\" " : "") + (ui.item.email ? "<"+ui.item.email+">" : "")); 
    3575                         terms.push( "" ); 
    3576                         this.value = terms.join( ", " ); 
    3577                         return false; 
    3578                 }, 
    3579                 autoFocus: true 
    3580         }).data( "autocomplete" )._renderItem = function( ul, item ) { 
    3581                 ul.css({"max-height" : "115px", "overflow-y" : "auto"}); 
    3582                 if( $(ul).find("li").length > 10 ){ 
    3583                         return; 
    3584                 } 
    3585                 return $( "<li></li>" ) 
    3586                         .data( "item.autocomplete", item ) 
    3587                         .append( "<a>" + item.name + " - " + item.email + "</a>" ) 
    3588                         .appendTo( ul ); 
    3589         }; 
    3590         input.parents("tr:first").find("button").button().click(function(){ 
    3591                 emQuickSearch($(this).parents("tr:first").find("textarea").val(), "."+$(this).parents("tr:first").attr('class').split("-")[0], ID, undefined, true); 
     3831                stop : function(e, ui){ 
     3832                        $(this).parent().droppable( "enable" ); 
     3833                } 
     3834        }); 
     3835} 
     3836 
     3837//MOSTRA OS DETALHES DAS CAIXA DE EMAIL NOS CAMPOS PARA - CC - CCO 
     3838function show_detais(box, value, personal){ 
     3839        var ldap_id = preferences.expressoMail_ldap_identifier_recipient; 
     3840        var group = (personal != undefined ? (personal == "G" ? true : false) : false); 
     3841         
     3842        if(group){ 
     3843                REST.get("/group/"+value, {}, function(data){ 
     3844                        if(!data.error){ 
     3845                                if(data.collection.error) 
     3846                                        box.find(".box-loading").remove(); 
     3847                                else{ 
     3848                                        //box.find(".box-loading").css("background-image", "url(templates/default/images/information.png) no-repeat! !important"); 
     3849                                        box.find(".box-loading").removeClass("box-loading").addClass("box-info"); 
     3850                                        box.addClass("box-"+value).removeClass("invalid-email-box"); 
     3851                                        loadGroupBox(data.collection, ".box-"+value); 
     3852                                        box.unbind("dblclick").bind("dblclick", function(e){ 
     3853                                                new $.Zebra_Dialog('<strong>Impossivel editar</strong> um contato do catálogo pessoal\n' + 
     3854                                                        '<strong>Porém</strong> é possivel remove-lo', { 
     3855                                                        'buttons':  false, 
     3856                                                        'modal': false, 
     3857                                                        'position': ['right - 20', 'top + 20'], 
     3858                                                        'auto_close': 3000 
     3859                                                }); 
     3860                                        }).find(".box-input").val("\""+data.collection.data[1].value+"\" <"+data.collection.data[1].value+">"); 
     3861                                        box.find(".email-box-value").html( (data.collection.data[1].value.length > 18 ? data.collection.data[1].value.substring(0, 15)+"...": data.collection.data[1].value)) 
     3862                                } 
     3863                        }else{ 
     3864                                box.find(".box-loading").remove(); 
     3865                        } 
     3866                }); 
     3867                return; 
     3868        } 
     3869         
     3870        if(personal){ 
     3871                REST.get("/contact/"+value, {}, function(data){ 
     3872                        if(!data.error){ 
     3873                                if(data.collection.error) 
     3874                                        box.find(".box-loading").remove(); 
     3875                                else{ 
     3876                                        //box.find(".box-loading").css("background-image", "url(templates/default/images/information.png) no-repeat! !important"); 
     3877                                        box.find(".box-loading").removeClass("box-loading").addClass("box-info"); 
     3878                                        box.addClass("box-"+value).removeClass("invalid-email-box"); 
     3879                                        loadExtraLDAPBox(data.collection.data, ".box-"+value); 
     3880                                        box.unbind("dblclick").bind("dblclick", function(e){ 
     3881                                                new $.Zebra_Dialog('<strong>Impossivel editar</strong> um contato do catálogo pessoal\n' + 
     3882                                                        '<strong>Porém</strong> é possivel remove-lo', { 
     3883                                                        'buttons':  false, 
     3884                                                        'modal': false, 
     3885                                                        'position': ['right - 20', 'top + 20'], 
     3886                                                        'auto_close': 3000 
     3887                                                }); 
     3888                                        }).find(".box-input").val("\""+data.collection.data[0].value+"\" <"+data.collection.data[1].value+">"); 
     3889                                        box.find(".email-box-value").html( (data.collection.data[0].value.length > 18 ? data.collection.data[0].value.substring(0, 15)+"...": data.collection.data[0].value)) 
     3890                                } 
     3891                        }else{ 
     3892                                box.find(".box-loading").remove(); 
     3893                        } 
     3894                }); 
     3895                return; 
     3896        } 
     3897         
     3898        REST.get("/usersldap", {field : ldap_id,value: value}, function(data){ 
     3899                if(!data.error){ 
     3900                        if(data.collection.error) 
     3901                                box.find(".box-loading").remove(); 
     3902                        else{ 
     3903                                //box.find(".box-loading").css("background-image", "url(templates/default/images/information.png) no-repeat! !important"); 
     3904                                box.find(".box-loading").removeClass("box-loading").addClass("box-info"); 
     3905                                box.addClass("box-"+value).removeClass("invalid-email-box"); 
     3906                                loadExtraLDAPBox(data.collection.itens[0].data, ".box-"+value); 
     3907                                box.unbind("dblclick").bind("dblclick", function(e){ 
     3908                                        new $.Zebra_Dialog('<strong>Impossivel editar</strong> um contato do catálogo geral\n' + 
     3909                                                '<strong>Porém</strong> é possivel remove-lo', { 
     3910                                                'buttons':  false, 
     3911                                                'modal': false, 
     3912                                                'position': ['right - 20', 'top + 20'], 
     3913                                                'auto_close': 3000 
     3914                                        }); 
     3915                                }).find(".box-input").val("\""+data.collection.itens[0].data[0].value+"\" <"+data.collection.itens[0].data[1].value+">"); 
     3916                                box.find(".email-box-value").html( (data.collection.itens[0].data[0].value.length > 18 ? data.collection.itens[0].data[0].value.substring(0, 15)+"...": data.collection.itens[0].data[0].value)) 
     3917                        } 
     3918                }else{ 
     3919                        box.find(".box-loading").remove(); 
     3920                } 
     3921        }); 
     3922} 
     3923 
     3924//FUNÇÃO QUE "SETA" OS BINDS DOS CAMPOS PARA - CC - CCO 
     3925function input_binds(div, ID){ 
     3926 
     3927        //AO CLICAR NA DIV SETA O FOCO NO INPUT 
     3928        div.click(function(e){ 
     3929                if(e.target == $(this)[0]){ 
     3930                        $(this).find("input:last").focus(); 
     3931                        $(this).find("div").removeClass("box-selected"); 
     3932                } 
     3933        }) 
     3934         
     3935        //AO SAIR DO FOCO DA DIV ELE RETIRA TODAS AS CLASSES DE CAIXAS SELECIONADAS 
     3936        .focusout(function(e){ 
     3937                if(!$(e.target).parents(".email-area:first").length) 
     3938                        $(this).find("div").removeClass("box-selected"); 
     3939        }).droppable({ 
     3940                hoverClass: "box-draggable-hover", 
     3941                accept : ".box", 
     3942                drop : function(e, ui){ 
     3943                        ui.draggable.parent().droppable( "enable" ); 
     3944                        var box = ui.draggable.clone(); 
     3945                        box_actions(box); 
     3946                        if(box.find(".box-info").length){ 
     3947                                box.unbind("dblclick").bind("dblclick", function(e){ 
     3948                                        new $.Zebra_Dialog('<strong>Impossivel editar</strong> um contato do ldap\n' + 
     3949                                                '<strong>Porém</strong>é possivel remove-lo', { 
     3950                                                'buttons':  false, 
     3951                                                'modal': false, 
     3952                                                'position': ['right - 20', 'top + 20'], 
     3953                                                'auto_close': 3000 
     3954                                        }); 
     3955                                }); 
     3956                        } 
     3957                        $(this).prepend(box); 
     3958                        ui.draggable.remove(); 
     3959                } 
     3960        }); 
     3961         
     3962        //MAKE KEYDOWN 
     3963        input_keydowns(div.find("input"), ID); 
     3964         
     3965         
     3966        //VERIFICA PREFERENCIA DE CONTATOS DINÂMICOS ESTA ATIVA 
     3967        if(parseInt(preferences.use_dynamic_contacts)){ 
     3968                //PREPARAÇÃO DA ARRAY DOS CONTATOS DINÂMICOS 
     3969 
     3970                $.widget( "custom.catcomplete", $.ui.autocomplete, { 
     3971                        _renderMenu: function( ul, items ) { 
     3972                                var self = this, 
     3973                                currentType = ""; 
     3974                                $.each( items, function( index, item ) { 
     3975                                        if ( item.type != currentType) { 
     3976                                                if(item.type == "G" && $(ul).find(".dynamic-recent").length) 
     3977                                                        self._renderItem( ul, {name:"", value:"", type:"linha"} ); 
     3978                                                if(item.type == "P" && $(ul).find(".dynamic-group").length) 
     3979                                                        self._renderItem( ul, {name:"", value:"", type:"linha"} );       
     3980                                                currentType = item.type; 
     3981                                        } 
     3982                                        self._renderItem( ul, item ); 
     3983                                        $(ul).find("li:last").find(".dynamic-stars").raty({ 
     3984                                                readOnly : true, 
     3985                                                half : true, 
     3986                                                hints : ['','','','',''], 
     3987                                                score    : ((parseInt(item.qtd)*5)/topContact), 
     3988                                                starOn  : '../../prototype/plugins/jq-raty/img/star-on.png', 
     3989                                                starOff : '../../prototype/plugins/jq-raty/img/star-off.png', 
     3990                                                starHalf : '../../prototype/plugins/jq-raty/img/star-half.png' 
     3991                                        }); 
     3992                                }); 
     3993                        } 
     3994                }); 
     3995                //INSERÇÃO DO AUTO COMPLETE AO INPUT 
     3996                div.find("input").catcomplete({ 
     3997                        minLength: 1,                    
     3998                        source: function(request, response){ 
     3999                                response( $.ui.autocomplete.filter(dynamicContactList, request.term ) ); 
     4000                        }, 
     4001                        focus: function() { 
     4002                                return false; 
     4003                        }, 
     4004                         
     4005                        //EVENTO AO SELECIONAR UM CONTATO DINÂMICO 
     4006                        select: function( event, ui ) { 
     4007                                event.preventDefault(); 
     4008                                $(this).val(""); 
     4009                                if(ui.item.type == "P") 
     4010                                        draw_email_box(""+ui.item.id, $(this), true); 
     4011                                else if(ui.item.type == "G") 
     4012                                        draw_email_box(""+ui.item.id, $(this), "G"); 
     4013                                else 
     4014                                        draw_email_box(ui.item.name ? "\""+ui.item.name+"\" <"+ui.item.email+">" : ui.item.email, $(this)); 
     4015                                return false; 
     4016                        }, 
     4017                        autoFocus: true, 
     4018                        position : { my: "left top", at: "left bottom", collision: "fit" } 
     4019                }).bind('catcompleteopen', function(event, ui) { 
     4020                        $(this).data('is_open',true); 
     4021                }).bind('catcompleteclose', function(event, ui) { 
     4022                        $(this).data('is_open',false); 
     4023                }) 
     4024                 
     4025                //MONTAGEM DA LISTA DE CONTATOS DINÂMICOS DO AUTO COMPLETE 
     4026                .data( "catcomplete" )._renderItem = function( ul, item ) { 
     4027                        ul.css({"min-width":"400px", "width":"50%", "max-height" : "180px", "overflow-y" : "auto", "min-height": "30px"}); 
     4028                        var listContacts = DataLayer.render("../prototype/modules/mail/templates/listContacts.ejs", item); 
     4029                        return $(listContacts).data( "item.autocomplete", item ).appendTo( ul ).find("span:last").button({ 
     4030                                        icons : { 
     4031                                        primary : "ui-icon-close" 
     4032                                }, 
     4033                                text: false 
     4034                        }).click(function(){ 
     4035                                var removeLi = $(this).parents("li:first"); 
     4036                                $.Zebra_Dialog('Deseja remover <b>'+(item.name ? item.name+" - " : "")+ item.email+'</b>?', { 
     4037                                                'type':     'question', 
     4038                                                'custom_class': (is_ie ? 'configure-zebra-dialog' : ''), 
     4039                                                'title':    'Atenção', 
     4040                                                'buttons': ['Sim','Não'],                
     4041                                                'overlay_opacity': '0.5', 
     4042                                                'onClose':  function(caption) { 
     4043                                                        if(caption == 'Sim'){ 
     4044                                                                $(removeLi).remove(); 
     4045                                                                REST.delete("/dynamiccontact/"+item.id); 
     4046                                                                updateDynamicContact(); 
     4047                                                                updateDynamicContactList(); 
     4048                                                        } 
     4049                                                } 
     4050                                }); 
     4051                        }); 
     4052                }; 
     4053        } 
     4054         
     4055        //FUNÇÃO DOS BOTÕES PARA - CC - CCO 
     4056        div.parents("tr:first").find("button").button().click(function(){ 
     4057                if(!$(":focus").hasClass("new-message-input")) 
     4058                        emQuickSearch(($(this).parents("tr:first").find("input").val() ? $(this).parents("tr:first").find("input").val() : input_search), "."+$(this).parents("tr:first").attr('class').split("-")[0], ID, undefined, true); 
    35924059        }); 
    35934060} 
     
    35964063        connector.loadScript("color_palette"); 
    35974064        connector.loadScript('wfolders'); 
     4065        connector.loadScript("ccQuickAdd");  
    35984066         
    35994067        if(typeof(RichTextEditor) == 'undefined' || typeof(ColorPalette) == 'undefined' || typeof(wfolders) == 'undefined') 
     
    36434111                button.toggleClass("expressomail-button-icon-ative"); 
    36444112                field.toggle(); 
    3645                 field.find("textarea").val("").focus(); 
    3646                 if(!field.find("textarea").hasClass("elastic")){ 
    3647                         field.find("textarea").css({"max-height" : "115px", "overflow-y" : "auto"}).addClass("elastic").elastic().unbind('blur');        
    3648                         input_binds(field.find("textarea"), ID); 
     4113                field.find("textarea").val("").parent().find("input").focus(); 
     4114                field.find(".email-area div").remove(); 
     4115                if(!field.find("textarea").hasClass("track")){ 
     4116                        field.find("textarea").css({"max-height" : "115px", "overflow-y" : "auto"}).addClass("track");   
     4117                        input_binds(field.find(".email-area"), ID); 
    36494118                } 
    36504119        }  
    36514120         
    3652         input_binds(content.find('[name="input_to"]').css({"max-height" : "115px", "overflow-y" : "auto"}).addClass("elastic").elastic().unbind('blur').focus(), ID);    
     4121        input_binds(content.find('[name="input_aux_to"]').css("max-width" , parseInt($(".email-area").css("width"))-5).focus().parent().css({"max-height" : "115px", "overflow-y" : "auto"}), ID);       
    36534122         
    36544123        //Botão TextoRico/TextoSimples 
  • trunk/expressoMail1_2/js/main.js

    r6494 r6528  
    99var checkAlarmsFilter = false; 
    1010 
     11var dynamicPersonalContacts = new Array(); 
     12var dynamicPersonalGroups = new Array(); 
     13var dynamicContacts = new Array(); 
     14var dynamicContactList = new Array(); 
     15var topContact = 0; 
     16 
    1117//Os IE's < 9 não possui suporte a trim() introduzida no JavaScript 1.8.1 
    1218if(!String.prototype.trim){   
    1319        String.prototype.trim = function(){ 
    14                                                                 return this.replace(/^\s+|\s+$/g,''); 
    15                                                         }  
     20                return this.replace(/^\s+|\s+$/g,''); 
     21        }  
    1622} 
    1723         
     
    2127        return folders.join(cyrus_delimiter); 
    2228}  
     29 
     30function updateDynamicContactList(){ 
     31        dynamicContactList = new Array(); 
     32        $.merge(dynamicContactList, dynamicContacts); 
     33        $.merge(dynamicContactList, dynamicPersonalGroups); 
     34        $.merge(dynamicContactList, dynamicPersonalContacts); 
     35} 
     36 
     37function updateDynamicContact(){ 
     38        dynamicContacts = new Array(); 
     39        var dynamicData = REST.get("/dynamiccontacts").collection.itens; 
     40        if(dynamicData){ 
     41                $.each(dynamicData, function(index, value){ 
     42                        if(index ==0){ 
     43                                topContact = parseInt(value.data[2].value); 
     44                        } 
     45                        var dynamic = { 
     46                                name : value.data[0].value, 
     47                                email : value.data[1].value, 
     48                                value: value.data[0].value + " - " + value.data[1].value, 
     49                                type: "", 
     50                                id: parseInt(value.data[3].value), 
     51                                qtd : parseInt(value.data[2].value) 
     52                        }; 
     53                        dynamicContacts.push(dynamic); 
     54                }); 
     55        } 
     56} 
     57 
     58function updateDynamicPersonalGroups(){ 
     59        dynamicPersonalGroups = new Array(); 
     60        var groupsData = REST.get("/groups").collection.itens; 
     61        if(groupsData){ 
     62                $.each(groupsData, function(index, value){ 
     63                        var group = { 
     64                                id : parseInt(value.data[0].value), 
     65                                name : value.data[2].value, 
     66                                email : value.data[2].value, 
     67                                value: value.data[2].value + " - " + value.data[2].value, 
     68                                type: "G" 
     69                        }; 
     70                        dynamicPersonalGroups.push(group); 
     71                }); 
     72        } 
     73} 
     74 
     75function updateDynamicPersonalContacts(){ 
     76        dynamicPersonalContacts = new Array(); 
     77        var contactsData = REST.get("/contacts").collection.itens; 
     78        if(contactsData){ 
     79                $.each(contactsData, function(index, value){ 
     80                        var contact = { 
     81                                id : parseInt(value.data[0].value), 
     82                                name : value.data[1].value, 
     83                                email : value.data[2].value, 
     84                                value: value.data[1].value + " - " + value.data[2].value, 
     85                                type: "P" 
     86                        }; 
     87                        dynamicPersonalContacts.push(contact); 
     88                }); 
     89        } 
     90} 
     91 
    2392function init(){ 
    2493        if (!is_ie) 
    2594                Element('tableDivAppbox').width = '100%'; 
    2695 
    27         var save_contacts = function(data){ 
     96        /*var save_contacts = function(data){ 
    2897                contacts = data; 
    2998                if (preferences.use_local_messages == 1 && window.google && google.gears) 
     
    31100                                expresso_local_messages.capt_url('controller.php?action=$this.db_functions.get_dropdown_contacts_to_cache'); 
    32101 
     102        }*/ 
     103        if(parseInt(preferences.use_dynamic_contacts)){ 
     104                var load_dynamics = function(){ 
     105                        updateDynamicContact(); 
     106                        updateDynamicPersonalGroups(); 
     107                        updateDynamicPersonalContacts(); 
     108                        updateDynamicContactList(); 
     109                }; 
     110                load_dynamics(); 
    33111        } 
    34112        var save_preferences = function(data){ 
     
    71149                //Substituido por padrão Jquery 
    72150                cExecute ("$this.imap_functions.get_range_msgs2&folder=INBOX&msg_range_begin=1&msg_range_end="+preferences.max_email_per_page+"&sort_box_type=SORTARRIVAL&search_box_type=ALL&sort_box_reverse=1", handler_draw_box); 
    73                 cExecute ("$this.db_functions.get_dropdown_contacts", save_contacts); //Save contacts needs preferences. 
     151                //cExecute ("$this.db_functions.get_dropdown_contacts", save_contacts); //Save contacts needs preferences. 
    74152                if(preferences.hide_folders == "1") 
    75153                        Element('divAppboxHeader').innerHTML =  title_app_menu; 
     
    193271        cyrus_delimiter = Element('cyrus_delimiter').value; 
    194272 
    195         cExecute ("$this.db_functions.get_dropdown_contacts_to_cache", function(data) {contacts = data;}); 
     273        //cExecute ("$this.db_functions.get_dropdown_contacts_to_cache", function(data) {contacts = data;}); 
    196274        //cExecute ("$this.functions.get_preferences", save_preferences); 
    197275        } 
     
    17601838                case "reply_without_history": 
    17611839                        RichTextEditor.replyController = true; //Seta o editor como modo reply 
    1762                         content.find('[name="input_to"]').val(data.to); 
     1840                        content.find('[name="input_to"]').val(data.to);                  
     1841                         
     1842                        draw_reply_boxes_by_field("to", data.to, content); 
     1843                         
    17631844                        title = "Re: " + html_entities(data.subject); 
    17641845                        content.find(".subject").val("Re: " + data.subject);                     
     
    17771858                        content.find(".subject").val("Re: " + data.subject); 
    17781859                        content.find('[name="input_to"]').val(data.to); 
     1860                         
     1861                        draw_reply_boxes_by_field("to", data.to, content); 
     1862                         
    17791863                        content.find('[name="msg_reply_from"]').val($("#msg_number_" + border_ID).val());        
    17801864 
     
    18071891                        else 
    18081892                                content.find('[name="input_to"]').val(data.to + ',' + data.to_all); 
    1809                                  
     1893                         
     1894                        draw_reply_boxes_by_field("to", data.to_all, content); 
     1895                         
    18101896                        if (data.cc){ 
    18111897                                data.cc = new Array(); 
     
    18181904                                if(data.cc != ""){ 
    18191905                                        content.find('[name="input_cc"]').val(data.cc); 
    1820                                         input_binds(content.find('[name="input_cc"]'), new_border_ID); 
     1906                                        input_binds(content.find('[name="input_cc"]').parent(), new_border_ID); 
    18211907                                        content.find(".cc-tr").show();//cc-button 
    18221908                                        //document.getElementById("a_cc_link" + new_border_ID).value = data.cc; 
    18231909                                        content.find(".cc-button").toggleClass("expressomail-button-icon-ative"); 
    18241910                                        content.find(".cc-button").find("span").html("Remover CC"); 
    1825                                         content.find('[name="input_cc"]').elastic().unbind('blur'); 
    1826                                         content.find('[name="input_cc"]').trigger("update"); 
     1911                                        draw_reply_boxes_by_field("cc", data.cc, content); 
    18271912                                } 
    18281913                        } 
     
    18461931                        else 
    18471932                                data.to_all = ""; 
     1933 
     1934                        draw_reply_boxes_by_field("to", data.to_all, content); 
     1935                         
    18481936                        title = "Re: " + html_entities(data.subject); 
    18491937                         
     
    18621950                                if(data.cc != ""){ 
    18631951                                        content.find('[name="input_cc"]').val(data.cc); 
    1864                                         input_binds(content.find('[name="input_cc"]'), new_border_ID); 
     1952                                        input_binds(content.find('[name="input_cc"]').parent(), new_border_ID); 
    18651953                                        content.find(".cc-tr").show(); 
    18661954                                        content.find(".cc-button").toggleClass("expressomail-button-icon-ative"); 
    18671955                                        content.find(".cc-button").find("span").html("Remover CC"); 
    1868                                         content.find('[name="input_cc"]').elastic().unbind('blur'); 
    1869                                         content.find('[name="input_cc"]').trigger("update"); 
     1956                                         
     1957                                        draw_reply_boxes_by_field("cc", data.cc, content); 
    18701958                                } 
    18711959                        } 
     
    19222010                                } 
    19232011                                content.find('[name="input_to"]').val(_to +','); 
     2012                                draw_email_box(_to, content.find(".to").filter("input")); 
    19242013                                Element('msg_number').value = ''; 
    19252014                        } 
     
    19472036                        } 
    19482037 
     2038                        draw_reply_boxes_by_field("to", data.to, content); 
     2039                         
    19492040                        content.find('[name="input_to"]').val(data.to); 
    19502041                        if (data.cc){ 
     
    19522043                                data.cc = data.cc.replace(/&gt;/gi,">"); 
    19532044                                content.find('[name="input_cc"]').val(data.cc); 
    1954                                 input_binds(content.find('[name="input_cc"]'), new_border_ID); 
     2045                                input_binds(content.find('[name="input_cc"]').parent(), new_border_ID); 
    19552046                                content.find(".cc-tr").show(); 
    19562047                                content.find(".cc-button").toggleClass("expressomail-button-icon-ative"); 
    19572048                                content.find(".cc-button").find("span").html(get_lang('Remove CC')); 
    1958                                 content.find('[name="input_cc"]').elastic().unbind('blur'); 
    1959                                 content.find('[name="input_cc"]').trigger("update"); 
     2049                                draw_reply_boxes_by_field("cc", data.cc, content); 
    19602050                        } 
    19612051                        if (data.cco){ 
     
    19652055                                        content.find(".cco-button").toggleClass("expressomail-button-icon-ative"); 
    19662056                                        content.find(".cco-button").find("span").html(get_lang('Remove CCo')); 
    1967                                         content.find('[name="input_cco"]').elastic().unbind('blur'); 
    1968                                         content.find('[name="input_cco"]').trigger("update"); 
     2057                                        input_binds(content.find('[name="input_cco"]').parent(), new_border_ID); 
     2058                                        draw_reply_boxes_by_field("cco", data.cco, content); 
    19692059                                } 
    19702060                        } 
     
    20062096        resizeWindow(); 
    20072097        return new_border_ID; //Preciso retornar o ID da nova mensagem. 
     2098} 
     2099 
     2100//DESENHA OS RETANGULOS PARA OS E-MAIL NA OPÇÃO REPLY 
     2101function draw_reply_boxes_by_field(field, value, context){ 
     2102        array = value.split(","); 
     2103        $.each(array, function(index, value){ 
     2104                draw_email_box(value, context.find("."+field).filter("input")); 
     2105        }); 
    20082106} 
    20092107 
     
    22412339        watch_changes_in_msg(ID); 
    22422340 
     2341        var content = $("#content_id_"+ID); 
    22432342        var sign = false; 
    22442343        var crypt = false; 
     2344        var reComplexEmail = /<([^<]*)>[\s]*$/; 
    22452345        if ((preferences.use_assinar_criptografar != '0') && (preferences.use_signature_digital_cripto != '0')){ 
    22462346                var checkSign = document.getElementById('return_digital_'+ID) 
     
    22822382        if(data && data.success == true ){ 
    22832383                // if send ok, set a flag as answered or forwarded 
    2284                 var msg_number_replied = $("#content_id_" + ID).find('[name="msg_reply_from"]'); 
    2285                 var msg_number_forwarded = $("#content_id_" + ID).find('[name="msg_forward_from"]'); 
     2384                var msg_number_replied = content.find('[name="msg_reply_from"]'); 
     2385                var msg_number_forwarded = content.find('[name="msg_forward_from"]'); 
    22862386 
    22872387                if (msg_number_replied.val()){ 
     
    23042404                        } 
    23052405                } 
     2406                 
     2407                $ 
     2408                //REFAZER ISTO COM UMA CHAMADA ASSINCRONA PARA REGISTRAR E ATUALIZAR A LISTA DOS NOVOS CONTATOS DINAMICOS 
    23062409                // If new dynamic contacts were added, update the autocomplete .... 
    2307                 if(data.new_contacts){ 
     2410                /*if(data.new_contacts){ 
    23082411                        var ar_contacts = data.new_contacts.split(',;'); 
    23092412                        for(var j in ar_contacts){ 
     
    23132416                        } 
    23142417                } 
     2418                var dynamicPersonalContacts = new Array(); 
     2419                var dynamicPersonalGroups = new Array(); 
     2420                var dynamicContacts = new Array(); 
     2421                var dynamicContactList = new Array(); 
     2422 
     2423                */ 
     2424                var array = content.find(".to-tr").find(".box").clone(); 
    23152425                delete_border(ID,'true');  
     2426                if(parseInt(preferences.use_dynamic_contacts)){ 
     2427                        $.each(array, function(i, value){ 
     2428                                var stop = false; 
     2429                                $.each(dynamicPersonalContacts, function(x, valuex){ 
     2430                                        if(valuex.email == $(value).find("input").val().match(reComplexEmail)[1]){ 
     2431                                                stop = true; 
     2432                                                return false; 
     2433                                        } 
     2434                                }); 
     2435                                if(!stop){ 
     2436                                        var exist = 0; 
     2437                                        $.each(dynamicContacts, function(x, valuex){ 
     2438                                                if(valuex.email == $(value).find("input").val().match(reComplexEmail)[1]){ 
     2439                                                        exist = valuex.id; 
     2440                                                        return false; 
     2441                                                } 
     2442                                        }); 
     2443                                        if(exist){ 
     2444                                                REST.put("/dynamiccontact/"+exist, {name: $(value).find("input").val().split('"')[1], mail:$(value).find("input").val().match(reComplexEmail)[1]}); 
     2445                                        }else{ 
     2446                                                REST.post("/dynamiccontacts", {name: $(value).find("input").val().split('"')[1], mail:$(value).find("input").val().match(reComplexEmail)[1]}); 
     2447                                        } 
     2448                                } 
     2449                        }); 
     2450                        updateDynamicContact(); 
     2451                        updateDynamicContactList(); 
     2452                } 
    23162453        } 
    23172454        else{ 
    23182455                if(data == 'Post-Content-Length') 
    23192456                        write_msg(get_lang('The size of this message has exceeded  the limit (%1B).',Element('upload_max_filesize').value)); 
    2320                 else if(data) 
     2457                else if(data){ 
     2458                        var error_mail = $.trim(data.split(":")[data.split(":").length-1]); 
     2459                        var array = content.find(".to-tr").find(".box"); 
     2460                        //$(value).find("input").val() 
     2461                        $.each(array, function(index, value){ 
     2462                                if(error_mail == $(value).find("input").val().match(reComplexEmail)[1]) 
     2463                                        $(value).addClass("invalid-email-box"); 
     2464                        }); 
     2465                        if ( content.find('[name="input_cco"]').length){ 
     2466                                if(content.find(".cco-tr").css("display") != "none"){ 
     2467                                        var array = content.find(".cco-tr").find(".box"); 
     2468                                        $.each(array, function(index, value){ 
     2469                                                if(error_mail == $(value).find("input").val().match(reComplexEmail)[1]) 
     2470                                                        $(value).addClass("invalid-email-box"); 
     2471                                        }); 
     2472                                } 
     2473                        } 
     2474                        if(content.find(".cc-tr").css("display") != "none") 
     2475                        { 
     2476                                var array = content.find(".cc-tr").find(".box"); 
     2477                                $.each(array, function(index, value){ 
     2478                                        if(error_mail == $(value).find("input").val().match(reComplexEmail)[1]) 
     2479                                                $(value).addClass("invalid-email-box"); 
     2480                                });                              
     2481                        }  
    23212482                        write_msg(data); 
    2322                 else 
     2483                }else 
    23232484                        write_msg(get_lang("Connection failed with %1 Server. Try later.", "Web")); 
    23242485                 
     
    25252686                return; 
    25262687        } 
    2527         stringEmail = content.find('[name="input_to"]').val(); 
    2528          
    2529         if ( content.find('[name="input_cco"]').length) 
    2530                 if(content.find(".cco-tr").css("display") != "none") 
    2531                         stringEmail += content.find('[name="input_cco"]').val() =='' ? "":", "+content.find('[name="input_cco"]').val(); 
     2688        //stringEmail = content.find('[name="input_to"]').val(); 
     2689        var stringEmail = ""; 
     2690        var array = content.find(".to-tr").find(".box"); 
     2691        $.each(array, function(index, value){ 
     2692                stringEmail += $(value).find("input").val() + ","; 
     2693        }); 
     2694        content.find('[name="input_to"]').val(stringEmail); 
     2695        if ( content.find('[name="input_cco"]').length){ 
     2696                if(content.find(".cco-tr").css("display") != "none"){ 
     2697                        var array = content.find(".cco-tr").find(".box"); 
     2698                        $.each(array, function(index, value){ 
     2699                                stringEmail += $(value).find("input").val() + ","; 
     2700                        }); 
     2701                        content.find('[name="input_cco"]').val(stringEmail); 
     2702                } 
     2703        } 
    25322704                         
    25332705        if(content.find(".cc-tr").css("display") != "none") 
    2534                 stringEmail += content.find('[name="input_cc"]').val() =='' ? "":", "+content.find('[name="input_cc"]').val(); 
     2706        { 
     2707                var array = content.find(".cc-tr").find(".box"); 
     2708                $.each(array, function(index, value){ 
     2709                        stringEmail += $(value).find("input").val() + ","; 
     2710                }); 
     2711                content.find('[name="input_cc"]').val(stringEmail); 
     2712        } 
    25352713                 
    25362714        if (expresso_offline) { 
     
    26322810       autoSaveControl.status[border_id] = true; 
    26332811   /////////////////////////////////////////// 
    2634   
     2812    var content = $("#content_id_"+border_id); 
     2813         
     2814        var stringEmail = ""; 
     2815        var array = content.find(".to-tr").find(".box"); 
     2816        $.each(array, function(index, value){ 
     2817                stringEmail += $(value).find("input").val() + ","; 
     2818        }); 
     2819        content.find('[name="input_to"]').val(stringEmail); 
     2820        stringEmail = ""; 
     2821        if ( content.find('[name="input_cco"]').length){ 
     2822                if(content.find(".cco-tr").css("display") != "none"){ 
     2823                        var array = content.find(".cco-tr").find(".box"); 
     2824                        $.each(array, function(index, value){ 
     2825                                stringEmail += $(value).find("input").val() + ","; 
     2826                        }); 
     2827                        content.find('[name="input_cco"]').val(stringEmail); 
     2828                } 
     2829        } 
     2830         
     2831        stringEmail = "";        
     2832        if(content.find(".cc-tr").css("display") != "none") 
     2833        { 
     2834                var array = content.find(".cc-tr").find(".box"); 
     2835                $.each(array, function(index, value){ 
     2836                        stringEmail += $(value).find("input").val() + ","; 
     2837                }); 
     2838                content.find('[name="input_cc"]').val(stringEmail); 
     2839        } 
     2840         
    26352841   var idJavascript = saveBorderError[border_id]; 
    26362842    
  • trunk/expressoMail1_2/js/search.js

    r6456 r6528  
    2020         
    2121        //Monta os forms dentro da janela; 
    22         searchE.prototype.showForms = function(value) 
     22        searchE.prototype.showForms = function(value, data) 
    2323        { 
    2424                if( trim(value) != "" ) 
     
    3939                        var div         = document.createElement("div"); 
    4040                        var args        = null; 
    41          
     41                         
    4242                        args =  
    4343                        { 
     
    6363                                "Old"                                           : get_lang('Old'), 
    6464                                "Search_the_messages_in_these_folders" : get_lang('Search the messages in these folders'), 
    65                                 "In_all_the_folders"            : get_lang('In all the folders') 
    66                         } 
    67                          
     65                                "In_all_the_folders"            : get_lang('In all the folders'), 
     66                                "From_value" : (data != "undefined" ? data : "") 
     67                        } 
     68                                 
    6869                        $(div).html(DataLayer.render("./templates/default/searchMails.ejs", args )); 
    6970                        div.setAttribute( "style","overflow:hidden"); 
     
    515516                                td.id = "td_message_answered_"+uid_msg; 
    516517                                if (aux.flag.match('X')) 
    517                                         td1 = '<img src=templates/'+template+'/images/forwarded.gif title="'+get_lang('Forwarded')+'">'; 
     518                                        td1 = '<img src=templates/'+template+'/images/forwarded.png title="'+get_lang('Forwarded')+'">'; 
    518519                                else 
    519520                                        if (aux.flag.match('A')) 
    520                                                 td1 = '<img src=templates/'+template+'/images/answered.gif title="'+get_lang('Answered')+'">'; 
     521                                                td1 = '<img src=templates/'+template+'/images/answered.png title="'+get_lang('Answered')+'">'; 
    521522                                        else 
    522523                                                td1 = ''; 
  • trunk/expressoMail1_2/setup/default_records.inc.php

    r5988 r6528  
    11<?php 
     2  /**************************************************************************\ 
     3  * eGroupWare - Setup                                                       * 
     4  * http://www.egroupware.org                                                * 
     5  * --------------------------------------------                             * 
     6  *  This program is free software; you can redistribute it and/or modify it * 
     7  *  under the terms of the GNU General Public License as published by the   * 
     8  *  Free Software Foundation; either version 2 of the License, or (at your  * 
     9  *  option) any later version.                                              * 
     10  \**************************************************************************/ 
     11 
    212                        $oProc->query("ALTER TABLE expressomail_message_followupflag ADD CONSTRAINT expressomail_message_followupflag_followupflag_id_fkey FOREIGN KEY (followupflag_id) REFERENCES expressomail_followupflag (id);"); 
    313                         
     
    1525                        $oProc->query("INSERT INTO phpgw_hooks( \"hook_appname\", \"hook_location\", \"hook_filename\") VALUES ('expressoMail1_2', 'config_validate', 'hook_config_validate.inc.php')"); 
    1626 
    17                  
     27                        /* Cria um indice unico para um owner e mail para nao ocorrer duplicidade em e-mails para um mesmo owner  */ 
     28                        $oProc->query("ALTER TABLE expressomail_dynamic_contact ADD CONSTRAINT owner_mail UNIQUE (owner, mail)"); 
    1829?> 
  • trunk/expressoMail1_2/setup/setup.inc.php

    r6255 r6528  
    1313$setup_info['expressoMail1_2']['name'] = 'expressoMail1_2'; 
    1414$setup_info['expressoMail1_2']['title'] = 'Expresso Mail'; 
    15 $setup_info['expressoMail1_2']['version'] = '2.4.7'; 
     15$setup_info['expressoMail1_2']['version'] = '2.4.8'; 
    1616$setup_info['expressoMail1_2']['app_order'] = 2; 
    17 $setup_info['expressoMail1_2']['tables'][] = 'phpgw_expressomail_contacts'; 
    1817$setup_info['expressoMail1_2']['tables'][] = 'phpgw_certificados'; 
    1918 
     
    2221$setup_info['expressoMail1_2']['tables'][] = 'expressomail_message_followupflag'; 
    2322$setup_info['expressoMail1_2']['tables'][] = 'expressomail_followupflag'; 
     23$setup_info['expressoMail1_2']['tables'][] = 'expressomail_dynamic_contact'; 
    2424 
    2525 
     
    4848    'versions' => Array('2.4') 
    4949); 
     50 
     51$setup_info['expressoMail1_2']['depends'][] = array( 
     52    'appname' => 'rest', 
     53    'versions' => Array('1.0') 
     54); 
     55 
    5056?> 
  • trunk/expressoMail1_2/setup/tables_current.inc.php

    r5981 r6528  
    1010        \**************************************************************************/ 
    1111        $phpgw_baseline = array( 
    12                 'phpgw_expressomail_contacts' => array( 
     12                'expressomail_dynamic_contact' => array( 
    1313                        'fd' => array( 
    14                                 'id_owner' => array( 'type' => 'int', 'precision' => 8, 'nullable' => false), 
    15                                 'data' => array( 'type' => 'text') 
     14                                'id' => array('type' => 'auto','nullable' => False), 
     15                                'owner' => array('type' => 'int','precision' => '16','nullable' => False), 
     16                                'name' => array('type' => 'varchar','precision' => '100','nullable' => true), 
     17                                'mail' => array('type' => 'varchar','precision' => '100','nullable' => False), 
     18                                'number_of_messages' => array('type' => 'int','precision' => '16','nullable' => False), 
     19                                'timestamp' => array('type' => 'int','precision' => '16','nullable' => False), 
    1620                        ), 
    17                         'pk' => array('id_owner'), 
     21                        'pk' => array('id'), 
    1822                        'fk' => array(), 
    1923                        'ix' => array(), 
    2024                        'uc' => array() 
    2125                ), 
     26                 
    2227        'phpgw_certificados' => array( 
    2328            'fd' => array( 
  • trunk/expressoMail1_2/setup/tables_update.inc.php

    r6255 r6528  
    267267            return $GLOBALS['setup_info']['expressoMail1_2']['currentver']; 
    268268        } 
    269          
     269 
     270        $test[] = '2.4.7'; 
     271        function expressoMail1_2_upgrade2_4_7() { 
     272                $oProc = $GLOBALS['phpgw_setup']->oProc; 
     273 
     274                //Criando nova tabela de contatos dinamicos 
     275                $oProc->CreateTable('expressomail_dynamic_contact',array( 
     276                        'fd' => array( 
     277                                'id' => array('type' => 'auto','nullable' => False), 
     278                                'owner' => array('type' => 'int','precision' => '16','nullable' => False), 
     279                                'name' => array('type' => 'varchar','precision' => '100','nullable' => true), 
     280                                'mail' => array('type' => 'varchar','precision' => '100','nullable' => False), 
     281                                'number_of_messages' => array('type' => 'int','precision' => '16','nullable' => False), 
     282                                'timestamp' => array('type' => 'int','precision' => '16','nullable' => False), 
     283                        ), 
     284                        'pk' => array('id'), 
     285                        'fk' => array(), 
     286                        'ix' => array(), 
     287                        'uc' => array() 
     288                        ) 
     289                ); 
     290 
     291                /* Cria um indice unico para um owner e mail para nao ocorrer duplicidade em e-mails para um mesmo owner  */ 
     292                $oProc->query("ALTER TABLE expressomail_dynamic_contact ADD CONSTRAINT owner_mail UNIQUE (owner, mail)"); 
     293 
     294                //Migra dados antigos para nova tabela 
     295                $oProc->query('SELECT * FROM phpgw_expressomail_contacts'); 
     296                $return = array(); 
     297                while($oProc->next_record()) 
     298                        $return[$oProc->f('id_owner')] = $oProc->f('data'); 
     299 
     300                foreach ($return as $owner => &$value) { 
     301                        $contacts = unserialize($value); 
     302                        foreach ($contacts as &$contact) { 
     303                                $info = explode('#', $contact['email']); 
     304                                $oProc->query("INSERT INTO expressomail_dynamic_contact (owner, name ,mail , number_of_messages ,timestamp) values ('".$owner."', '".$info[0]."', '".$info[1]."', 1, '".$contact['timestamp']."');"); 
     305                        } 
     306                } 
     307 
     308                //Deleta tabela antiga 
     309                $oProc->DropTable('phpgw_expressomail_contacts'); 
     310 
     311                /* Remove a restricao de quantidade de contatos recentes */ 
     312                $oProc->query("DELETE FROM phpgw_config WHERE config_app = 'expressoMail1_2' AND config_name = 'expressoMail_Number_of_dynamic_contacts'"); 
     313 
     314                $GLOBALS['setup_info']['expressoMail1_2']['currentver'] = '2.4.8'; 
     315            return $GLOBALS['setup_info']['expressoMail1_2']['currentver']; 
     316        } 
    270317?> 
  • trunk/expressoMail1_2/templates/default/config.tpl

    r5988 r6528  
    9898    </td> 
    9999    </tr> 
     100<!--    <tr bgcolor="{row_on}"> 
     101    <td>{lang_Number_of_dynamic_contacts}</td> 
     102    <td> 
     103    <input size="1" name="newsettings[expressoMail_Number_of_dynamic_contacts]" value="{value_expressoMail_Number_of_dynamic_contacts}">  
     104    </td> 
     105    </tr> --> 
    100106    <tr bgcolor="{row_on}"> 
    101     <td>{lang_Number_of_dynamic_contacts}</td> 
    102     <td> 
    103     <input size="1" name="newsettings[expressoMail_Number_of_dynamic_contacts]" value="{value_expressoMail_Number_of_dynamic_contacts}">  
    104     </td> 
    105     </tr> 
    106     <tr bgcolor="{row_off}"> 
    107107    <td>{lang_imap_max_folders}:</td> 
    108108    <td> 
     
    110110    </td> 
    111111    </tr> 
    112     <tr bgcolor="{row_on}"> 
     112    <tr bgcolor="{row_off}"> 
    113113    <td>{lang_Max_attachment_size}</td> 
    114114    <td> 
     
    118118    </td> 
    119119    </tr> 
    120         <tr bgcolor="{row_off}">  
     120        <tr bgcolor="{row_on}">  
    121121            <td>{lang_allow_hidden_copy}</td>  
    122122            <td>  
     
    133133    </td> 
    134134    </tr> 
    135         <tr bgcolor="{row_off}"> 
     135        <tr bgcolor="{row_on}"> 
    136136        <td>{lang_gears_firefox_windows_url}</td> 
    137137        <td> 
     
    139139        </td> 
    140140    </tr> 
    141     <tr bgcolor="{row_on}"> 
     141    <tr bgcolor="{row_off}"> 
    142142        <td>{lang_gears_firefox_linux_url}</td> 
    143143        <td> 
     
    145145        </td> 
    146146    </tr> 
    147    <tr bgcolor="{row_off}"> 
     147   <tr bgcolor="{row_on}"> 
    148148        <td>{lang_gears_ie_url}</td> 
    149149        <td> 
     
    151151        </td> 
    152152    </tr> 
    153     <tr bgcolor="{row_on}"> 
     153    <tr bgcolor="{row_off}"> 
    154154    <td>{lang_Do_you_want_to_use_x_origin_in_source_menssage?}</td> 
    155155    <td> 
     
    160160    </td> 
    161161    </tr> 
    162          <tr bgcolor="{row_off}"> 
     162         <tr bgcolor="{row_on}"> 
    163163                <td>{lang_Number_max_of_labels}</td> 
    164164                <td> 
     
    244244        </td> 
    245245    </tr> 
     246         
     247        <tr bgcolor="{th_bg}">  
     248                <td colspan="2">  
     249                        &nbsp;  
     250                </td>  
     251        </tr> 
     252        <tr bgcolor="{row_on}">  
     253                <td colspan="2">  
     254                        <label style="font-weight:bold;">{lang_Identifier_of_the_recipient_of_a_message}</label>  
     255                </td>  
     256        </tr> 
     257        <tr bgcolor="{row_off}"> 
     258        <td>{lang_LDAP_attribute_used_to_replacement}</td> 
     259        <td> 
     260            <select id="identifier_recipient" name="newsettings[expressoMail_ldap_identifier_recipient]"> 
     261                                {rows_ldap_identifier} 
     262            </select> 
     263        </td> 
     264    </tr>  
     265         
     266        <!-- <tr bgcolor="{row_off}"> 
     267        <td>{lang_LDAP_attribute_used_to_replacement}</td> 
     268        <td> 
     269            <input type="text" id="identifier_recipient " value="{value_expressoMail_ldap_identifier_recipient}" name="newsettings[expressoMail_ldap_identifier_recipient]" size=10 maxlength=10 /> 
     270        </td> 
     271    </tr> --> 
    246272    <!--tr bgcolor="{row_on}"> 
    247273        <td>{lang_Days_interval_to_show_balloon_for_user}</td> 
  • trunk/expressoMail1_2/templates/default/main.css

    r6459 r6528  
    127127.context-menu-item.icon-normal { background-image: url(images/door.png); } 
    128128.context-menu-item.icon-followupflag { background-image: url(images/door.png); } 
     129.context-menu-item.icon-quick-add { background-image: url(images/vcard_add.png); } 
     130.context-menu-item.icon-delete-box{ background-image: url(images/user_delete.png); } 
     131.context-menu-item.icon-quick-search-contact{ background-image: url(images/zoom.png); } 
    129132 
    130133 
     
    700703} 
    701704.message_options_trash { 
    702         background-image: url(../../../phpgwapi/templates/default/images/foldertree_trash.png); 
     705        background-image: url(images/page_white_delete.png); 
    703706        background-repeat: no-repeat; 
    704707        background-position:left center; 
     
    12741277}  
    12751278 
    1276 #detalhes_contato img{ margin-bottom: -4px;}  
     1279#detalhes_contato img{ margin-bottom: -4px;} 
     1280 
     1281 button.expressomail-button-icon-ative{color:#E17009 !important; border: 1px solid #E17009 !important;background: none repeat scroll 0 0 #FFE1CC !important;} 
     1282  
     1283.box{ 
     1284        background-color: #96B3D3; 
     1285        border-radius: 5px; 
     1286        border: 1px solid #201b41;  
     1287        display: inline-block; 
     1288        cursor : pointer; 
     1289        margin-top : 1px; 
     1290        margin-right: 1px; 
     1291        outline : none; 
     1292        padding : 1px; 
     1293} 
     1294 
     1295 
     1296.box span{ 
     1297        font-family: Verdana, Arial, Helvetica, sans-serif; 
     1298        font-size: 13px; 
     1299        color : #201b41; 
     1300        outline : none; 
     1301} 
     1302 
     1303.invalid-email-box{ 
     1304        background-color: #F08080; 
     1305        border : 1px solid #540303 !important; 
     1306} 
     1307 
     1308.invalid-email-box span{ 
     1309        color: #540303; 
     1310} 
     1311 
     1312.email-area{ 
     1313        border-radius: 5px;  
     1314        width: 98.5%; 
     1315        padding: 5px; 
     1316        border : 1px solid #BBBBBB;  
     1317        heigth : auto; 
     1318        max-height : 115px; 
     1319        overflow-y: auto; 
     1320} 
     1321.email-text{ 
     1322        outline:none; 
     1323        width:15px; 
     1324        border : none; 
     1325        font-family: Verdana, Arial, Helvetica, sans-serif; 
     1326        font-size: 13px; 
     1327} 
     1328 
     1329.box-input{ 
     1330        outline:none; 
     1331        border : none; 
     1332        font-family: Verdana, Arial, Helvetica, sans-serif; 
     1333        font-size: 13px; 
     1334        display : none; 
     1335} 
     1336 
     1337.box-selected{ 
     1338        background-color : #BBBBBB; 
     1339} 
     1340 
     1341.hidden { 
     1342        display : none; 
     1343} 
     1344 
     1345.loading { 
     1346        background: url(../../../prototype/modules/mail/img/loader.gif) !important; 
     1347        background-position: 0 0 !important; 
     1348        background-repeat : no-repeat !important; 
     1349} 
     1350 
     1351.line-separator{ 
     1352        background: url("images/linha.png") repeat-x scroll 0 8px transparent; 
     1353        clear : both; 
     1354} 
     1355 
     1356.box-draggable-hover{ 
     1357        border : 1px solid #474747; 
     1358} 
     1359 
     1360.box-loading{ 
     1361        background : url("../../../prototype/modules/mail/img/loading.gif") no-repeat !important; 
     1362        background-size: 17px auto !important; 
     1363} 
     1364 
     1365.box-info{ 
     1366        background : url("images/information.png") no-repeat !important; 
     1367} 
  • trunk/expressoMail1_2/templates/default/searchMails.ejs

    r5751 r6528  
    33                         
    44                                <label><%=data.From%>:</label> 
    5                                 <input style="margin-left: 6px;" type="text" id="txt_de" size="20" /> 
     5                                <input style="margin-left: 6px;" type="text" id="txt_de" size="20" value="<%=data.From_value%>"/> 
    66                                <br style="margin-bottom:15px" /> 
    77 
  • trunk/home.php

    r5042 r6528  
    9898                echo parse_navbar(); 
    9999        } 
    100         // Default Applications (Home Page)  
    101         $default_apps = Array(                   
    102                         'workflow',                      
    103                         'expressoMail1_2', 
    104                         'calendar', 
    105                         'news_admin' 
    106                 ); 
    107         $sorted_apps = array(); 
    108         $user_apps = $GLOBALS['phpgw_info']['user']['apps'];  
    109         @reset($user_apps);      
    110         for($i = 0; $i < count($default_apps);$i++) { 
    111                 if(array_key_exists($default_apps[$i], $user_apps)){ 
    112                         $sorted_apps[] = $default_apps[$i]; 
    113                 }                
    114         } 
    115          
    116         foreach($GLOBALS['phpgw_info']['user']['apps'] as $i => $p) { 
    117                 $sorted_apps[] = $p['name']; 
    118         } 
    119          
     100 
     101        // Default Applications (Home Page)  
     102        $default_apps = Array(                   
     103                        'workflow',                      
     104                        'expressoMail1_2', 
     105                        'calendar', 
     106                        'news_admin' 
     107                ); 
     108        $sorted_apps = array(); 
     109        $user_apps = $GLOBALS['phpgw_info']['user']['apps'];  
     110        @reset($user_apps);      
     111        for($i = 0; $i < count($default_apps);$i++) { 
     112                if(array_key_exists($default_apps[$i], $user_apps)){ 
     113                        $sorted_apps[] = $default_apps[$i]; 
     114                }                
     115        } 
     116         
     117        foreach($GLOBALS['phpgw_info']['user']['apps'] as $i => $p) { 
     118                $sorted_apps[] = $p['name']; 
     119        } 
     120 
    120121        $portal_oldvarnames = array('mainscreen_showevents', 'homeShowEvents','homeShowLatest','mainscreen_showmail','mainscreen_showbirthdays','mainscreen_show_new_updated'); 
    121         $done = array(); 
    122         // Display elements, within appropriate table cells      
    123         @reset($sorted_apps); 
    124         $idx = 1; 
    125         echo "<table width='100%' cellpadding=5>"; 
    126         foreach($sorted_apps as $appname) 
    127         { 
    128                 if((int)$done[$appname] == 1 || empty($appname)){ 
    129                         continue; 
    130                 }                
    131                 $varnames = $portal_oldvarnames; 
    132                 $varnames[] = 'homepage_display'; 
    133                 $thisd = 0; 
    134                 $tmp = ''; 
    135                  
    136                 foreach($varnames as $varcheck) 
    137                 { 
    138                                                                          
    139                         /*if($appname == 'expressoMail1_2') { 
    140                                 $tmp = $appname; 
    141                                 $appname = 'expressoMail'; 
    142                         }*/                              
     122        $done = array(); 
     123        // Display elements, within appropriate table cells      
     124        @reset($sorted_apps); 
     125        $idx = 1; 
     126        echo "<table width='100%' cellpadding=5>"; 
     127        foreach($sorted_apps as $appname) 
     128        { 
     129                if((int)$done[$appname] == 1 || empty($appname)){ 
     130                        continue; 
     131                } 
     132                $varnames = $portal_oldvarnames; 
     133                $varnames[] = 'homepage_display'; 
     134                $thisd = 0; 
     135                $tmp = ''; 
    143136 
    144                         if(array_search($appname, $default_apps) !== False){ 
    145                                 $thisd = 1; 
    146                                 break; 
    147                         } 
    148                         if($GLOBALS['phpgw_info']['user']['preferences'][$appname][$varcheck]=='True') { 
    149                                 $thisd = 1; 
    150                                 break; 
    151                         } 
    152                         else  { 
    153                                 $_thisd = (int)$GLOBALS['phpgw_info']['user']['preferences'][$appname][$varcheck]; 
    154                                 if($_thisd > 0) { 
    155                                         $thisd = $_thisd; 
    156                                         break; 
    157                                 } 
    158                         } 
    159                 } 
     137                foreach($varnames as $varcheck) 
     138                { 
    160139 
    161                 if($thisd > 0) 
    162                 { 
    163                         if($tmp) { 
    164                 $appname = $tmp; 
    165                                 $tmp = ''; 
    166                         } 
    167                         if($idx == 0) {                          
    168                                 print '<tr>'; 
    169                         } 
    170                         print '<td style="vertical-align:top;" width="45%">'; 
    171                         $GLOBALS['phpgw']->hooks->single('home',$appname);                       
    172                         print '</td>'; 
    173                          
    174                         if($idx == 2){ 
    175                                 $idx = 0; 
    176                                 print '</tr>'; 
    177                         }                        
    178                         $idx++; 
    179                         $neworder[] = $appname; 
    180                 } 
    181                 $done[$appname] = 1; 
    182         } 
    183         print '</table>'; 
     140                        /*if($appname == 'expressoMail1_2') { 
     141                                $tmp = $appname; 
     142                                $appname = 'expressoMail'; 
     143                        }*/ 
     144 
     145                        if(array_search($appname, $default_apps) !== False){ 
     146                                $thisd = 1; 
     147                                break; 
     148                        } 
     149                        if($GLOBALS['phpgw_info']['user']['preferences'][$appname][$varcheck]=='True') { 
     150                                $thisd = 1; 
     151                                break; 
     152                        } 
     153                        else  { 
     154                                $_thisd = (int)$GLOBALS['phpgw_info']['user']['preferences'][$appname][$varcheck]; 
     155                                if($_thisd > 0) { 
     156                                        $thisd = $_thisd; 
     157                                        break; 
     158                                } 
     159                        } 
     160                } 
     161 
     162               if($thisd > 0) 
     163                { 
     164                        if($tmp) { 
     165                $appname = $tmp; 
     166                                $tmp = ''; 
     167                        } 
     168                        if($idx == 0) { 
     169                                print '<tr>'; 
     170                        } 
     171                        print '<td style="vertical-align:top;" width="45%">'; 
     172                        $GLOBALS['phpgw']->hooks->single('home',$appname); 
     173                        print '</td>'; 
     174 
     175                        if($idx == 2){ 
     176                                $idx = 0; 
     177                                print '</tr>'; 
     178                        } 
     179                        $idx++; 
     180                        $neworder[] = $appname; 
     181                } 
     182                $done[$appname] = 1; 
     183        } 
     184        print '</table>'; 
     185 
    184186        $GLOBALS['phpgw']->common->phpgw_footer(); 
    185187?> 
  • trunk/phpgwapi/templates/default/login_default.php

    r5281 r6528  
    177177                        else 
    178178                                $_POST['login'] = $_POST['user']; 
     179 
     180                        /** 
     181                         * LOGIN OAUTH POR CURL 
     182                         */ 
     183                        $ch = curl_init(); 
     184 
     185                        $restConf = parse_ini_file( __DIR__ . '/../../../prototype/config/REST.ini', true ); 
     186 
     187                        $param  = 'grant_type=password'; 
     188                        $param .= '&client_id=' . $restConf['oauth']['client_id']; 
     189                        $param .= '&client_secret=' . $restConf['oauth']['client_secret']; 
     190                        $param .= '&username=' . $_POST['user']; 
     191                        $param .= '&password=' . $_POST['passwd']; 
     192 
     193                        // set URL and other appropriate options 
     194                        curl_setopt($ch, CURLOPT_URL, $restConf['oauth']['url_token']); 
     195                        curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: */*')); 
     196                        curl_setopt($ch, CURLOPT_POST, TRUE); 
     197                        curl_setopt($ch, CURLOPT_POSTFIELDS, $param); 
     198                        curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);  //configura para nao imprimir a saida na tela 
     199                        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2);//Passe um nï¿œmero long como parï¿œmetro que contï¿œm o limite de tempo, em segundos, que vocï¿œ permite as funᅵᅵes CURL levar.  
     200 
     201                        // grab URL and pass it to the browser 
     202                        $res = curl_exec($ch); 
     203                         
     204                        // close cURL resource, and free up system resources 
     205                        curl_close($ch); 
     206                        $a = json_decode($res); 
     207         
     208                        if ( isset($a->access_token) ) { 
     209                                $_SESSION['oauth']['access_token'] = $a->access_token; 
     210                                $_SESSION['oauth']['expires_in'] = $a->expires_in; 
     211                                $_SESSION['oauth']['token_type'] = $a->token_type; 
     212                                $_SESSION['oauth']['scope'] = $a->scope; 
     213                                $_SESSION['oauth']['refresh_token'] = $a->refresh_token; 
     214                                 
     215                        } 
     216                        else { 
     217                        } 
     218                        /** 
     219                         * #################### 
     220                         */ 
     221 
    179222                } 
    180223                if(getenv('REQUEST_METHOD') != 'POST' && $_SERVER['REQUEST_METHOD'] != 'POST' && 
     
    598641        if(isset($ultima_revisao)) $tmpl->set_var('ultima_rev','<br>' . $ultima_revisao); 
    599642 
    600         // Adiciona código personalizado de outro template 
     643        // Adiciona cï¿œdigo personalizado de outro template 
    601644        // que esteja utilizando o login_default.php 
    602645        if(is_file('.'.$template_dir.'/login.inc.php')) { 
  • trunk/prototype/api/config.php

    r5764 r6528  
    11<?php 
     2 
     3namespace prototype\api; 
    24 
    35class Config  
    46{ 
    5     static $register; 
    6     static $sessionStarted; 
     7        static $register; 
     8        static $sessionStarted; 
    79   
    8     static function module($config , $module = false) 
    9     { 
    10         //Todo: registrar na nova api o currentapp 
    11         if(!$module) 
    12             $module =  $_SESSION['flags']['currentapp']; 
     10        static function module($config , $module = false) 
     11        { 
     12                //Todo: registrar na nova api o currentapp 
     13                if(!$module) 
     14                                $module =  $_SESSION['flags']['currentapp']; 
    1315   
    14         if( !isset( $_SESSION['config'][$module] ) || !isset( $_SESSION['config'][$module][$config] )) 
    15             $_SESSION['config'][$module] = parse_ini_file( ROOTPATH."/config/$module.ini", true ); 
     16                if( !isset( $_SESSION['config'][$module] ) || !isset( $_SESSION['config'][$module][$config] )) 
     17                                $_SESSION['config'][$module] = parse_ini_file( ROOTPATH."/config/$module.ini", true ); 
    1618         
    17         return isset($_SESSION['config'][$module][$config]) ? $_SESSION['config'][$module][$config] : false; 
     19                return isset($_SESSION['config'][$module][$config]) ? $_SESSION['config'][$module][$config] : false; 
    1820      
    19     } 
     21        } 
    2022     
    21     static function me($config) 
    22     { 
     23        static function me($config) 
     24        { 
    2325         
    24         return isset($_SESSION['wallet']['user'][$config]) ? $_SESSION['wallet']['user'][$config] : false; 
    25     } 
     26                return isset($_SESSION['wallet']['user'][$config]) ? $_SESSION['wallet']['user'][$config] : false; 
     27        } 
    2628     
    27     static function service( $service , $config ) 
    28     { 
    29         if( !isset( $_SESSION['wallet'][$service] ) || !isset( $_SESSION['wallet'][$service][$config] )) 
    30             $_SESSION['wallet'][$service] = parse_ini_file( ROOTPATH."/config/$service.srv", true ); 
     29        static function service( $service , $config ) 
     30        { 
     31                if( !isset( $_SESSION['wallet'][$service] ) || !isset( $_SESSION['wallet'][$service][$config] )) 
     32                                $_SESSION['wallet'][$service] = parse_ini_file( ROOTPATH."/config/$service.srv", true ); 
    3133        
    32         return (isset($_SESSION['wallet'][$service][$config])) ? $_SESSION['wallet'][$service][$config] : false; 
    33     } 
     34                return (isset($_SESSION['wallet'][$service][$config])) ? $_SESSION['wallet'][$service][$config] : false; 
     35        } 
    3436     
    35     static function get( $concept , $config = false , $module = false ) 
    36     { 
    37         $load = parse_ini_file( ROOTPATH."/config/$concept.ini", true ); 
     37        static function get( $concept , $config = false , $module = false ) 
     38        { 
     39                $load = parse_ini_file( ROOTPATH."/config/$concept.ini", true ); 
    3840         
    39         if($config === false) return $load; 
     41                if($config === false) return $load; 
    4042         
    41         return (isset($load[$config])) ? $load[$config] : false; 
    42     } 
     43                return (isset($load[$config])) ? $load[$config] : false; 
     44        } 
    4345     
    44     static function regSet( $name , $value) 
    45     { 
    46         self::$register[$name] = $value; 
    47     } 
    48     static function regGet ($name ) 
    49     { 
    50         return (isset(self::$register[$name]) ? self::$register[$name] : false ); 
    51     } 
     46        static function regSet( $name , $value) 
     47        { 
     48                self::$register[$name] = $value; 
     49        } 
     50        static function regGet ($name ) 
     51        { 
     52                return (isset(self::$register[$name]) ? self::$register[$name] : false ); 
     53        } 
    5254 
    53     static function init( ) 
    54     { 
     55        static function init( ) 
     56        { 
     57     
     58                if( !defined( 'ROOTPATH' ) ) 
     59                                define( 'ROOTPATH', dirname(__FILE__).'/..' ); 
    5560         
    56         if( !defined( 'ROOTPATH' ) ) 
    57             define( 'ROOTPATH', dirname(__FILE__).'/..' ); 
    58          
    59         if ( isset( $_COOKIE[ 'sessionid' ] ) )  
    60         { 
    61             session_id( $_COOKIE[ 'sessionid' ] );  
    62             $GLOBALS['phpgw']->session->sessionid = $_COOKIE[ 'sessionid' ]; 
    63         } 
     61                if ( isset( $_COOKIE[ 'sessionid' ] ) )  
     62                { 
     63                                session_id( $_COOKIE[ 'sessionid' ] );  
     64                                $GLOBALS['phpgw']->session->sessionid = $_COOKIE[ 'sessionid' ]; 
     65                } 
    6466                 
    6567        if( !self::$sessionStarted ) 
    66             self::$sessionStarted = session_start(); 
    67 //               
    68 //      if( $header === true ) 
    69 //      { 
    70 //            require_once (dirname(__FILE__).'/../../header.inc.php'); 
    71 // 
    72 //            $_SESSION['wallet']['Sieve']['user']          =  $GLOBALS['phpgw_info']['user']['account_lid']; 
    73 //            $_SESSION['wallet']['Sieve']['password']      =  $GLOBALS['phpgw_info']['user']['passwd']; 
    74 // 
    75 //            $_SESSION['wallet']['Cyrus']['user']          =  $GLOBALS['phpgw_info']['user']['account_lid']; 
    76 //            $_SESSION['wallet']['Cyrus']['password']      =  $GLOBALS['phpgw_info']['user']['passwd']; 
    77 // 
    78 //            $_SESSION['wallet']['user']['uid']                  =  $GLOBALS['phpgw_info']['user']['userid']; 
    79 //            $_SESSION['wallet']['user']['uidNumber']      =  $GLOBALS['phpgw_info']['user']['account_id']; 
    80 //            $_SESSION['wallet']['user']['password']       =  $GLOBALS['phpgw_info']['user']['passwd']; 
    81 //            $_SESSION['wallet']['user']['cn']             =  $GLOBALS['phpgw_info']['user']['cn']; 
    82 //            $_SESSION['wallet']['user']['mail']           =  $GLOBALS['phpgw_info']['user']['email']; 
    83 // 
    84 //            $_SESSION['wallet']['PostgreSQL']['user']     = $GLOBALS['phpgw_info']['server']['db_user']; 
    85 //            $_SESSION['wallet']['PostgreSQL']['password'] = $GLOBALS['phpgw_info']['server']['db_pass']; 
    86 //            $_SESSION['wallet']['PostgreSQL']['dbname']   = $GLOBALS['phpgw_info']['server']['db_name']; 
    87 //            $_SESSION['wallet']['PostgreSQL']['host']     = $GLOBALS['phpgw_info']['server']['db_host']; 
    88 //             
    89 //            $_SESSION['wallet']['OpenLDAP']['context']   =  $GLOBALS['phpgw_info']['server']['ldap_context']; 
    90 //            $_SESSION['wallet']['OpenLDAP']['host']      =  $GLOBALS['phpgw_info']['server']['ldap_host']; 
    91 //            
    92 //      } 
     68                                self::$sessionStarted = session_start(); 
    9369                 
    94     } 
     70        } 
     71     
     72        public static function writeIniFile($assoc_arr, $path, $has_sections) 
     73        { 
     74                $content = '';   
     75                self::_writeIniFile($content, $assoc_arr, $has_sections); 
     76                if( file_put_contents($path, $content) === false) 
     77                { 
     78                        trigger_error("Permission failure when trying to write in the file: $path ", E_USER_WARNING); 
     79                        return false; 
     80                } 
     81                return true; 
     82        } 
     83 
     84        private static function _writeIniFile(&$content, $assoc_arr, $has_sections) 
     85        { 
     86                foreach ($assoc_arr as $key => $val) 
     87                { 
     88                        if (is_array($val)) 
     89                        { 
     90                                if($has_sections) 
     91                                { 
     92                                        $content .= "[$key]\n"; 
     93                                        self::_writeIniFile(&$content, $val, false); 
     94                                } 
     95                                else                             
     96                                        foreach($val as $iKey => $iVal) 
     97                                        { 
     98                                                if (is_int($iKey)) 
     99                                                        $content .= $key ."[] = $iVal\n"; 
     100                                                else 
     101                                                        $content .= $key ."[$iKey] = $iVal\n"; 
     102                                        } 
     103                        } 
     104                        else 
     105                                $content .= "$key = $val\n"; 
     106                } 
     107        } 
    95108 
    96109} 
    97110 
    98     Config::init(); 
     111        Config::init(); 
    99112         
    100113 
  • trunk/prototype/api/controller.php

    r6419 r6528  
    4444 
    4545require_once(ROOTPATH.'/api/config.php'); 
    46  
     46use prototype\api\Config as Config; 
    4747/** 
    4848TODO list: 
  • trunk/prototype/api/newcontroller.php

    r5715 r6528  
    55 
    66require_once(ROOTPATH.'/api/config.php'); 
     7use prototype\api\Config as Config; 
    78 
    89/** 
  • trunk/prototype/config/user.ini

    r6459 r6528  
    5555phpgwAccountVisible = phpgwAccountVisible 
    5656gidNumber = gidNumber 
     57telephoneNumber=telephoneNumber 
  • trunk/prototype/me.php

    r5399 r6528  
    11<?php 
    2  
    32require_once  (dirname(__FILE__).'/api/controller.php'); 
     3use prototype\api\Config as Config; 
    44 
    55$me = Controller::read(array('concept' => 'user', 'service' => 'OpenLDAP'  , 'id' => Config::me('uidNumber'))); 
    66 
     7if(isset($_POST['refreshToken'])){ 
     8     
     9    $ch = curl_init(); 
     10 
     11    $restConf = parse_ini_file( __DIR__ . '/config/REST.ini', true ); 
     12 
     13    $param  = 'grant_type=refresh_token'; 
     14    $param .= '&client_id=' . $restConf['oauth']['client_id']; 
     15    $param .= '&client_secret=' . $restConf['oauth']['client_secret']; 
     16    $param .= '&refresh_token=' . $_SESSION['oauth']['refresh_token']; 
     17 
     18    // set URL and other appropriate options 
     19    curl_setopt($ch, CURLOPT_URL, $restConf['oauth']['url_token']); 
     20    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: */*')); 
     21    curl_setopt($ch, CURLOPT_POST, TRUE); 
     22    curl_setopt($ch, CURLOPT_POSTFIELDS, $param); 
     23    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);  //configura para nao imprimir a saida na tela 
     24    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2);//Passe um número long como parâmetro que contêm o limite de tempo, em segundos, que você permite as funções CURL levar.  
     25 
     26    // grab URL and pass it to the browser 
     27    $res = curl_exec($ch); 
     28 
     29    // close cURL resource, and free up system resources 
     30    curl_close($ch); 
     31    $a = json_decode($res); 
     32 
     33    if ( isset($a->access_token) ) { 
     34        $_SESSION['oauth']['access_token'] = $a->access_token; 
     35        $_SESSION['oauth']['expires_in'] = $a->expires_in; 
     36        $_SESSION['oauth']['token_type'] = $a->token_type; 
     37        $_SESSION['oauth']['scope'] = $a->scope; 
     38        $_SESSION['oauth']['refresh_token'] = $a->refresh_token; 
     39        $_SESSION['oauth']['client_secret'] = $restConf['oauth']['client_secret']; 
     40    }  else { 
     41        echo json_encode(null); 
     42        return; 
     43    } 
     44} 
     45 
     46$me['token'] = $_SESSION['oauth']['access_token']; 
    747echo json_encode( $me ); 
    848 
  • trunk/prototype/modules/calendar/alarms.php

    r6378 r6528  
    77require_once ROOTPATH.'/modules/calendar/constants.php'; 
    88require_once ROOTPATH.'/api/parseTPL.php'; 
     9 
     10use prototype\api\Config as Config; 
    911 
    1012$target = (gmdate('U') - 300 ).'000'; 
  • trunk/prototype/modules/calendar/interceptors/DAViCalAdapter.php

    r6010 r6528  
    11<?php 
    22require_once ROOTPATH.'/modules/calendar/constants.php'; 
     3use prototype\api\Config as Config; 
    34 
    45class DAViCalAdapter {  
  • trunk/prototype/modules/calendar/interceptors/DBMapping.php

    r6498 r6528  
    55 
    66require_once ROOTPATH . '/modules/calendar/interceptors/Helpers.php'; 
     7 
     8use prototype\api\Config as Config; 
    79 
    810class DBMapping extends Helpers { 
  • trunk/prototype/modules/calendar/interceptors/Notifications.php

    r6331 r6528  
    55require_once ROOTPATH . '/plugins/icalcreator/iCalcreator.class.php'; 
    66require_once ROOTPATH . '/api/parseTPL.php'; 
     7 
     8use prototype\api\Config as Config; 
    79 
    810class Notifications extends Helpers { 
  • trunk/prototype/modules/mail/interceptors/Attachments.php

    r6130 r6528  
    4747* @since      Classe disponibilizada na versão 2.4 
    4848*/ 
     49 
     50use prototype\api\Config as Config; 
     51 
    4952class Attachments {      
    5053         
  • trunk/prototype/modules/mail/interceptors/FollowupflagSecure.php

    r5611 r6528  
    11<?php 
     2 
     3use prototype\api\Config as Config; 
     4 
    25class FollowupflagSecure {       
    36         
  • trunk/prototype/modules/mail/interceptors/Helpers.php

    r6385 r6528  
    11<?php 
    22include_once ROOTPATH."/../expressoMail1_2/inc/class.imap_functions.inc.php"; 
     3 
     4use prototype\api\Config as Config; 
    35 
    46class Helpers {     
  • trunk/prototype/modules/mail/interceptors/LabelSecure.php

    r5540 r6528  
    11<?php 
     2 
     3use prototype\api\Config as Config; 
     4 
    25class LabelSecure {      
    36 
  • trunk/prototype/modules/mail/templates/new_message.ejs

    r6220 r6528  
    6161                                </td> 
    6262                                <td class="value" style="width: 100%;"> 
    63                                         <textarea class="new-message-input to" name="input_to" style="width:99%; resize: none;"></textarea> 
     63                                        <div class="email-area"> 
     64                                                <input class="new-message-input to email-text" name="input_aux_to" type="text" value="" autocomplete="off"/>     
     65                                        </div> 
     66                                        <textarea class="new-message-input to" name="input_to" style="width:99%; resize: none;display : none;"></textarea> 
    6467                                </td> 
    6568                        </tr> 
     
    7174                                </td> 
    7275                                <td class="value"> 
    73                                         <textarea class="new-message-input cc" name="input_cc" style="width:99%; resize: none;"></textarea> 
     76                                        <div class="email-area"> 
     77                                                <input class="new-message-input cc email-text" name="input_aux_cc" type="text" value="" autocomplete="off"/>     
     78                                        </div> 
     79                                        <textarea class="new-message-input cc" name="input_cc" style="width:99%; resize: none;display : none;"></textarea> 
    7480                                </td> 
    7581                        </tr> 
     
    8187                                </td> 
    8288                                <td class="value"> 
    83                                         <textarea class="new-message-input cco" name="input_cco" style="width:99%; resize: none;"></textarea> 
     89                                        <div class="email-area"> 
     90                                                <input class="new-message-input cco email-text" name="input_aux_cco" type="text" value="" autocomplete="off"/>   
     91                                        </div> 
     92                                        <textarea class="new-message-input cco" name="input_cco" style="width:99%; resize: none;display : none;"></textarea> 
    8493                                </td> 
    8594                        </tr> 
  • trunk/prototype/services/ImapServiceAdapter.php

    r6457 r6528  
    4242include_once ROOTPATH."/../expressoMail1_2/inc/class.imap_functions.inc.php"; 
    4343 
     44use prototype\api\Config as Config; 
     45 
    4446/** 
    4547 * 
  • trunk/prototype/services/OpenLDAP.php

    r5804 r6528  
    11<?php 
     2 
     3use prototype\api\Config as Config; 
    24 
    35class OpenLDAP implements Service 
     
    1315        if( !isset($criteria["limit"]) ) 
    1416                $criteria["limit"] = $this->limit; 
    15          
     17       
    1618        $sr =  ldap_search( $this->con , $this->config['context'] , self::parseCriteria($criteria , $map) , self::parseJustthese($justthese, $map) , 0 , $criteria["limit"]);  
    1719        if(!$sr) return false;  
     
    156158        $as = array_shift( $filter ); 
    157159        $op = self::parseOperator( $as ); 
    158                  
     160 
    159161        if( is_array($filter[0]) ) 
    160162        { 
  • trunk/prototype/services/PostgreSQL.php

    r6299 r6528  
    4040 */ 
    4141 
     42use prototype\api\Config as Config; 
     43 
    4244class PostgreSQL implements Service 
    4345{ 
     
    8789            $map = Config::get($uri['concept'], 'PostgreSQL.mapping'); 
    8890            $criteria = ($criteria !== false) ? $this->parseCriteria ( $criteria , $map , ' WHERE '.$map['id'].' = \''.addslashes( $uri['id'] ).'\'') : ' WHERE '.$map['id'].' = \''.addslashes( $uri['id'] ).'\''; 
     91 
    8992            return $this->execSql('UPDATE '.(Config::get($uri['concept'],'PostgreSQL.concept')).' '. self::parseUpdateData( $data ,$map).$criteria); 
    9093    } 
     
    197200                    $val[] = '\''.addslashes($v).'\''; 
    198201            } 
    199              
    200             return '('.implode(',', $ind).') VALUES ('.implode(',', $val).') RETURNING '.$map['id'].' as id'; 
     202            return '('.implode(',', $ind).') VALUES ('.implode(',', $val).') RETURNING '.$map['id'].' as id';        
    201203    } 
    202204         
     
    244246                    $query .= ' GROUP BY '.( is_array($criteria["group"]) ? implode(', ', $criteria["group"]) : $criteria["group"] ).' '; 
    245247            } 
    246              
     248    
    247249            if( isset($criteria["order"]) ) 
    248250            { 
    249                     $query .= ' ORDER BY '.self::parseOrder( $criteria["order"], $map ).' '; 
    250             } 
     251                    //Verificar se os atributos para o ORDER BY serao ordenados em ordem decrescente [DESC] 
     252                    $orderDesc = ( isset($criteria["orderDesc"]) && count($criteria["order"]) == count($criteria["orderDesc"]) ) ? $criteria["orderDesc"] : false; 
     253                 
     254                    $query .= ' ORDER BY '.self::parseOrder( $criteria["order"], $map, $orderDesc ).' '; 
     255             
     256            } 
     257 
    251258            if( isset($criteria["limit"]) ) 
    252259            { 
     
    339346    } 
    340347 
    341    private static function parseOrder($order , &$map) 
     348    private static function parseOrder($order , &$map, $orderDesc=false) 
    342349    { 
    343                    
     350 
    344351        if($notArray = !is_array($order)) //Caso seja um full select pegar todas as keys 
    345352            $order = array( $order ); 
     353 
     354        //Caso seja feita ordenacao em ordem descrescente 
     355        //concatenar DESC em cada atributo 
     356        if($orderDesc !== false){ 
     357                if(!is_array($orderDesc)){ 
     358                        $orderDesc = array( $orderDesc ); 
     359                } 
     360 
     361                for($i=0; $i<count($order); $i++){ 
     362                        $order[$i] .= ($orderDesc[$i] === true) ? ' DESC' : ''; 
     363                } 
     364        } 
    346365 
    347366        $return = array(); 
     
    356375        return ( $notArray ?  $order[0] : implode(', ', $order) ); 
    357376    } 
     377 
    358378} 
    359379 
  • trunk/prototype/services/iCal.php

    r6346 r6528  
    44require_once ROOTPATH . '/plugins/icalcreator/iCalcreator.class.php'; 
    55require_once ROOTPATH . '/modules/calendar/constants.php'; 
     6 
     7use prototype\api\Config as Config; 
    68 
    79//TODO:Timeout request 
  • trunk/services/class.db.php

    r5842 r6528  
    263263                $query = 'select' 
    264264                                                . ' G.oid,' 
     265                                                . ' G.id_group,' 
    265266                                                . ' G.title,' 
    266267                                                . ' G.short_name'; 
     
    288289                                $all_contacts[ $object[ 'oid' ] ]['title'] = $object['title']; 
    289290                                $all_contacts[ $object[ 'oid' ] ]['short_name'] = $object['short_name']; 
     291                                $all_contacts[ $object[ 'oid' ] ]['id'] = $object[ 'id_group' ]; 
    290292                } 
    291293                return array_values($all_contacts); 
  • trunk/setup/applications.php

    r3620 r6528  
    402402                function allow_remove( $app ) 
    403403                { 
    404                         $never_remove = array( 'phpgwapi', 'preferences' ); 
     404                        $never_remove = array( 'phpgwapi', 'preferences' , 'rest' ); 
    405405 
    406406                        return ( in_array( $app, $never_remove ) ) ? '&nbsp;' : '<input type="checkbox" name="remove[' . $app . ']">'; 
Note: See TracChangeset for help on using the changeset viewer.