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


PHP CEvent::canDelete方法代碼示例

本文整理匯總了PHP中CEvent::canDelete方法的典型用法代碼示例。如果您正苦於以下問題:PHP CEvent::canDelete方法的具體用法?PHP CEvent::canDelete怎麽用?PHP CEvent::canDelete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CEvent的用法示例。


在下文中一共展示了CEvent::canDelete方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: die

<?php

/* CALENDAR $Id$ */
if (!defined('DP_BASE_DIR')) {
    die('You should not access this file directly.');
}
$event_id = intval(dPgetParam($_GET, 'event_id', 0));
// check permissions for this record
$canAuthor = getPermission('events', 'add', $event_id);
$canEdit = getPermission('events', 'edit', $event_id);
// check if this record has dependencies to prevent deletion
$msg = '';
$obj = new CEvent();
$canDelete = $obj->canDelete($msg, $event_id);
// load the record data
if (!$obj->load($event_id)) {
    $AppUI->setMsg('Event');
    $AppUI->setMsg('invalidID', UI_MSG_ERROR, true);
    $AppUI->redirect();
} else {
    $AppUI->savePlace();
}
// load the event types
$types = dPgetSysVal('EventType');
// load the event recurs types
$recurs = array('Never', 'Hourly', 'Daily', 'Weekly', 'Bi-Weekly', 'Every Month', 'Quarterly', 'Every 6 months', 'Every Year');
$assigned = $obj->getAssigned();
if ($obj->event_owner != $AppUI->user_id && !getPermission('admin', 'view')) {
    $canEdit = false;
}
$df = $AppUI->getPref('SHDATEFORMAT');
開發者ID:slawekmikula,項目名稱:dotproject,代碼行數:31,代碼來源:view.php

示例2: die

<?php

if (!defined('W2P_BASE_DIR')) {
    die('You should not access this file directly.');
}
// @todo    convert to template
$event_id = (int) w2PgetParam($_GET, 'event_id', 0);
$event = new CEvent();
if (!$event->load($event_id)) {
    $AppUI->redirect(ACCESS_DENIED);
}
$canEdit = $event->canEdit();
$canDelete = $event->canDelete();
// load the event recurs types
$recurs = array('Never', 'Hourly', 'Daily', 'Weekly', 'Bi-Weekly', 'Every Month', 'Quarterly', 'Every 6 months', 'Every Year');
$assigned = $event->getAssigned();
$start_date = $event->event_start_date ? new w2p_Utilities_Date($event->event_start_date) : new w2p_Utilities_Date();
$end_date = $event->event_end_date ? new w2p_Utilities_Date($event->event_end_date) : new w2p_Utilities_Date();
if ($event->event_project) {
    $project = new CProject();
    $event_project = $project->load($event->event_project)->project_name;
}
// setup the title block
$titleBlock = new w2p_Theme_TitleBlock('View Event', 'icon.png', $m);
$titleBlock->addCrumb('?m=events&a=year_view&date=' . $start_date->format(FMT_TIMESTAMP_DATE), 'year view');
$titleBlock->addCrumb('?m=events&amp;date=' . $start_date->format(FMT_TIMESTAMP_DATE), 'month view');
$titleBlock->addCrumb('?m=events&a=week_view&date=' . $start_date->format(FMT_TIMESTAMP_DATE), 'week view');
$titleBlock->addCrumb('?m=events&amp;a=day_view&amp;date=' . $start_date->format(FMT_TIMESTAMP_DATE) . '&amp;tab=0', 'day view');
if ($canEdit) {
    $titleBlock->addCell();
    $titleBlock->addCell('
開發者ID:illuminate3,項目名稱:web2project,代碼行數:31,代碼來源:view.php

示例3: CDate

}
if ($obj->event_end_date) {
    $end_date = new CDate($obj->event_end_date . $_POST['end_time']);
    $obj->event_end_date = $end_date->format(FMT_DATETIME_MYSQL);
}
if (!$del && $start_date->compare($start_date, $end_date) >= 0) {
    $AppUI->setMsg("Start-Date >= End-Date, please correct", UI_MSG_ERROR);
    $AppUI->redirect();
    exit;
}
// prepare (and translate) the module name ready for the suffix
$AppUI->setMsg('Event');
$do_redirect = true;
require_once $AppUI->getSystemClass("CustomFields");
if ($del) {
    if (!$obj->canDelete($msg)) {
        $AppUI->setMsg($msg, UI_MSG_ERROR);
        $AppUI->redirect();
    }
    if ($msg = $obj->delete()) {
        $AppUI->setMsg($msg, UI_MSG_ERROR);
    } else {
        $AppUI->setMsg("deleted", UI_MSG_OK, true);
    }
    $AppUI->redirect('m=calendar');
} else {
    $isNotNew = @$_POST['event_id'];
    if (!$isNotNew) {
        $obj->event_owner = $AppUI->user_id;
    }
    // Check for existence of clashes.
開發者ID:klr2003,項目名稱:sourceread,代碼行數:31,代碼來源:do_event_aed.php

示例4: die

/* $Id$ $URL$ */
if (!defined('W2P_BASE_DIR')) {
    die('You should not access this file directly.');
}
$event_id = intval(w2PgetParam($_GET, 'event_id', 0));
// check permissions for this record
$perms =& $AppUI->acl();
$canRead = $perms->checkModuleItem($m, 'view', $event_id);
if (!$canRead) {
    $AppUI->redirect('m=public&a=access_denied');
}
$canEdit = $perms->checkModuleItem($m, 'edit', $event_id);
// check if this record has dependencies to prevent deletion
$msg = '';
$event = new CEvent();
$canDelete = $event->canDelete($msg, $event_id);
// load the record data
if (!$event->load($event_id)) {
    $AppUI->setMsg('Event');
    $AppUI->setMsg('invalidID', UI_MSG_ERROR, true);
    $AppUI->redirect();
} else {
    $AppUI->savePlace();
}
//check if the user has view permission over the project
if ($event->event_project && !$perms->checkModuleItem('projects', 'view', $event->event_project)) {
    $AppUI->redirect('m=public&a=access_denied');
}
// load the event types
$types = w2PgetSysVal('EventType');
// load the event recurs types
開發者ID:joly,項目名稱:web2project,代碼行數:31,代碼來源:view.php


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