本文整理汇总了PHP中task::getProjectTasks方法的典型用法代码示例。如果您正苦于以下问题:PHP task::getProjectTasks方法的具体用法?PHP task::getProjectTasks怎么用?PHP task::getProjectTasks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类task
的用法示例。
在下文中一共展示了task::getProjectTasks方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deassign
/**
* Removes a user from a project
*
* @param int $user User ID of user to remove
* @param int $id Project ID of project to remove from
* @return bool
*/
function deassign($user, $id)
{
global $conn;
$sqlStmt = $conn->prepare("DELETE FROM projekte_assigned WHERE user = ? AND projekt = ?");
$milestone = new milestone();
// Delete the users assignments to closed milestones
$donemiles = $milestone->getDoneProjectMilestones($id);
if (!empty($donemiles)) {
$sql1Stmt = $conn->prepare("DELETE FROM milestones_assigned WHERE user = ? AND milestone = ?");
foreach ($donemiles as $dm) {
$sql1 = $sql1Stmt->execute(array((int) $user, $dm['ID']));
}
}
// Delete the users assignments to open milestones
$openmiles = $milestone->getAllProjectMilestones($id, 100000);
if (!empty($openmiles)) {
$sql2Stmt = $conn->prepare("DELETE FROM milestones_assigned WHERE user = ? AND milestone = ?");
foreach ($openmiles as $om) {
$sql2 = $sql2Stmt->execute(array((int) $user, $om['ID']));
}
}
$task = new task();
$tasks = $task->getProjectTasks($id);
// Delete tasks assignments of the user
if (!empty($tasks)) {
$sql3Stmt = $conn->prepare("DELETE FROM tasks_assigned WHERE user = ? AND task = ?");
foreach ($tasks as $t) {
$sql3 = $sql3Stmt->execute(array((int) $user, $t['ID']));
}
}
// Finally remove the user from the project
$del = $sqlStmt->execute(array((int) $user, (int) $id));
if ($del) {
$userObj = new user();
$user = $userObj->getProfile($user);
$this->mylog->add($user["name"], 'user', 7, $id);
return true;
} else {
return false;
}
}
示例2: milestone
if (getArrayVal($_COOKIE, "status")) {
$statstyle = "display:" . $_COOKIE['status'];
$template->assign("statstyle", $statstyle);
$statbar = "win_" . $_COOKIE['status'];
} else {
$statbar = "win_block";
}
$template->assign("milebar", $milebar);
$template->assign("trackbar", $trackbar);
$template->assign("logbar", $logbar);
$template->assign("statbar", $statbar);
$template->assign("projectov", "no");
$milestone = (object) new milestone();
$mylog = (object) new mylog();
$task = new task();
$ptasks = $task->getProjectTasks($id, 1);
$today = date("d");
$log = $mylog->getProjectLog($id);
$log = $mylog->formatdate($log);
$tproject = $project->getProject($id);
$done = $project->getProgress($id);
$title = $langfile['project'];
$title = $title . " " . $tproject["name"];
$template->assign("title", $title);
$template->assign("tree", $milestone->getAllProjectMilestones($id, 1000));
$template->assign("project", $tproject);
$template->assign("done", $done);
$template->assign("ptasks", $ptasks);
$template->assign("today", $today);
$template->assign("log", $log);
SmartyPaginate::assign($template);
示例3: deassign
/**
* Entfernt ein Projekt aus der Zuweisung an ein bestimmtes Mitglied
*
* @param int $user User ID
* @param int $id Project ID
* @return bool
*/
function deassign($user, $id)
{
$user = mysql_real_escape_string($user);
$id = mysql_real_escape_string($id);
$user = (int) $user;
$id = (int) $id;
$sql = "DELETE FROM projekte_assigned WHERE user = {$user} AND projekt = {$id}";
$milestone = new milestone();
$donemiles = $milestone->getDoneProjectMilestones($id);
if (!empty($donemiles)) {
foreach ($donemiles as $dm) {
$sql1 = mysql_query("DELETE FROM milestones_assigned WHERE user = {$user} AND milestone = {$dm['ID']}");
}
}
$openmiles = $milestone->getAllProjectMilestones($id, 100000);
if (!empty($openmiles)) {
foreach ($openmiles as $om) {
$sql2 = mysql_query("DELETE FROM milestones_assigned WHERE user = {$user} AND milestone = {$om['ID']}");
}
}
$task = new task();
$tasks = $task->getProjectTasks($id);
if (!empty($tasks)) {
foreach ($tasks as $t) {
$sql3 = mysql_query("DELETE FROM tasks_assigned WHERE user = {$user} AND task = {$t['ID']}");
}
}
$del = mysql_query($sql);
if ($del) {
$userObj = new user();
$user = $userObj->getProfile($user);
$this->mylog->add($user["name"], 'user', 7, $id);
return true;
} else {
return false;
}
}