Changeset 4502 for sandbox/2.2.0.2/contactcenter
- Timestamp:
- 05/25/11 12:08:00 (13 years ago)
- Location:
- sandbox/2.2.0.2/contactcenter
- Files:
-
- 4 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/2.2.0.2/contactcenter/inc/class.bo_group.inc.php
r4498 r4502 127 127 return $this->so->deleteContactsByGroup($id_group, $contacts_conns); 128 128 } 129 130 function update_contact_groups($id_defaultconnection, $connections, $groups) 131 { 132 return $this->so->updateContactGroups($id_defaultconnection, $connections, $groups); 133 } 129 134 130 135 } -
sandbox/2.2.0.2/contactcenter/inc/class.bo_people_catalog.inc.php
r4498 r4502 1890 1890 1891 1891 } 1892 1892 $groups = CreateObject('contactcenter.so_group'); 1893 1893 1894 foreach ($connections as $id => $type) 1894 1895 { … … 1897 1898 return false; 1898 1899 } 1899 1900 $groups->deleteContactFromGroups($id); 1900 1901 if (!($connection->remove())) 1901 1902 { -
sandbox/2.2.0.2/contactcenter/inc/class.so_group.inc.php
r4498 r4502 569 569 } 570 570 571 function updateContactGroups($id_defaultconnection, $connections, $groups) 572 { 573 if (is_array($groups) && count($groups) > 0) 574 { 575 $query = "UPDATE phpgw_cc_contact_grps SET id_connection = " . $id_defaultconnection . " WHERE ("; 576 $more = false; 577 foreach ($connections as $connection) 578 { 579 if ($more) 580 $query .= " OR "; 581 $query .= "id_connection = " . $connection['id_connection']; 582 $more = true; 583 } 584 $query .= ") AND ("; 585 $more = false; 586 foreach ($groups as $group) 587 { 588 if ($more) 589 $query .= " OR "; 590 $query .= "id_group = " . $group['id_group']; 591 $more = true; 592 } 593 $query .= ");"; 594 if (!$this->db->query($query)) 595 exit ('Query failed! File: '.__FILE__.' on line'.__LINE__); 596 597 return true; 598 } 599 } 600 571 601 function deleteContactsByGroup($id_group, $contacts = null) 572 602 { -
sandbox/2.2.0.2/contactcenter/inc/class.ui_data.inc.php
r4500 r4502 2029 2029 $data['contact_in_list'] = $new_tdata[1]; 2030 2030 $data['id_group'] = $new_tdata[2]; 2031 $data['old_contacts_in_list'] = $new_tdata[3]; 2031 2032 2032 $contactWOemail = false; 2033 2034 foreach ($data['contact_in_list'] as $id_connection) 2035 { 2036 $boConn = CreateObject('contactcenter.bo_connection'); 2037 $type = $boConn->get_connection_type_by_conn_id($id_connection); 2038 if ($type != 1) 2039 { 2040 $contactWOemail = true; 2041 break; 2042 } 2043 } 2044 2045 2033 foreach ($data['old_contacts_in_list'] as $id_connection) 2034 { 2035 $boConn = CreateObject('contactcenter.bo_connection'); 2036 2037 $id_contact = $boConn->get_contact_id_by_connection($id_connection); 2038 $contact = CreateObject('contactcenter.so_contact', $id_contact); 2039 $contact->set_field("last_status", 'U'); 2040 $contact->set_field("last_update",time()."000"); 2041 $contact->commit(); 2042 } 2043 2044 $contactWOemail = false; 2045 2046 foreach ($data['contact_in_list'] as $id_connection) 2047 { 2048 $boConn = CreateObject('contactcenter.bo_connection'); 2049 2050 $id_contact = $boConn->get_contact_id_by_connection($id_connection); 2051 $contact = CreateObject('contactcenter.so_contact', $id_contact); 2052 $contact->set_field("last_status", 'U'); 2053 $contact->set_field("last_update",time()."000"); 2054 $contact->commit(); 2055 2056 if (!$contactWOemail) 2057 { 2058 $type = $boConn->get_connection_type_by_conn_id($id_connection); 2059 if ($type != 1) 2060 { 2061 $contactWOemail = true; 2062 } 2063 } 2064 } 2065 2066 2046 2067 $acumulatedErrors = ''; 2047 2068 … … 2497 2518 if (!is_null($id) and $id !== '') 2498 2519 { 2499 $id = $this->bo->catalog->update_single_info($id, $data); 2520 $old_connections = $this->bo->catalog->get_connections($id); 2521 $id = $this->bo->catalog->update_single_info($id, $data); 2500 2522 $result = array( 2501 2523 'msg' => lang('Updated Successfully!'), … … 2522 2544 else 2523 2545 { 2524 $this->bo->catalog->update_contact_groups($id, $groups); 2546 if (isset($old_connections)) 2547 $this->bo->catalog->update_contact_groups($id, $groups, $old_connections); 2548 else 2549 $this->bo->catalog->update_contact_groups($id, $groups); 2525 2550 } 2526 2551 -
sandbox/2.2.0.2/contactcenter/js/cc.js
r4500 r4502 592 592 } 593 593 ccAddGroup.setSelectedSourceLevel(ccTree.actualLevel); 594 ccAddGroup. window.open();594 ccAddGroup.openEditWindow(); 595 595 }; 596 596 … … 888 888 * Função que retorna os grupos que foram anteriormente selecionados, adicionados ou removidos pelo 889 889 * usuário. O formato retornado é um array contendo: 890 * ['previous_selected'] { 891 * [id_group] { 892 * 'id_group' => o ID do grupo 893 * 'title' => o título do grupo 894 * } 890 895 * ['added'] { 891 896 * [id_group] { … … 908 913 var removed_groups = diffContactIDArray(CC_initial_selected_grps, selected_groups); 909 914 var groups = new Array(); 915 groups['previous_selected'] = CC_initial_selected_grps; 910 916 groups['added'] = added_groups; 911 917 groups['removed'] = removed_groups; -
sandbox/2.2.0.2/contactcenter/js/ccAddGroup.js
r4477 r4502 37 37 this.group_id = Element('group_id'); 38 38 39 this.old_contacts_in_list = new Array(); 40 39 41 ccAGWinHeight = 'ccAGWinHeightMO'; 40 42 … … 154 156 155 157 sdata[0] = this.title.value; 156 var contacts = new Array(); 158 var contacts = new Array(); 159 var old_contacts = new Array(); 157 160 158 161 for (j =0; j < this.contact_in_list.length; j++) 159 contacts[j] = this.contact_in_list.options[j].value; 162 contacts[j] = this.contact_in_list.options[j].value; 163 for (i = 0; i < this.old_contacts_in_list.length; i++) 164 old_contacts[i] = this.old_contacts_in_list[i]; 160 165 161 166 if(!this.title.value) { … … 171 176 172 177 sdata[1] = contacts; 173 sdata[2] = this.group_id.value == 'undefined' ? sdata[2] = 0 : sdata[2] = this.group_id.value; 178 sdata[2] = this.group_id.value == 'undefined' ? sdata[2] = 0 : sdata[2] = this.group_id.value; 179 sdata[3] = old_contacts; 174 180 var sdata = 'add='+escape(serialize(sdata)); 175 181 Connector.newRequest('cAddGroup.Send', CC_url+'add_group', 'POST', handler, sdata); … … 200 206 this.title.value = ''; 201 207 } 208 209 cAddGroup.prototype.openEditWindow = function() 210 { 211 var list_old_contacts = Element('contact_in_list'); 212 for (var i = 0; i < list_old_contacts.length; i++) 213 { 214 this.old_contacts_in_list[i] = list_old_contacts.options[i].value; 215 } 216 this.window.open(); 217 }; 202 218 203 219 /* Função para remover contato da lista */
Note: See TracChangeset
for help on using the changeset viewer.