Changeset 1280
- Timestamp:
- 08/05/09 18:20:55 (15 years ago)
- Location:
- trunk
- Files:
-
- 7 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');};"); -
trunk/phpgwapi/inc/class.acl.inc.php
r2 r1280 194 194 return $this->data; 195 195 } 196 196 197 function persist_shared_groups($location) 198 { 199 $this->db->persist_shared_groups($location,$this->account_id); 200 } 201 197 202 /*! 198 203 @function delete -
trunk/phpgwapi/inc/class.db.inc.php
r2 r1280 1134 1134 } 1135 1135 1136 function persist_shared_groups($location,$account_id) 1137 { 1138 1139 $sql = "delete from phpgw_cc_contact_grps where oid in ( 1140 select A.oid from phpgw_cc_contact_grps A inner join phpgw_cc_groups B on A.id_group=B.id_group 1141 inner join phpgw_cc_contact_conns C on A.id_connection=C.id_connection 1142 inner join phpgw_cc_contact D on C.id_contact=D.id_contact 1143 where B.owner=$location and D.id_owner=$account_id );"; 1144 1145 return $this->query($sql); 1146 } 1147 1136 1148 /** 1137 1149 * Updates the data of one or more rows in a table, all data is quoted according to it's type -
trunk/preferences/inc/class.uiaclprefs2.inc.php
r496 r1280 101 101 $to_remove = unserialize(urldecode($processed)); 102 102 103 for($i=0;$i<count($to_remove);$i++) 104 $this->acl->delete($GLOBALS['phpgw_info']['flags']['currentapp'],$to_remove[$i]); 105 103 /* User records */ 104 $user_variable = $_POST['u_'.$GLOBALS['phpgw_info']['flags']['currentapp']]; 106 105 /* Group records */ 107 106 $group_variable = $_POST['g_'.$GLOBALS['phpgw_info']['flags']['currentapp']]; 107 $keys_to_keep = array(); 108 if(!empty($user_variable)) { 109 foreach($user_variable as $key_user=>$value) { 110 $temp = explode("_",$key_user); 111 $keys_to_keep[(int)$temp[0]] = 1; 112 } 113 } 114 115 for($i=0;$i<count($to_remove);$i++) { 116 117 if(!array_key_exists((int)$to_remove[$i],$keys_to_keep)) { 118 $this->acl->persist_shared_groups($to_remove[$i]); 119 } 120 $this->acl->delete($GLOBALS['phpgw_info']['flags']['currentapp'],$to_remove[$i]); 121 } 122 123 /* Group records */ 124 //$group_variable = $_POST['g_'.$GLOBALS['phpgw_info']['flags']['currentapp']]; 108 125 109 126 if (!$group_variable) … … 120 137 if($is_group) 121 138 $rights &= ~PHPGW_ACL_PRIVATE; 139 if(array_key_exists($user_id,$keys_to_keep)) 140 if(($rights & 1) == 0) { 141 $this->acl->persist_shared_groups($user_id); 142 } 122 143 $this->acl->add($GLOBALS['phpgw_info']['flags']['currentapp'],$group_id,$rights); 123 144 } 124 145 125 146 /* User records */ 126 $user_variable = $_POST['u_'.$GLOBALS['phpgw_info']['flags']['currentapp']];147 //$user_variable = $_POST['u_'.$GLOBALS['phpgw_info']['flags']['currentapp']]; 127 148 128 149 if (!$user_variable)
Note: See TracChangeset
for help on using the changeset viewer.