Changeset 4510 for sandbox/2.2.0.2/contactcenter
- Timestamp:
- 05/25/11 16:25:53 (13 years ago)
- Location:
- sandbox/2.2.0.2/contactcenter/inc
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/2.2.0.2/contactcenter/inc/cc_updown.php
r1679 r4510 3 3 // This script upload an CSV file to import contacts .... 4 4 if($ftmp = $_FILES['import_file']['tmp_name']){ 5 $fname = ini_get("session.save_path").'/'."contacts_".md5(microtime()).".swp"; 5 // Foi necessário modificar o caminho onde se recuperava o diretório temporário. 6 // Esse caminho foi hardcodificado na string abaixo ( /tmp ) temporariamente, mas deve ser recuperada atraves 7 // da configuracao do Expresso. Ver ticket #385. 8 $fname = "/tmp/contacts_".md5(microtime()).".swp"; 6 9 if(move_uploaded_file($ftmp, $fname)) 7 10 $_SESSION['contactcenter']['importCSV'] = $fname; 8 11 } 9 // ... or download an CSV 12 // ... or download an CSVfile to export contacts. 10 13 else if($_GET['file_name']) { 11 14 $file_name = $_GET['file_name']; … … 16 19 header("Content-disposition: attachment; filename=".$file_name); 17 20 readfile($file_path); 21 unlink($file_path); 18 22 } 19 23 ?> -
sandbox/2.2.0.2/contactcenter/inc/class.bo_group.inc.php
r4502 r4510 42 42 } 43 43 44 function verify_contact($email ){44 function verify_contact($email, $name, $phone){ 45 45 46 $result = $this-> so -> verifyContact($email );46 $result = $this-> so -> verifyContact($email, $name, $phone); 47 47 return $result; 48 48 } -
sandbox/2.2.0.2/contactcenter/inc/class.so_group.inc.php
r4502 r4510 423 423 } 424 424 425 function verifyContact($email) 426 { 427 $query = 'select A.names_ordered, C.id_connection from phpgw_cc_contact A,'. 428 'phpgw_cc_contact_conns B, phpgw_cc_connections C where '. 429 'A.id_contact = B.id_contact and B.id_connection = C.id_connection '. 430 'and B.id_typeof_contact_connection = 1 and '. 431 'A.id_owner ='.$this->owner.' and C.connection_value = \''.$email.'\''; 432 433 if (!$this->db->query($query)) 434 { 435 exit ('Query failed! File: '.__FILE__.' on line'.__LINE__); 436 } 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 } 437 439 438 $return = false; 439 440 while($this->db->next_record()) 441 { 442 $row = $this->db->row(); 443 $return[] = $row['names_ordered']; 444 $return[] = $row['id_connection']; 445 } 446 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 447 492 return $return; 448 493 } -
sandbox/2.2.0.2/contactcenter/inc/class.ui_data.inc.php
r4509 r4510 4121 4121 4122 4122 $file = "contacts_".md5(microtime()).".swp"; 4123 $tempDir = ini_get("session.save_path");4123 $tempDir = $GLOBALS['phpgw_info']['server']['temp_dir']; 4124 4124 $f = fopen($tempDir.'/'.$file,"w"); 4125 4125 if(!$f) … … 4470 4470 $sdata['connections']['default_phone']['connection_value'] = $phone; 4471 4471 4472 // 4472 // verifica se email já existe! 4473 4473 $email = addslashes($email); 4474 $contact = $boGroup->verify_contact($email); 4474 // Foi modificado o método que fazia a verificação se um contato já existe. 4475 // Antes era verificado somente com base no email do contato. 4476 $contact = $boGroup->verify_contact($email, $full_name, $phone); 4475 4477 4476 4478 if(!$sdata['given_names'] && $email){ … … 4483 4485 if($contact){ 4484 4486 $return['_existing']++; 4485 } 4486 else if((!eregi("^[/_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) && $email) { 4487 } 4488 // Modificada a expressão regular para aceitar endereços de email fora do padrão nome@provedor.com.br. 4489 // Aceita casos de domínios internos como c0000@mail.caixa. 4490 else if((!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[_a-z0-9-]+(\.[_a-z0-9-]+)+$", $email)) && $email) { 4487 4491 $return['_failure']++; 4488 4492 $return['_failure_status'] .= "Line: " . ($line_iteration + 2) . ", Invalid E-Mail address: " . $email ."<br>";
Note: See TracChangeset
for help on using the changeset viewer.