本文整理汇总了PHP中CContact::getCompanyDetails方法的典型用法代码示例。如果您正苦于以下问题:PHP CContact::getCompanyDetails方法的具体用法?PHP CContact::getCompanyDetails怎么用?PHP CContact::getCompanyDetails使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CContact
的用法示例。
在下文中一共展示了CContact::getCompanyDetails方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CContact
$msg = '';
$contact = new CContact();
$canDelete = $contact->canDelete($msg, $contact_id);
$is_user = $contact->isUser($contact_id);
$canEdit = $perms->checkModuleItem($m, 'edit', $contact_id);
if (!$contact->load($contact_id) && $contact_id > 0) {
$AppUI->setMsg('Contact');
$AppUI->setMsg('invalidID', UI_MSG_ERROR, true);
$AppUI->redirect();
} elseif ($contact->contact_private && $contact->contact_owner != $AppUI->user_id && $contact->contact_owner && $contact_id != 0) {
// check only owner can edit
$AppUI->redirect('m=public&a=access_denied');
}
$countries = w2PgetSysVal('GlobalCountries');
// Get the contact details for company and department
$company_detail = $contact->getCompanyDetails();
$dept_detail = $contact->getDepartmentDetails();
// Get the Contact info (phone, emails, etc) for the contact
$methods = $contact->getContactMethods();
$methodLabels = w2PgetSysVal('ContactMethods');
// setup the title block
$ttl = 'View Contact';
$titleBlock = new w2p_Theme_TitleBlock($ttl, 'monkeychat-48.png', $m, $m . '.' . $a);
$titleBlock->addCrumb('?m=contacts', 'contacts list');
if ($canEdit && $contact_id) {
$titleBlock->addCrumb('?m=contacts&a=addedit&contact_id=' . $contact_id, 'edit this contact');
}
if ($canDelete && $contact_id) {
$titleBlock->addCrumbDelete('delete contact', $canDelete, $msg);
}
$titleBlock->show();
示例2: CTitleBlock
if (!empty($tmp_user)) {
$canDelete = false;
}
$canEdit = $perms->checkModuleItem($m, "edit", $contact_id);
if (!$row->load($contact_id) && $contact_id > 0) {
$AppUI->setMsg('Contact');
$AppUI->setMsg("invalidID", UI_MSG_ERROR, true);
$AppUI->redirect();
} else {
if ($row->contact_private && $row->contact_owner != $AppUI->user_id && $row->contact_owner && $contact_id != 0) {
// check only owner can edit
$AppUI->redirect("m=public&a=access_denied");
}
}
// Get the contact details for company and department
$company_detail = $row->getCompanyDetails();
$dept_detail = $row->getDepartmentDetails();
// setup the title block
$ttl = "View Contact";
$titleBlock = new CTitleBlock($ttl, 'monkeychat-48.png', $m, "{$m}.{$a}");
$titleBlock->addCrumb("?m=contacts", "contacts list");
if ($canEdit && $contact_id) {
$titleBlock->addCrumb("?m=contacts&a=addedit&contact_id={$contact_id}", 'edit');
}
$titleBlock->addCell('<input type="submit" class="button" value="' . $AppUI->_('new project') . '" />', '', '<form action="?m=projects&a=addedit&company_id=' . $row->contact_company . '&contact_id=' . $contact_id . '" method="post">', '</form>');
if ($canDelete && $contact_id) {
$titleBlock->addCrumbDelete('delete contact', $canDelete, $msg);
}
$titleBlock->show();
?>
<form name="changecontact" action="?m=contacts" method="post">
示例3: testGetCompanyDetails
public function testGetCompanyDetails()
{
$contact = new CContact();
$results = $contact->getCompanyDetails();
$this->AssertEquals(2, count($results));
$this->assertEquals(0, $results['company_id']);
$this->assertEquals('', $results['company_name']);
$contact->contact_company = 1;
$results = $contact->getCompanyDetails();
$this->AssertEquals(2, count($results));
$this->assertEquals(1, $results['company_id']);
$this->assertEquals('UnitTestCompany', $results['company_name']);
}