Changeset 3334 for branches/2.2/contactcenter/inc/class.so_group.inc.php
- Timestamp:
- 10/06/10 16:14:29 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/contactcenter/inc/class.so_group.inc.php
r3322 r3334 105 105 106 106 return True; 107 } 108 109 function selectGroupsOwnerCanImportContacts($owner) { 110 $query = "select id_group,title,short_name from phpgw_cc_groups where owner=$owner or owner in (select B.acl_location::bigint from phpgw_acl A, phpgw_acl B where 111 A.acl_location=B.acl_account and A.acl_account=B.acl_location 112 and A.acl_appname = 'contactcenter' and B.acl_appname = 'contactcenter' 113 and A.acl_rights & 4 <> 0 and B.acl_rights & 1 <> 0 114 and A.acl_location = $owner)"; //He can import contacts only to his groups, or shared groups that he gave read permission. 115 $this->db->query($query); 116 117 $return = array(); 118 119 while($this->db->next_record()) 120 { 121 $return[] = $this->db->row(); 122 } 123 124 return $return; 125 107 126 } 108 127 … … 492 511 return True; 493 512 } 513 514 function add_user_by_name($id_group){ 515 $query = 'select C.id_connection, A.id_contact, A.names_ordered, C.connection_value, B.id_typeof_contact_connection'. 516 ' from phpgw_cc_contact A, phpgw_cc_contact_conns B, phpgw_cc_connections C'. 517 ' where A.id_contact = B.id_contact and B.id_connection = C.id_connection'. 518 ' and A.last_update = (select max(up.last_update) from phpgw_cc_contact up where up.id_owner ='.$this->owner.")". 519 ' and A.id_owner ='.$this->owner.' and C.connection_is_default = true'. 520 ' order by A.names_ordered,C.connection_value'; 521 522 523 if (!$this->db->query($query)){ 524 exit ('Query failed! File: '.__FILE__.' on line'.__LINE__); 525 } 526 527 $return = array(); 528 529 $array_connections = array(); 530 while($this->db->next_record()){ 531 $return = $this->db->row(); 532 array_push($array_connections, $return['id_connection']); 533 } 534 $this -> insertContactsByGroup($id_group, $array_connections); 535 536 } 537 494 538 } 495 539 ?>
Note: See TracChangeset
for help on using the changeset viewer.