当前位置: 首页>>代码示例>>PHP>>正文


PHP CContact::getCompanyDetails方法代码示例

本文整理汇总了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();
开发者ID:,项目名称:,代码行数:31,代码来源:

示例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">
开发者ID:magsilva,项目名称:dotproject,代码行数:31,代码来源:view.php

示例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']);
 }
开发者ID:eureka2,项目名称:web2project,代码行数:13,代码来源:contacts.test.php


注:本文中的CContact::getCompanyDetails方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。