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


PHP task::getProjectTasks方法代码示例

本文整理汇总了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;
     }
 }
开发者ID:Setrino,项目名称:collabtive,代码行数:48,代码来源:class.project.php

示例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);
开发者ID:Setrino,项目名称:collabtive,代码行数:31,代码来源:manageproject.php

示例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;
     }
 }
开发者ID:janvalentik,项目名称:Collabtive,代码行数:44,代码来源:class.project.php


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