Changeset 1280 for trunk/contactcenter
- Timestamp:
- 08/05/09 18:20:55 (15 years ago)
- Location:
- trunk/contactcenter
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/contactcenter/inc/class.bo_group.inc.php
r702 r1280 36 36 } 37 37 38 function get_all_contacts($field = false ){38 function get_all_contacts($field = false,$owner=null){ 39 39 40 $result = $this-> so -> selectAllContacts($field );40 $result = $this-> so -> selectAllContacts($field,$owner); 41 41 return $result; 42 42 } -
trunk/contactcenter/inc/class.so_group.inc.php
r752 r1280 107 107 } 108 108 109 110 function selectAllContacts( $field = false ) 111 { 112 113 $query = 'select C.id_connection, A.id_contact, A.names_ordered, C.connection_value , B.id_typeof_contact_connection from phpgw_cc_contact A,'. 114 'phpgw_cc_contact_conns B, phpgw_cc_connections C where '. 115 'A.id_contact = B.id_contact and B.id_connection = C.id_connection and '. 116 'A.id_owner ='.$this->owner.' and C.connection_is_default = true '; 109 //Owner = null means the owner setted on constructor. 110 function selectAllContacts( $field = false ,$shared_from=null) 111 { 112 if($shared_from==null) { 113 $query = 'select C.id_connection, A.id_contact, A.names_ordered, C.connection_value , B.id_typeof_contact_connection from phpgw_cc_contact A,'. 114 'phpgw_cc_contact_conns B, phpgw_cc_connections C where '. 115 'A.id_contact = B.id_contact and B.id_connection = C.id_connection and '. 116 'A.id_owner ='.$this->owner.' and C.connection_is_default = true '; 117 } 118 else { 119 $sub_query = 'select A.id_related from phpgw_cc_contact_rels A,phpgw_acl B 120 where B.acl_location!=\'run\' and A.id_contact = B.acl_location::bigint and A.id_related = B.acl_account and 121 B.acl_appname = \'contactcenter\' and B.acl_rights & 1 <> 0 122 and A.id_typeof_contact_relation=1 and A.id_contact = '.$shared_from.' and A.id_related='.$this->owner; 123 124 $query = 'select C.id_connection, A.id_contact, A.names_ordered, C.connection_value , B.id_typeof_contact_connection from phpgw_cc_contact A,'. 125 'phpgw_cc_contact_conns B, phpgw_cc_connections C where '. 126 'A.id_contact = B.id_contact and B.id_connection = C.id_connection and '. 127 'A.id_owner in ('.$shared_from.',('.$sub_query.'))'. 128 ' and C.connection_is_default = true '; 129 } 117 130 118 131 if ( $field == 'only_email' ) … … 256 269 'A.id_contact = B.id_contact and B.id_connection = C.id_connection '. 257 270 'and B.id_typeof_contact_connection = 1 and '. 258 'A.id_owner ='.$this->owner.' and D.id_connection = C.id_connection and D.id_group = '.$id_group. 271 //'A.id_owner ='.$this->owner.' and D.id_connection = C.id_connection and D.id_group = '.$id_group. 272 ' D.id_connection = C.id_connection and D.id_group = '.$id_group. //If I have the group ID, why ask about owner? 259 273 ' order by A.names_ordered'; 260 274 -
trunk/contactcenter/inc/class.ui_data.inc.php
r962 r1280 312 312 313 313 case 'get_group': 314 return $this->get_group_data($_GET['id'] );314 return $this->get_group_data($_GET['id'],isset($_GET['shared_from'])?$_GET['shared_from']:null); 315 315 316 316 case 'get_contact_full_add_const': … … 1160 1160 $final[3][$i][5] = lang('Shared').": ".$owner_names[$owners[$i]]['cn']; 1161 1161 $final[3][$i][6] = $owner_names[$owners[$i]]['uid']; 1162 $final[3][$i][7] = $owners[$i]; //uidNumber 1162 1163 } 1163 1164 $i++; … … 1313 1314 1314 1315 */ 1315 function get_group_data($id )1316 function get_group_data($id,$shared_from=null) 1316 1317 { 1317 1318 $this->bo->catalog = CreateObject('contactcenter.bo_group_manager'); … … 1326 1327 $boGroup = CreateObject('contactcenter.bo_group'); 1327 1328 1328 $all_contacts = $boGroup->get_all_contacts('only_email' );1329 $all_contacts = $boGroup->get_all_contacts('only_email',$shared_from); 1329 1330 1330 1331 $contact_options = ""; -
trunk/contactcenter/js/cc.js
r880 r1280 195 195 } 196 196 197 function editSharedGroup(id ){198 populateEdit Group(id, 'shared');197 function editSharedGroup(id,shared){ 198 populateEditSharedGroup(id, shared); 199 199 } 200 200 … … 312 312 function populateEditGroup (id) 313 313 { 314 populateEditSharedGroup(id,false); 315 } 316 317 function populateEditSharedGroup(id,shared) { 314 318 var handler = function(responseText) 315 319 { … … 345 349 346 350 ccAddGroup.clear(true); 347 Connector.newRequest('populateEditGroup', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_group&id='+id, 'GET', handler); 351 if(!shared) 352 Connector.newRequest('populateEditGroup', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_group&id='+id, 'GET', handler); 353 else 354 Connector.newRequest('populateEditGroup', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_group&id='+id+'&shared_from='+shared, 'GET', handler); 348 355 } 349 356 … … 2084 2091 2085 2092 if (type == "shared_groups") { 2086 /* Edição de grupos compartilhados está com problema. Desabilitado temporariamente.2093 2087 2094 if (data[3][pos][4] & 4) 2088 eval("document.getElementById(id + ':cc_card_edit').onclick = function(){editSharedGroup(Element('"+id+"' + ':cc_id').value);};"); 2089 else 2090 */ 2091 document.getElementById(id + ':cc_card_edit').onclick = function(){ alert(Element('cc_msg_unavailable').value); }; 2092 2095 eval("document.getElementById(id + ':cc_card_edit').onclick = function(){editSharedGroup(Element('"+id+"' + ':cc_id').value,"+data[3][pos][7]+");};"); 2096 else 2097 document.getElementById(id + ':cc_card_edit').onclick = function(){ alert(Element('cc_msg_not_allowed').value); }; 2098 2093 2099 if (data[3][pos][4] & 8) 2094 2100 eval("document.getElementById(id + ':cc_card_remove').onclick = function(){removeEntry(Element('" + id + "' + ':cc_id').value,'groups');};");
Note: See TracChangeset
for help on using the changeset viewer.