當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CCompany::getContacts方法代碼示例

本文整理匯總了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']);
//.........這裏部分代碼省略.........
開發者ID:eureka2,項目名稱:web2project,代碼行數:101,代碼來源:companies.test.php

示例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');
    ?>
開發者ID:eureka2,項目名稱:web2project,代碼行數:31,代碼來源:vw_contacts.php

示例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']);
//.........這裏部分代碼省略.........
開發者ID:joly,項目名稱:web2project,代碼行數:101,代碼來源:companies.test.php


注:本文中的CCompany::getContacts方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。