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


PHP CContact::canEdit方法代码示例

本文整理汇总了PHP中CContact::canEdit方法的典型用法代码示例。如果您正苦于以下问题:PHP CContact::canEdit方法的具体用法?PHP CContact::canEdit怎么用?PHP CContact::canEdit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CContact的用法示例。


在下文中一共展示了CContact::canEdit方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: die

<?php

if (!defined('W2P_BASE_DIR')) {
    die('You should not access this file directly.');
}
$contact_id = (int) w2PgetParam($_GET, 'contact_id', 0);
$tab = $AppUI->processIntState('ContactVwTab', $_GET, 'tab', 0);
$contact = new CContact();
if (!$contact->load($contact_id)) {
    $AppUI->redirect(ACCESS_DENIED);
}
$canEdit = $contact->canEdit();
$canDelete = $contact->canDelete();
$is_user = $contact->isUser($contact_id);
// 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, 'icon.png', $m);
$titleBlock->addCrumb('?m=contacts', 'contacts list');
if ($canEdit) {
    $titleBlock->addCrumb('?m=contacts&a=addedit&contact_id=' . $contact_id, 'edit this contact');
}
if ($contact->user_id) {
    $titleBlock->addCrumb('?m=users&a=view&user_id=' . $contact->user_id, 'view this user');
}
if ($canDelete) {
开发者ID:illuminate3,项目名称:web2project,代码行数:31,代码来源:view.php

示例2: die

<?php

if (!defined('W2P_BASE_DIR')) {
    die('You should not access this file directly.');
}
// @todo    convert to template
$object_id = (int) w2PgetParam($_GET, 'contact_id', 0);
$company_id = (int) w2PgetParam($_GET, 'company_id', 0);
$dept_id = (int) w2PgetParam($_GET, 'dept_id', 0);
$object = new CContact();
$object->setId($object_id);
$canAddEdit = $object->canAddEdit();
$canAuthor = $object->canCreate();
$canEdit = $object->canEdit();
$canDelete = $object->canDelete();
if (!$canAddEdit) {
    $AppUI->redirect(ACCESS_DENIED);
}
// load the record data
$obj = $AppUI->restoreObject();
if ($obj) {
    $object = $obj;
    $object_id = $object->getId();
} else {
    $object->load($object_id);
}
if (!$object && $object_id > 0) {
    $AppUI->setMsg('Contact');
    $AppUI->setMsg('invalidID', UI_MSG_ERROR, true);
    $AppUI->redirect('m=' . $m);
}
开发者ID:illuminate3,项目名称:web2project,代码行数:31,代码来源:addedit.php


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