Changeset 4477
- Timestamp:
- 05/20/11 17:03:00 (13 years ago)
- Location:
- sandbox/2.2.0.2/contactcenter
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/2.2.0.2/contactcenter/inc/class.bo_people_catalog.inc.php
r3826 r4477 524 524 { 525 525 $connection = CreateObject('contactcenter.so_connection', $id); 526 527 if ($extra === 'default' and $connection->is_default()) 528 { 529 $connection_type = CreateObject('contactcenter.so_contact_connection_type', $type); 530 $return['connection'.$count]['id_connection'] = $id; 531 $return['connection'.$count]['id_type'] = $type; 532 $return['connection'.$count]['type'] = $connection_type->get_type_name(); 533 $return['connection'.$count]['connection_name'] = $connection->get_name(); 534 $return['connection'.$count]['connection_value'] = $connection->get_value(); 535 $return['connection'.$count]['connection_is_default'] = $connection->is_default(); 536 $count++; 537 } 538 else if ($extra !== 'default') 539 { 540 $connection_type = CreateObject('contactcenter.so_contact_connection_type', $type); 541 $return['connection'.$count]['id_connection'] = $id; 542 $return['connection'.$count]['id_type'] = $type; 543 $return['connection'.$count]['type'] = $connection_type->get_type_name(); 544 $return['connection'.$count]['connection_name'] = $connection->get_name(); 545 $return['connection'.$count]['connection_value'] = $connection->get_value(); 546 $return['connection'.$count]['connection_is_default'] = $connection->is_default(); 547 $count++; 526 if ($getDummy || $connection->get_name() !== 'no_conns') 527 { 528 if ($extra === 'default' and $connection->is_default()) 529 { 530 $connection_type = CreateObject('contactcenter.so_contact_connection_type', $type); 531 $return['connection'.$count]['id_connection'] = $id; 532 $return['connection'.$count]['id_type'] = $type; 533 $return['connection'.$count]['type'] = $connection_type->get_type_name(); 534 $return['connection'.$count]['connection_name'] = $connection->get_name(); 535 $return['connection'.$count]['connection_value'] = $connection->get_value(); 536 $return['connection'.$count]['connection_is_default'] = $connection->is_default(); 537 $count++; 538 } 539 else if ($extra !== 'default') 540 { 541 $connection_type = CreateObject('contactcenter.so_contact_connection_type', $type); 542 $return['connection'.$count]['id_connection'] = $id; 543 $return['connection'.$count]['id_type'] = $type; 544 $return['connection'.$count]['type'] = $connection_type->get_type_name(); 545 $return['connection'.$count]['connection_name'] = $connection->get_name(); 546 $return['connection'.$count]['connection_value'] = $connection->get_value(); 547 $return['connection'.$count]['connection_is_default'] = $connection->is_default(); 548 $count++; 549 } 548 550 } 549 551 } … … 902 904 $permissions = $this->security->get_permissions(); 903 905 906 $exist_connections = false; 907 904 908 if (!$permissions['create']) 905 909 { … … 913 917 foreach($data as $field => $value) 914 918 { 915 if ($value === false )919 if ($value === false && $field != 'connections') 916 920 { 917 921 continue; … … 1001 1005 foreach($value as $connection_name => $connection_fields) 1002 1006 { 1007 $exist_connections = true; 1003 1008 $connection = CreateObject('contactcenter.so_connection'); 1004 1009 $connection->reset_values(); … … 1026 1031 { 1027 1032 $contact->set_field('id_owner',$GLOBALS['phpgw_info']['user']['account_id']); 1033 //insert a dummy connection if the contact dont have an email and telephone 1034 if (!$exist_connections) 1035 { 1036 $this->add_dummy($contact); 1037 } 1028 1038 return $contact->commit(); 1029 1039 } … … 1519 1529 1520 1530 case 'connections': 1531 //alteracao para permitir a exibicao de contatos sem email ou telefone 1532 $all_removed = true; 1533 $added_connection = false; 1521 1534 foreach($value as $connection_name => $connection_fields) 1522 1535 { … … 1537 1550 } 1538 1551 1552 $all_removed = false; 1553 // removes the dummy if there is at least one connection 1554 if (!$added_connection) 1555 { 1556 $this->remove_dummy($contact); //remove the dummy 1557 } 1558 $added_connection = true; 1539 1559 $id_connection = $connection_fields['id_connection']; 1540 1560 if ($id_connection === '_NEW_' or … … 1564 1584 $contact->set_connection($id_connection, $connection_fields['id_typeof_connection']); 1565 1585 } 1586 // add the dummy if there is no other connection 1587 if ($all_removed) 1588 $this->add_dummy($contact); 1566 1589 break; 1567 1590 … … 1583 1606 1584 1607 /*! 1608 @function remove_dummy 1609 @abstract Remove the dummy connection entry. 1610 @author Luiz Carlos Viana Melo - Prognus 1611 */ 1612 function remove_dummy($so_contact) 1613 { 1614 //$so_contact = CreateObject('contactcenter.so_contact', $id_contact); 1615 $connections = $so_contact->get_connections(); 1616 foreach ($connections as $id_connection => $type_connection) 1617 { 1618 $so_connection = CreateObject('contactcenter.so_connection', $id_connection); 1619 if ($so_connection->get_field('connection_name') === 'no_conns') //if connection is the dummy one 1620 { 1621 if (!$so_connection->remove()) 1622 { 1623 return false; 1624 } 1625 $so_contact->remove_connection($id_connection); 1626 //$so_connection->commit(); 1627 break; 1628 } 1629 } 1630 1631 } 1632 1633 /*! 1634 @function add_dummy 1635 @abstract Add a dummy connection entry on a contact. This is necessary for 1636 possibility on adding a contact that dont have an email or telephone. 1637 @return The dummy's connection ID. 1638 @author Luiz Carlos Viana Melo - Prognus 1639 */ 1640 function add_dummy($so_contact) 1641 { 1642 $so_connection = CreateObject('contactcenter.so_connection'); 1643 $so_connection->reset_values(); 1644 1645 $so_connection->set_field('connection_name', 'no_conns'); //defined code for the dummy connection 1646 $so_connection->set_field('connection_value', ''); 1647 $so_connection->set_field('connection_is_default', true); 1648 1649 if (!$so_connection->commit()) 1650 { 1651 return false; 1652 } 1653 $id_connection = $so_connection->get_id(); 1654 $so_contact->set_connection($id_connection, 2); 1655 return $id_connection; 1656 } 1657 1658 /*! 1585 1659 1586 1660 @function update_prefix -
sandbox/2.2.0.2/contactcenter/inc/class.so_group.inc.php
r4470 r4477 376 376 'phpgw_cc_contact_conns B, phpgw_cc_connections C,phpgw_cc_contact_grps D where '. 377 377 'A.id_contact = B.id_contact and B.id_connection = C.id_connection '. 378 'and B.id_typeof_contact_connection = 1 and'.378 'and '. 379 379 //'A.id_owner ='.$this->owner.' and'. 380 380 ' D.id_connection = C.id_connection and D.id_group = '.$idGroup. -
sandbox/2.2.0.2/contactcenter/inc/class.ui_data.inc.php
r4289 r4477 1682 1682 1683 1683 $boGroup = CreateObject('contactcenter.bo_group'); 1684 1685 $all_contacts = $boGroup->get_all_contacts('only_email',$shared_from); 1684 1685 $all_contacts = $boGroup->get_all_contacts(false,$shared_from); 1686 1686 1687 1687 1688 $contact_options = ""; 1688 1689 if(count($all_contacts)) { 1689 1690 foreach($all_contacts as $idx => $contact) { 1690 $contact_options .= "<OPTION value='".$contact['id_connection']."'>".$contact['names_ordered']." (".$contact['connection_value'].")</OPTION>"; 1691 $contact_options .= "<OPTION value='".$contact['id_connection']."'>".$contact['names_ordered']; 1692 if (isset($contact['connection_value'])) 1693 $contact_options .= " (".$contact['connection_value'].")</OPTION>"; 1694 else 1695 $contact_options .= " (". $contact['phone'].")</OPTION>"; 1691 1696 } 1692 1697 } … … 1987 1992 $data['contact_in_list'] = $new_tdata[1]; 1988 1993 $data['id_group'] = $new_tdata[2]; 1994 1995 $contactWOemail = false; 1996 1997 foreach ($data['contact_in_list'] as $id_connection) 1998 { 1999 $boConn = CreateObject('contactcenter.bo_connection'); 2000 $type = $boConn->get_connection_type_by_conn_id($id_connection); 2001 if ($type != 1) 2002 { 2003 $contactWOemail = true; 2004 break; 2005 } 2006 } 2007 2008 1989 2009 $acumulatedErrors = ''; 1990 2010 … … 2038 2058 { 2039 2059 $this->page_info['changed'] = true; 2040 2060 2061 if (!$contactWOemail) 2062 echo serialize(array( 2063 'msg' => lang('Entry added with success!'), 2064 'status' => 'ok' 2065 )); 2066 else 2067 echo serialize(array( 2068 'msg' => lang('Entry added with success. But some contacts will not receive or send messages.'), 2069 'status' => 'warning' 2070 )); 2071 } 2072 else 2073 { 2041 2074 echo serialize(array( 2042 'msg' => lang('Entry added with success!'), 2043 'status' => 'ok' 2044 )); 2045 } 2046 else 2047 { 2048 echo serialize(array( 2049 'msg' => lang('Problems on adding your Contact. No Contact added!'). 2050 "\n".$acumulatedErrors, 2075 'msg' => lang('Problems on adding your Contact. No Contact added!'), 2051 2076 'status' => 'error' 2052 2077 )); -
sandbox/2.2.0.2/contactcenter/js/ccAddGroup.js
r4470 r4477 124 124 //showMessage(data['msg']); 125 125 126 if (data['status'] != 'ok' )126 if (data['status'] != 'ok' && data['status'] != 'warning') 127 127 { 128 showMessage(data['msg']);129 128 return; 130 129 } 130 131 if(data['status'] == 'warning') 132 showMessage(data['msg']); 131 133 132 134 _this.clear(); -
sandbox/2.2.0.2/contactcenter/setup/phpgw_es-es.lang
r3665 r4477 77 77 Empty contactcenter es-es Vacío 78 78 Entry added with success! contactcenter es-es ¡Contacto añadido con suceso! 79 Entry added with success. But some contacts will not receive or send messages. contactcenter es-es Entrada añadido con éxito. Pero algunos contactos no recibir ni enviar mensajes. 79 80 Export as Expresso (default) CSV. contactcenter es-es Exportar como Expresso (standar) CSV 80 81 Export as Mozilla Thunderbird CSV. contactcenter es-es Exportar como Mozilla Thunderbird CSV.
Note: See TracChangeset
for help on using the changeset viewer.