Changeset 3334
- Timestamp:
- 10/06/10 16:14:29 (13 years ago)
- Location:
- branches/2.2/contactcenter
- Files:
-
- 3 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 ?> -
branches/2.2/contactcenter/inc/class.ui_data.inc.php
r3333 r3334 22 22 23 23 var $bo; 24 var $so_group; 24 25 var $typeContact; 25 26 … … 259 260 $GLOBALS['phpgw']->template->set_var('cc_msg_fill_field_name', lang('Fill the field Full Name')); 260 261 262 $select_groups = ''; 263 264 $this->so_group = CreateObject('contactcenter.so_group'); 265 266 $array_groups = $this->so_group->selectGroupsOwnerCanImportContacts($GLOBALS['phpgw_info']['user']['account_id']); 267 268 $select_groups = "<select id='id_group'>";//<option value=0>Selecione um grupo...</option></select>"; 269 $select_groups .= "<option value=0 selected>Nenhum...</option>"; 270 foreach ($array_groups as $group){ 271 $select_groups .= "<option value='".$group['id_group']."'>".$group['title']."</option>"; 272 } 273 $select_groups .= "</select>"; 274 275 $GLOBALS['phpgw']->template->set_var('cc_select_groups',$select_groups); 276 261 277 if($GLOBALS['phpgw_info']['server']['personal_contact_type']=='True'){ 262 278 $GLOBALS['phpgw']->template->set_var('cc_contact_type', 'advanced'); … … 417 433 418 434 case 'import_contacts': 419 return $this->import_contacts($_GET['typeImport'] );435 return $this->import_contacts($_GET['typeImport'],$_GET['id_group']); 420 436 421 437 case 'export_contacts': … … 519 535 level 520 536 @author Raphael Derosso Pereira 521 @author M ï¿œrio Cï¿œsar Kolling (error messages and timeout)537 @author Mário César Kolling (error messages and timeout) 522 538 523 539 @param (string) $level The level to be taken … … 1281 1297 //echo 'ID_I: '.$id_i.'<br>'; 1282 1298 //echo 'ID_F: '.$id_f.'<br>'; 1283 ///---------------- Correᅵᅵo Temporï¿œria PHP5 -----------------------/// 1284 1299 ///---------------- Correção Temporária PHP5 -----------------------/// 1285 1300 $ids = array(); 1286 1301 /**rev 104**/ … … 1411 1426 1412 1427 /**rev 104**/ 1413 // ?aqui alterar a chamada desse m ï¿œtodo para receber o base dn?1428 // ?aqui alterar a chamada desse método para receber o base dn? 1414 1429 //$contacts = &$this->bo->catalog->get_multiple_entries($ids,$fields); 1415 1430 … … 1437 1452 { 1438 1453 /* 1439 * TODO: Os timeouts de conex ï¿œo foram retirados, ver se serï¿œ necessï¿œrio retornar essa funcionalidade, e,1440 * neste caso, terminar a implementa ᅵᅵo das mensagens de retorno.1454 * TODO: Os timeouts de conexão foram retirados, ver se será necessário retornar essa funcionalidade, e, 1455 * neste caso, terminar a implementação das mensagens de retorno. 1441 1456 */ 1442 1457 if ($index !== 'error'){ … … 1789 1804 } 1790 1805 1791 // verifica se email j ï¿œexiste!1806 // verifica se email já existe! 1792 1807 $boGroup = CreateObject('contactcenter.bo_group'); 1793 1808 $contact = $boGroup->verify_contact($tdata[4]); … … 2848 2863 of the entries that matches the search argument 2849 2864 @author Raphael Derosso Pereira 2850 @author M ï¿œrio Cï¿œsar Kolling (external catalogs)2865 @author Mário César Kolling (external catalogs) 2851 2866 2852 2867 @param string $str_data A serialized array with two informations: … … 3852 3867 //em 19/06/2009 - Rommel Cysne (rommel.cysne@serpro.gov.br); 3853 3868 function import_contacts($typeImport){ 3854 3869 $this->so_group = CreateObject('contactcenter.so_group'); 3855 3870 if($file = $_SESSION['contactcenter']['importCSV']) { 3856 3871 unset($_SESSION['contactcenter']['importCSV']); … … 4144 4159 $return['_failure_status'] .= "Line: " . ($line_iteration + 2) . ", Invalid Name: " . $sdata['given_names'] ."<br>"; 4145 4160 } 4146 else 4147 $return['_new']++; 4161 else{ 4162 if($id_group != 0){ 4163 $this->so_group->add_user_by_name($id_group,$full_name); 4164 } 4165 $return['_new']++; 4166 } 4148 4167 } 4149 4168 fclose($handle); -
branches/2.2/contactcenter/js/ccIEContacts.js
r285 r3334 2 2 this.win; 3 3 this.el; 4 this.wWidth = 395;4 this.wWidth = 610; 5 5 this.wHeight = 255; 6 6 } … … 93 93 '<option value="thunderbird">'+("Mozilla Thunderbird")+'</option>'+ 94 94 '<option value="expresso" selected>'+lang_expresso_default+'</option></select><br>'+ 95 '<br>'+lang_choose_contacts_file+'<br><br>'+ 95 '<br> Selecione um grupo: ' + Element('cc_select_groups').value + '<br>' + 96 '<br>'+lang_choose_contacts_file+'<br><br>'+ 96 97 '<input id="import_file" type="file" name="import_file">'+ 97 98 '</form></td></tr>'+ … … 237 238 var _onload = function(){ 238 239 var typeImport = Element('typeImport').value; 239 240 Connector.newRequest('import_contacts','../index.php?menuaction=contactcenter.ui_data.data_manager&method=import_contacts&typeImport='+typeImport,'GET',handler_import); 240 var id_group = Element('id_group').value; 241 242 Connector.newRequest('import_contacts','../index.php?menuaction=contactcenter.ui_data.data_manager&method=import_contacts&typeImport='+typeImport+'&id_group='+id_group,'GET',handler_import); 241 243 } 242 244
Note: See TracChangeset
for help on using the changeset viewer.