本文整理汇总了PHP中task::close方法的典型用法代码示例。如果您正苦于以下问题:PHP task::close方法的具体用法?PHP task::close怎么用?PHP task::close使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类task
的用法示例。
在下文中一共展示了task::close方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: count
/**
* Finish / close a tasklist
*
*
* @param int $id Tasklist ID
* @param bool $closeMilestones Determines if the parent milestone is closed too if $id is the last assigned tasklist to that ms
* @return bool
*/
function close_liste($id, $closeMilestones = true)
{
global $conn, $mylog;
$id = (int) $id;
$updStmt = $conn->prepare("UPDATE tasklist SET status = 0 WHERE ID = ?");
$upd = $updStmt->execute(array($id));
if ($closeMilestones) {
// Close assigned milestone too, if no other open tasklists are assigned to it
$milestone = $conn->query("SELECT milestone FROM tasklist WHERE ID = {$id}")->fetch();
if ($milestone[0] > 0) {
$cou = $conn->query("SELECT count(*) FROM tasklist WHERE milestone = {$milestone['0']} AND status = 1")->fetch();
if ($cou[0] == 0) {
$miles = new milestone();
$miles->close($milestone[0]);
}
}
}
// Close tasks in this list
$tasks = $this->getTasksFromList($id);
if (!empty($tasks)) {
$taskobj = new task();
foreach ($tasks as $task) {
$taskobj->close($task["ID"]);
}
}
// Log entry
if ($upd) {
$nam = $conn->query("SELECT project, name FROM tasklist WHERE ID = {$id}")->fetch();
$project = $nam[0];
$name = $nam[1];
$mylog->add($name, 'tasklist', 5, $project);
return true;
} else {
return false;
}
}
示例2: count
/**
* Finish / close a tasklist
*
* @param int $id Tasklist ID
* @return bool
*/
function close_liste($id)
{
$id = (int) $id;
$upd = mysql_query("UPDATE tasklist SET status = 0 WHERE ID = {$id}");
// Close assigned milestone too, if no other open tasklists are assigned to it
$sql = mysql_query("SELECT milestone FROM tasklist WHERE ID = {$id}");
$milestone = mysql_fetch_row($sql);
if ($milestone[0] > 0) {
$sql2 = mysql_query("SELECT count(*) FROM tasklist WHERE milestone = {$milestone['0']} AND status = 1");
$cou = mysql_fetch_row($sql2);
if ($cou[0] == 0) {
$miles = new milestone();
$miles->close($milestone[0]);
}
}
$tasks = $this->getTasksFromList($id);
if (!empty($tasks)) {
$taskobj = new task();
foreach ($tasks as $task) {
$taskobj->close($task["ID"]);
}
}
// Log entry
if ($upd) {
$nam = mysql_query("SELECT project, name FROM tasklist WHERE ID = {$id}");
$nam = mysql_fetch_row($nam);
$project = $nam[0];
$name = $nam[1];
$this->mylog->add($name, 'tasklist', 5, $project);
return true;
} else {
return false;
}
}