Changeset 5131
- Timestamp:
- 11/03/11 11:17:35 (12 years ago)
- Location:
- trunk/contactcenter
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/contactcenter/inc/cc_updown.php
r4880 r5131 2 2 require_once '../../header.session.inc.php'; 3 3 // 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']){ 5 5 // Foi necessário modificar o caminho onde se recuperava o diretório temporário. 6 6 // Esse caminho foi hardcodificado na string abaixo ( /tmp ) temporariamente, mas deve ser recuperada atraves -
trunk/contactcenter/inc/class.abo_catalog.inc.php
r4742 r5131 188 188 function init() 189 189 { 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'); 192 192 } 193 193 … … 729 729 730 730 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\'))'; 733 733 break; 734 734 735 735 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\'))'; 738 738 break; 739 739 … … 883 883 foreach($id_states as $id_state) 884 884 { 885 $state = &CreateObject('contactcenter.so_state', $id_state['id_state']);885 $state = CreateObject('contactcenter.so_state', $id_state['id_state']); 886 886 887 887 $result[$id_state['id_state']]['id_state'] = $state->get_id(); … … 945 945 foreach($id_cities as $id_city) 946 946 { 947 $city = &CreateObject('contactcenter.so_city', $id_city['id_city']);947 $city = CreateObject('contactcenter.so_city', $id_city['id_city']); 948 948 949 949 $result[$id_city['id_city']]['id_city'] = $city->get_id(); … … 1035 1035 } 1036 1036 1037 $city = &CreateObject('contactcenter.so_city');1037 $city = CreateObject('contactcenter.so_city'); 1038 1038 1039 1039 $city->set_id_country($city_info['id_country']); … … 1107 1107 } 1108 1108 1109 $state = &CreateObject('contactcenter.so_state');1109 $state = CreateObject('contactcenter.so_state'); 1110 1110 1111 1111 $state->set_id_country($state_info['id_country']); -
trunk/contactcenter/inc/class.bo_catalog_group_catalog.inc.php
r3970 r5131 75 75 if ($ldap_info = $this->catalog['ldap']) 76 76 { 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); 78 78 return $meta_catalog->find($what, $rules, $other, false, $recursive); 79 79 } -
trunk/contactcenter/inc/class.bo_global_ldap_catalog.inc.php
r4838 r5131 127 127 } 128 128 129 if(!((strlen($find) == 2 && substr($find, -1) == '%') || $find == '%' ) )129 if(!((strlen($find) == 2 && substr($find, -1) == '%') || $find == '%' ) && !$this->external) 130 130 return $this->findAddress($find,$other); 131 131 … … 160 160 $ldap = $GLOBALS['phpgw']->common->ldapConnect($this->src_info['host'], $this->src_info['acc'], $this->src_info['pw'], true); 161 161 $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); 163 166 164 167 if (!$result_r) … … 350 353 351 354 */ 352 function process_restrictions( $rules, &$trans_table, $join_type='&' )355 function process_restrictions( &$rules, &$trans_table, $join_type='&' ) 353 356 { 354 357 if (!is_array($rules) or !count($rules)) … … 832 835 case 'connections': 833 836 $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 839 841 unset($l_fields); 840 842 $l_fields['connection_name'] = $this->trans_table['contact.connection.connection_name']; -
trunk/contactcenter/inc/class.bo_group.inc.php
r4754 r5131 42 42 } 43 43 44 function verify_contact($email, $name, $phone){45 46 $result = $this-> so -> verifyContact($email, $name, $phone);47 return $result;48 }49 50 44 function verify_shared_contact($owner,$email){ 51 45 … … 58 52 $result = $this-> so -> selectContactsByGroup($id); 59 53 return $result; 54 } 55 56 function verify_contact($email, $name, $phone){ 57 $result = $this->so->verifyContact($email, $name, $phone); 58 return $result; 60 59 } 61 60 -
trunk/contactcenter/inc/class.bo_people_catalog.inc.php
r4502 r5131 608 608 $added_groups = $groups['added']; 609 609 $removed_groups = $groups['removed']; 610 610 if(is_array($added_groups)) 611 611 foreach ($added_groups as $group) 612 612 { … … 616 616 $bo_group->add_contacts_in_group($group['id_group'], $c); 617 617 } 618 618 if(is_array($removed_groups)) 619 619 foreach ($removed_groups as $group) 620 620 { … … 1285 1285 }else{ 1286 1286 $default =1; 1287 if(isset($data['connections']['aditional_phone'])) 1287 1288 foreach($data['connections']['aditional_phone'] as $connection_name => $connection_fields) 1288 1289 { … … 1567 1568 1568 1569 case 'addresses': 1570 if(is_array($value)) 1569 1571 foreach($value as $address_name => $address_fields) 1570 1572 { -
trunk/contactcenter/inc/class.so_group.inc.php
r4754 r5131 93 93 } 94 94 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 95 131 function delete($data) 96 132 { … … 423 459 } 424 460 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 495 461 function verifySharedContact($owner,$email) 496 462 { … … 588 554 function updateContactsByGroup($id_group, $contacts) 589 555 { 590 556 //Atualiza timestamp de status dos contatos afetados 557 $this -> touchContacts($contacts); 558 $this -> touchContactsByGroup($id_group); 559 ///---------------------------------------------------// 591 560 $query = 'select C.id_connection from phpgw_cc_contact A,'. 592 561 'phpgw_cc_contact_conns B, phpgw_cc_connections C,phpgw_cc_contact_grps D where '. … … 724 693 } 725 694 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 726 795 } 727 796 ?> -
trunk/contactcenter/inc/class.ui_api.inc.php
r4500 r5131 48 48 $template->set_var('cc_msg_err_serialize_data_unknown',lang('Data to be serialized is of unknown type!')); 49 49 $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.')); 50 51 /* End Messages */ 51 52 … … 422 423 } 423 424 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"; 425 426 }else if ($i == 3){ 426 427 $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 19 19 var $public_functions = array( 20 20 'data_manager' => true, 21 'advanced_searh_fields' => true 21 22 ); 22 23 … … 68 69 } 69 70 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']); 71 72 72 73 … … 257 258 $GLOBALS['phpgw']->template->set_var('cc_msg_outlook_2k_pt', lang('Export as Outlook 2000 (Portuguese) CSV.')); 258 259 $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.')); 259 261 $GLOBALS['phpgw']->template->set_var('cc_msg_expresso_default_csv', lang('Export as Expresso (Default) CSV.')); 260 262 $GLOBALS['phpgw']->template->set_var('cc_msg_copy_to_catalog', lang('Copy to personal catalog.')); 261 263 $GLOBALS['phpgw']->template->set_var('cc_msg_add_contact_to_group', lang('You did not add any contact for this group.')); 262 264 $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.")); 263 266 264 267 $select_groups = ''; … … 282 285 $GLOBALS['phpgw']->template->set_var('cc_contact_type', 'default'); 283 286 } 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 284 336 $GLOBALS['phpgw']->template->parse('out','index'); 285 337 … … 289 341 $main .= $api->get_quick_add_plugin(); 290 342 $main .= $api->get_add_group(); 343 $main .= $api->get_contact_details(); 291 344 $main .= $GLOBALS['phpgw']->template->get_var('out'); 292 345 … … 358 411 case 'get_catalog_add_contact': 359 412 // 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'])); 361 414 return; 362 415 … … 450 503 echo $this->get_list_owners_perms_add(); 451 504 return; 452 505 case 'get_contact_details': 506 return $this->get_contact_details($_GET['id']); 453 507 } 454 508 } … … 487 541 { 488 542 $id_catalog = str_replace('\\"', '"', $id_catalog); 489 $temp = &$this->bo->set_catalog($id_catalog);543 $temp = $this->bo->set_catalog($id_catalog); 490 544 491 545 if(!$this->bo->catalog->src_info) { … … 505 559 $this->page_info['changed'] = true; 506 560 $this->page_info['actual_entries'] = false; 507 $this->page_info['actual_catalog'] = &$temp;561 $this->page_info['actual_catalog'] = $temp; 508 562 $this->save_session(); 509 563 … … 1330 1384 ); 1331 1385 1386 //verifica se esta habilitado a opcao de exibir os detalhes extras 1387 $objconfig = CreateObject('phpgwapi.config', 'contactcenter'); 1388 $config = $objconfig->read_repository(); 1389 1332 1390 //echo 'Page: '.$page.'<br>'; 1333 1391 $n_entries = count($this->page_info['actual_entries']); … … 1389 1447 for($z = 0; $z < $info['count']; $z++) { 1390 1448 $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 } 1391 1469 } 1392 1470 } … … 1418 1496 ); 1419 1497 1420 $groups = &$this->bo->catalog->get_multiple_entries($ids,$fields);1498 $groups = $this->bo->catalog->get_multiple_entries($ids,$fields); 1421 1499 1422 1500 $i = 0; … … 1473 1551 if($external) 1474 1552 { 1475 $contacts = &$this->bo->catalog->get_multiple_entries($ids,$fields,false,true);1553 $contacts = $this->bo->catalog->get_multiple_entries($ids,$fields,false,true); 1476 1554 } else{ 1477 $contacts = &$this->bo->catalog->get_multiple_entries($ids,$fields); 1478 } 1479 1555 $contacts = $this->bo->catalog->get_multiple_entries($ids,$fields); 1556 } 1480 1557 /*******/ 1481 1482 1483 1558 if (!is_array($contacts) or !count($contacts)) 1484 1559 { … … 1517 1592 /********/ 1518 1593 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'; 1520 1595 1521 1596 //Para exibir a matricula do empregado … … 1551 1626 $default_phone_found = true; 1552 1627 } 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 } 1554 1632 /**rev 104**/ 1555 1633 //if ($_SESSION['phpgw_info']['user']['preferences']['contactcenter']['voip_enabled'] && !$external){ … … 1563 1641 $final[3][$i][3] = $conn_info['connection_value'] ? $conn_info['connection_value'] : 'none'; 1564 1642 } 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 } 1565 1648 } 1566 1649 } … … 1571 1654 } 1572 1655 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 1576 1660 } 1577 1661 1578 1662 $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]); 1580 1664 1581 1665 /**rev 104**/ … … 1593 1677 $final[3][$i][12] = lang('Shared').": ".$owner_names[$owners[$i]]['cn']; 1594 1678 } 1595 /******/1596 1679 1597 1680 $final[4][$i] = $contact['photo'] ? 1 : 0; 1681 1682 1683 1598 1684 $i++; 1599 1685 } … … 1610 1696 $final[9] = $count; 1611 1697 $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="" '; 1614 1700 $this->page_info['actual_letter'] = $letter; 1615 1701 $this->page_info['actual_page'] = $page; … … 1656 1742 } 1657 1743 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 } 1658 1759 } 1659 1760 echo serialize ($owner_names); … … 1690 1791 $boGroup = CreateObject('contactcenter.bo_group'); 1691 1792 1692 $all_contacts = $boGroup->get_all_contacts( 'only_email',$shared_from);1793 $all_contacts = $boGroup->get_all_contacts(false,$shared_from); 1693 1794 1694 1795 $contact_options = ""; 1695 1796 if(count($all_contacts)) { 1696 1797 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>"; 1698 1803 } 1699 1804 } … … 1805 1910 1806 1911 /* 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 } 1807 1938 1808 1939 echo serialize($data); … … 1824 1955 $predata[] = $boPeopleCatalog -> get_all_countries(); 1825 1956 $predata[] = $boPeopleCatalog -> get_all_connections_types(); 1957 $boGroup = CreateObject('contactcenter.bo_group'); 1958 //$predata[] = $boGroup->get_groups_by_user(); 1826 1959 //$predata[] = $this->bo->catalog->get_all_relations_types(); 1827 1960 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 1828 1973 $i = 0; 1829 1974 foreach($predata as $data_) … … 1883 2028 } 1884 2029 } 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 else1904 {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 1913 2030 $data['alias'] = addslashes($tdata[0]); 1914 2031 $data['given_names'] = addslashes($tdata[1]); … … 2305 2422 $email = $dataConn['connection'.$i]['connection_value']; 2306 2423 } 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;2319 2424 } 2320 2425 … … 2448 2553 /* Does nothing... */ 2449 2554 break; 2450 2555 case 'groups': 2556 $groups = $data['groups']; 2557 unset($data['groups']); 2558 break; 2451 2559 default: 2452 2560 echo serialize(array( … … 2482 2590 'status' => 'fail' 2483 2591 ); 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); 2484 2599 } 2485 2600 … … 2617 2732 $email = $dataConn['connection'.$i]['connection_value']; 2618 2733 } 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;2631 2734 } 2632 2735 … … 2765 2868 } 2766 2869 2767 $code = '$id = $this->bo->catalog->';2870 //$code = '$id = $this->bo->catalog->'; 2768 2871 2769 2872 if (!is_null($id) and $id !== '') 2770 2873 { 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){ 2772 2877 $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!'), 2774 2886 'status' => 'ok' 2775 2887 ); 2776 2888 } 2889 } 2777 2890 else 2778 2891 { 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){ 2790 2895 $result = array( 2791 2896 'msg' => lang('Some problem occured when trying to insert/update contact information.<br>'. … … 2794 2899 ); 2795 2900 } 2796 2901 else{ 2902 $result = array( 2903 'msg' => lang('Entry Added Successfully!'), 2904 'status' => 'ok' 2905 ); 2906 } 2907 } 2797 2908 echo serialize($result); 2798 }2909 } 2799 2910 /*! 2800 2911 … … 3096 3207 if (!is_array($data) || (!$data['search_for'] && !$full_search) || !is_array($data['fields'])) 3097 3208 { 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 ); 3104 3222 } 3105 3223 … … 3118 3236 { 3119 3237 3120 $data['search_for'] = utf8_encode($data['search_for']);3238 $data['search_for'] = $data['search_for']; 3121 3239 } 3122 3240 … … 3245 3363 // Get only this attributes: dn, cn for external catalogs, 3246 3364 // 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); } 3249 3366 else 3250 3367 { … … 3259 3376 'contact.connection.mail', 3260 3377 '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 ); } 3263 3379 3264 3380 if (!is_array($ids) || !count($ids)) … … 3641 3757 for($z = 0; $z < 5; $z++) { 3642 3758 $participant = $info[0][$justThese[$z]]; 3759 $participant[0] = utf8_decode($participant[0]); 3643 3760 array_push($array_participants, $participant); 3644 3761 } … … 3755 3872 $contacts = $boGroup->get_all_contacts(); 3756 3873 $streamBuffer = ''; 3874 $stramArray = Array(); 3757 3875 3758 3876 if(!count($contacts)) … … 3780 3898 3781 3899 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;" 3783 3901 ."Cidade do endereço residencial;CEP do endereço residencial;Estado;País/região do endereço residencial;" 3784 3902 ."Telefone residencial;Fax residencial;Telefone celular;Página pessoal da Web;Rua do endereço comercial;" … … 3789 3907 foreach($contacts as $index => $object){ 3790 3908 $streamBuffer.= "\"".$object[ 'names_ordered'] . "\";" 3791 .";;;"3792 3909 . "\"".$object[ 'alias' ] . "\";" 3793 3910 . "\"".$object[ 'main-mail' ] . "\";" … … 3813 3930 . "\"".$object[ 'job_title' ] . "\";" 3814 3931 . "\"".$object[ 'department' ] . "\";" 3815 ." ;"3932 ."\"\";" 3816 3933 . "\"".str_replace("\r\n\x0a","\t",$object[ 'notes' ]) . "\"\r\n"; 3817 3934 } … … 3958 4075 ."Home Address 2,Home City,Home State,Home ZipCode,Home Country,Work Address,Work Address 2," 3959 4076 ."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"; 3961 4078 3962 4079 foreach($contacts as $index => $object){ 3963 4080 $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); 3998 4131 } 3999 4132 break; … … 4007 4140 4008 4141 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); 4043 4187 } 4044 4188 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; 4045 4306 4046 4307 } 4047 4308 4048 4309 $file = "contacts_".md5(microtime()).".swp"; 4049 $tempDir = ini_get("session.save_path");4310 $tempDir = $GLOBALS['phpgw_info']['server']['temp_dir']; 4050 4311 $f = fopen($tempDir.'/'.$file,"w"); 4051 4312 if(!$f) … … 4095 4356 //sobrenome, notas e e-mail; 4096 4357 //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 { 4098 4360 $this->so_group = CreateObject('contactcenter.so_group'); 4099 if($file = $_SESSION['contactcenter']['importCSV']) { 4361 if($file = $_SESSION['contactcenter']['importCSV']) 4362 { 4100 4363 unset($_SESSION['contactcenter']['importCSV']); 4101 4364 $len = filesize($file); … … 4107 4370 if ($typeImport == 'outlook') 4108 4371 $delim = ';'; 4109 else if ($typeImport == 'auto' )4372 else if ($typeImport == 'auto' || $typeImport== 'thunderbird') 4110 4373 $delim = strstr($input_header,',') ? ',' : ';'; 4111 4374 else … … 4149 4412 break; 4150 4413 case 'outlook': 4151 $name_pos= 3;4152 $email_pos= 4;4153 $phone_pos= 7;4154 $home_phone_pos= 10;4155 $personal_cell_pos=1 2;4156 $corporate_street_pos=1 3;4157 $cep_pos=1 5;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; 4159 4422 $fax_pos=19; 4160 4423 $pager_pos=20; … … 4163 4426 case 'thunderbird': 4164 4427 $name_pos=2; 4428 $alias_pos=3; 4429 //MAILS 4165 4430 $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; 4167 4497 break; 4168 4498 case 'expresso': … … 4276 4606 } 4277 4607 4278 while (($data = fgetcsv($handle, $len, $delim))) { 4608 4609 4610 while (($data = fgetcsv($handle, $len, $delim))) 4611 { 4279 4612 foreach ($header as $key=>$heading) 4280 4613 $row[$heading]=(isset($data[$key])) ? $data[$key] : ''; 4281 4614 4282 4615 $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]])); 4297 4631 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;4303 4632 $array_name = explode(' ', str_replace('"','',(str_replace('\'','',$full_name)))); 4304 4633 $sdata['given_names'] = addslashes($array_name[0]); … … 4386 4715 $sdata['addresses']['address_personal']['id_city'] = trim($row[$header[$city_pos]]); 4387 4716 4388 if(trim($birth)) { 4717 if(trim($birth)) 4718 { 4389 4719 $array_birth = explode("/",trim($birth)); 4390 4720 $sdata['birthdate'] = date('Y-m-d', mktime(0,0,0,$array_birth[1],$array_birth[0],$array_birth[2])); … … 4394 4724 //$sdata['is_quick_add'] = true; 4395 4725 $sdata['connections']['default_phone']['connection_value'] = $phone; 4396 4726 if(!$phone){ 4727 4728 } 4397 4729 // verifica se email já existe! 4398 4730 $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 { 4402 4735 $a_email = explode("@",$email); 4403 4736 $sdata['given_names'] = addslashes($a_email[0]); … … 4406 4739 $line_iteration = $return['_failure'] + $return['_existing'] + $return['_new']; 4407 4740 4408 if($contact){ 4741 if($contact[0] != null) 4742 { 4409 4743 $return['_existing']++; 4410 4744 } 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) { 4412 4746 $return['_failure']++; 4413 4747 $return['_failure_status'] .= "Line: " . ($line_iteration + 2) . ", Invalid E-Mail address: " . $email ."<br>"; … … 4432 4766 echo serialize($return); 4433 4767 } 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 4434 4830 } 4435 4831 -
trunk/contactcenter/js/cc.js
r4507 r5131 231 231 function openContactDetails(id){ 232 232 // Build the ContactDetails Window. 233 if( !contactdetailsWin&& !is_ie)233 if((typeof(contactdetailsWin) == 'undefined') && !is_ie) 234 234 __cdWin(); 235 235 … … 996 996 for (var type in CC_contact_full_info['connections']){ 997 997 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,})*$/; 998 999 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{ 999 1007 if((CC_contact_full_info['connections'][type][i]['value'].length < 4) || 1000 1008 (!comp.test(CC_contact_full_info['connections'][type][i]['value']))){ … … 1002 1010 return false; 1003 1011 } 1012 } 1004 1013 } 1005 1014 var _options_default = Element("cc_"+(type == 1 ? 'email' : 'phone')+"_default"); … … 1009 1018 } 1010 1019 } 1011 }1012 if(!haveConnections){1013 showMessage(Element('cc_msg_tel_or_mail_required').value);1014 return false;1015 1020 } 1016 1021 … … 1634 1639 //'<td style="width: 30px;" align="right"><input name="cc_conn_is_default" id="cc_conn_is_default_'+ CC_conn_count +'" type="radio"></td>'+ 1635 1640 '<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"> ' +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"> ' + 1637 1642 '<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>'; 1638 1643 } … … 1642 1647 //'<td style="width: 30px;" align="right"><input name="cc_conn_is_default" id="cc_conn_is_default_'+ CC_conn_count +'" type="radio"></td>'+ 1643 1648 '<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)"> ' +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)"> ' + 1645 1650 '<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>'; 1646 1651 } … … 1806 1811 1807 1812 connRemoveLine(id); 1813 } 1814 1815 function emailTolower(obj){ 1816 document.getElementById(obj).value = document.getElementById(obj).value.toLowerCase(); 1817 1808 1818 } 1809 1819 … … 2308 2318 2309 2319 if(data[3][pos][k] === 'none') 2310 data[3][pos][k] = ' ';2320 "Não informado."; 2311 2321 break; 2312 2322 case 'cc_phone' : 2313 2323 2314 2324 if(data[3][pos][k] === 'none') 2315 data[3][pos][k] = ' ';2325 data[3][pos][k] = "Não informado."; 2316 2326 break; 2317 2327 } … … 2352 2362 else 2353 2363 { 2364 if(data[3][pos][k] != "Não informado.") 2354 2365 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>'; 2355 2368 } 2356 2369 break; … … 2366 2379 Element(id+':'+data[2][k]).innerHTML = adjustString(data[3][pos][k], 20); 2367 2380 } 2381 if(data[3][pos][k] != " ") 2368 2382 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."; 2369 2385 break; 2370 2386 2371 2387 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) 2373 2393 { 2374 2394 Element(id+':'+data[2][k]).innerHTML = adjustString(data[3][pos][k], 15); … … 2380 2400 } 2381 2401 break; 2382 2402 }else{ 2403 break; 2404 } 2383 2405 case 'cc_id': 2384 2406 var id_contact = data[3][pos][k]; … … 2410 2432 //Para tratar tamanho do campo "celular" do empregado 2411 2433 case 'cc_mobile': 2434 if(preferences.cellShow && ccTree.catalog_perms == 1){ 2412 2435 if (data[3][pos][k].length > 20) 2413 2436 { … … 2421 2444 Element(id+':cc_mobile').innerHTML = data[3][pos][k]; 2422 2445 break; 2423 2446 }else{ 2447 break; 2448 } 2424 2449 //Para tratar tamanho do campo "matricula" do empregado 2425 2450 case 'cc_empNumber': 2451 if(preferences.empNumShow && ccTree.catalog_perms == 1){ 2426 2452 if (data[3][pos][k].length > 20) 2427 2453 { … … 2435 2461 Element(id+':cc_empNumber').innerHTML = data[3][pos][k]; 2436 2462 break; 2437 2463 }else{ 2464 break; 2465 } 2438 2466 //Para tratar tamanho do campo "departamento" do empregado 2439 2467 case 'cc_department': … … 2461 2489 Element(id+':'+data[2][k]).innerHTML = data[3][pos][k]; 2462 2490 } 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; 2463 2521 } 2464 2522 } … … 2515 2573 { 2516 2574 case 'cc_title': 2517 if (data[3][pos][k].length > 50)2575 if (data[3][pos][k].length > (CC_visual == 'table' ? 50 : 20)) 2518 2576 { 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)); 2520 2578 Element(id+':'+data[2][k]).title = data[3][pos][k]; 2521 2579 } … … 2663 2721 '<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">' : '') + 2664 2722 '<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: 1 4px; 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>' + 2666 2724 '<span style="cursor: pointer; cursor: hand; z-index: 1;position: absolute; top: 100px; left: 35px" valign="bottom" id="' + id + ':cc_icon_group"> </span>'+ 2667 2725 //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>' + 2669 2727 '<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>' + 2671 2729 //Para exibir o setor/lotacao do empregado nos cartoes 2672 2730 '<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>' + … … 2694 2752 '<span id="' + id + ':cc_participantes" style="cursor: pointer; cursor: hand; z-index: 1"></span>' + 2695 2753 '<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%">'+ 2698 2756 '<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">' + 2699 2757 ' | '+ … … 2705 2763 html_card = '<tr style="height:20px" id="' + id + '" onmouseout="'+bg+'" onmouseover="this.style.background=\'LIGHTYELLOW\'" bgcolor="EEEEEE">' + 2706 2764 //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>' : '') + 2708 2766 '<td width="auto" style="font-weight: normal; font-size: 10px; text-align: left; height: 10px;"><span valign="bottom" id="' + id + ':cc_icon_group"> </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>' + 2711 2769 //Para exibir o celular empresarial do empregado na tabela 2712 (preferences.cellShow && ccTree.catalog_perms == 1 ? '<td align="center" n owrap><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>' : '') + 2713 2771 //Para exibir o setor/lotacao do empregado na tabela 2714 (preferences.departmentShow && ccTree.catalog_perms == 1 ? '<td align="center" n owrap><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>' : '') + 2715 2773 ( 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>':'') + 2717 2775 (ccTree.catalog_perms & 2 ? 2718 '<td align=" left" >'+2776 '<td align="center" width="10%" >'+ 2719 2777 '<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">' + 2720 2778 ' | '+ … … 2722 2780 '<input id="' + id + ':cc_id" type="hidden">'+ 2723 2781 '<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>' + 2725 2783 '<span id="' + id + ':cc_alias" style="display:none"></span>' + 2726 2784 // Esse campo é necessário se o contato possui dados no campo cc_company -
trunk/contactcenter/js/ccAddGroup.js
r4769 r5131 128 128 if (data['status'] != 'ok' && data['status'] != 'warning') 129 129 { 130 showMessage(Element('cc_msg_err_duplicate_group').value); 130 131 return; 131 132 } … … 205 206 206 207 this.title.value = ''; 208 ccAGSearchTerm.value = ''; 207 209 } 208 210 … … 240 242 241 243 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)){ 243 245 isSelected = true; 244 break;246 //break; 245 247 } 246 248 } … … 346 348 347 349 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 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 // } 363 365 364 366 var handler = function(data) … … 435 437 { 436 438 ccAddGroup.clearSourceList(); 439 if (catalogLevel == '0.2') 440 ccAddGroup.search(); 437 441 } 438 442 -
trunk/contactcenter/js/ccIEContacts.js
r3334 r5131 47 47 this.el.style.top = "0px"; 48 48 this.el.style.width = this.wWidth + 'px'; 49 this.el.style.height = this.wHeight + 'px';49 this.el.style.height = this.wHeight + 100+'px'; 50 50 if(is_ie) { 51 this.el.style.width = " 430";51 this.el.style.width = "650"; 52 52 this.el.style.overflowY = "auto"; 53 53 this.el.style.overflowX = "hidden"; 54 54 } 55 55 else { 56 this.el.style.overflowY = "auto"; 56 57 this.el.style.overflow = "-moz-scrollbars-vertical"; 57 58 } … … 75 76 var lang_outl2k_pt = Element('cc_msg_outlook_2k_pt').value; 76 77 var lang_outl2k_en = Element('cc_msg_outlook_2k_en').value; 78 var lang_outl03 = Element('cc_msg_outlook_2003').value; 77 79 var lang_expresso_default_csv = Element('cc_msg_expresso_default_csv').value; 78 80 79 81 80 82 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>'+ 82 84 '<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+ 83 85 ' <input onclick="javascript:ccIEContacts.changeOptions(this.value)" id="type" type="radio" name="type" style="border:0" value="e"/>'+lang_export_contacts+' <br></td></tr>'+ 84 86 '</table>'+ 85 '<table border=0 height=" 208px" width="100%" id="import_span">'+87 '<table border=0 height="100%" width="100%" id="import_span">'+ 86 88 '<tr><td>'+ 87 89 '<font color="DARKBLUE" size="2">'+lang_expresso_info_csv+'</font></td></tr>'+ … … 91 93 '<option value="outlook">'+("Outlook Express")+'</option>'+ 92 94 '<option value="outlook2000">'+("Outlook 2000")+'</option>'+ 95 '<option value="outlook2003">'+("Outlook 2003")+'</option>'+ 93 96 '<option value="thunderbird">'+("Mozilla Thunderbird")+'</option>'+ 94 97 '<option value="expresso" selected>'+lang_expresso_default+'</option></select><br>'+ … … 102 105 '<input type="button" value='+lang_close_win+' onClick="javascript:ccIEContacts.close()"></center></td></tr>'+ 103 106 '<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">'+ 105 108 '<tr><td>'+ 106 109 '<font color="DARKBLUE" size="2">'+ lang_msg_expresso_info_csv+'</font></td></tr>'+ … … 112 115 '<option value="outlook2000_pt-BR">'+lang_outl2k_pt+'</option>'+ 113 116 '<option value="outlook2000_en">'+lang_outl2k_en+'</option>'+ 117 '<option value="outlook2003">'+lang_outl03+'</option>'+ 114 118 '<option value="thunderbird">'+lang_moz_tb+'</option>'+ 115 119 '</select>'+ 116 120 '</td></tr>'+ 117 '<tr><td align="center"> </td></tr>'+118 121 '<tr><td nowrap><center><input id="export_button" type="button" value='+lang_export_contacts+ ' onClick="javascript:ccIEContacts.exportCSV(this)"> '+ 119 122 '<input type="button" value='+lang_close_win+ ' onClick="javascript:ccIEContacts.close()"></center></td></tr>'+ … … 121 124 } 122 125 this.showWindow(); 126 if(Element('s_info')) 127 Element('s_info').style.visibility = 'hidden'; 128 ccIEContacts.cleanInfo(); 123 129 } 124 130 … … 131 137 content_id: this.el.id, 132 138 width: (this.wWidth +(is_ie ? 41 : 0)) +'px', 133 height: this.wHeight + 'px',139 height: this.wHeight +100+'px', 134 140 title_color: '#3978d6', 135 141 bg_color: '#eee', … … 166 172 var l_2 = '<font face="Verdana" size="1" color="RED">['+args[2]+lang_failure+']</font>'; 167 173 var l_3 = '<font face="Verdana" size="1" color="DARKBLUE">['+args[3]+lang_exists+']</font>'; 174 if(args[2]) 168 175 var l_4 = '<br><a font face="Verdana" size="1" href="javascript:ccIEContacts.showFailures(\''+args[4]+'\')">'+lang_show_more_info+'</a>'; 169 176 var l_error = '<span style="height:15px;background:#cc4444"> <font face="Verdana" size="1" color="WHITE">'+lang_import_fail+ ' </font></span>'; … … 172 179 if(args[0] == 'success') { 173 180 174 for(i = 1; i < 5; i++) {181 for(i = 1; i < 4; i++) { 175 182 status += " "+eval('l_'+i); 183 } 184 if(args[2]){ 185 status += " "+eval('l_4'); 176 186 } 177 187 Element('s_info').innerHTML = ' <font face="Verdana" size="1" color="BLACK"><b>'+lang_import_finish+'</b></font><br> '+status; … … 200 210 cIEContacts.prototype.importCSV = function () 201 211 { 212 ccIEContacts.cleanInfo(); 202 213 var lang_msg_invalid_csv = Element('cc_msg_invalid_csv').value; 203 214 var form = document.formCSV; … … 223 234 args[3] = data._existing ? data._existing : 0; 224 235 args[4] = data._failure_status 225 236 if(args[1] > 0) 237 ccTree.setCatalog("0.0"); 226 238 } 227 239 _this.importWriteStatus(args); -
trunk/contactcenter/js/ccListParticipants.js
r880 r5131 55 55 if(names.length) { 56 56 for (var d = 0; d < (names.length-1); d++) { 57 var email_valido = email[d] != 'null' ? email[d] : "não informado" 57 58 el.innerHTML += 58 59 "<font color='DARKBLUE'> "+ 59 60 "\"" + names[d]+ "\"" + 60 " <"+email [d]+61 " <"+email_valido+ 61 62 "></font> <br>"; 62 63 } -
trunk/contactcenter/js/ccMain.js
r3795 r5131 22 22 var search_params = new Array(); 23 23 search_params['holder'] = Element('cc_panel_search_call'); 24 search_params['total_width'] = (v_label != false & v_atrib != false)? '485px' : '33 0px';24 search_params['total_width'] = (v_label != false & v_atrib != false)? '485px' : '335px'; 25 25 search_params['input_width'] = '200px'; 26 26 search_params['progress_top'] = '150px'; -
trunk/contactcenter/js/ccQuickAdd-plugin.js
r4721 r5131 202 202 } 203 203 //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,})*$/; 206 206 207 207 if (sdata[4] !== "" && !reEmail.test(this._fields[4].value)) { … … 211 211 } 212 212 } 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(); 217 214 var sdata = 'add='+escape(serialize(sdata)); 218 215 -
trunk/contactcenter/js/cc_config.js
r4548 r5131 22 22 function cc_attribute_clear(form) 23 23 { 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 }49 24 form.submit(); 50 25 } … … 60 35 function cc_attribute_add() 61 36 { 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; 64 42 65 43 var numeroAtributo = 0; 66 var vars = document.getElementsByClassName("cc_attribute"); 44 var table = document.getElementsByName("cc_newconftable"); 45 var vars = table[0].getElementsByTagName("TR"); 67 46 68 47 var maior = 0; 69 for (var i= 0; i<vars.length; i++) {48 for (var i=1; i<vars.length; i++) { 70 49 var tupla = vars[i]; 71 50 var linhaIndice = tupla.getElementsByTagName("input")[0]; … … 88 67 var cc_attribute_searchable = "newsettings[cc_attribute_searchable_" + numeroAtributo + "]"; 89 68 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"); 92 70 93 var newDiv = document.createElement("div");94 newDiv.setAttribute("class", "cc_attribute");71 //LINHA DOS CAMPOS 72 var tudo = document.createElement("TR"); 95 73 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); 108 134 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); 160 136 } 161 137 … … 170 146 { 171 147 var tupla = e.parentNode; 172 148 tupla = tupla.parentNode; 149 var mom = tupla.parentNode; 173 150 var inputs = tupla.getElementsByTagName("input"); 174 151 -
trunk/contactcenter/js/cc_search.js
r4548 r5131 270 270 target.appendChild( holder ); 271 271 272 this.win = new dJSWin({272 this.win = win = new dJSWin({ 273 273 id: 'ccSearch_Layer2', 274 274 content_id: 'Layer2', … … 380 380 data['search_for'] = cn; 381 381 382 customFilterDiv.style.visibility = 'hidden';382 win.close(); 383 383 document.getElementById('overlay').style.visibility = 'hidden'; 384 384 } -
trunk/contactcenter/setup/setup.inc.php
r4306 r5131 17 17 $setup_info['contactcenter']['name'] = 'contactcenter'; 18 18 $setup_info['contactcenter']['title'] = 'ContactCenter'; 19 $setup_info['contactcenter']['version'] = '2. 2.2';19 $setup_info['contactcenter']['version'] = '2.4.0'; 20 20 $setup_info['contactcenter']['app_order'] = 4; 21 21 $setup_info['contactcenter']['enable'] = 1; … … 76 76 $setup_info['contactcenter']['depends'][] = array( 77 77 'appname' => 'phpgwapi', 78 'versions' => Array('2. 2')78 'versions' => Array('2.4.0') 79 79 ); 80 80 ?> -
trunk/contactcenter/setup/tables_current.inc.php
r3282 r5131 288 288 'notes' => array( 'type' => 'text' ), 289 289 '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) 291 294 ), 292 295 'pk' => array('id_contact'), -
trunk/contactcenter/setup/tables_update.inc.php
r4306 r5131 65 65 return $GLOBALS['setup_info']['contactcenter']['currentver']; 66 66 } 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 } 67 79 ?> -
trunk/contactcenter/templates/default/api_common.tpl
r1496 r5131 16 16 <input id="cc_msg_err_serialize_data_unknown" type="hidden" value="{cc_msg_err_serialize_data_unknown}" /> 17 17 <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}" /> 18 19 19 20 <input id="cc_msg_err_empty_field" type="hidden" value="{cc_msg_err_empty_field}" /> -
trunk/contactcenter/templates/default/index.tpl
r4548 r5131 86 86 <input id="cc_msg_outlook_2k_pt" type="hidden" value="{cc_msg_outlook_2k_pt}"> 87 87 <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}"> 88 89 <input id="cc_msg_moz_thunderbird" type="hidden" value="{cc_msg_moz_thunderbird}"> 89 90 <input id="cc_msg_expresso_default_csv" type="hidden" value="{cc_msg_expresso_default_csv}"> … … 212 213 <table bgcolor="#D3DCE3" cellspacing="0" cellpadding="0" border="0"> 213 214 <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> 215 216 </tr> 216 217 </table> … … 219 220 <table bgcolor="#D3DCE3" cellspacing="0" cellpadding="0" border="0"> 220 221 <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> 222 223 </tr> 223 224 </table> … … 233 234 <table bgcolor="#D3DCE3" cellspacing="0" cellpadding="0" border="0"> 234 235 <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> 236 237 </tr> 237 238 </table> … … 240 241 <table bgcolor="#D3DCE3" cellspacing="0" cellpadding="0" border="0"> 241 242 <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> 243 244 </tr> 244 245 </table> -
trunk/contactcenter/templates/default/preferences.tpl
r1600 r5131 20 20 <td> 21 21 <select name="personCardEmail" style="width: 200px"> 22 <option selected value="_NONE_">{lang_Choose_Email_Type...}</option>23 22 {personCardEmail} 24 23 </select> … … 29 28 <td> 30 29 <select name="personCardPhone" style="width: 200px"> 31 <option selected value="_NONE_">{lang_Choose_Telephone_Type...}</option>32 30 {personCardPhone} 33 31 </select>
Note: See TracChangeset
for help on using the changeset viewer.