本文整理汇总了PHP中CCompany::getContacts方法的典型用法代码示例。如果您正苦于以下问题:PHP CCompany::getContacts方法的具体用法?PHP CCompany::getContacts怎么用?PHP CCompany::getContacts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCompany
的用法示例。
在下文中一共展示了CCompany::getContacts方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetContacts
/**
* Tests loading list of Contacts for this company.
*/
public function testGetContacts()
{
global $AppUI;
$contacts = CCompany::getContacts($AppUI, 1);
/**
* getContacts returns both an associative array as well as a indexed array
* so we need to check both to make sure functionality depending on either does
* not break.
*/
$this->assertEquals(2, count($contacts));
$this->assertEquals(1, $contacts[1]['contact_id']);
$this->assertEquals('Admin', $contacts[1]['contact_first_name']);
$this->assertEquals('Person', $contacts[1]['contact_last_name']);
$this->assertEquals('', $contacts[1]['contact_display_name']);
$this->assertEquals('', $contacts[1]['contact_order_by']);
$this->assertEquals('President', $contacts[1]['contact_title']);
$this->assertEquals('1983-07-22', $contacts[1]['contact_birthday']);
$this->assertEquals('President', $contacts[1]['contact_job']);
$this->assertEquals(1, $contacts[1]['contact_company']);
$this->assertEquals(0, $contacts[1]['contact_department']);
$this->assertEquals('person', $contacts[1]['contact_type']);
$this->assertEquals('email1@example.com', $contacts[1]['contact_email']);
$this->assertEquals('703-555-1111', $contacts[1]['contact_phone']);
$this->assertEquals('c1 address 1', $contacts[1]['contact_address1']);
$this->assertEquals('c1 address 2', $contacts[1]['contact_address2']);
$this->assertEquals('c1 city', $contacts[1]['contact_city']);
$this->assertEquals('CA', $contacts[1]['contact_state']);
$this->assertEquals('90210', $contacts[1]['contact_zip']);
$this->assertEquals('US', $contacts[1]['contact_country']);
$this->assertEquals('c1s notes.', $contacts[1]['contact_notes']);
$this->assertEquals(0, $contacts[1]['contact_project']);
$this->assertEquals('obj/contact', $contacts[1]['contact_icon']);
$this->assertEquals(0, $contacts[1]['contact_owner']);
$this->assertEquals(0, $contacts[1]['contact_private']);
$this->assertEquals('', $contacts[1]['contact_updatekey']);
$this->assertEquals('2009-01-01 11:11:11', $contacts[1]['contact_lastupdate']);
$this->assertEquals('2008-12-12 11:11:11', $contacts[1]['contact_updateasked']);
$this->assertEquals('', $contacts[1]['dept_name']);
$this->assertEquals(1, $contacts[1]['0']);
$this->assertEquals('Admin', $contacts[1]['1']);
$this->assertEquals('Person', $contacts[1]['2']);
$this->assertEquals('', $contacts[1]['3']);
$this->assertEquals('', $contacts[1]['4']);
$this->assertEquals('President', $contacts[1]['5']);
$this->assertEquals('1983-07-22', $contacts[1]['6']);
$this->assertEquals('President', $contacts[1]['7']);
$this->assertEquals(1, $contacts[1]['8']);
$this->assertEquals(0, $contacts[1]['9']);
$this->assertEquals('person', $contacts[1]['10']);
$this->assertEquals('email1@example.com', $contacts[1]['11']);
$this->assertEquals('703-555-1111', $contacts[1]['12']);
$this->assertEquals('c1 address 1', $contacts[1]['13']);
$this->assertEquals('c1 address 2', $contacts[1]['14']);
$this->assertEquals('c1 city', $contacts[1]['15']);
$this->assertEquals('CA', $contacts[1]['16']);
$this->assertEquals('90210', $contacts[1]['17']);
$this->assertEquals('US', $contacts[1]['18']);
$this->assertEquals('c1s notes.', $contacts[1]['19']);
$this->assertEquals(0, $contacts[1]['20']);
$this->assertEquals('obj/contact', $contacts[1]['21']);
$this->assertEquals(0, $contacts[1]['22']);
$this->assertEquals(0, $contacts[1]['23']);
$this->assertEquals('', $contacts[1]['24']);
$this->assertEquals('2009-01-01 11:11:11', $contacts[1]['25']);
$this->assertEquals('2008-12-12 11:11:11', $contacts[1]['26']);
$this->assertEquals('', $contacts[1]['27']);
$this->assertEquals(2, $contacts[2]['contact_id']);
$this->assertEquals('Contact', $contacts[2]['contact_first_name']);
$this->assertEquals('Number 1', $contacts[2]['contact_last_name']);
$this->assertEquals('', $contacts[2]['contact_display_name']);
$this->assertEquals('', $contacts[2]['contact_order_by']);
$this->assertEquals('Vice President', $contacts[2]['contact_title']);
$this->assertEquals('1973-07-22', $contacts[2]['contact_birthday']);
$this->assertEquals('Vice President', $contacts[2]['contact_job']);
$this->assertEquals(1, $contacts[2]['contact_company']);
$this->assertEquals(0, $contacts[2]['contact_department']);
$this->assertEquals('person', $contacts[2]['contact_type']);
$this->assertEquals('email2@example.com', $contacts[2]['contact_email']);
$this->assertEquals('703-555-2222', $contacts[2]['contact_phone']);
$this->assertEquals('c2 address 1', $contacts[2]['contact_address1']);
$this->assertEquals('c2 address 2', $contacts[2]['contact_address2']);
$this->assertEquals('c2 city', $contacts[2]['contact_city']);
$this->assertEquals('CA', $contacts[2]['contact_state']);
$this->assertEquals('90211', $contacts[2]['contact_zip']);
$this->assertEquals('US', $contacts[2]['contact_country']);
$this->assertEquals('c2s notes.', $contacts[2]['contact_notes']);
$this->assertEquals(0, $contacts[2]['contact_project']);
$this->assertEquals('obj/contact', $contacts[2]['contact_icon']);
$this->assertEquals(0, $contacts[2]['contact_owner']);
$this->assertEquals(0, $contacts[2]['contact_private']);
$this->assertEquals('', $contacts[2]['contact_updatekey']);
$this->assertEquals('2008-01-01 11:11:11', $contacts[2]['contact_lastupdate']);
$this->assertEquals('2007-12-12 11:11:11', $contacts[2]['contact_updateasked']);
$this->assertEquals('', $contacts[2]['dept_name']);
$this->assertEquals(2, $contacts[2]['0']);
$this->assertEquals('Contact', $contacts[2]['1']);
$this->assertEquals('Number 1', $contacts[2]['2']);
//.........这里部分代码省略.........
示例2: die
<?php
/* $Id: vw_contacts.php 1516 2010-12-05 07:18:58Z caseydk $ $URL: https://web2project.svn.sourceforge.net/svnroot/web2project/trunk/modules/companies/vw_contacts.php $ */
if (!defined('W2P_BASE_DIR')) {
die('You should not access this file directly.');
}
##
## Companies: View User sub-table
##
global $AppUI, $company;
$contacts = CCompany::getContacts($AppUI, $company->company_id);
?>
<table width="100%" border="0" cellpadding="2" cellspacing="1" class="tbl"><?php
if (count($contacts) > 0) {
?>
<tr>
<th><?php
echo $AppUI->_('Name');
?>
</th>
<th><?php
echo $AppUI->_('Job Title');
?>
</th>
<th><?php
echo $AppUI->_('e-mail');
?>
</th>
<th><?php
echo $AppUI->_('Phone');
?>
示例3: testGetContacts
/**
* Tests loading list of Contacts for this company.
*/
public function testGetContacts()
{
global $AppUI;
$contacts = CCompany::getContacts($AppUI, 1);
/**
* getContacts returns both an associative array as well as a indexed array
* so we need to check both to make sure functionality depending on either does
* not break.
*/
$this->assertType(PHPUnit_Framework_Constraint_IsType::TYPE_ARRAY, $contacts);
$this->assertEquals(2, count($contacts));
$this->assertEquals(1, $contacts[1]['contact_id']);
$this->assertEquals('Admin', $contacts[1]['contact_first_name']);
$this->assertEquals('Person', $contacts[1]['contact_last_name']);
$this->assertEquals('', $contacts[1]['contact_order_by']);
$this->assertEquals('President', $contacts[1]['contact_title']);
$this->assertEquals('1983-07-22', $contacts[1]['contact_birthday']);
$this->assertEquals('President', $contacts[1]['contact_job']);
$this->assertEquals(1, $contacts[1]['contact_company']);
$this->assertEquals(0, $contacts[1]['contact_department']);
$this->assertEquals('person', $contacts[1]['contact_type']);
$this->assertEquals('contact1@example.org', $contacts[1]['contact_email']);
$this->assertEquals('contact1_2@example.org', $contacts[1]['contact_email2']);
$this->assertEquals('1.example.org', $contacts[1]['contact_url']);
$this->assertEquals('1.999.999.9999', $contacts[1]['contact_phone']);
$this->assertEquals('1.999.999.9998', $contacts[1]['contact_phone2']);
$this->assertEquals('1.999.999.9997', $contacts[1]['contact_fax']);
$this->assertEquals('1.999.999.9996', $contacts[1]['contact_mobile']);
$this->assertEquals('c1 address 1', $contacts[1]['contact_address1']);
$this->assertEquals('c1 address 2', $contacts[1]['contact_address2']);
$this->assertEquals('c1 city', $contacts[1]['contact_city']);
$this->assertEquals('CA', $contacts[1]['contact_state']);
$this->assertEquals('90210', $contacts[1]['contact_zip']);
$this->assertEquals('US', $contacts[1]['contact_country']);
$this->assertEquals('c1jabber', $contacts[1]['contact_jabber']);
$this->assertEquals('c1icq', $contacts[1]['contact_icq']);
$this->assertEquals('c1msn', $contacts[1]['contact_msn']);
$this->assertEquals('c1yahoo', $contacts[1]['contact_yahoo']);
$this->assertEquals('c1aol', $contacts[1]['contact_aol']);
$this->assertEquals('c1s notes.', $contacts[1]['contact_notes']);
$this->assertEquals(0, $contacts[1]['contact_project']);
$this->assertEquals('obj/contact', $contacts[1]['contact_icon']);
$this->assertEquals(0, $contacts[1]['contact_owner']);
$this->assertEquals(0, $contacts[1]['contact_private']);
$this->assertEquals('', $contacts[1]['contact_updatekey']);
$this->assertEquals('2009-01-01 11:11:11', $contacts[1]['contact_lastupdate']);
$this->assertEquals('2008-12-12 11:11:11', $contacts[1]['contact_updateasked']);
$this->assertEquals('c1skype', $contacts[1]['contact_skype']);
$this->assertEquals('c1google', $contacts[1]['contact_google']);
$this->assertEquals('', $contacts[1]['dept_name']);
$this->assertEquals(1, $contacts[1]['0']);
$this->assertEquals('Admin', $contacts[1]['1']);
$this->assertEquals('Person', $contacts[1]['2']);
$this->assertEquals('', $contacts[1]['3']);
$this->assertEquals('President', $contacts[1]['4']);
$this->assertEquals('1983-07-22', $contacts[1]['5']);
$this->assertEquals('President', $contacts[1]['6']);
$this->assertEquals(1, $contacts[1]['7']);
$this->assertEquals(0, $contacts[1]['8']);
$this->assertEquals('person', $contacts[1]['9']);
$this->assertEquals('contact1@example.org', $contacts[1]['10']);
$this->assertEquals('contact1_2@example.org', $contacts[1]['11']);
$this->assertEquals('1.example.org', $contacts[1]['12']);
$this->assertEquals('1.999.999.9999', $contacts[1]['13']);
$this->assertEquals('1.999.999.9998', $contacts[1]['14']);
$this->assertEquals('1.999.999.9997', $contacts[1]['15']);
$this->assertEquals('1.999.999.9996', $contacts[1]['16']);
$this->assertEquals('c1 address 1', $contacts[1]['17']);
$this->assertEquals('c1 address 2', $contacts[1]['18']);
$this->assertEquals('c1 city', $contacts[1]['19']);
$this->assertEquals('CA', $contacts[1]['20']);
$this->assertEquals('90210', $contacts[1]['21']);
$this->assertEquals('US', $contacts[1]['22']);
$this->assertEquals('c1jabber', $contacts[1]['23']);
$this->assertEquals('c1icq', $contacts[1]['24']);
$this->assertEquals('c1msn', $contacts[1]['25']);
$this->assertEquals('c1yahoo', $contacts[1]['26']);
$this->assertEquals('c1aol', $contacts[1]['27']);
$this->assertEquals('c1s notes.', $contacts[1]['28']);
$this->assertEquals(0, $contacts[1]['29']);
$this->assertEquals('obj/contact', $contacts[1]['30']);
$this->assertEquals(0, $contacts[1]['31']);
$this->assertEquals(0, $contacts[1]['32']);
$this->assertEquals('', $contacts[1]['33']);
$this->assertEquals('2009-01-01 11:11:11', $contacts[1]['34']);
$this->assertEquals('2008-12-12 11:11:11', $contacts[1]['35']);
$this->assertEquals('c1skype', $contacts[1]['36']);
$this->assertEquals('c1google', $contacts[1]['37']);
$this->assertEquals('', $contacts[1]['38']);
$this->assertEquals(2, $contacts[2]['contact_id']);
$this->assertEquals('Contact', $contacts[2]['contact_first_name']);
$this->assertEquals('Number 1', $contacts[2]['contact_last_name']);
$this->assertEquals('', $contacts[2]['contact_order_by']);
$this->assertEquals('Vice President', $contacts[2]['contact_title']);
$this->assertEquals('1973-07-22', $contacts[2]['contact_birthday']);
$this->assertEquals('Vice President', $contacts[2]['contact_job']);
$this->assertEquals(1, $contacts[2]['contact_company']);
//.........这里部分代码省略.........