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


PHP CProject::getManager方法代碼示例

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


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

示例1: setComplete

function setComplete($id)
{
    global $AppUI;
    $task = new CTask();
    if ($task->load($id)) {
        $q = new DBQuery();
        $q->addTable('user_tasks');
        $q->addQuery('user_id');
        $q->addWhere('task_id = ' . $id);
        $q->addWhere('user_id = ' . $AppUI->user_id);
        $r = $q->loadResult();
        if ($r != $AppUI->user_id) {
            $p = new CProject($task->task_project);
            if (!$p->project_id || $p->getManager() != $AppUI->user_id) {
                return 'Error';
            }
        }
        $q->addTable('tasks');
        $q->addUpdate('task_percent_complete', '100');
        $q->addWhere('task_id = ' . $id);
        $q->exec();
        return 'OK';
    }
    return 'Error';
}
開發者ID:n2i,項目名稱:xvnkb,代碼行數:25,代碼來源:complete.php

示例2: CTask

            exit;
        } else {
            $AppUI->setMsg('Missing task information', UI_MSG_WARNING);
            $AppUI->redirect();
        }
    }
    $obj = new CTask();
    $obj->load($_REQUEST['task']);
}
$p = new CProject($obj->task_project);
$q = new DBQuery();
$q->addTable('user_tasks');
$q->addQuery('user_id');
$q->addWhere('task_id = ' . $obj->task_id);
$users = arrayMerge(array($obj->task_creator => ''), $q->loadHashList());
$canUpload = $AppUI->user_id == $p->getManager() || in_array($AppUI->user_id, array_keys($users));
$cmd = isset($_REQUEST['cmd']) ? $_REQUEST['cmd'] : 'list';
if ($cmd != 'get' && $cmd != 'list' && !$canUpload) {
    $AppUI->setMsg('You dont have permission to ' . $cmd . ' file', UI_MSG_ERROR);
    $AppUI->redirect('&m=tasks&a=view&task_id=' . $obj->task_id);
    exit;
}
switch ($cmd) {
    case 'get':
        getfile();
        break;
    case 'put':
        putfile();
        break;
    case 'update':
        updatefile();
開發者ID:n2i,項目名稱:xvnkb,代碼行數:31,代碼來源:file.php

示例3: CProject

// retrieve any state parameters
if (isset($_GET['tab'])) {
    $AppUI->setState('ProjVwTab', $_GET['tab']);
}
$tab = $AppUI->getState('ProjVwTab') !== NULL ? $AppUI->getState('ProjVwTab') : 0;
// check if this record has dependencies to prevent deletion
$msg = '';
$obj = new CProject();
// Now check if the proect is editable/viewable.
$denied = $obj->getDeniedRecords($AppUI->user_id);
if (in_array($project_id, $denied)) {
    $AppUI->setMsg('Access denied', UI_MSG_ERROR);
    $AppUI->redirect();
}
$obj->load($project_id);
$isProjectManager = $AppUI->user_id == $obj->getManager();
$canEdit = $perms->checkModuleItem($m, 'edit', $project_id) && ($AppUI->user_type == SYSADMIN || $isProjectManager);
$canEditT = $obj->canCreateTasks();
$canDelete = $obj->canDelete($msg, $project_id) && ($AppUI->user_type == SYSADMIN || $AppUI->user_id == $obj->project_owner);
$canViewReport = $isProjectManager || $AppUI->user_type <= MANAGER;
// get critical tasks (criteria: task_end_date)
$criticalTasks = $project_id > 0 ? $obj->getCriticalTasks($project_id) : NULL;
// get ProjectPriority from sysvals
$projectPriority = dPgetSysVal('ProjectPriority');
$projectPriorityColor = dPgetSysVal('ProjectPriorityColor');
$working_hours = $dPconfig['daily_working_hours'] ? $dPconfig['daily_working_hours'] : 8;
$q = new DBQuery();
//check that project has tasks; otherwise run seperate query
$q->addTable('tasks');
$q->addQuery('COUNT(distinct tasks.task_id) AS total_tasks');
$q->addWhere('task_project = ' . $project_id);
開發者ID:n2i,項目名稱:xvnkb,代碼行數:31,代碼來源:view.php


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