Changeset 4599 for branches/2.2.0.1/contactcenter/inc
- Timestamp:
- 06/11/11 16:42:10 (13 years ago)
- Location:
- branches/2.2.0.1/contactcenter/inc
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.0.1/contactcenter/inc/class.bo_group.inc.php
r1280 r4599 47 47 return $result; 48 48 } 49 50 function verify_shared_contact($owner,$email){ 51 52 $result = $this-> so -> verifySharedContact($owner,$email); 53 return $result; 54 } 49 55 50 56 function get_contacts_by_group($id){ -
branches/2.2.0.1/contactcenter/inc/class.so_group.inc.php
r4444 r4599 370 370 return $return; 371 371 } 372 372 373 function verifySharedContact($owner,$email) 374 { 375 $query = 'select A.names_ordered, C.id_connection from phpgw_cc_contact A,'. 376 'phpgw_cc_contact_conns B, phpgw_cc_connections C where '. 377 'A.id_contact = B.id_contact and B.id_connection = C.id_connection '. 378 'and B.id_typeof_contact_connection = 1 and '. 379 'A.id_owner ='.$owner.' and C.connection_value = \''.$email.'\''; 380 381 if (!$this->db->query($query)) 382 { 383 exit ('Query failed! File: '.__FILE__.' on line'.__LINE__); 384 } 385 386 $return = false; 387 388 while($this->db->next_record()) 389 { 390 $row = $this->db->row(); 391 $return[] = $row['names_ordered']; 392 $return[] = $row['id_connection']; 393 } 394 395 return $return; 396 } 397 373 398 function selectContactsByGroup($idGroup) 374 399 { -
branches/2.2.0.1/contactcenter/inc/class.ui_data.inc.php
r4598 r4599 2289 2289 foreach($data as $field => $value) 2290 2290 { 2291 $dataConn = $data['connections']; 2292 $aa = count($dataConn); 2293 2294 for($i = 0; $i < $aa; $i++ ) 2295 { 2296 if($dataConn['connection'.$i]['connection_is_default'] == "TRUE") 2297 { 2298 $email = $dataConn['connection'.$i]['connection_value']; 2299 } 2300 } 2301 // verifica se email já existe! 2302 $boGroup = CreateObject('contactcenter.bo_group'); 2303 $contact = $boGroup->verify_contact($email); 2304 if($contact) 2305 { 2306 $str_contact = "\r\n - ".implode("\r\n - ",$contact); 2307 echo serialize(array( 2308 'msg' => lang('Problems on adding your Contact. The email "%1" already exists in: %2',$tdata[4], $str_contact), 2309 'status' => 'alreadyExists' 2310 )); 2311 return; 2312 } 2291 2313 2292 2314 switch($field) … … 2578 2600 foreach($data as $field => &$value) 2579 2601 { 2602 2603 $dataConn = $data['connections']; 2604 $aa = count($dataConn); 2605 2606 for($i = 0; $i < $aa; $i++ ) 2607 { 2608 if($dataConn['connection'.$i]['connection_is_default'] == "TRUE") 2609 { 2610 $email = $dataConn['connection'.$i]['connection_value']; 2611 } 2612 } 2613 // verifica se email já existe! 2614 $boGroup = CreateObject('contactcenter.bo_group'); 2615 $contact = $boGroup->verify_shared_contact($owner,$email); 2616 if($contact) 2617 { 2618 $str_contact = "\r\n - ".implode("\r\n - ",$contact); 2619 echo serialize(array( 2620 'msg' => lang('Problems on adding your Contact. The email "%1" already exists in: %2',$tdata[4], $str_contact), 2621 'status' => 'alreadyExists' 2622 )); 2623 return; 2624 } 2625 2580 2626 if ($value == '' or is_null($value)) 2581 2627 { … … 2696 2742 case 'connections': 2697 2743 /* Does nothing... */ 2744 $aaaa = 1111; 2698 2745 break; 2699 2746
Note: See TracChangeset
for help on using the changeset viewer.