Changeset 5131


Ignore:
Timestamp:
11/03/11 11:17:35 (12 years ago)
Author:
wmerlotto
Message:

Ticket #2305 - Enviando alteracoes, desenvolvidas internamente na Prognus, do modulo contactcenter.

Location:
trunk/contactcenter
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • trunk/contactcenter/inc/cc_updown.php

    r4880 r5131  
    22        require_once '../../header.session.inc.php'; 
    33//      This script upload an CSV file to import contacts ....   
    4         if($ftmp = $_FILES['import_file']['tmp_name']){                                          
     4        if(array_key_exists('import_file', $_FILES) && $ftmp = $_FILES['import_file']['tmp_name']){                                              
    55                // Foi necessário modificar o caminho onde se recuperava o diretório temporário. 
    66                // Esse caminho foi hardcodificado na string abaixo ( /tmp ) temporariamente, mas deve ser recuperada atraves 
  • trunk/contactcenter/inc/class.abo_catalog.inc.php

    r4742 r5131  
    188188                function init() 
    189189                { 
    190                         $this->db =& $GLOBALS['phpgw']->db; 
    191                         $this->security =& CreateObject('contactcenter.security_manager'); 
     190                        $this->db = $GLOBALS['phpgw']->db; 
     191                        $this->security = CreateObject('contactcenter.security_manager'); 
    192192                } 
    193193 
     
    729729                                                 
    730730                                        case 'iLIKE': 
    731                                                 $return_t[] = 'UPPER( '.$associative_tree[$restrict_data['field']]['table'].'.'. 
    732                                                               $associative_tree[$restrict_data['field']]['field'].') LIKE UPPER(\''.$restrict_data['value'].'\')'; 
     731                                                $return_t[] = 'UPPER( translate('.$associative_tree[$restrict_data['field']]['table'].'.'. 
     732                                                              $associative_tree[$restrict_data['field']]['field'].',\'áàâãäéèêëíìïóòôõöúùûüÁÀÂÃÄÉÈÊËÍÌÏÓÒÔÕÖÚÙÛÜçÇñÑ\',\'aaaaaeeeeiiiooooouuuuAAAAAEEEEIIIOOOOOUUUUcCnN\')) LIKE UPPER(translate(\''.$restrict_data['value'].'\', \'áàâãäéèêëíìïóòôõöúùûüÁÀÂÃÄÉÈÊËÍÌÏÓÒÔÕÖÚÙÛÜçÇñÑ\',\'aaaaaeeeeiiiooooouuuuAAAAAEEEEIIIOOOOOUUUUcCnN\'))'; 
    733733                                                break; 
    734734                                         
    735735                                        case 'LIKE and ~=': 
    736                                                 $return_t[] = 'UPPER( to_ascii('.$associative_tree[$restrict_data['field']]['table'].'.'. 
    737                                       $associative_tree[$restrict_data['field']]['field'].')) LIKE UPPER( to_ascii (\''."%".$restrict_data['value']."%".'\'))'; 
     736                                        $return_t[] = 'UPPER(translate('.$associative_tree[$restrict_data['field']]['table'].'.'. 
     737                                      $associative_tree[$restrict_data['field']]['field'].',\'áàâãäéèêëíìïóòôõöúùûüÁÀÂÃÄÉÈÊËÍÌÏÓÒÔÕÖÚÙÛÜçÇñÑ\',\'aaaaaeeeeiiiooooouuuuAAAAAEEEEIIIOOOOOUUUUcCnN\')) LIKE UPPER(translate(\''."%".($restrict_data['value'])."%".'\', \'áàâãäéèêëíìïóòôõöúùûüÁÀÂÃÄÉÈÊËÍÌÏÓÒÔÕÖÚÙÛÜçÇñÑ\',\'aaaaaeeeeiiiooooouuuuAAAAAEEEEIIIOOOOOUUUUcCnN\'))'; 
    738738                                                break; 
    739739                                         
     
    883883                        foreach($id_states as $id_state) 
    884884                        { 
    885                                 $state =& CreateObject('contactcenter.so_state', $id_state['id_state']); 
     885                                $state = CreateObject('contactcenter.so_state', $id_state['id_state']); 
    886886                                 
    887887                                $result[$id_state['id_state']]['id_state']   = $state->get_id(); 
     
    945945                        foreach($id_cities as $id_city) 
    946946                        { 
    947                                 $city =& CreateObject('contactcenter.so_city', $id_city['id_city']); 
     947                                $city = CreateObject('contactcenter.so_city', $id_city['id_city']); 
    948948                                 
    949949                                $result[$id_city['id_city']]['id_city']      = $city->get_id(); 
     
    10351035                        } 
    10361036 
    1037                         $city =& CreateObject('contactcenter.so_city'); 
     1037                        $city = CreateObject('contactcenter.so_city'); 
    10381038 
    10391039                        $city->set_id_country($city_info['id_country']); 
     
    11071107                        } 
    11081108 
    1109                         $state =& CreateObject('contactcenter.so_state'); 
     1109                        $state = CreateObject('contactcenter.so_state'); 
    11101110 
    11111111                        $state->set_id_country($state_info['id_country']); 
  • trunk/contactcenter/inc/class.bo_catalog_group_catalog.inc.php

    r3970 r5131  
    7575                        if ($ldap_info = $this->catalog['ldap']) 
    7676                        { 
    77                                 $meta_catalog =& CreateObject('contactcenter.bo_global_ldap_catalog',$ldap_info['id_source'], $ldap_info['context'], $this->external); 
     77                                $meta_catalog = CreateObject('contactcenter.bo_global_ldap_catalog',$ldap_info['id_source'], $ldap_info['context'], $this->external); 
    7878                                return $meta_catalog->find($what, $rules, $other, false, $recursive); 
    7979                        } 
  • trunk/contactcenter/inc/class.bo_global_ldap_catalog.inc.php

    r4838 r5131  
    127127                    } 
    128128 
    129                     if(!((strlen($find) == 2 && substr($find, -1) == '%') || $find == '%' )) 
     129                    if(!((strlen($find) == 2 && substr($find, -1) == '%') || $find == '%' ) && !$this->external) 
    130130                          return $this->findAddress($find,$other); 
    131131 
     
    160160                        $ldap = $GLOBALS['phpgw']->common->ldapConnect($this->src_info['host'], $this->src_info['acc'], $this->src_info['pw'], true); 
    161161                        $result_r = $recursive ? ldap_search($ldap , $this->src_info['context'], $filter, $fields, 0, $this->src_info['max_results']) : 
    162                         ldap_list($ldap , $this->src_info['context'], $filter, $fields, 0, $this->src_info['max_results']); 
     162                        //Traz apenas 10 resultados, 
     163                        //ldap_list($ldap , $this->src_info['context'], $filter, $fields, 0, $this->src_info['max_results']); 
     164                        //Traz todos os usuários 
     165                        ldap_list($ldap , $this->src_info['context'], $filter, $fields, 0, 0); 
    163166 
    164167                         if (!$result_r) 
     
    350353                 
    351354                */ 
    352                 function process_restrictions( $rules, &$trans_table, $join_type='&' ) 
     355                function process_restrictions( &$rules, &$trans_table, $join_type='&' ) 
    353356                { 
    354357                        if (!is_array($rules) or !count($rules)) 
     
    832835                                        case 'connections': 
    833836                            $preferences = ExecMethod('contactcenter.ui_preferences.get_preferences'); 
    834                             if (!is_array($preferences)) 
    835                             { 
    836                                                         $preferences['personCardEmail'] = 1; 
    837                                                         $preferences['personCardPhone'] = 2; 
    838                                                 } 
     837 
     838                                                if(!array_key_exists('personCardEmail', $preferences)) $preferences['personCardEmail'] = 1; 
     839                                                if(!array_key_exists('personCardPhone', $preferences)) $preferences['personCardPhone'] = 2;                      
     840                             
    839841                                                unset($l_fields); 
    840842                                                $l_fields['connection_name'] = $this->trans_table['contact.connection.connection_name']; 
  • trunk/contactcenter/inc/class.bo_group.inc.php

    r4754 r5131  
    4242                } 
    4343                 
    44                 function verify_contact($email, $name, $phone){ 
    45                  
    46                         $result = $this-> so -> verifyContact($email, $name, $phone); 
    47                         return $result; 
    48                 } 
    49  
    5044                function verify_shared_contact($owner,$email){ 
    5145 
     
    5852                        $result = $this-> so -> selectContactsByGroup($id); 
    5953                        return $result; 
     54                } 
     55                 
     56                function verify_contact($email, $name, $phone){                           
     57            $result = $this->so->verifyContact($email, $name, $phone);  
     58            return $result;  
    6059                } 
    6160                 
  • trunk/contactcenter/inc/class.bo_people_catalog.inc.php

    r4502 r5131  
    608608                                $added_groups = $groups['added']; 
    609609                                $removed_groups = $groups['removed']; 
    610                                          
     610                                if(is_array($added_groups))      
    611611                                foreach ($added_groups as $group) 
    612612                                { 
     
    616616                                        $bo_group->add_contacts_in_group($group['id_group'], $c); 
    617617                                } 
    618                                          
     618                                if(is_array($removed_groups))    
    619619                                foreach ($removed_groups as $group) 
    620620                                { 
     
    12851285                        }else{ 
    12861286                                $default =1; 
     1287                                if(isset($data['connections']['aditional_phone'])) 
    12871288                                foreach($data['connections']['aditional_phone'] as $connection_name => $connection_fields) 
    12881289                                { 
     
    15671568                                         
    15681569                                        case 'addresses': 
     1570                                                if(is_array($value)) 
    15691571                                                foreach($value as $address_name => $address_fields) 
    15701572                                                { 
  • trunk/contactcenter/inc/class.so_group.inc.php

    r4754 r5131  
    9393                } 
    9494                 
     95                function touchContacts( $pContacts ) 
     96                { 
     97                    
     98                    $qSelect =  'SELECT A.id_contact from phpgw_cc_contact A,'. 
     99                                'phpgw_cc_contact_conns B WHERE '. 
     100                                'A.id_contact = B.id_contact and B.id_connection in('.implode( ',' , $pContacts ).')'; 
     101                     
     102                     
     103                    $qUpdate = 'UPDATE phpgw_cc_contact '. 
     104                               'SET last_status = \'U\', last_update = \''.time().'000\' '. 
     105                               'WHERE id_contact IN( '.$qSelect.' )';    
     106                     
     107                      if (!$this->db->query($qUpdate)) 
     108                        exit ('Query failed! File: '.__FILE__.' on line'.__LINE__); 
     109                } 
     110                 
     111                function touchContactsByGroup ( $pIdGroup ) 
     112                { 
     113                    $qSelect = 'SELECT A.id_contact from phpgw_cc_contact A,'. 
     114                        'phpgw_cc_contact_conns B, phpgw_cc_connections C,phpgw_cc_contact_grps D where '. 
     115                        'A.id_contact = B.id_contact and B.id_connection = C.id_connection '. 
     116                        ' and '. 
     117                        ' D.id_connection = C.id_connection and D.id_group = '.$pIdGroup; 
     118 
     119                     
     120                    $qUpdate = 'UPDATE phpgw_cc_contact '. 
     121                             'SET last_status = \'U\', last_update = \''.time().'000\' '. 
     122                             'WHERE id_contact IN( '.$qSelect.' )';    
     123    
     124 
     125                    if (!$this->db->query($qUpdate)) 
     126                        exit ('Query failed! File: '.__FILE__.' on line'.__LINE__); 
     127                         
     128                     
     129                } 
     130                 
    95131                function delete($data) 
    96132                { 
     
    423459                } 
    424460 
    425                 function verifyContact($email, $name, $phone) 
    426                 { 
    427                         if ($email) { 
    428                          
    429                                 $query = 'select A.names_ordered, C.id_connection from phpgw_cc_contact A,'. 
    430                                 'phpgw_cc_contact_conns B, phpgw_cc_connections C where '. 
    431                                 'A.id_contact = B.id_contact and B.id_connection = C.id_connection '. 
    432                                 'and B.id_typeof_contact_connection = 1 and '. 
    433                                 "A.id_owner ='" .$this->owner."' and C.connection_value = '".$email. "'"; 
    434  
    435                                 if (!$this->db->query($query)) 
    436                                 {        
    437                                         exit ('Query failed! File: '.__FILE__.' on line'.__LINE__); 
    438                                 } 
    439                           
    440                                 $return = false; 
    441                          
    442                                 while($this->db->next_record()) 
    443                                 { 
    444                                         $row = $this->db->row(); 
    445                                         $return[] =  $row['names_ordered'];  
    446                                 } 
    447                         }  
    448                          
    449                         if (!$return && $phone) {  
    450  
    451                                 $query = 'select A.names_ordered, C.id_connection from phpgw_cc_contact A,'. 
    452                                 'phpgw_cc_contact_conns B, phpgw_cc_connections C where '. 
    453                                 'A.id_contact = B.id_contact and B.id_connection = C.id_connection '. 
    454                                 'and B.id_typeof_contact_connection = 2 and '. 
    455                                 "A.id_owner ='" .$this->owner."' and C.connection_value = '".$phone. "'"; 
    456  
    457                                 if (!$this->db->query($query)) 
    458                                 {        
    459                                         exit ('Query failed! File: '.__FILE__.' on line'.__LINE__); 
    460                                 } 
    461                           
    462                                 $return = false; 
    463                          
    464                                 while($this->db->next_record()) 
    465                                 { 
    466                                         $row = $this->db->row(); 
    467                                         $return[] =  $row['names_ordered'];  
    468                                 } 
    469  
    470                         } 
    471                          
    472                         if (!$return && $name) {  
    473  
    474                                 $query = "select names_ordered, C.id_connection from phpgw_cc_contact where id_owner = '" . $this->owner . "' and RTRIM(names_ordered) = '". $name. "'"; 
    475  
    476                                 if (!$this->db->query($query)) 
    477                                 {        
    478                                         exit ('Query failed! File: '.__FILE__.' on line'.__LINE__); 
    479                                 } 
    480                           
    481                                 $return = false; 
    482                          
    483                                 while($this->db->next_record()) 
    484                                 { 
    485                                         $row = $this->db->row(); 
    486                                         $return[] =  $row['names_ordered'];  
    487                                 } 
    488  
    489                         } 
    490                     $return[] =  $row['id_connection']; 
    491  
    492                         return $return; 
    493                 }                
    494  
    495461                function verifySharedContact($owner,$email) 
    496462                { 
     
    588554                function updateContactsByGroup($id_group, $contacts) 
    589555                { 
    590                                                  
     556                        //Atualiza timestamp de status dos contatos afetados 
     557                        $this -> touchContacts($contacts); 
     558                        $this -> touchContactsByGroup($id_group); 
     559                        ///---------------------------------------------------// 
    591560                        $query = 'select C.id_connection from phpgw_cc_contact A,'. 
    592561                        'phpgw_cc_contact_conns B, phpgw_cc_connections C,phpgw_cc_contact_grps D where '. 
     
    724693                } 
    725694                 
     695                 
     696                function verifyContact($email, $name, $phone)  
     697                                {  
     698                                                                if($email && $phone && $name){ 
     699                                                                 
     700                                                                        $query = 'select A.names_ordered, C.id_connection from phpgw_cc_contact A,'.  
     701                                                'phpgw_cc_contact_conns B, phpgw_cc_connections C where '.  
     702                                                'A.id_contact = B.id_contact and B.id_connection = C.id_connection '.  
     703                                                'and B.id_typeof_contact_connection = 1 and '.  
     704                                                "A.id_owner ='" .$this->owner."' and (C.connection_value = '".$email. "' or C.connection_value = '".$phone. "') and RTRIM(A.names_ordered) = '". $name. "'";  
     705                                                                 
     706                                                                        if (!$this->db->query($query))  
     707                                                {         
     708                                                        exit ('Query failed! File: '.__FILE__.' on line'.__LINE__);  
     709                                                }  
     710                                           
     711                                                $return = false;  
     712                                          
     713                                                while($this->db->next_record())  
     714                                                {  
     715                                                        $row = $this->db->row();  
     716                                                        $return[] =  $row['names_ordered'];   
     717                                                }  
     718                                                                } 
     719                                        if (!$return && $email) {  
     720                                          
     721                                                $query = 'select A.names_ordered, C.id_connection from phpgw_cc_contact A,'.  
     722                                                'phpgw_cc_contact_conns B, phpgw_cc_connections C where '.  
     723                                                'A.id_contact = B.id_contact and B.id_connection = C.id_connection '.  
     724                                                'and B.id_typeof_contact_connection = 1 and '.  
     725                                                "A.id_owner ='" .$this->owner."' and C.connection_value = '".$email. "' and RTRIM(A.names_ordered) = '". $name. "'";  
     726                  
     727                                                if (!$this->db->query($query))  
     728                                                {         
     729                                                        exit ('Query failed! File: '.__FILE__.' on line'.__LINE__);  
     730                                                }  
     731                                           
     732                                                $return = false;  
     733                                          
     734                                                while($this->db->next_record())  
     735                                                {  
     736                                                        $row = $this->db->row();  
     737                                                        $return[] =  $row['names_ordered'];   
     738                                                }  
     739                                        }                       
     740                                        if (!$return && $phone) {   
     741                  
     742                                                                                $query = 'select A.names_ordered, C.id_connection from phpgw_cc_contact A,'.  
     743                                                'phpgw_cc_contact_conns B, phpgw_cc_connections C where '.  
     744                                                'A.id_contact = B.id_contact and B.id_connection = C.id_connection '.  
     745                                                'and B.id_typeof_contact_connection = 2 and '.  
     746                                                "A.id_owner ='" .$this->owner."' and C.connection_value = '".$phone. "' and RTRIM(A.names_ordered) = '". $name. "'";  
     747                  
     748                                                if (!$this->db->query($query))  
     749                                                {         
     750                                                        exit ('Query failed! File: '.__FILE__.' on line'.__LINE__);  
     751                                                }  
     752                                           
     753                                                $return = false;  
     754                                          
     755                                                while($this->db->next_record())  
     756                                                {  
     757                                                        $row = $this->db->row();  
     758                                                        $return[] =  $row['names_ordered'];   
     759                                                }  
     760                  
     761                                        }  
     762 
     763                                        if (!$return && $name) {   
     764                  
     765                                                $query = " 
     766                                                                                select A.names_ordered, C.id_connection  
     767                                                                                 
     768                                                                                from phpgw_cc_contact A,  
     769                                                                                        phpgw_cc_contact_conns B,  
     770                                                                                        phpgw_cc_connections C 
     771                                                                                where A.id_contact = B.id_contact and B.id_connection = C.id_connection and 
     772                                                                                B.id_typeof_contact_connection = 2 and 
     773                                                                                A.id_owner = '" . $this->owner . "' and RTRIM(A.names_ordered) = '". $name. "'";  
     774                  
     775                                                if (!$this->db->query($query))  
     776                                                {         
     777                                                        exit ('Query failed! File: '.__FILE__.' on line'.__LINE__);  
     778                                                }  
     779                                           
     780                                                $return = false;  
     781                                          
     782                                                while($this->db->next_record())  
     783                                                {  
     784                                                        $row = $this->db->row();  
     785                                                        $return[] =  $row['names_ordered'];   
     786                                                }  
     787                  
     788                                        }  
     789                                    $return[] =  $row['id_connection'];  
     790 
     791                                        return $return;  
     792                                }  
     793                 
     794                 
    726795        } 
    727796?> 
  • trunk/contactcenter/inc/class.ui_api.inc.php

    r4500 r5131  
    4848                        $template->set_var('cc_msg_err_serialize_data_unknown',lang('Data to be serialized is of unknown type!')); 
    4949                        $template->set_var('cc_msg_err_shared',lang('No shared catalog that has permission to add.')); 
     50                        $template->set_var('cc_msg_err_duplicate_group',lang('This group name already exists, please enter another name.')); 
    5051                        /* End Messages */ 
    5152 
     
    422423                                } 
    423424                                else if ($i == 4){ 
    424                                         $fieldsHTML .= '<input id="ccQuickAddI'.$i.'" type="text" value="" maxlength="100" style="position: absolute; top: '.($fieldsTop+$i*$fieldsSpace).'px; left: 110px; width: 135px;">'."\n"; 
     425                                        $fieldsHTML .= '<input id="ccQuickAddI'.$i.'" type="text" value="" onkeyup="emailTolower(\'ccQuickAddI' .$i. '\')" maxlength="100" style="position: absolute; top: '.($fieldsTop+$i*$fieldsSpace).'px; left: 110px; width: 135px;">'."\n"; 
    425426                                }else if ($i == 3){ 
    426427                                        $fieldsHTML .= '<input id="ccQuickAddI'.$i.'" type="text" value="" onkeyup="formatPhone(this)" maxlength="30" style="position: absolute; top: '.($fieldsTop+$i*$fieldsSpace).'px; left: 110px; width: 135px;">'."\n"; 
  • trunk/contactcenter/inc/class.ui_data.inc.php

    r4838 r5131  
    1919                var $public_functions = array( 
    2020                        'data_manager' => true, 
     21                        'advanced_searh_fields' => true  
    2122                ); 
    2223 
     
    6869                        } 
    6970 
    70                         $this->page_info['actual_catalog'] =& $this->bo->set_catalog($this->page_info['actual_catalog']); 
     71                        $this->page_info['actual_catalog'] = $this->bo->set_catalog($this->page_info['actual_catalog']); 
    7172 
    7273 
     
    257258                        $GLOBALS['phpgw']->template->set_var('cc_msg_outlook_2k_pt', lang('Export as Outlook 2000 (Portuguese) CSV.')); 
    258259                        $GLOBALS['phpgw']->template->set_var('cc_msg_outlook_2k_en', lang('Export as Outlook 2000 (English) CSV.')); 
     260                        $GLOBALS['phpgw']->template->set_var('cc_msg_outlook_2003', lang('Export as Outlook 2003 CSV.')); 
    259261                        $GLOBALS['phpgw']->template->set_var('cc_msg_expresso_default_csv', lang('Export as Expresso (Default) CSV.')); 
    260262                        $GLOBALS['phpgw']->template->set_var('cc_msg_copy_to_catalog', lang('Copy to personal catalog.')); 
    261263                        $GLOBALS['phpgw']->template->set_var('cc_msg_add_contact_to_group', lang('You did not add any contact for this group.')); 
    262264                        $GLOBALS['phpgw']->template->set_var('cc_msg_fill_field_name', lang('Fill the field Full Name')); 
     265                        $GLOBALS['phpgw']->template->set_var('cc_msg_show_extra_detail', lang("Show extra contact's details.")); 
    263266 
    264267                        $select_groups = ''; 
     
    282285                                $GLOBALS['phpgw']->template->set_var('cc_contact_type', 'default'); 
    283286                        } 
     287                         
     288                        /* 
     289                         * Monta Contactcenter Busca Avancada 
     290                         */ 
     291                        $c = CreateObject('phpgwapi.config','contactcenter'); 
     292                        $c->read_repository(); 
     293                        $current_config = $c->config_data; 
     294 
     295                        $arraySearch = array(); 
     296                        foreach ($current_config as $index => $value) 
     297                        { 
     298 
     299                            if(substr($index, 0, 24) == 'cc_attribute_searchable_') 
     300                            { 
     301                                if($value == 'true') 
     302                                { 
     303                                    $v = substr($index, 24, strlen($index)); 
     304                                    $arraySearch[] = $v; 
     305                                } 
     306                            } 
     307                        } 
     308                        $advanceSearchArray = array(); 
     309                        foreach ($arraySearch as $value) 
     310                        { 
     311                            foreach ($current_config as $index => $value2) 
     312                            { 
     313                                if($value == substr($index, 22, strlen($index)) && substr($index, 0, 22) == 'cc_attribute_ldapname_') 
     314                                { 
     315                                    foreach ($current_config as $index2 => $value3) 
     316                                    { 
     317                                        if($value == substr($index2, 18, strlen($index2)) && substr($index2, 0, 18) == 'cc_attribute_name_') 
     318                                             $advanceSearchArray[$value2] =  $value3; 
     319                                    } 
     320                                } 
     321 
     322                            } 
     323                        } 
     324 
     325                        $advanceSearch = array(); 
     326                        foreach ($advanceSearchArray as $index => $value) 
     327                            $advanceSearch[] ='"'.$index.'":"'.$value.'"'; 
     328 
     329                        $advancedFields =  "{".implode(',',$advanceSearch)."}"; 
     330 
     331 
     332                        $GLOBALS['phpgw']->template->set_var('cc_config_advanced_search', $advancedFields); 
     333 
     334                         
     335                         
    284336                        $GLOBALS['phpgw']->template->parse('out','index'); 
    285337 
     
    289341                        $main .= $api->get_quick_add_plugin(); 
    290342                        $main .= $api->get_add_group(); 
     343                        $main .= $api->get_contact_details(); 
    291344                        $main .= $GLOBALS['phpgw']->template->get_var('out'); 
    292345 
     
    358411                                case 'get_catalog_add_contact': 
    359412                                        // To support ldap catalogs with accentuation 
    360                                         echo serialize($this->get_catalog_add_contact(utf8_decode($_POST['id']))); 
     413                                        echo serialize($this->get_catalog_add_contact($_POST['id'])); 
    361414                                        return; 
    362415 
     
    450503                                        echo $this->get_list_owners_perms_add(); 
    451504                                        return; 
    452  
     505                                case 'get_contact_details': 
     506                                        return $this->get_contact_details($_GET['id']); 
    453507                        } 
    454508                } 
     
    487541                { 
    488542                        $id_catalog = str_replace('\\"', '"', $id_catalog); 
    489                         $temp =& $this->bo->set_catalog($id_catalog); 
     543                        $temp = $this->bo->set_catalog($id_catalog); 
    490544 
    491545                        if(!$this->bo->catalog->src_info) { 
     
    505559                                $this->page_info['changed'] = true; 
    506560                                $this->page_info['actual_entries'] = false; 
    507                                 $this->page_info['actual_catalog'] =& $temp; 
     561                                $this->page_info['actual_catalog'] = $temp; 
    508562                                $this->save_session(); 
    509563 
     
    13301384                                ); 
    13311385 
     1386                                //verifica se esta habilitado a opcao de exibir os detalhes extras 
     1387                                $objconfig = CreateObject('phpgwapi.config', 'contactcenter'); 
     1388                                $config = $objconfig->read_repository(); 
     1389                                 
    13321390                                //echo 'Page: '.$page.'<br>'; 
    13331391                                $n_entries = count($this->page_info['actual_entries']); 
     
    13891447                                        for($z = 0; $z < $info['count']; $z++) { 
    13901448                                                $owner_names[$info[$z]['uidnumber'][0]] = array("cn" => $info[$z]['cn'][0], "uid" => $info[$z]['uid'][0]); 
     1449                                        } 
     1450 
     1451                                        //SAMPLE : dc=teste, dc=diretorio, dc=empresa 
     1452                                        if(!count($owner_names)){ 
     1453                                                $dns = explode(',', $dn); 
     1454                                                for($i = count($dns); $i > 0; $i--){ 
     1455                                                        $ds = $GLOBALS['phpgw']->common->ldapConnect($this->bo->catalog->src_info['host'], $this->bo->catalog->src_info['acc'], $this->bo->catalog->src_info['pw'], false); 
     1456                                                        //verifica se veio a base como parametro, remoção de erros gerados por paramentro null 
     1457                                                        //if(isset($dns[$i])){ 
     1458                                                                $sr = ldap_search($ds,$dns[$i], $filter,$justThese); 
     1459                                                                $info = ldap_get_entries($ds, $sr); 
     1460                                                                ldap_close($ds); 
     1461                                                                for($z = 0; $z < $info['count']; $z++) { 
     1462                                                                        $owner_names[$info[$z]['uidnumber'][0]] = array("cn" => $info[$z]['cn'][0], "uid" => $info[$z]['uid'][0]); 
     1463                                                                }        
     1464                                                                if(count($owner_names)){ 
     1465                                                                        $i = 0; 
     1466                                                                } 
     1467                                                //      } 
     1468                                                } 
    13911469                                        } 
    13921470                                } 
     
    14181496                                        ); 
    14191497 
    1420                                         $groups =& $this->bo->catalog->get_multiple_entries($ids,$fields); 
     1498                                        $groups = $this->bo->catalog->get_multiple_entries($ids,$fields); 
    14211499 
    14221500                                        $i = 0; 
     
    14731551                                if($external) 
    14741552                                { 
    1475                                         $contacts = &$this->bo->catalog->get_multiple_entries($ids,$fields,false,true); 
     1553                                        $contacts = $this->bo->catalog->get_multiple_entries($ids,$fields,false,true); 
    14761554                                } else{ 
    1477                                         $contacts = &$this->bo->catalog->get_multiple_entries($ids,$fields); 
    1478                                 } 
    1479  
     1555                                        $contacts = $this->bo->catalog->get_multiple_entries($ids,$fields); 
     1556                                } 
    14801557/*******/ 
    1481  
    1482  
    14831558                                if (!is_array($contacts) or !count($contacts)) 
    14841559                                { 
     
    15171592/********/ 
    15181593 
    1519                                                 $final[3][$i][2] = $contact['companies']['company1']['title']? urldecode( $contact['companies']['company1']['title'] ) :'none'; 
     1594                                                $final[3][$i][2] = $contact['companies']['company1']['title']? $contact['companies']['company1']['title']:'none'; 
    15201595 
    15211596                                                //Para exibir a matricula do empregado 
     
    15511626                                                                                $default_phone_found = true; 
    15521627                                                                        } 
    1553  
     1628                                                                        if($final[3][$i][4] == 'none' or !$final[3][$i][4]){ 
     1629                                                                                $final[3][$i][4] = "Não informado."; 
     1630                                                                                $final[3][$i][13] = $conn_info['id_connection']; 
     1631                                                                        } 
    15541632/**rev 104**/ 
    15551633                                                                        //if ($_SESSION['phpgw_info']['user']['preferences']['contactcenter']['voip_enabled'] && !$external){ 
     
    15631641                                                                        $final[3][$i][3] = $conn_info['connection_value'] ? $conn_info['connection_value'] : 'none'; 
    15641642                                                                } 
     1643                                                                if($final[3][$i][4] == 'none' or !$final[3][$i][4]){ 
     1644                                                                        $final[3][$i][4] = 'Não informado'; 
     1645                                                                        $final[3][$i][13] = $conn_info['id_connection']; 
     1646                                                                 
     1647                                                                } 
    15651648                                                        } 
    15661649                                                } 
     
    15711654                                                } 
    15721655 
    1573                                                 if (!$final[3][$i][4]) 
    1574                                                 { 
    1575                                                         $final[3][$i][4] = 'none'; 
     1656                                                if($final[3][$i][4] == 'none' or !$final[3][$i][4]){ 
     1657                                                                        $final[3][$i][4] = 'Não informado.'; 
     1658                                                                        $final[3][$i][13] = $conn_info['id_connection']; 
     1659                                                                 
    15761660                                                } 
    15771661 
    15781662                                                $final[3][$i][5] = $contact['alias']? urldecode( $contact['alias'] ):'none'; 
    1579                                                 $final[3][$i][6] = $ids[$i]; 
     1663                                                $final[3][$i][6] = utf8_decode($ids[$i]); 
    15801664 
    15811665/**rev 104**/ 
     
    15931677                                                        $final[3][$i][12] = lang('Shared').": ".$owner_names[$owners[$i]]['cn']; 
    15941678                                                } 
    1595 /******/ 
    15961679 
    15971680                                                $final[4][$i] = $contact['photo'] ? 1  : 0; 
     1681                                                 
     1682 
     1683 
    15981684                                                $i++; 
    15991685                                        } 
     
    16101696                                $final[9] = $count; 
    16111697                                $final[11] = $this->bo->catalog_level; 
    1612  
    1613  
     1698                                $final[12] = isset($config['cc_allow_details'])? $config['cc_allow_details'] : false; 
     1699                                $final[13] = '<span class="" '; 
    16141700                                $this->page_info['actual_letter'] = $letter; 
    16151701                                $this->page_info['actual_page'] = $page; 
     
    16561742                                } 
    16571743                                ldap_close($ds); 
     1744                                if(!count($owner_names)){ 
     1745                                                $dns = explode(',', $dn); 
     1746                                                for($i = count($dns); $i > 0; $i--){ 
     1747                                                        $ds = $GLOBALS['phpgw']->common->ldapConnect($this->bo->catalog->src_info['host'], $this->bo->catalog->src_info['acc'], $this->bo->catalog->src_info['pw'], false); 
     1748                                                        $sr = ldap_search($ds,$dns[$i], $filter,$justThese); 
     1749                                                        $info = ldap_get_entries($ds, $sr); 
     1750                                                        ldap_close($ds); 
     1751                                                        for($z = 0; $z < $info['count']; $z++) { 
     1752                                                                $owner_names[$info[$z]['uidnumber'][0]] = array("cn" => $info[$z]['cn'][0], "uid" => $info[$z]['uid'][0]); 
     1753                                                        } 
     1754                                                        if(count($owner_names)){ 
     1755                                                                $i = 0; 
     1756                                                        } 
     1757                                                } 
     1758                                        } 
    16581759                        } 
    16591760                        echo serialize ($owner_names);   
     
    16901791                        $boGroup = CreateObject('contactcenter.bo_group'); 
    16911792 
    1692                         $all_contacts = $boGroup->get_all_contacts('only_email',$shared_from); 
     1793                        $all_contacts = $boGroup->get_all_contacts(false,$shared_from); 
    16931794                         
    16941795                        $contact_options = ""; 
    16951796                        if(count($all_contacts)) {                                       
    16961797                                foreach($all_contacts as $idx => $contact) {                             
    1697                                         $contact_options .= "<OPTION value='".$contact['id_connection']."'>".$contact['names_ordered']." (".$contact['connection_value'].")</OPTION>"; 
     1798                                        $contact_options .= "<OPTION value='".$contact['id_connection']."'>".$contact['names_ordered']; 
     1799                                        if (isset($contact['connection_value'])) 
     1800                                                $contact_options .= " (".$contact['connection_value'].")</OPTION>"; 
     1801                                        else 
     1802                                                $contact_options .= " (". $contact['phone'].")</OPTION>"; 
    16981803                                } 
    16991804                        } 
     
    18051910 
    18061911                        /* Relations */ 
     1912                        /* Groups */ 
     1913                        /* 
     1914                         * Criado uma estrutura no data que conterá os grupos do 
     1915                         * contato. O formato é: 
     1916                         * data['groups'] = array( 
     1917                         *                                              'id_group' => array( 
     1918                         *                                                                              'id_group', 'title', 'short_name' 
     1919                         *                                                                              ) 
     1920                         *                                              ); 
     1921                         */ 
     1922                        $boGroup = CreateObject('contactcenter.bo_group'); 
     1923                        $groups = $boGroup->get_contact_groups($id); 
     1924                         
     1925                        $i = 0; 
     1926                        $data['groups'] = array(); 
     1927                        if(is_array($groups)) 
     1928                        foreach($groups as $group) 
     1929                        { 
     1930                                $idGroup = $group['id_group']; 
     1931                                $data['groups'][$idGroup] = array( 
     1932                                        'title'                 => $group['title'], 
     1933                                        'id_group'              => $idGroup, 
     1934                                        'short_name'    => $group['short_name'] 
     1935                                ); 
     1936                                $i++; 
     1937                        } 
    18071938 
    18081939                        echo serialize($data); 
     
    18241955                        $predata[] = $boPeopleCatalog -> get_all_countries(); 
    18251956                        $predata[] = $boPeopleCatalog -> get_all_connections_types(); 
     1957                        $boGroup = CreateObject('contactcenter.bo_group');  
     1958            //$predata[] = $boGroup->get_groups_by_user(); 
    18261959                        //$predata[] = $this->bo->catalog->get_all_relations_types(); 
    18271960 
     1961                        if ($this->typeContact == 'shared_contacts') {   
     1962                                                $so_contact = CreateObject('contactcenter.so_contact',  $GLOBALS['phpgw_info']['user']['account_id']);  
     1963                                $relacionados = $so_contact->get_relations();  
     1964                                          
     1965                                foreach($relacionados as $uid_relacionado => $tipo_relacionamento) {      
     1966                                                $predata[] = $boGroup->get_groups_by_user($uid_relacionado);                                              
     1967                                                }         
     1968                                        } else {  
     1969                                                                $predata[] = $boGroup->get_groups_by_user();  
     1970                                                        } 
     1971                         
     1972                         
    18281973                        $i = 0; 
    18291974                        foreach($predata as $data_) 
     
    18832028                                } 
    18842029                        } 
    1885  
    1886                         // verifica se email já existe! 
    1887                         $boGroup = CreateObject('contactcenter.bo_group'); 
    1888                         $contact = $boGroup->verify_contact($tdata[4]); 
    1889  
    1890                         if($contact) 
    1891                         { 
    1892                                 $str_contact = "\r\n - ".implode("\r\n - ",$contact); 
    1893  
    1894                             if ($echo) 
    1895                             { 
    1896                                 echo serialize(array( 
    1897                                         'msg'    => lang('Problems on adding your Contact. The email "%1" already exists in: %2',$tdata[4], $str_contact), 
    1898                                         'status' => 'alreadyExists' 
    1899                                 )); 
    1900  
    1901                                 return; 
    1902                             } 
    1903                             else 
    1904                                 { 
    1905                                     return serialize(array( 
    1906                                         'msg'       => lang('Problems on adding your Contact. The email "%1" already exists in: %2',$tdata[4], $str_contact), 
    1907                                         'status'    => 'alreadyExists', 
    1908                                         'id_connection'  => $contact[1] 
    1909                                     )); 
    1910                                 } 
    1911                         } 
    1912  
    19132030                        $data['alias'] = addslashes($tdata[0]); 
    19142031                        $data['given_names'] = addslashes($tdata[1]); 
     
    23052422                                        $email = $dataConn['connection'.$i]['connection_value']; 
    23062423                                    } 
    2307                                 } 
    2308                                 // verifica se email já existe! 
    2309                                 $boGroup = CreateObject('contactcenter.bo_group'); 
    2310                                 $contact = $boGroup->verify_contact($email); 
    2311                                 if($contact) 
    2312                                 { 
    2313                                     $str_contact = "\r\n - ".implode("\r\n - ",$contact); 
    2314                                     echo serialize(array( 
    2315                                     'msg'    => lang('Problems on adding your Contact. The email "%1" already exists in: %2',$tdata[4], $str_contact), 
    2316                                     'status' => 'alreadyExists' 
    2317                                     )); 
    2318                                     return; 
    23192424                                } 
    23202425 
     
    24482553                                                /* Does nothing... */ 
    24492554                                                break; 
    2450  
     2555                                        case 'groups': 
     2556                                                $groups = $data['groups']; 
     2557                                                unset($data['groups']); 
     2558                                                break; 
    24512559                                        default: 
    24522560                                                echo serialize(array( 
     
    24822590                                        'status' => 'fail' 
    24832591                                ); 
     2592                        } 
     2593                        else 
     2594                        { 
     2595                                if (isset($old_connections)) 
     2596                                        $this->bo->catalog->update_contact_groups($id, $groups, $old_connections); 
     2597                                else 
     2598                                        $this->bo->catalog->update_contact_groups($id, $groups); 
    24842599                        } 
    24852600 
     
    26172732                                        $email = $dataConn['connection'.$i]['connection_value']; 
    26182733                                    } 
    2619                                 } 
    2620                                 // verifica se email já existe! 
    2621                                 $boGroup = CreateObject('contactcenter.bo_group'); 
    2622                                 $contact = $boGroup->verify_shared_contact($owner,$email); 
    2623                                 if($contact) 
    2624                                 { 
    2625                                     $str_contact = "\r\n - ".implode("\r\n - ",$contact); 
    2626                                     echo serialize(array( 
    2627                                     'msg'    => lang('Problems on adding your Contact. The email "%1" already exists in: %2',$tdata[4], $str_contact), 
    2628                                     'status' => 'alreadyExists' 
    2629                                     )); 
    2630                                     return; 
    26312734                                } 
    26322735 
     
    27652868                        } 
    27662869 
    2767                         $code = '$id = $this->bo->catalog->'; 
     2870                        //$code = '$id = $this->bo->catalog->'; 
    27682871 
    27692872                        if (!is_null($id) and $id !== '') 
    27702873                        { 
    2771                                 $code .= $code.'update_single_info($id, $data);'; 
     2874                                //$code .= $code.'update_single_info($id, $data);'; 
     2875                                $id = $this->bo->catalog->update_single_info($id, $data); 
     2876                                if(!$id){ 
    27722877                                $result = array( 
    2773                                         'msg' => lang('Updated Successfully!'), 
     2878                                                'msg' => lang('Some problem occured when trying to insert/update contact information.<br>'. 
     2879                                        'Report the problem to the Administrator.'), 
     2880                                                'status' => 'fail' 
     2881                                ); 
     2882                        } 
     2883                                else{ 
     2884                                $result = array( 
     2885                                                'msg' => lang('Updated Successfully!'), 
    27742886                                        'status' => 'ok' 
    27752887                                ); 
    27762888                        } 
     2889                        } 
    27772890                        else 
    27782891                        { 
    2779                                 $code .= 'add_single_entry($data,'.$owner.');'; 
    2780                                 $result = array( 
    2781                                         'msg' => lang('Entry Added Successfully!'), 
    2782                                         'status' => 'ok' 
    2783                                 ); 
    2784                         } 
    2785  
    2786                         eval($code); 
    2787  
    2788                         if (!($id)) 
    2789                         { 
     2892                                //$code .= 'add_single_entry($data,'.$owner.');'; 
     2893                                $id = $this->bo->catalog->add_single_entry($data,$owner); 
     2894                                if(!$id){ 
    27902895                                $result = array( 
    27912896                                        'msg' => lang('Some problem occured when trying to insert/update contact information.<br>'. 
     
    27942899                                ); 
    27952900                        } 
    2796  
     2901                                else{ 
     2902                                        $result = array( 
     2903                                                'msg' => lang('Entry Added Successfully!'), 
     2904                                                'status' => 'ok' 
     2905                                        ); 
     2906                                } 
     2907                        } 
    27972908                        echo serialize($result); 
    2798 } 
     2909                } 
    27992910                /*! 
    28002911 
     
    30963207                        if (!is_array($data) || (!$data['search_for'] && !$full_search) || !is_array($data['fields'])) 
    30973208                        { 
    3098                                 echo serialize(array( 
    3099                                         'msg'    => lang('Invalid parameters'), 
    3100                                         'status' => 'abort' 
    3101                                 )); 
    3102  
    3103                                 return array('error' => lang('Invalid parameters')); 
     3209                        //      echo serialize(array( 
     3210                        //              'msg'    => lang('Invalid parameters'), 
     3211                        //              'status' => 'abort' 
     3212                        //      )); 
     3213 
     3214                        //      return array('error' => lang('Invalid parameters')); 
     3215                                $rules = array( 
     3216                                        0 => array( 
     3217                                                'field' => $data['fields']['search'], 
     3218                                                'type'  => 'LIKE', 
     3219                                                'value' => '%' 
     3220                                        ) 
     3221                                ); 
    31043222                        } 
    31053223 
     
    31183236                        { 
    31193237 
    3120                                 $data['search_for'] = utf8_encode($data['search_for']); 
     3238                                $data['search_for'] = $data['search_for']; 
    31213239                        } 
    31223240 
     
    32453363                                // Get only this attributes: dn, cn for external catalogs, 
    32463364                                // used to restrict the attributes used in filters 
    3247                                 $ids = $this->bo->find(array($data['fields']['id'], $data['fields']['search']), $rules, array('order' => $data['fields']['search'], 'sort' => 'ASC'), $data['search_for'] != null); 
    3248                         } 
     3365                                $ids = $this->bo->find(array($data['fields']['id'], $data['fields']['search']), $rules, array('order' => $data['fields']['search'], 'sort' => 'ASC', 'customFilter' => $data['custom_filter'], 'CN' => $data['CN'], 'exact' => $data['exact']), $data['search_for'] != null);   } 
    32493366                        else 
    32503367                        { 
     
    32593376                                        'contact.connection.mail', 
    32603377                                        'contact.connection.phone' 
    3261                                         ), $rules, array('order' => $data['fields']['search'], 'sort' => 'ASC'), $data['search_for_area'], $data['search_for'] != null ); 
    3262                         } 
     3378                                        ), $rules, array('order' => $data['fields']['search'], 'sort' => 'ASC', 'customFilter' => $data['custom_filter'], 'CN' => $data['CN'], 'exact' => $data['exact']), $data['search_for_area'], $data['search_for'] != null ); } 
    32633379 
    32643380                        if (!is_array($ids) || !count($ids)) 
     
    36413757                        for($z = 0; $z < 5; $z++) { 
    36423758                                $participant = $info[0][$justThese[$z]]; 
     3759                                $participant[0] = utf8_decode($participant[0]); 
    36433760                                array_push($array_participants, $participant); 
    36443761                        } 
     
    37553872                        $contacts = $boGroup->get_all_contacts(); 
    37563873                        $streamBuffer = ''; 
     3874                        $stramArray = Array(); 
    37573875 
    37583876                        if(!count($contacts)) 
     
    37803898 
    37813899                                case 'outlook_pt-BR': 
    3782                                         $streamBuffer = "Nome;Sobrenome;Segundo nome;Nome;Apelido;End. de email;Endereço residencial;" 
     3900                                        $streamBuffer = "Nome;Apelido;End. de email;Endereço residencial;" 
    37833901                                                                        ."Cidade do endereço residencial;CEP do endereço residencial;Estado;País/região do endereço residencial;" 
    37843902                                                                        ."Telefone residencial;Fax residencial;Telefone celular;Página pessoal da Web;Rua do endereço comercial;" 
     
    37893907                                        foreach($contacts as $index => $object){ 
    37903908                                                $streamBuffer.= "\"".$object[ 'names_ordered'] . "\";" 
    3791                                                         .";;;" 
    37923909                                                        . "\"".$object[ 'alias' ] . "\";" 
    37933910                                                        . "\"".$object[ 'main-mail' ] . "\";" 
     
    38133930                                                        . "\"".$object[ 'job_title' ] . "\";" 
    38143931                                                        . "\"".$object[ 'department' ] . "\";" 
    3815                                                         .";" 
     3932                                                        ."\"\";" 
    38163933                                                        . "\"".str_replace("\r\n\x0a","\t",$object[ 'notes' ]) . "\"\r\n"; 
    38173934                                        } 
     
    39584075                                                ."Home Address 2,Home City,Home State,Home ZipCode,Home Country,Work Address,Work Address 2," 
    39594076                                                ."Work City,Work State,Work ZipCode,Work Country,Job Title,Department,Organization,Web Page 1," 
    3960                                                 ."Web Page 2,Birth Year,Birth Month,Birth Day,Custom 1,Custom 2,Custom 3,Custom 4,Notes,\n"; 
     4077                                                ."Web Page 2,Birth Year,Birth Month,Birth Day,Custom 1,Custom 2,Custom 3,Custom 4,Notes,\r\n"; 
    39614078 
    39624079                                        foreach($contacts as $index => $object){ 
    39634080                                                $array_birth = explode("-",$object[ 'birthdate' ]); 
    3964                                                 $streamBuffer.= "\"".$object[ 'names_ordered'] . "\"," 
    3965                                                         .",," 
    3966                                                         . "\"".$object[ 'alias' ] . "\"," 
    3967                                                         . "\"".$object[ 'main-mail' ] . "\"," 
    3968                                                         . "\"".$object[ 'alternative-mail' ] . "\"," 
    3969                                                         ."," 
    3970                                                         . "\"".$phone . "\"," 
    3971                                                         . "\"".$object[ 'home-phone' ] . "\"," 
    3972                                                         . "\"".$object[ 'business-fax' ] . "\"," 
    3973                                                         . "\"".$object[ 'business-pager' ] . "\"," 
    3974                                                         . "\"".$object[ 'mobile' ] . "\"," 
    3975                                                         . "\"".$object[ 'home-address' ] . "\"," 
    3976                                                         . "\"".$object[ 'home-address-2' ] . "\"," 
    3977                                                         . "\"".$object[ 'home-city_name' ] . "\"," 
    3978                                                         . "\"".$object[ 'home-state_name' ] . "\"," 
    3979                                                         . "\"".$object[ 'home-postal_code' ] . "\"," 
    3980                                                         . "\"".$object[ 'home-id_country' ] . "\"," 
    3981                                                         . "\"".$object[ 'business-address' ] . "\"," 
    3982                                                         . "\"".$object[ 'business-address-2' ] . "\"," 
    3983                                                         . "\"".$object[ 'business-city_name' ] . "\"," 
    3984                                                         . "\"".$object[ 'business-state_name' ] . "\"," 
    3985                                                         . "\"".$object[ 'business-postal_code' ] . "\"," 
    3986                                                         . "\"".$object[ 'business-id_country' ] . "\"," 
    3987                                                         . "\"".$object[ 'job_title' ] . "\"," 
    3988                                                         . "\"".$object[ 'department' ] . "\"," 
    3989                                                         . "\"".$object[ 'corporate_name' ] . "\"," 
    3990                                                         . "\"".$object[ 'web_page' ] . "\"," 
    3991                                                         . "\"".$object[ 'web_page' ] . "\"," 
    3992                                                         . "\"".$array_birth[0] . "\"," 
    3993                                                         . "\"".$array_birth[1] . "\"," 
    3994                                                         . "\"".$array_birth[2] . "\"," 
    3995                                                         .",,,," 
    3996                                                         . "\"".str_replace("\r\n\x0a","\t",$object[ 'notes' ]) . "\",\r\n"; 
    3997  
     4081 
     4082                                                $stramArray[0] = "\"".$object[ 'names_ordered'] . "\""; 
     4083                                                $stramArray[1] = ""; 
     4084                                                $stramArray[2] = "\"".$object[ 'names_ordered'] . "\""; 
     4085                                                $stramArray[3] = "\"".$object[ 'alias' ] . "\""; 
     4086                                                $stramArray[4] = "\"".$object[ 'main-mail' ] . "\""; 
     4087                                                $stramArray[5] = "\"".$object[ 'alternative-mail' ] . "\""; 
     4088                                                $stramArray[6] = ""; 
     4089                                                $stramArray[7] = "\"".$object[ 'business-phone' ] . "\""; 
     4090                                                $stramArray[8] = "\"".$object[ 'home-phone' ] . "\""; 
     4091                                                $stramArray[9] = "\"".$object[ 'business-fax' ] . "\""; 
     4092                                                $stramArray[10] = "\"".$object[ 'business-pager' ] . "\""; 
     4093                                                $stramArray[11] = "\"".$object[ 'mobile' ] . "\""; 
     4094                                                $stramArray[12] = "\"".$object[ 'home-address' ] . "\""; 
     4095                                                $stramArray[13] = "\"".$object[ 'home-address-2' ] . "\""; 
     4096                                                $stramArray[14] = "\"".$object[ 'home-city_name' ] . "\""; 
     4097                                                $stramArray[15] = "\"".$object[ 'home-state_name' ] . "\""; 
     4098                                                $stramArray[16] = "\"".$object[ 'home-postal_code' ] . "\""; 
     4099                                                $stramArray[17] = "\"".$object[ 'home-id_country' ] . "\""; 
     4100                                                $stramArray[18] = "\"".$object[ 'business-address' ] . "\""; 
     4101                                                $stramArray[19] = "\"".$object[ 'business-address-2' ] . "\""; 
     4102                                                $stramArray[20] = "\"".$object[ 'business-city_name' ] . "\""; 
     4103                                                $stramArray[21] = "\"".$object[ 'business-state_name' ] . "\""; 
     4104                                                $stramArray[22] = "\"".$object[ 'business-postal_code' ] . "\""; 
     4105                                                $stramArray[23] = "\"".$object[ 'business-id_country' ] . "\""; 
     4106                                                $stramArray[24] = "\"".$object[ 'job_title' ] . "\""; 
     4107                                                $stramArray[25] = "\"".$object[ 'department' ] . "\""; 
     4108                                                $stramArray[26] = "\"".$object[ 'corporate_name' ] . "\""; 
     4109                                                $stramArray[27] = ""; 
     4110                                                $stramArray[28] = ""; 
     4111                                                $stramArray[29] = "\"".$array_birth[0] . "\""; 
     4112                                                $stramArray[30] = "\"".$array_birth[1] . "\""; 
     4113                                                $stramArray[31] = "\"".$array_birth[2] . "\""; 
     4114                                                $stramArray[32] = ""; 
     4115                                                $stramArray[33] = ""; 
     4116                                                $stramArray[34] = ""; 
     4117                                                $stramArray[35] = ""; 
     4118                                                $stramArray[36] = ""; 
     4119                                                $stramArray[37] = "\"".str_replace("\r\n\x0a","\t",$object[ 'notes' ]) . "\"\r\n"; 
     4120                                                 
     4121                                                if($object[ 'phone' ]){ 
     4122                                                        if(!$object[ 'home-phone' ]) 
     4123                                                                $stramArray[8] = "\"".$object[ 'phone' ]. "\""; 
     4124                                                        else if(!$object[ 'mobile' ]) 
     4125                                                                $stramArray[11] = "\"".$object[ 'phone' ]. "\""; 
     4126                                                        else if(!$object[ 'business-phone' ]) 
     4127                                                                $stramArray[7] = "\"".$object[ 'phone' ]. "\""; 
     4128                                                } 
     4129                                                 
     4130                                                $streamBuffer .= implode("," , $stramArray); 
    39984131                                        } 
    39994132                                break; 
     
    40074140 
    40084141                            foreach($contacts as $index => $object){ 
    4009                                 $streamBuffer .= "\"".$object[ 'names_ordered'] . "\"," 
    4010                                     . "\"".$object[ 'alias' ] . "\"," 
    4011                                     . "\"".$object[ 'main-mail' ] . "\"," 
    4012                                     . "\"".$object[ 'alternative-mail' ] . "\"," 
    4013                                     . "\"".$object[ 'mobile' ] . "\"," 
    4014                                     . "\"".$object[ 'business-phone' ] . "\"," 
    4015                                     . "\"".$object[ 'business-address' ] . "\"," 
    4016                                     . "\"".$object[ 'business-complement' ] . "\"," 
    4017                                     . "\"".$object[ 'business-postal_code' ] . "\"," 
    4018                                     . "\"".$object[ 'business-city_name' ] . "\"," 
    4019                                     . "\"".$object[ 'business-state_name' ] . "\"," 
    4020                                     . "\"".$object[ 'business-id_country' ] . "\"," 
    4021                                     . "\"".$object[ 'home-phone' ] . "\"," 
    4022                                     . "\"".$object[ 'home-address' ] . "\"," 
    4023                                     . "\"".$object[ 'home-complement' ] . "\"," 
    4024                                     . "\"".$object[ 'home-postal_code' ] . "\"," 
    4025                                     . "\"".$object[ 'home-city_name' ] . "\"," 
    4026                                     . "\"".$object[ 'home-state_name' ] . "\"," 
    4027                                     . "\"".$object[ 'home-id_country' ] . "\"," 
    4028                                                                 . "\"".$object[ 'birthdate' ] . "\"," 
    4029                                                                 . "\"".$object[ 'sex' ] . "\"," 
    4030                                                                 . "\"".$object[ 'pgp_key' ] . "\"," 
    4031                                                                 . "\"".str_replace("\r\n\x0a","\t",$object[ 'notes' ]) . "\"," 
    4032                                                                 . "\"".$object[ 'web_page' ] . "\"," 
    4033                                                                 . "\"".$object[ 'corporate_name' ] . "\"," 
    4034                                                                 . "\"".$object[ 'job_title' ] . "\"," 
    4035                                                                 . "\"".$object[ 'department' ] . "\"," 
    4036                                                                 . "\"".$object[ 'business-fax' ] . "\"," 
    4037                                                                 . "\"".$object[ 'business-pager' ] . "\"," 
    4038                                                                 . "\"".$object[ 'business-mobile' ] . "\"," 
    4039                                                                 . "\"".$object[ 'home-fax' ] . "\"," 
    4040                                                                 . "\"".$object[ 'home-pager' ] . "\"," 
    4041                                                                 . "\"".$object[ 'business-address-2' ] . "\"," 
    4042                                                                 . "\"".$object[ 'home-address-2' ] . "\"\r\n"; 
     4142                                                                $stramArray[0] = "\"".$object[ 'names_ordered'] . "\""; 
     4143                                                                $stramArray[1] = "\"".$object[ 'alias' ] . "\""; 
     4144                                                                $stramArray[2] = "\"".$object[ 'main-mail' ] . "\""; 
     4145                                                                $stramArray[3] = "\"".$object[ 'alternative-mail' ] . "\""; 
     4146                                                                $stramArray[4] = "\"".$object[ 'mobile' ] . "\""; 
     4147                                                                $stramArray[5] = "\"".$object[ 'business-phone' ] . "\""; 
     4148                                                                $stramArray[6] = "\"".$object[ 'business-address' ] . "\""; 
     4149                                                                $stramArray[7] = "\"".$object[ 'business-complement' ] . "\""; 
     4150                                                                $stramArray[8] = "\"".$object[ 'business-postal_code' ] . "\""; 
     4151                                                                $stramArray[9] = "\"".$object[ 'business-city_name' ] . "\""; 
     4152                                                                $stramArray[10] = "\"".$object[ 'business-state_name' ] . "\""; 
     4153                                                                $stramArray[11] = "\"".$object[ 'business-id_country' ] . "\""; 
     4154                                                                $stramArray[12] = "\"".$object[ 'home-phone' ] . "\""; 
     4155                                                                $stramArray[13] = "\"".$object[ 'home-address' ] . "\"";  
     4156                                                                $stramArray[14] = "\"".$object[ 'home-complement' ] . "\""; 
     4157                                                                $stramArray[15] = "\"".$object[ 'home-postal_code' ] . "\""; 
     4158                                                                $stramArray[16] = "\"".$object[ 'home-city_name' ] . "\""; 
     4159                                                                $stramArray[17] = "\"".$object[ 'home-state_name' ] . "\""; 
     4160                                                                $stramArray[18] = "\"".$object[ 'home-id_country' ] . "\""; 
     4161                                                                $stramArray[19] = "\"".$object[ 'birthdate' ] . "\""; 
     4162                                                                $stramArray[20] = "\"".$object[ 'sex' ] . "\""; 
     4163                                                                $stramArray[21] = "\"".$object[ 'pgp_key' ] . "\""; 
     4164                                                                $stramArray[22] = "\"".str_replace("\r\n\x0a","\t",$object[ 'notes' ]) . "\""; 
     4165                                                                $stramArray[23] = "\"".$object[ 'web_page' ] . "\""; 
     4166                                                                $stramArray[24] = "\"".$object[ 'corporate_name' ] . "\""; 
     4167                                                                $stramArray[25] = "\"".$object[ 'job_title' ] . "\""; 
     4168                                                                $stramArray[26] = "\"".$object[ 'department' ] . "\""; 
     4169                                                                $stramArray[27] = "\"".$object[ 'business-fax' ] . "\""; 
     4170                                                                $stramArray[28] = "\"".$object[ 'business-pager' ] . "\""; 
     4171                                                                $stramArray[29] = "\"".$object[ 'business-mobile' ] . "\""; 
     4172                                                                $stramArray[30] = "\"".$object[ 'home-fax' ] . "\""; 
     4173                                                                $stramArray[31] = "\"".$object[ 'home-pager' ] . "\""; 
     4174                                                                $stramArray[32] = "\"".$object[ 'business-address-2' ] . "\""; 
     4175                                                                $stramArray[33] = "\"".$object[ 'home-address-2' ] . "\"\r\n"; 
     4176                                                                 
     4177                                                                if($object[ 'phone' ]){ 
     4178                                                                        if(!$object[ 'home-phone' ]) 
     4179                                                                                $stramArray[12] = "\"".$object[ 'phone' ]. "\""; 
     4180                                                                        else if(!$object[ 'mobile' ]) 
     4181                                                                                $stramArray[4] = "\"".$object[ 'phone' ]. "\""; 
     4182                                                                        else if(!$object[ 'business-phone' ]) 
     4183                                                                                $stramArray[5] = "\"".$object[ 'phone' ]. "\""; 
     4184                                                                } 
     4185                                                 
     4186                                                                $streamBuffer .= implode("," , $stramArray); 
    40434187                            } 
    40444188                        break; 
     4189                                         
     4190                                        case 'outlook2003': 
     4191                                        $streamBuffer = "\"Tratamento\",\"Primeiro nome\",\"Segundo Nome\",\"Sobrenome\",\"Sufixo\",". 
     4192                                        "\"Empresa\",\"Departamento\",\"Cargo\",\"Business Street\",\"Rua do endereço comercial 2\",". 
     4193                                        "\"Rua do endereço comercial 3\",\"Business City\",\"Business State\",". 
     4194                                        "\"Business Postal Code\",\"Business Country\",\"Endereço residencial\",\"Endereço residencial 2\",". 
     4195                                        "\"Endereço residencial 3\",\"Cidade do endereço residencial\",\"Estado\",\"CEP do endereço residencial\",\"País do endereço residencial\",". 
     4196                                        "\"Outro endereço\",\"Outro endereço 2\",\"Outro endereço 3\",\"Cidade\",\"Estado\",\"CEP\",\"País\",". 
     4197                                        "\"Telefone do assistente\",\"Fax comercial\",\"Telefone comercial\",\"Telefone comercial 2\",\"Retorno de chamada\",". 
     4198                                        "\"Telefone do carro\",\"Telefone principal da empresa\",\"Fax residencial\",\"Telefone residencial\",". 
     4199                                        "\"Telefone residencial 2\",\"ISDN\",\"Telefone celular\",\"Outro fax\",\"Outro telefone\",\"Pager\",\"Telefone principal\",". 
     4200                                        "\"Radiofone\",\"Telefone TTY/TDD\",\"Telex\",\"Anotações\",\"Birthday\",\"Caixa postal de outro endereço\",\"Caixa postal do endereço comercial\",". 
     4201                                        "\"Caixa postal do endereço residencial\",\"Categorias\",\"Código da empresa\",\"Código do governo\",\"Conta\",\"Datas especiais\",\"Disponibilidade da internet\",\"E-mail Address\",". 
     4202                                        "\"Tipo de email\",\"Nome para exibição do email\",\"Endereço de email 2\",". 
     4203                                        "\"Tipo de email 2\",\"Nome para exibição do email 2\",". 
     4204                                        "\"Endereço de email 3\",\"Tipo de email 3\",\"Nome para exibição de email 3\",". 
     4205                                        "\"Filhos\",\"Hobby\",\"Idioma\",\"Indicação\",\"Informações para cobrança\",\"Iniciais\",\"Local\",". 
     4206                                        "\"Nome do assistente\",\"Nome do gerenciador\",\"Página da Web\",\"Palavras-chave\",\"Particular\",\"Personalizado 1\",\"Personalizado 2\",". 
     4207                                        "\"Personalizado 3\",\"Personalizado 4\",\"Prioridade\",\"Profissão\",\"Quilometragem\",\"Sala\",\"Sensibilidade\",\"Servidor de diretório\",". 
     4208                                        "\"Sexo\",\"Spouse\"\r\n"; 
     4209                                        foreach($contacts as $index => $object){ 
     4210                                                $stramArray[0] = "\"".$object[ 'alias' ] . "\""; 
     4211                                                $stramArray[1] = "\"".$object[ 'names_ordered'] . "\""; 
     4212                                                $stramArray[2] = ""; 
     4213                                                $stramArray[3] = ""; 
     4214                                                $stramArray[4] = "";                                                                                             
     4215                                                $stramArray[5] = "\"".$object[ 'corporate_name' ] . "\"";                        
     4216                                                $stramArray[6] = "\"".$object[ 'department' ] . "\""; 
     4217                                                $stramArray[7] = "\"".$object[ 'job_title' ] . "\"";                             
     4218                                                $stramArray[8] = "\"".$object[ 'business-address' ] . "\""; 
     4219                                                $stramArray[9] = "\"".$object[ 'business-address-2' ] . "\""; 
     4220                                                $stramArray[10] = ""; 
     4221                                                $stramArray[11] = "\"".$object[ 'business-city_name' ] . "\"";           
     4222                                                $stramArray[12] = "\"".$object[ 'business-state_name' ] . "\"";          
     4223                                                $stramArray[13] = "\"".$object[ 'business-postal_code' ] . "\"";         
     4224                                                $stramArray[14] = "\"".$object[ 'business-id_country' ] . "\"";          
     4225                                                $stramArray[15] = "\"".$object[ 'home-address' ] . "\"";                         
     4226                                                $stramArray[16] = "\"".$object[ 'business-address-2' ] . "\"";           
     4227                                                $stramArray[17] = "";                                                                                            
     4228                                                $stramArray[18] = "\"".$object[ 'home-city_name' ] . "\""; 
     4229                                                $stramArray[19] = "\"".$object[ 'home-state_name' ] . "\""; 
     4230                                                $stramArray[20] = "\"".$object[ 'home-postal_code' ] . "\""; 
     4231                                                $stramArray[21] = "\"".$object[ 'home-id_country' ] . "\""; 
     4232                                                $stramArray[22] = ""; 
     4233                                                $stramArray[23] = ""; 
     4234                                                $stramArray[24] = ""; 
     4235                                                $stramArray[25] = "\"".$object[ 'home-city_name' ] . "\""; 
     4236                                                $stramArray[26] = "\"".$object[ 'home-state_name' ] . "\""; 
     4237                                                $stramArray[27] = "\"".$object[ 'home-postal_code' ] . "\""; 
     4238                                                $stramArray[28] = "\"".$object[ 'home-id_country' ] . "\""; 
     4239                                                $stramArray[29] = ""; 
     4240                                                $stramArray[30] = "\"".$object[ 'business-fax' ] . "\""; 
     4241                                                $stramArray[31] = "\"".$object[ 'business-phone' ] . "\""; 
     4242                                                $stramArray[32] = "\"".$object[ 'mobile' ] . "\""; 
     4243                                                $stramArray[33] = ""; 
     4244                                                $stramArray[34] = ""; 
     4245                                                $stramArray[35] = ""; 
     4246                                                $stramArray[36] = "\"".$object[ 'home-fax' ] . "\""; 
     4247                                                $stramArray[37] = "\"".$object[ 'home-phone' ] . "\""; 
     4248                                                $stramArray[38] = ""; 
     4249                                                $stramArray[39] = ""; 
     4250                                                $stramArray[40] = "\"".$object[ 'mobile' ] . "\""; 
     4251                                                $stramArray[41] = ""; 
     4252                                                $stramArray[42] = ""; 
     4253                                                $stramArray[43] = "\"".$object[ 'home-pager' ] . "\""; 
     4254                                                $stramArray[44] = "\"".$object[ 'phone' ] . "\""; 
     4255                                                $stramArray[45] = ""; 
     4256                                                $stramArray[46] = ""; 
     4257                                                $stramArray[47] = ""; 
     4258                                                $stramArray[48] = "\"".str_replace("\r\n\x0a","\t",$object[ 'notes' ]) . "\""; 
     4259                                                $stramArray[49] = "\"".$object[ 'birthdate' ] . "\""; 
     4260                                                $stramArray[50] = ""; 
     4261                                                $stramArray[51] = ""; 
     4262                                                $stramArray[52] = ""; 
     4263                                                $stramArray[53] = ""; 
     4264                                                $stramArray[54] = ""; 
     4265                                                $stramArray[55] = ""; 
     4266                                                $stramArray[56] = ""; 
     4267                                                $stramArray[57] = ""; 
     4268                                                $stramArray[58] = ""; 
     4269                                                $stramArray[59] = "\"".$object[ 'main-mail' ] . "\""; 
     4270                                                $stramArray[60] = ""; 
     4271                                                $stramArray[61] = ""; 
     4272                                                $stramArray[62] = "\"".$object[ 'alternative-mail' ] . "\""; 
     4273                                                $stramArray[63] = ""; 
     4274                                                $stramArray[64] = ""; 
     4275                                                $stramArray[65] = ""; 
     4276                                                $stramArray[66] = ""; 
     4277                                                $stramArray[67] = ""; 
     4278                                                $stramArray[68] = ""; 
     4279                                                $stramArray[69] = ""; 
     4280                                                $stramArray[70] = ""; 
     4281                                                $stramArray[71] = ""; 
     4282                                                $stramArray[72] = ""; 
     4283                                                $stramArray[73] = ""; 
     4284                                                $stramArray[74] = ""; 
     4285                                                $stramArray[75] = ""; 
     4286                                                $stramArray[76] = ""; 
     4287                                                $stramArray[77] = "\"".$object[ 'web_page' ] . "\""; 
     4288                                                $stramArray[78] = ""; 
     4289                                                $stramArray[79] = ""; 
     4290                                                $stramArray[80] = ""; 
     4291                                                $stramArray[81] = ""; 
     4292                                                $stramArray[82] = ""; 
     4293                                                $stramArray[83] = ""; 
     4294                                                $stramArray[84] = ""; 
     4295                                                $stramArray[85] = ""; 
     4296                                                $stramArray[86] = ""; 
     4297                                                $stramArray[87] = ""; 
     4298                                                $stramArray[88] = ""; 
     4299                                                $stramArray[89] = ""; 
     4300                                                $stramArray[90] = "\"".$object[ 'sex' ] . "\""; 
     4301                                                $stramArray[91] = "\r\n"; 
     4302                                                 
     4303                                                $streamBuffer .= implode("," , $stramArray); 
     4304                            } 
     4305                        break; 
    40454306 
    40464307                        } 
    40474308 
    40484309                        $file = "contacts_".md5(microtime()).".swp"; 
    4049                         $tempDir = ini_get("session.save_path"); 
     4310                        $tempDir = $GLOBALS['phpgw_info']['server']['temp_dir']; 
    40504311                        $f = fopen($tempDir.'/'.$file,"w"); 
    40514312                        if(!$f) 
     
    40954356                //sobrenome, notas e e-mail; 
    40964357                //em 19/06/2009 - Rommel Cysne (rommel.cysne@serpro.gov.br); 
    4097                 function import_contacts($typeImport, $id_group=false){ 
     4358                function import_contacts($typeImport, $id_group=false) 
     4359                { 
    40984360                        $this->so_group = CreateObject('contactcenter.so_group'); 
    4099                         if($file = $_SESSION['contactcenter']['importCSV']) { 
     4361                        if($file = $_SESSION['contactcenter']['importCSV'])  
     4362                        { 
    41004363                                unset($_SESSION['contactcenter']['importCSV']); 
    41014364                                $len = filesize($file); 
     
    41074370                                if ($typeImport == 'outlook') 
    41084371                                        $delim = ';'; 
    4109                                 else if ($typeImport == 'auto') 
     4372                                else if ($typeImport == 'auto' || $typeImport== 'thunderbird') 
    41104373                                $delim = strstr($input_header,',') ? ',' : ';'; 
    41114374                                else 
     
    41494412                                                        break; 
    41504413                                                case 'outlook': 
    4151                                                         $name_pos=3; 
    4152                                                         $email_pos=4; 
    4153                                                         $phone_pos=7; 
    4154                                                         $home_phone_pos=10; 
    4155                                                         $personal_cell_pos=12; 
    4156                                                         $corporate_street_pos=13; 
    4157                                                         $cep_pos=15; 
    4158                                                         $phone_pos=18; 
     4414                                                        $name_pos=0; 
     4415                                                        $email_pos=2; 
     4416                                                        $phone_pos=8; 
     4417                                                        $home_phone_pos=9; 
     4418                                                        $personal_cell_pos=10; 
     4419                                                        $corporate_street_pos=12; 
     4420                                                        $cep_pos=14; 
     4421                                                        $corporate_phone_pos=18; 
    41594422                                                        $fax_pos=19; 
    41604423                                                        $pager_pos=20; 
     
    41634426                                                case 'thunderbird': 
    41644427                                                        $name_pos=2; 
     4428                                                        $alias_pos=3; 
     4429                                                        //MAILS 
    41654430                                                        $email_pos=4; 
    4166                                                         $phone_pos=7; 
     4431                                                        $aditionalEmail_pos=5; 
     4432                                                         
     4433                                                        //PHONES 
     4434                                                        $corporate_phone_pos=7;  
     4435                                                        $main_phone_pos=8; 
     4436                                                        $home_phone_pos=8; 
     4437                                                        $fax_pos=9; 
     4438                                                        $pager_pos=10; 
     4439                                                        $personal_cell_pos=11; 
     4440                                                         
     4441                                                        //ADRESS 
     4442                                                        $street_pos=12; 
     4443                                                        $street_2_pos = 13; 
     4444                                                        $city_pos=14; 
     4445                                                        $state_pos=15; 
     4446                                                        $cep_pos=16; 
     4447                                                        $country_pos=17; 
     4448                                                         
     4449                                                        //CORPORATE ADRESS 
     4450                                                        $corporate_street_pos=18; 
     4451                                                        $corporate_city_pos=20; 
     4452                                                        $corporate_state_pos=21; 
     4453                                                        $corporate_cep_pos=22; 
     4454                                                        $corporate_country_pos=23; 
     4455                                                         
     4456                                                        //CORPORATE DETAILS 
     4457                                                        $job_title_pos=24; 
     4458                                                        $department_pos=25; 
     4459                                                        $corporate_name_pos=26; 
     4460                                                         
     4461                                                        $notes_pos=36; 
     4462                                                        break; 
     4463                                                case 'outlook2003': 
     4464                                                        $alias_pos=0; 
     4465                                                        $name_pos=1; 
     4466                                                        //CORPORATE DETAILS 
     4467                                                        $corporate_name_pos=5; 
     4468                                                        $department_pos=6; 
     4469                                                        $job_title_pos=7; 
     4470                                                        //CORPORATE ADRESS 
     4471                                                        $corporate_comp_pos=7; 
     4472                                                        $corporate_street_pos=8; 
     4473                                                        $street_2_pos = 9;       
     4474                                                        $corporate_city_pos=11; 
     4475                                                        $corporate_state_pos=12; 
     4476                                                        $corporate_cep_pos=13; 
     4477                                                        $corporate_country_pos=14; 
     4478                                                        //HOME ADRESS 
     4479                                                        $street_pos=13; 
     4480                                                        $comp_pos=14; 
     4481                                                        $cep_pos=15; 
     4482                                                        $city_pos=16; 
     4483                                                        $state_pos=17; 
     4484                                                        $country_pos=18; 
     4485                                                        //PHONE's 
     4486                                                        $corporate_phone_pos=31; 
     4487                                                        $fax_pos=36; 
     4488                                                        $home_phone_pos=37; 
     4489                                                        $pager_pos=43; 
     4490                                                        $main_phone_pos=44; 
     4491                                                        //OTHER's 
     4492                                                        $notes_pos=48; 
     4493                                                        $birth_pos=49; 
     4494                                                        //EMAIL's 
     4495                                                        $email_pos=59; 
     4496                                                        $aditionalEmail_pos=62; 
    41674497                                                        break; 
    41684498                                                case 'expresso': 
     
    42764606                                } 
    42774607 
    4278                                 while (($data = fgetcsv($handle, $len, $delim))) { 
     4608 
     4609                 
     4610                                while (($data = fgetcsv($handle, $len, $delim)))  
     4611                                { 
    42794612                                        foreach ($header as $key=>$heading) 
    42804613                                $row[$heading]=(isset($data[$key])) ? $data[$key] : ''; 
    42814614 
    42824615                                                $sdata = array(); 
    4283                                                 $full_name  = trim($row[$header[$name_pos]]); 
    4284                                                 $email          = trim($row[$header[$email_pos]]); 
    4285                                                 $phone          = trim($row[$header[$phone_pos]]); 
    4286                                                 $name2          = trim($row[$header[$name2_pos]]); 
    4287                                                 $name3          = trim($row[$header[$name3_pos]]); 
    4288  
    4289                                                 $birth          = trim($row[$header[$birth_pos]]); 
    4290                                                 $notes          = trim($row[$header[$notes_pos]]); 
    4291                                                 $altEmail       = trim($row[$header[$altEmail_pos]]); 
    4292                                                 $sdata['alias']                         = trim($row[$header[$alias_pos]]); 
    4293                                                 $sdata['corporate_name']      = trim($row[$header[$corporate_name_pos]]); 
    4294                                                 $sdata['job_title']             = trim($row[$header[$job_title_pos]]); 
    4295                                                 $sdata['department']            = trim($row[$header[$department_pos]]); 
    4296                                                 $sdata['web_page']                      = trim($row[$header[$web_page_pos]]); 
     4616                                                $full_name               = addslashes(trim($row[$header[$name_pos]])); 
     4617                                                $email                       = addslashes(trim($row[$header[$email_pos]])); 
     4618                                                $phone                       = addslashes(trim($row[$header[$main_phone_pos]])); 
     4619                                                $name2                   = addslashes(trim($row[$header[$name2_pos]])); 
     4620                                                $name3                       = addslashes(trim($row[$header[$name3_pos]])); 
     4621                                                $birth                       = addslashes(trim($row[$header[$birth_pos]])); 
     4622                                                $notes                                   = addslashes(trim($row[$header[$notes_pos]])); 
     4623                                                $altEmail                                = addslashes(trim($row[$header[$altEmail_pos]])); 
     4624                                                $sdata['alias']          = addslashes(trim($row[$header[$alias_pos]])); 
     4625                                                $sdata['corporate_name'] = addslashes(trim($row[$header[$corporate_name_pos]])); 
     4626                                                $sdata['job_title']      = addslashes(trim($row[$header[$job_title_pos]])); 
     4627                                                $sdata['department']     = addslashes(trim($row[$header[$department_pos]])); 
     4628                                                $sdata['web_page']               = addslashes(trim($row[$header[$web_page_pos]])); 
     4629                                                $sdata['sex']            = addslashes(trim($row[$header[$sex_pos]])); 
     4630                                                $sdata['pgp_key']        = addslashes(trim($row[$header[$pgp_key_pos]])); 
    42974631                                                 
    4298                                                 $sdata['sex']                   = trim($row[$header[$sex_pos]]); 
    4299                                                 $sdata['pgp_key']      = trim($row[$header[$pgp_key_pos]]); 
    4300  
    4301  
    4302                                         $full_name = $full_name; 
    43034632                                        $array_name = explode(' ', str_replace('"','',(str_replace('\'','',$full_name)))); 
    43044633                                        $sdata['given_names'] = addslashes($array_name[0]); 
     
    43864715                                                $sdata['addresses']['address_personal']['id_city'] =  trim($row[$header[$city_pos]]); 
    43874716 
    4388                                         if(trim($birth)) { 
     4717                                        if(trim($birth))  
     4718                                        { 
    43894719                                                $array_birth = explode("/",trim($birth)); 
    43904720                                                $sdata['birthdate'] = date('Y-m-d', mktime(0,0,0,$array_birth[1],$array_birth[0],$array_birth[2])); 
     
    43944724                                        //$sdata['is_quick_add'] = true; 
    43954725                                        $sdata['connections']['default_phone']['connection_value'] = $phone; 
    4396  
     4726                                        if(!$phone){ 
     4727 
     4728                                        } 
    43974729                                        //      verifica se email já existe! 
    43984730                                        $email = addslashes($email); 
    4399                                         $contact = $boGroup->verify_contact($email); 
    4400  
    4401                                         if(!$sdata['given_names'] && $email){ 
     4731                                        $contact = false; 
     4732                                        $contact = $boGroup->verify_contact($email, $full_name, $phone); 
     4733                                        if(!$sdata['given_names'] && $email) 
     4734                                        { 
    44024735                                                        $a_email = explode("@",$email); 
    44034736                                                        $sdata['given_names'] = addslashes($a_email[0]); 
     
    44064739                                        $line_iteration = $return['_failure'] + $return['_existing'] + $return['_new']; 
    44074740 
    4408                                         if($contact){ 
     4741                                        if($contact[0] != null) 
     4742                                        { 
    44094743                                                $return['_existing']++; 
    44104744                                        } 
    4411                                         else if((!eregi("^[/_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) && $email) { 
     4745                                        else if((!eregi("^[a-zA-Z0-9][_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]{1,})*$", $email)) && $email) { 
    44124746                                                $return['_failure']++; 
    44134747                                                $return['_failure_status'] .= "Line: " . ($line_iteration + 2) . ", Invalid E-Mail address: " . $email ."<br>"; 
     
    44324766                        echo serialize($return); 
    44334767                } 
     4768                 
     4769                function get_contact_details($id) 
     4770                { 
     4771                        $data = array(); 
     4772                         
     4773                        if(!$this->bo->catalog->src_info) { 
     4774                                $ldap = CreateObject('contactcenter.bo_ldap_manager'); 
     4775                                $this->bo->catalog->src_info = $ldap->srcs[1]; 
     4776                        } 
     4777                        //$id = urlencode($id); 
     4778                        $ds = $GLOBALS['phpgw']->common->ldapConnect($this->bo->catalog->src_info['host'], $this->bo->catalog->src_info['acc'], $this->bo->catalog->src_info['pw'], true);                               
     4779                        $dn=$this->bo->catalog->src_info['dn']; 
     4780 
     4781                        //buscar os atributos do ldap 
     4782                        $configobj = CreateObject('phpgwapi.config', 'contactcenter'); 
     4783                        $prefs = $configobj->read_repository(); 
     4784                        $attr_names = array(); 
     4785                        $attr_types = array(); 
     4786                        $justThese = array(); 
     4787                        foreach ($prefs as $pref_key => $pref_value) 
     4788                        { 
     4789                                if (stripos($pref_key, "cc_attribute_name_") !== false) 
     4790                                { 
     4791                                        $num = substr($pref_key, strlen("cc_attribute_name_")); 
     4792                                        $attr_names[] = $prefs["cc_attribute_name_$num"]; 
     4793                                        $attr_types[] = $prefs["cc_attribute_type_$num"]; 
     4794                                        $justThese[] = strtolower($prefs["cc_attribute_ldapname_$num"]); 
     4795                                } 
     4796                        } 
     4797                         
     4798 
     4799 
     4800                        $sr = ldap_read($ds,utf8_encode($id), "objectClass=*",$justThese);                                                       
     4801                        $info = ldap_get_entries($ds, $sr); 
     4802                        if ($info) 
     4803                        { 
     4804                                for ($i = 0; $i < count($justThese); $i++) 
     4805                                { 
     4806                                        $attr = array(); 
     4807                                        $attr['name'] = $attr_names[$i]; 
     4808                                        if ($attr_types[$i] == 'multivalues') 
     4809                                        { 
     4810                                                $attr['type'] = 'multivalues'; 
     4811                                                $attr['value'] = array(); 
     4812                                                for ($j = 0; $j < $info[0][$justThese[$i]]['count']; $j++) 
     4813                                                        $attr['value'][] = utf8_decode($info[0][$justThese[$i]][$j]); 
     4814                                        } 
     4815                                        else 
     4816                                        { 
     4817                                                $attr['type'] = 'text'; 
     4818                                                $attr['value'] = utf8_decode($info[0][$justThese[$i]][0]); 
     4819                                        } 
     4820                                        $data[] = $attr; 
     4821                                } 
     4822                        } 
     4823                        else 
     4824                                $data = 'error'; 
     4825                        ldap_close($ds); 
     4826                         
     4827                        echo serialize($data); 
     4828                } 
     4829                 
    44344830        } 
    44354831 
  • trunk/contactcenter/js/cc.js

    r4507 r5131  
    231231function openContactDetails(id){ 
    232232        // Build the ContactDetails Window. 
    233         if(!contactdetailsWin && !is_ie)  
     233        if((typeof(contactdetailsWin) == 'undefined') && !is_ie)  
    234234                __cdWin(); 
    235235 
     
    996996        for (var type in CC_contact_full_info['connections']){ 
    997997            haveConnections = true; 
     998                        var reEmail = /^[a-zA-Z0-9][_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]{1,})*$/; 
    998999            for (var i in CC_contact_full_info['connections'][type]){ 
     1000                                if(type == 1){ 
     1001                                        if(!reEmail.test(CC_contact_full_info['connections'][type][i]['value'])){ 
     1002                                                showMessage('Endereço para conexão de ' + CC_contact_full_info['connections'][type][i]['name'] + ', não é válido'); 
     1003                                                return false; 
     1004                                        } 
     1005                                } 
     1006                                else{ 
    9991007                if((CC_contact_full_info['connections'][type][i]['value'].length < 4) || 
    10001008                    (!comp.test(CC_contact_full_info['connections'][type][i]['value']))){ 
     
    10021010                    return false; 
    10031011                } 
     1012            } 
    10041013            } 
    10051014            var _options_default = Element("cc_"+(type == 1 ? 'email' : 'phone')+"_default"); 
     
    10091018            } 
    10101019        } 
    1011     } 
    1012     if(!haveConnections){ 
    1013         showMessage(Element('cc_msg_tel_or_mail_required').value); 
    1014         return false; 
    10151020    } 
    10161021 
     
    16341639                        //'<td style="width: 30px;" align="right"><input name="cc_conn_is_default" id="cc_conn_is_default_'+ CC_conn_count +'" type="radio"></td>'+ 
    16351640                        '<td style="width: 10px;" align="right"><input id="cc_conn_name_'+CC_conn_count+'" type="hidden"><td style="width: 100px;" align="right"><span style="width: 150px;" id="cc_conn_label_'+CC_conn_count+'">'+_label+'</span></td>' + 
    1636                         '<td align="left"><input id="cc_conn_value_'+ CC_conn_count +'" style="width: 150px;" maxlength="100" type="text">&nbsp;' + 
     1641                        '<td align="left"><input id="cc_conn_value_'+ CC_conn_count +'" onkeyup="javascript:emailTolower(\'cc_conn_value_' + CC_conn_count + '\')" style="width: 150px;" maxlength="100" type="text">&nbsp;' + 
    16371642                        '<img align="top" alt="X" src="templates/default/images/x.png" style="width:18px; height:18px" onclick="javascript:removeConnField(\'cc_conn_tr_' + CC_conn_count + '\')"></td>'; 
    16381643                } 
     
    16421647                        //'<td style="width: 30px;" align="right"><input name="cc_conn_is_default" id="cc_conn_is_default_'+ CC_conn_count +'" type="radio"></td>'+ 
    16431648                        '<td style="width: 10px;" align="right"><input id="cc_conn_name_'+CC_conn_count+'" type="hidden"><td style="width: 100px;" align="right"><span style="width: 150px;" id="cc_conn_label_'+CC_conn_count+'">'+_label+'</span></td>' + 
    1644                         '<td align="left"><input id="cc_conn_value_'+ CC_conn_count +'" style="width: 150px;" maxlength="30" type="text" onkeyup="formatPhone(this)">&nbsp;' + 
     1649                        '<td align="left"><input id="cc_conn_value_'+ CC_conn_count +'" onkeyup="javascript:emailTolower(\'cc_conn_value_' + CC_conn_count + '\')" style="width: 150px;" maxlength="30" type="text" onkeyup="formatPhone(this)">&nbsp;' + 
    16451650                        '<img align="top" alt="X" src="templates/default/images/x.png" style="width:18px; height:18px" onclick="javascript:removeConnField(\'cc_conn_tr_' + CC_conn_count + '\')"></td>'; 
    16461651                } 
     
    18061811 
    18071812        connRemoveLine(id); 
     1813} 
     1814 
     1815function emailTolower(obj){ 
     1816        document.getElementById(obj).value = document.getElementById(obj).value.toLowerCase(); 
     1817 
    18081818} 
    18091819 
     
    23082318 
    23092319                                                                if(data[3][pos][k] === 'none') 
    2310                                                                         data[3][pos][k] = '&nbsp'; 
     2320                                                                        "Não informado."; 
    23112321                                                                break; 
    23122322                                                        case 'cc_phone' : 
    23132323 
    23142324                                                                if(data[3][pos][k] === 'none') 
    2315                                                                         data[3][pos][k] = '&nbsp'; 
     2325                                                                        data[3][pos][k] = "Não informado."; 
    23162326                                                                break; 
    23172327                                                } 
     
    23522362                                                                else 
    23532363                                                                { 
     2364                                                                        if(data[3][pos][k] != "Não informado.") 
    23542365                                                                        Element(id+':'+data[2][k]).innerHTML = data[5] + data[3][pos][k] + '\')">'+ data[3][pos][k]+'</span>'; 
     2366                                                                        else 
     2367                                                                                Element(id+':'+data[2][k]).innerHTML = data[13] + data[3][pos][k] + '\')">'+ data[3][pos][k]+'</span>'; 
    23552368                                                                } 
    23562369                                                                break; 
     
    23662379                                                                        Element(id+':'+data[2][k]).innerHTML = adjustString(data[3][pos][k], 20); 
    23672380                                                                } 
     2381                                                                if(data[3][pos][k] != " ") 
    23682382                                                                Element(id+':cc_phone').innerHTML = (data[3][pos][k].length < 23) ? data[3][pos][k]:data[3][pos][k].substr(0,22)+"<br>"+data[3][pos][k].substr(22,data[3][pos][k].length); 
     2383                                                                else 
     2384                                                                        Element(id+':cc_phone').innerHTML = "Não informado."; 
    23692385                                                                break; 
    23702386 
    23712387                                                        case 'cc_title': 
    2372                                                                 if (data[3][pos][k].length > 15) 
     2388                                                                if(preferences.departmentShow && ccTree.catalog_perms == 1){ 
     2389                                                                        if(data[3][pos][k] == " " || data[3][pos][k] == "" || data[3][pos][k] == "undefined"){ 
     2390                                                                                Element(id+':'+data[2][k]).innerHTML = "Não informado."; 
     2391                                                                        } 
     2392                                                                        else if (data[3][pos][k].length > 15) 
    23732393                                                                { 
    23742394                                                                        Element(id+':'+data[2][k]).innerHTML = adjustString(data[3][pos][k], 15); 
     
    23802400                                                                } 
    23812401                                                                break; 
    2382  
     2402                                                                }else{ 
     2403                                                                        break; 
     2404                                                                } 
    23832405                                                        case 'cc_id': 
    23842406                                                                var id_contact = data[3][pos][k]; 
     
    24102432                                                        //Para tratar tamanho do campo "celular" do empregado 
    24112433                                                        case 'cc_mobile': 
     2434                                                                if(preferences.cellShow && ccTree.catalog_perms == 1){ 
    24122435                                                                if (data[3][pos][k].length > 20) 
    24132436                                                                { 
     
    24212444                                                                Element(id+':cc_mobile').innerHTML = data[3][pos][k]; 
    24222445                                                                break; 
    2423  
     2446                                                                }else{ 
     2447                                                                        break; 
     2448                                                                }                
    24242449                                                        //Para tratar tamanho do campo "matricula" do empregado 
    24252450                                                        case 'cc_empNumber': 
     2451                                                                if(preferences.empNumShow && ccTree.catalog_perms == 1){ 
    24262452                                                                if (data[3][pos][k].length > 20) 
    24272453                                                                { 
     
    24352461                                                                Element(id+':cc_empNumber').innerHTML = data[3][pos][k]; 
    24362462                                                                break; 
    2437  
     2463                                                                }else{ 
     2464                                                                        break; 
     2465                                                                } 
    24382466                                                        //Para tratar tamanho do campo "departamento" do empregado 
    24392467                                                        case 'cc_department': 
     
    24612489                                                                        Element(id+':'+data[2][k]).innerHTML = data[3][pos][k]; 
    24622490                                                                } 
     2491                                                } 
     2492                                        }else{ 
     2493                                                data[3][pos][k] = unescape(data[3][pos][k]); 
     2494                                                switch (data[2][k]) 
     2495                                                { 
     2496                                                        case 'cc_mail': 
     2497                                                                Element(id+':'+data[2][k]).innerHTML = data[13] + "Não informado." + '\')">'+ "Não infomardo." +'</span>'; 
     2498                                                                break; 
     2499 
     2500                                                        case 'cc_phone': 
     2501                                                                Element(id+':cc_phone').innerHTML = "Não informado."; 
     2502                                                                break; 
     2503                                                        case 'cc_empNumber': 
     2504                                                                if(preferences.empNumShow && ccTree.catalog_perms == 1){ 
     2505                                                                        var cc_empNumberTD = Element(id+':cc_empNumber').parentNode; 
     2506                                                                        cc_empNumberTD.parentNode.removeChild(cc_empNumberTD); 
     2507                                                                } 
     2508                                                                break; 
     2509                                                        case 'cc_mobile': 
     2510                                                                if(preferences.cellShow && ccTree.catalog_perms == 1){ 
     2511                                                                        var cc_mobileTD = Element(id+':cc_mobile').parentNode; 
     2512                                                                        cc_mobileTD.parentNode.removeChild(cc_mobileTD); 
     2513                                                                } 
     2514                                                                break; 
     2515                                                        case 'cc_title': 
     2516                                                                if(preferences.departmentShow && ccTree.catalog_perms == 1){ 
     2517                                                                        var cc_titleTD = Element(id+':cc_title').parentNode; 
     2518                                                                        cc_titleTD.parentNode.removeChild(cc_titleTD); 
     2519                                                                } 
     2520                                                                break; 
    24632521                                                } 
    24642522                                        } 
     
    25152573                                                { 
    25162574                                                        case 'cc_title': 
    2517                                                                 if (data[3][pos][k].length > 50) 
     2575                                                                if (data[3][pos][k].length > (CC_visual == 'table'  ? 50 : 20)) 
    25182576                                                                { 
    2519                                                                         Element(id+':'+data[2][k]).innerHTML = adjustString(data[3][pos][k], 50); 
     2577                                                                        Element(id+':'+data[2][k]).innerHTML = adjustString(data[3][pos][k], (CC_visual == 'table'  ? 50 : 20)); 
    25202578                                                                        Element(id+':'+data[2][k]).title = data[3][pos][k]; 
    25212579                                                                } 
     
    26632721                                                '<img title="'+Element('cc_msg_card_remove').value+'" id="' + id + ':cc_card_remove" style="position: absolute; top: 78px; left: 223px; width: 15px; height: 14px; cursor: pointer; cursor: hand; z-index: 1" onclick="removeEntry(Element(\'' + id + ':cc_id\').value);" onmouseover="resizeIcon(\''+id+':cc_card_remove\',0)" onmouseout="resizeIcon(\''+id+':cc_card_remove\',1)" src="templates/default/images/cc_x.png">' : '') + 
    26642722                                                '<img id="' + id + ':cc_photo" style="position: absolute; top: 15px; left: 7px;" src="" border="0" ondblclick="editContact(Element(\'' + id + ':cc_id\').value);">' + 
    2665                                                 '<span id="' + id + ':cc_company" style="position: absolute; top: 5px; left: 75px; width: 135px; border: 0px solid #999; font-weight: bold; font-size: 14px; text-align: center; height: 10px;" onmouseover="//Element(\''+id+':cc_company_full\').style.visibility=\'visible\'" onmouseout="//Element(\''+id+':cc_company_full\').style.visibility=\'hidden\'"></span>' + 
     2723                                                '<span id="' + id + ':cc_company" style="position: absolute; top: 5px; left: 75px; width: 135px; border: 0px solid #999; font-weight: bold; font-size: 10px; text-align: center; height: 10px;" onmouseover="//Element(\''+id+':cc_company_full\').style.visibility=\'visible\'" onmouseout="//Element(\''+id+':cc_company_full\').style.visibility=\'hidden\'"></span>' + 
    26662724                                                '<span style="cursor: pointer; cursor: hand; z-index: 1;position: absolute; top: 100px; left: 35px"  valign="bottom" id="' + id + ':cc_icon_group">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>'+ 
    26672725                                                //Para exibir a matricula do empregado nos cartoes 
    2668                                                 '<span id="' + id + ':cc_empNumber" style="position: absolute; top: 15px; left: 75px; width: 135px; border: 0px solid #999; font-weight: normal; font-size: 9px; text-align: center; height: 10px;"></span>' + 
     2726                                                '<span id="' + id + ':cc_empNumber" style="position: absolute; top: 20px; left: 75px; width: 135px; border: 0px solid #999; font-weight: normal; font-size: 9px; text-align: center; height: 10px;"></span>' + 
    26692727                                                '<span id="' + id + ':cc_name" style="position: absolute; top: 30px; left: 75px; width: 135px; border: 0px solid #999; font-weight: bold; font-size: 10px; text-align: center; height: 10px;" onmouseover="//Element(\''+id+':cc_name_full\').style.visibility=\'visible\'" onmouseout="//Element(\''+id+':cc_name_full\').style.visibility=\'hidden\'"></span>' + 
    2670                                                 '<span id="' + id + ':cc_title" style="position: absolute; top: 50px; left: 75px; width: 135px; border: 0px solid #999; font-weight: normal; font-size: 12px; text-align: center; height: 10px;"></span>' + 
     2728                                                '<span id="' + id + ':cc_title" style="position: absolute; top: 90px; left: 75px; width: 135px; border: 0px solid #999; font-weight: normal; font-size: 12px; text-align: center; height: 10px;"></span>' + 
    26712729                                                //Para exibir o setor/lotacao do empregado nos cartoes 
    26722730                                                '<span id="' + id + ':cc_department" style="position: absolute; top: 60px; left: 75px; width: 135px; border: 0px solid #999; font-weight: normal; font-size: 10px; text-align: center; height: 10px;"></span>' + 
     
    26942752                                        '<span id="' + id + ':cc_participantes" style="cursor: pointer; cursor: hand; z-index: 1"></span>' + 
    26952753                                        '<span id="' + id + ':cc_title"></span></td>' + 
    2696                                         '<td width="40%" style="solid #999; font-weight: normal; font-size: 10px; text-align: left; height: 10px"><span onMouseOver="this.title = \''+Element('cc_send_mail').value+'\'"  id="' + id + ':cc_short_name"></span></td>' + 
    2697                                         '<td align="left" width="55px">'+ 
     2754                                        '<td width="40%" style="solid #999; font-weight: normal; font-size: 10px; text-align: left; height: 10px"><span id="' + id + ':cc_short_name"></span></td>' + 
     2755                                        '<td align="center" width="10%">'+ 
    26982756                                        '<img  title="'+Element('cc_msg_group_edit').value+'" id="' + id + ':cc_card_edit" style=" cursor: pointer; cursor: hand; z-index: 1;width: 18px; height: 18px;"  onclick="editGroup(Element(\'' + id + ':cc_id\').value);" src="templates/default/images/cc_card_edit.png">' + 
    26992757                                        '&nbsp;&nbsp;|&nbsp;&nbsp;'+ 
     
    27052763                                html_card = '<tr  style="height:20px" id="' + id + '" onmouseout="'+bg+'" onmouseover="this.style.background=\'LIGHTYELLOW\'" bgcolor="EEEEEE">' + 
    27062764                                        //Para exibir a matricula do empregado na tabela 
    2707                                         (preferences.empNumShow && ccTree.catalog_perms == 1 ? '<td align="center" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_empNumber"></span></td>' : '') + 
     2765                                        (preferences.empNumShow && ccTree.catalog_perms == 1 ? '<td align="center" width="10%" name="cc_name_empNumber" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_empNumber"></span></td>' : '') + 
    27082766                                        '<td width="auto" style="font-weight: normal; font-size: 10px; text-align: left; height: 10px;"><span valign="bottom" id="' + id + ':cc_icon_group">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="' + id + ':cc_name"></span></td>' + 
    2709                                         '<td style="solid #999; font-weight: normal; font-size: 10px; text-align: left; height: 10px"><span onMouseOver="this.title = \''+Element('cc_send_mail').value+' => '+'\'+document.getElementById(\''+id + ':cc_name\').innerHTML" id="' + id + ':cc_mail"></span></td>' + 
    2710                                         '<td align="center" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_phone"></span></td>' + 
     2767                                        '<td width="20%" align="center" name="cc_name_send_mail" style="solid #999; font-weight: normal; font-size: 10px; height: 10px"><span onMouseOver="this.title = \''+Element('cc_send_mail').value+' => '+'\'+document.getElementById(\''+id + ':cc_name\').innerHTML" id="' + id + ':cc_mail"></span></td>' + 
     2768                                        '<td width="20%" align="center" name="cc_name_phone" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_phone"></span></td>' + 
    27112769                                        //Para exibir o celular empresarial do empregado na tabela 
    2712                                         (preferences.cellShow && ccTree.catalog_perms == 1 ?    '<td align="center" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_mobile"></span></td>' : '') + 
     2770                                        (preferences.cellShow && ccTree.catalog_perms == 1 ?    '<td align="center" name="cc_name_mobile" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_mobile"></span></td>' : '') +  
    27132771                                        //Para exibir o setor/lotacao do empregado na tabela 
    2714                                         (preferences.departmentShow && ccTree.catalog_perms == 1 ? '<td align="center" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_department"></span></td>' : '') + 
     2772                                        (preferences.departmentShow && ccTree.catalog_perms == 1 ? '<td align="center" name="cc_name_title" nowrap><span style="solid #999; font-weight: normal; font-size: 10px;height: 10px" id="' + id + ':cc_title"></span></td>' : '') + 
    27152773                                        ( ccTree.catalog_perms == 1 ? 
    2716                                         '<td align="left"><span valign="bottom" id="' + id + ':cc_icon_data"></span></td>':'') +                                         
     2774                                        '<td align="center" width="10%"><span valign="bottom" id="' + id + ':cc_icon_data"></span></td>':'') +                                   
    27172775                                        (ccTree.catalog_perms & 2 ? 
    2718                                         '<td align="left" >'+ 
     2776                                        '<td align="center" width="10%" >'+ 
    27192777                                        '<img  title="'+Element('cc_msg_card_edit').value+'" id="' + id + ':cc_card_edit" style=" cursor: pointer; cursor: hand; z-index: 1;width: 18px; height: 18px;"  onclick="editContact(Element(\'' + id + ':cc_id\').value);" src="templates/default/images/cc_card_edit.png">' + 
    27202778                                        '&nbsp;&nbsp;|&nbsp;&nbsp;'+ 
     
    27222780                                        '<input id="' + id + ':cc_id" type="hidden">'+ 
    27232781                                        '<input type="hidden" id="' + id + ':cc_photo">' + 
    2724                                         '<span id="' + id + ':cc_title" style="display:none"></span>' + 
     2782                                        //'<span id="' + id + ':cc_mobile" style="display:none"></span>' + 
    27252783                                        '<span id="' + id + ':cc_alias" style="display:none"></span>' + 
    27262784                                        // Esse campo é necessário se o contato possui dados no campo cc_company 
  • trunk/contactcenter/js/ccAddGroup.js

    r4769 r5131  
    128128                        if (data['status'] != 'ok' && data['status'] != 'warning') 
    129129                        { 
     130                                showMessage(Element('cc_msg_err_duplicate_group').value); 
    130131                                return; 
    131132                        } 
     
    205206                         
    206207                this.title.value = '';                           
     208                ccAGSearchTerm.value = ''; 
    207209        } 
    208210         
     
    240242 
    241243                                for(var j = 0;j < select_in.options.length; j++) {                                                                                                                                                       
    242                                         if(select_in.options[j].value == select.options[i].value){ 
     244                                        if((select_in.options[j].value == select.options[i].value) && (select_in.options[j].textContent == select.options[i].textContent)){ 
    243245                                                isSelected = true;                                               
    244                                                 break;   
     246                                                //break;         
    245247                                        } 
    246248                                } 
     
    346348 
    347349            var search_for = data['search_for'].split(' '); 
    348             var greaterThan4 = false; 
    349             var use_length = v_min; 
    350  
    351             for (i = 0; i < search_for.length; i++) 
    352             { 
    353                 if (search_for[i].length >= use_length) 
    354                 { 
    355                     greaterThan4 = true; 
    356                 } 
    357             } 
    358  
    359             if (!greaterThan4){ 
    360                 alert("Favor fazer a consulta com pelo menos " + v_min + " caracteres!"); 
    361                 return; 
    362             } 
     350            //var greaterThan4 = false; 
     351            //var use_length = v_min; 
     352 
     353            //for (i = 0; i < search_for.length; i++) 
     354            //{ 
     355            //    if (search_for[i].length >= use_length) 
     356            //    { 
     357            //        greaterThan4 = true; 
     358            //    } 
     359            //} 
     360 
     361            // if (!greaterThan4){ 
     362            //     alert("Favor fazer a consulta com pelo menos " + v_min + " caracteres!"); 
     363                        //     return; 
     364            // } 
    363365 
    364366            var handler = function(data) 
     
    435437                { 
    436438                   ccAddGroup.clearSourceList(); 
     439                                   if (catalogLevel == '0.2') 
     440                                                ccAddGroup.search(); 
    437441                } 
    438442 
  • trunk/contactcenter/js/ccIEContacts.js

    r3334 r5131  
    4747                        this.el.style.top = "0px"; 
    4848                        this.el.style.width = this.wWidth       + 'px'; 
    49                         this.el.style.height = this.wHeight + 'px'; 
     49                        this.el.style.height = this.wHeight + 100+'px'; 
    5050                        if(is_ie) { 
    51                                 this.el.style.width = "430"; 
     51                                this.el.style.width = "650"; 
    5252                                this.el.style.overflowY = "auto";        
    5353                                this.el.style.overflowX = "hidden"; 
    5454                        }                                                                                                        
    5555                        else {                                                                   
     56                                this.el.style.overflowY = "auto"; 
    5657                                this.el.style.overflow = "-moz-scrollbars-vertical"; 
    5758                        } 
     
    7576                        var lang_outl2k_pt = Element('cc_msg_outlook_2k_pt').value; 
    7677                        var lang_outl2k_en = Element('cc_msg_outlook_2k_en').value; 
     78                        var lang_outl03 = Element('cc_msg_outlook_2003').value; 
    7779                        var lang_expresso_default_csv = Element('cc_msg_expresso_default_csv').value; 
    7880 
    7981                 
    8082                        this.el.innerHTML =  
    81                         '<div align="left" id="divAppbox"><table width="100%" border=0>'+ 
     83                        '<div align="left" id="divAppbox" width="90%" ><table width="100%" border=0>'+ 
    8284                        '<tr><td style="border-bottom:1px solid black"><input onclick="javascript:ccIEContacts.changeOptions(this.value)" id="type" type="radio" name="type" value="i" style="border:0" checked>'+lang_import_contacts+ 
    8385                        '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input onclick="javascript:ccIEContacts.changeOptions(this.value)" id="type" type="radio" name="type" style="border:0" value="e"/>'+lang_export_contacts+' <br></td></tr>'+ 
    8486                        '</table>'+ 
    85                         '<table border=0 height="208px"  width="100%" id="import_span">'+ 
     87                        '<table border=0 height="100%"  width="100%" id="import_span">'+ 
    8688                        '<tr><td>'+ 
    8789                        '<font color="DARKBLUE" size="2">'+lang_expresso_info_csv+'</font></td></tr>'+ 
     
    9193                        '<option value="outlook">'+("Outlook Express")+'</option>'+ 
    9294                        '<option value="outlook2000">'+("Outlook 2000")+'</option>'+ 
     95                        '<option value="outlook2003">'+("Outlook 2003")+'</option>'+ 
    9396                        '<option value="thunderbird">'+("Mozilla Thunderbird")+'</option>'+ 
    9497                        '<option value="expresso" selected>'+lang_expresso_default+'</option></select><br>'+ 
     
    102105                        '<input type="button" value='+lang_close_win+' onClick="javascript:ccIEContacts.close()"></center></td></tr>'+ 
    103106                        '<tr><td height="10px" align="center" nowrap><span style="visibility:hidden" id="s_info2"></span></td></tr></table>'+ 
    104                         '<table border=0  height="208px"  width="100%" style="display:none" id="export_span">'+ 
     107                        '<table border=0  height="100%"  width="100%" style="display:none" id="export_span">'+ 
    105108                        '<tr><td>'+                                              
    106109                        '<font color="DARKBLUE" size="2">'+ lang_msg_expresso_info_csv+'</font></td></tr>'+ 
     
    112115                        '<option value="outlook2000_pt-BR">'+lang_outl2k_pt+'</option>'+ 
    113116                        '<option value="outlook2000_en">'+lang_outl2k_en+'</option>'+ 
     117                        '<option value="outlook2003">'+lang_outl03+'</option>'+ 
    114118                        '<option value="thunderbird">'+lang_moz_tb+'</option>'+ 
    115119                        '</select>'+                     
    116120                        '</td></tr>'+ 
    117                         '<tr><td align="center">&nbsp;</td></tr>'+ 
    118121                        '<tr><td nowrap><center><input id="export_button" type="button" value='+lang_export_contacts+ ' onClick="javascript:ccIEContacts.exportCSV(this)">&nbsp;&nbsp;&nbsp;&nbsp;'+ 
    119122                        '<input type="button" value='+lang_close_win+ ' onClick="javascript:ccIEContacts.close()"></center></td></tr>'+ 
     
    121124                }                
    122125                this.showWindow(); 
     126                if(Element('s_info')) 
     127                        Element('s_info').style.visibility = 'hidden'; 
     128                ccIEContacts.cleanInfo(); 
    123129        } 
    124130         
     
    131137                                content_id: this.el.id, 
    132138                                width: (this.wWidth +(is_ie ? 41 : 0))  +'px', 
    133                                 height: this.wHeight +'px', 
     139                                height: this.wHeight +100+'px', 
    134140                                title_color: '#3978d6', 
    135141                                bg_color: '#eee', 
     
    166172                var l_2         = '<font face="Verdana" size="1" color="RED">['+args[2]+lang_failure+']</font>'; 
    167173                var l_3         = '<font face="Verdana" size="1" color="DARKBLUE">['+args[3]+lang_exists+']</font>'; 
     174                if(args[2]) 
    168175                var l_4         = '<br><a font face="Verdana" size="1" href="javascript:ccIEContacts.showFailures(\''+args[4]+'\')">'+lang_show_more_info+'</a>'; 
    169176                var l_error     = '<span style="height:15px;background:#cc4444">&nbsp;&nbsp;<font face="Verdana" size="1" color="WHITE">'+lang_import_fail+ '&nbsp;</font></span>'; 
     
    172179                if(args[0] == 'success') { 
    173180 
    174                         for(i = 1; i < 5; i++) { 
     181                        for(i = 1; i < 4; i++) { 
    175182                                status += "&nbsp;"+eval('l_'+i); 
     183                        } 
     184                        if(args[2]){ 
     185                                status += "&nbsp;"+eval('l_4'); 
    176186                        } 
    177187                        Element('s_info').innerHTML = '&nbsp;&nbsp;<font face="Verdana" size="1" color="BLACK"><b>'+lang_import_finish+'</b></font><br>&nbsp;'+status; 
     
    200210        cIEContacts.prototype.importCSV = function () 
    201211        {                
     212                ccIEContacts.cleanInfo(); 
    202213                var lang_msg_invalid_csv = Element('cc_msg_invalid_csv').value; 
    203214                var form = document.formCSV; 
     
    223234                                args[3] = data._existing ? data._existing : 0; 
    224235                                args[4] = data._failure_status 
    225  
     236                                if(args[1] > 0) 
     237                                        ccTree.setCatalog("0.0"); 
    226238                        } 
    227239                        _this.importWriteStatus(args); 
  • trunk/contactcenter/js/ccListParticipants.js

    r880 r5131  
    5555                if(names.length) { 
    5656                        for (var d = 0; d < (names.length-1); d++) {                                                                                                                                                                                                                                                                                                     
     57                                var email_valido = email[d] != 'null' ? email[d] : "não informado"                                                                                                                                                                                                                                                                                               
    5758                                el.innerHTML +=  
    5859                                "<font color='DARKBLUE'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+ 
    5960                                        "\"" + names[d]+ "\"" + 
    60                                         " &lt;"+email[d]+ 
     61                                        " &lt;"+email_valido+ 
    6162                                        "&gt;</font>&nbsp;&nbsp;&nbsp;<br>";                                                                                                                                     
    6263                        } 
  • trunk/contactcenter/js/ccMain.js

    r3795 r5131  
    2222                var search_params = new Array(); 
    2323                search_params['holder'] = Element('cc_panel_search_call'); 
    24                 search_params['total_width'] = (v_label != false &  v_atrib != false)? '485px' : '330px'; 
     24                search_params['total_width'] = (v_label != false &  v_atrib != false)? '485px' : '335px'; 
    2525                search_params['input_width'] = '200px'; 
    2626                search_params['progress_top'] = '150px'; 
  • trunk/contactcenter/js/ccQuickAdd-plugin.js

    r4721 r5131  
    202202                } 
    203203                //Utiliza expressão regular para validar email 
    204                 if (this._fields[4].value != '') { 
    205                         var reEmail = /^[A-Za-z\d_-]+(\.[A-Za-z\d_-]+)*@(([A-Za-z\d][A-Za-z\d-]{0,61}[A-Za-z\d]\.)+[A-Za-z]{2,6}|\[\d{1,3}(\.\d{1,3}){3}\])$/; 
     204                if (this._fields[4].value != ''){ 
     205                        var reEmail = /^[a-zA-Z0-9][_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]{1,})*$/; 
    206206                         
    207207                        if (sdata[4] !== "" && !reEmail.test(this._fields[4].value)) { 
     
    211211                        } 
    212212                } 
    213                 else if(this._fields[3].value=='') { 
    214                         alert(Element('cc_msg_tel_or_mail_required').value); 
    215                         return false; 
    216                 } 
     213                sdata[4] = sdata[4].toLowerCase(); 
    217214                var sdata = 'add='+escape(serialize(sdata)); 
    218215 
  • trunk/contactcenter/js/cc_config.js

    r4548 r5131  
    2222        function cc_attribute_clear(form) 
    2323        { 
    24  
    25                 var vars = document.getElementsByClassName("cc_attribute"); 
    26                  
    27                 var tupla; 
    28                 var select; 
    29                 var inputs; 
    30                  
    31                 for (var i=0; i<vars.length; i++) {      
    32                         tupla = vars[i]; 
    33                         inputs = tupla.getElementsByTagName("input"); 
    34                          
    35                         if(inputs[0].value == "" || inputs[1].value == "")  
    36                         {                
    37                                 //tupla.parentNode.removeChild(tupla); 
    38                                 inputs[0].setAttribute("value", ""); 
    39                                 inputs[1].setAttribute("value", ""); 
    40                                  
    41                                 select = tupla.getElementsByTagName("select"); 
    42                                 select[0].innerHTML = "<option value=\"\" selected=\"selected\"></option>"; 
    43                                 select[1].innerHTML = "<option value=\"\" selected=\"selected\"></option>"; 
    44                                  
    45                                 tupla.style.visible = "hidden"; 
    46                                 tupla.style.display = "none"; 
    47                         } 
    48                 } 
    4924                form.submit(); 
    5025        } 
     
    6035        function cc_attribute_add() 
    6136        { 
    62                 var stringTexto = document.getElementsByClassName("cc_attribute")[0].getElementsByTagName("select")[0].getElementsByTagName("option")[0].innerHTML; 
    63                 var stringMultivalorado = document.getElementsByClassName("cc_attribute")[0].getElementsByTagName("select")[0].getElementsByTagName("option")[1].innerHTML 
     37                var stringTexto = document.getElementById('textHidden').value; 
     38                var stringMultivalorado = document.getElementById('multitextHidden').value; 
     39                var stringYes = document.getElementById('yesHidden').value; 
     40                var stringNo = document.getElementById('noHidden').value; 
     41                var stringDelete = document.getElementById('deleteHidden').value; 
    6442                 
    6543                var numeroAtributo = 0; 
    66                 var vars = document.getElementsByClassName("cc_attribute"); 
     44                var table = document.getElementsByName("cc_newconftable"); 
     45                var vars = table[0].getElementsByTagName("TR");  
    6746                 
    6847                var maior = 0; 
    69                 for (var i=0; i<vars.length; i++) { 
     48                for (var i=1; i<vars.length; i++) { 
    7049                        var tupla = vars[i]; 
    7150                        var linhaIndice = tupla.getElementsByTagName("input")[0]; 
     
    8867                var cc_attribute_searchable = "newsettings[cc_attribute_searchable_" + numeroAtributo + "]"; 
    8968                 
    90                 var pool = document.getElementById("cc_attribute_fields"); 
    91                 var btn = document.getElementById("c_attribute_box_adder"); // nome do id definido no template. 
     69                var pool = document.getElementById("cc_newconftable"); 
    9270                 
    93                 var newDiv = document.createElement("div"); 
    94                         newDiv.setAttribute("class", "cc_attribute"); 
     71                //LINHA DOS CAMPOS 
     72                var tudo = document.createElement("TR"); 
    9573         
    96                 var formularioNome = document.createElement("input"); 
    97                         formularioNome.setAttribute("type", "text"); 
    98                         formularioNome.setAttribute("name", cc_attribute_name); 
    99                         formularioNome.setAttribute("value", ""); 
    100                         formularioNome.setAttribute("style", "width: 170px;"); 
    101          
    102                 var formularioLdap = document.createElement("input"); 
    103                         formularioLdap.setAttribute("type", "text"); 
    104                         formularioLdap.setAttribute("name", cc_attribute_ldapname); 
    105                         formularioLdap.setAttribute("value", ""); 
    106                         //formularioLdap.setAttribute("style", "margin: 0px 40px;"); 
    107                         formularioLdap.setAttribute("style", "width: 170px;"); 
     74                //INPUT DO NOME 
     75                var tudoBody1 = document.createElement("TD"); 
     76                tudoBody1.innerHTML = "<input type=\"text\" name=\""+cc_attribute_name+"\" value=\"\" style=\"width:170px;\" />"; 
     77                tudo.appendChild(tudoBody1); 
     78                 
     79                //INPUT CORRESPONDENTE 
     80                var tudoBody2 = document.createElement("TD"); 
     81                tudoBody2.innerHTML = "<input type=\"text\" name=\""+cc_attribute_ldapname+"\" value=\"\" style=\"width:170px;\" />"; 
     82                tudo.appendChild(tudoBody2); 
     83                 
     84                //TD SELECT MULTI OR TEXT  
     85                var tudoBody3 = document.createElement("TD"); 
     86                        //SELECT MULTI OR TEXT  
     87                        var select1 = document.createElement("SELECT"); 
     88                        select1.name = cc_attribute_type; 
     89                        select1.style.width = "86px"; 
     90                        select1.style.margin = "0px 0px 0px 8px"; 
     91                        //OPTION TEXT 
     92                        var option1 = document.createElement("OPTION"); 
     93                        option1.innerHTML = stringTexto; 
     94                        option1.value = "text"; 
     95                        //OPTION MULTI 
     96                        var option2 = document.createElement("OPTION"); 
     97                        option2.innerHTML = stringMultivalorado; 
     98                        option2.value = "multivalues"; 
     99                        //ADD OPTIONs TO SELECT 
     100                        select1.appendChild(option1); 
     101                        select1.appendChild(option2); 
     102                        //ADD SELECT TO TD 
     103                        tudoBody3.appendChild(select1); 
     104                        //ADD TD TO TR 
     105                        tudo.appendChild(tudoBody3); 
     106                         
     107                //TD SELECT YES OR NO  
     108                var tudoBody4 = document.createElement("TD"); 
     109                        //SELECT YES OR NO  
     110                        var select2 = document.createElement("SELECT"); 
     111                        select2.name = cc_attribute_searchable; 
     112                        select2.style.margin = "0px 16px"; 
     113                        //OPTION YES 
     114                        var option3 = document.createElement("OPTION"); 
     115                        option3.innerHTML = stringYes; 
     116                        option3.value = "true"; 
     117                        //OPTION NO 
     118                        var option4 = document.createElement("OPTION"); 
     119                        option4.selected = "selected"; 
     120                        option4.innerHTML = stringNo; 
     121                        option4.value = "false"; 
     122                        //ADD OPTIONs TO SELECT 
     123                        select2.appendChild(option3); 
     124                        select2.appendChild(option4); 
     125                        //ADD SELECT TO TD 
     126                        tudoBody4.appendChild(select2); 
     127                        //ADD TD TO TR 
     128                        tudo.appendChild(tudoBody4); 
     129                 
     130                //TD IMG                 
     131                var tudoBody5 = document.createElement("TD"); 
     132                tudoBody5.innerHTML = "<img src=\"contactcenter/templates/default/images/cc_x.png\" title=\""+ stringDelete +"\" alt=\""+ stringDelete +"\" style=\"width: 15px; height: 14px; cursor: pointer; position: relative; top: 3px;\" onclick=\"javascript:cc_attribute_delete(this)\">" 
     133                tudo.appendChild(tudoBody5); 
    108134 
    109                 var selectTipos = document.createElement("select"); 
    110                 selectTipos.setAttribute("name", cc_attribute_type); 
    111                 selectTipos.setAttribute("style", "width: 86px; margin: 0px 0px 0px 8px"); 
    112                 //selectTipos.setAttribute("style", "margin: 0px 0px 0px 8px"); 
    113                         var optionTexto = document.createElement("option"); 
    114                         optionTexto.setAttribute("value", "text"); 
    115                         optionTexto.setAttribute("selected", "selected"); 
    116                         optionTexto.innerHTML = stringTexto + " "; 
    117                  
    118                         var optionMultivalorado = document.createElement("option"); 
    119                         optionMultivalorado.setAttribute("value", "multivalues"); 
    120                         optionMultivalorado.innerHTML = stringMultivalorado + " "; 
    121                          
    122                 selectTipos.appendChild(optionTexto); 
    123                 selectTipos.appendChild(optionMultivalorado); 
    124                                  
    125                 var selectPesquisavel = document.createElement("select"); 
    126                 selectPesquisavel.setAttribute("name", cc_attribute_searchable); 
    127                 selectPesquisavel.setAttribute("style", "margin: 0px 16px;"); 
    128                         var optionYes = document.createElement("option"); 
    129                                 optionYes.setAttribute("value", "true"); 
    130                                 optionYes.innerHTML = "Sim "; 
    131                         var optionNo =  document.createElement("option"); 
    132                                 optionNo.setAttribute("value", "false"); 
    133                                 optionNo.setAttribute("selected", "selected"); 
    134                                 optionNo.innerHTML = "Não "; 
    135                          
    136                                  
    137                 selectPesquisavel.appendChild(optionYes); 
    138                 selectPesquisavel.appendChild(optionNo);                 
    139                                  
    140                                  
    141                                  
    142                 var imagem = document.createElement("img"); 
    143                         imagem.setAttribute("type", "image"); 
    144                         imagem.setAttribute("src", "contactcenter/templates/default/images/cc_x.png"); 
    145                         imagem.setAttribute("alt", "Excluir Campo "); 
    146                         imagem.setAttribute("style", "width: 15px; height: 14px; cursor: pointer; position: relative; top: 3px;"); 
    147                         imagem.setAttribute("onclick", "javascript:cc_attribute_delete(this)"); 
    148          
    149                 newDiv.appendChild(formularioNome); 
    150                 newDiv.appendChild(document.createTextNode(" ")); 
    151                 newDiv.appendChild(formularioLdap); 
    152                 newDiv.appendChild(document.createTextNode(" ")); 
    153                 newDiv.appendChild(selectTipos); 
    154                 newDiv.appendChild(document.createTextNode(" ")); 
    155                 newDiv.appendChild(selectPesquisavel); 
    156                 newDiv.appendChild(document.createTextNode(" ")); 
    157                 newDiv.appendChild(imagem); 
    158  
    159                 pool.appendChild(newDiv); 
     135                pool.appendChild(tudo); 
    160136        } 
    161137         
     
    170146        { 
    171147                        var tupla = e.parentNode; 
    172                          
     148                        tupla = tupla.parentNode; 
     149                        var mom = tupla.parentNode; 
    173150                        var inputs = tupla.getElementsByTagName("input"); 
    174151 
  • trunk/contactcenter/js/cc_search.js

    r4548 r5131  
    270270                        target.appendChild( holder ); 
    271271                         
    272                         this.win = new dJSWin({ 
     272                        this.win = win = new dJSWin({ 
    273273                                        id: 'ccSearch_Layer2', 
    274274                                        content_id: 'Layer2', 
     
    380380                        data['search_for'] = cn; 
    381381 
    382                     customFilterDiv.style.visibility = 'hidden'; 
     382                    win.close(); 
    383383                    document.getElementById('overlay').style.visibility = 'hidden'; 
    384384                } 
  • trunk/contactcenter/setup/setup.inc.php

    r4306 r5131  
    1717        $setup_info['contactcenter']['name']      = 'contactcenter'; 
    1818        $setup_info['contactcenter']['title']     = 'ContactCenter'; 
    19         $setup_info['contactcenter']['version']   = '2.2.2'; 
     19        $setup_info['contactcenter']['version']   = '2.4.0'; 
    2020        $setup_info['contactcenter']['app_order'] = 4; 
    2121        $setup_info['contactcenter']['enable']    = 1; 
     
    7676        $setup_info['contactcenter']['depends'][] = array( 
    7777                'appname' => 'phpgwapi', 
    78                 'versions' => Array('2.2') 
     78                'versions' => Array('2.4.0') 
    7979        ); 
    8080?> 
  • trunk/contactcenter/setup/tables_current.inc.php

    r3282 r5131  
    288288                                'notes'                 => array( 'type' => 'text' ), 
    289289                                'is_global'             => array( 'type' => 'bool' ), 
    290                                 'corporate_name'=> array( 'type' => 'varchar', 'precision' => 100) 
     290                                'corporate_name'=> array( 'type' => 'varchar', 'precision' => 100), 
     291                                'web_page'=> array( 'type' => 'varchar', 'precision' => 100), 
     292                                'job_title'=> array( 'type' => 'varchar', 'precision' => 40), 
     293                                'department'=> array( 'type' => 'varchar', 'precision' => 30) 
    291294                        ), 
    292295                        'pk' => array('id_contact'), 
  • trunk/contactcenter/setup/tables_update.inc.php

    r4306 r5131  
    6565            return $GLOBALS['setup_info']['contactcenter']['currentver'];  
    6666        } 
     67         
     68        $test[] = '2.2.3';  
     69        function contactcenter_upgrade2_2_3() {  
     70                $GLOBALS['phpgw_setup']->db->query("ALTER TABLE phpgw_cc_contact ALTER COLUMN alias TYPE character varying(100);"); 
     71            $GLOBALS['setup_info']['contactcenter']['currentver'] = '2.2.3.1'; 
     72                return $GLOBALS['setup_info']['contactcenter']['currentver'];  
     73        } 
     74        $test[] = '2.2.3.1';  
     75        function contactcenter_upgrade2_2_3_1() {  
     76            $GLOBALS['setup_info']['contactcenter']['currentver'] = '2.4.0'; 
     77                return $GLOBALS['setup_info']['contactcenter']['currentver'];  
     78        } 
    6779?> 
  • trunk/contactcenter/templates/default/api_common.tpl

    r1496 r5131  
    1616<input id="cc_msg_err_serialize_data_unknown" type="hidden" value="{cc_msg_err_serialize_data_unknown}" /> 
    1717<input id="cc_msg_err_shared" type="hidden" type="hidden" value="{cc_msg_err_shared}" /> 
     18<input id="cc_msg_err_duplicate_group" type="hidden" type="hidden" value="{cc_msg_err_duplicate_group}" /> 
    1819 
    1920<input id="cc_msg_err_empty_field" type="hidden" value="{cc_msg_err_empty_field}" /> 
  • trunk/contactcenter/templates/default/index.tpl

    r4548 r5131  
    8686<input id="cc_msg_outlook_2k_pt" type="hidden" value="{cc_msg_outlook_2k_pt}"> 
    8787<input id="cc_msg_outlook_2k_en" type="hidden" value="{cc_msg_outlook_2k_en}"> 
     88<input id="cc_msg_outlook_2003" type="hidden" value="{cc_msg_outlook_2003}"> 
    8889<input id="cc_msg_moz_thunderbird" type="hidden" value="{cc_msg_moz_thunderbird}"> 
    8990<input id="cc_msg_expresso_default_csv" type="hidden" value="{cc_msg_expresso_default_csv}"> 
     
    212213                                                                        <table bgcolor="#D3DCE3" cellspacing="0" cellpadding="0" border="0"> 
    213214                                                                                <tr> 
    214                                                                                         <td align="left" valign="middle"><span id="cc_panel_arrow_first"><img src="templates/default/images/first-grey.png" border="0" alt="{cc_panel_first_page}" hspace="2" onclick="javascript:false"/></span></td> 
     215                                                                                        <td align="left" valign="middle"><span id="cc_panel_arrow_first"><img src="templates/default/images/first-grey.png" border="0" alt="{cc_panel_first_page}" title="{cc_panel_first_page}" hspace="2" onclick="javascript:false"/></span></td> 
    215216                                                                                </tr> 
    216217                                                                        </table> 
     
    219220                                                                        <table bgcolor="#D3DCE3" cellspacing="0" cellpadding="0" border="0"> 
    220221                                                                                <tr> 
    221                                                                                         <td align="left" valign="middle"><span id="cc_panel_arrow_previous"><img src="templates/default/images/left-grey.png" border="0" alt="{cc_panel_previous_page}" hspace="2" onclick="" /></span></td> 
     222                                                                                        <td align="left" valign="middle"><span id="cc_panel_arrow_previous"><img src="templates/default/images/left-grey.png" border="0" alt="{cc_panel_previous_page}" title="{cc_panel_previous_page}" hspace="2" onclick="" /></span></td> 
    222223                                                                                </tr> 
    223224                                                                        </table> 
     
    233234                                                                        <table bgcolor="#D3DCE3" cellspacing="0" cellpadding="0" border="0"> 
    234235                                                                                <tr> 
    235                                                                                         <td align="left" valign="middle"><span id="cc_panel_arrow_next"><img src="templates/default/images/right-grey.png" border="0" alt="{cc_panel_next_page}" hspace="2" /></span></td> 
     236                                                                                        <td align="left" valign="middle"><span id="cc_panel_arrow_next"><img src="templates/default/images/right-grey.png" border="0" alt="{cc_panel_next_page}" title="{cc_panel_next_page}" hspace="2" /></span></td> 
    236237                                                                                </tr> 
    237238                                                                        </table> 
     
    240241                                                                        <table bgcolor="#D3DCE3" cellspacing="0" cellpadding="0" border="0"> 
    241242                                                                                <tr> 
    242                                                                                         <td align="left" valign="middle"><span id="cc_panel_arrow_last"><img src="templates/default/images/last-grey.png" border="0" alt="{cc_panel_last_page}" hspace="2" /></span></td> 
     243                                                                                        <td align="left" valign="middle"><span id="cc_panel_arrow_last"><img src="templates/default/images/last-grey.png" border="0" alt="{cc_panel_last_page}" title="{cc_panel_last_page}" hspace="2" /></span></td> 
    243244                                                                                </tr> 
    244245                                                                        </table>                         
  • trunk/contactcenter/templates/default/preferences.tpl

    r1600 r5131  
    2020                        <td> 
    2121                                <select name="personCardEmail" style="width: 200px"> 
    22                                         <option selected value="_NONE_">{lang_Choose_Email_Type...}</option> 
    2322                                        {personCardEmail} 
    2423                                </select> 
     
    2928                        <td> 
    3029                                <select name="personCardPhone" style="width: 200px"> 
    31                                         <option selected value="_NONE_">{lang_Choose_Telephone_Type...}</option> 
    3230                                        {personCardPhone} 
    3331                                </select> 
Note: See TracChangeset for help on using the changeset viewer.