本文整理汇总了PHP中CContact::getDepartmentDetails方法的典型用法代码示例。如果您正苦于以下问题:PHP CContact::getDepartmentDetails方法的具体用法?PHP CContact::getDepartmentDetails怎么用?PHP CContact::getDepartmentDetails使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CContact
的用法示例。
在下文中一共展示了CContact::getDepartmentDetails方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
echo $AppUI->_('Name');
?>
</th>
<th><?php
echo $AppUI->_('e-mail');
?>
</th>
<th><?php
echo $AppUI->_('Department');
?>
</th>
</tr>
<?php
foreach ($rows as $row) {
$contact = new CContact();
$contact->bind($row);
$dept_detail = $contact->getDepartmentDetails();
$s .= '<tr><td>';
$s .= '<a href="?m=contacts&a=view&contact_id=' . dPformSafe($row['contact_id']) . '">' . htmlspecialchars($row['contact_last_name'] . ', ' . $row['contact_first_name']) . '</a>';
$s .= '<td><a href="mailto:' . dPformSafe($row['contact_email'], DP_FORM_URI) . '">' . htmlspecialchars($row['contact_email']) . '</a></td>';
$s .= '<td>' . htmlspecialchars($dept_detail['dept_name']) . '</td>';
$s .= '</tr>';
}
}
$s .= '<tr><td colspan="3" align="right" valign="top" style="background-color:#ffffff">';
$s .= '<input type="button" class=button value="' . $AppUI->_('new contact') . '" onclick="javascript:window.location=\'./index.php?m=contacts&a=addedit&company_id=' . dPformSafe($company_id) . '&company_name=' . dPformSafe($obj->company_name) . '\'">';
$s .= '</td></tr>';
echo $s;
?>
</table>
示例2: CTitleBlock
$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">
<input type="hidden" name="dosql" value="do_contact_aed" />
示例3: testGetDepartmentDetails
public function testGetDepartmentDetails()
{
$contact = new CContact();
$results = $contact->getDepartmentDetails();
$this->AssertEquals(2, count($results));
$this->assertEquals(0, $results['dept_id']);
$this->assertEquals('', $results['dept_name']);
$contact->contact_department = 1;
$results = $contact->getDepartmentDetails();
$this->AssertEquals(2, count($results));
$this->assertEquals(1, $results['dept_id']);
$this->assertEquals('Department 1', $results['dept_name']);
}