本文整理汇总了PHP中task::get_pending_tasks方法的典型用法代码示例。如果您正苦于以下问题:PHP task::get_pending_tasks方法的具体用法?PHP task::get_pending_tasks怎么用?PHP task::get_pending_tasks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类task
的用法示例。
在下文中一共展示了task::get_pending_tasks方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepare
$TPL["taskDuplicateLink"] = $realtask->get_task_link(array("prefixTaskID" => 1, "return" => "html"));
$mesg = "This task is a duplicate of " . $TPL["taskDuplicateLink"];
$TPL["message_help_no_esc"][] = $mesg;
$TPL["editing_disabled"] = true;
}
// Link off to the duplicate tasks, if this task is the source task
$q = prepare("SELECT taskID FROM task WHERE duplicateTaskID = %d", $task->get_id());
$db->query($q);
while ($row = $db->row()) {
$realtask = new task();
$realtask->set_id($row["taskID"]);
$realtask->select();
$duds .= "<br>" . $realtask->get_task_link(array("prefixTaskID" => 1, "return" => "html"));
}
$duds and $TPL["message_help_no_esc"][] = "The following tasks have been marked as a duplicate of this task: " . $duds;
$rows = $task->get_pending_tasks();
foreach ((array) $rows as $pendingTaskID) {
$realtask = new task();
$realtask->set_id($pendingTaskID);
$realtask->select();
unset($st1, $st2);
if (substr($realtask->get_value("taskStatus"), 0, 6) == "closed") {
$st1 = "<strike>";
$st2 = "</strike>";
} else {
$wasopen = true;
}
$pendingTaskLinks[] = $st1 . $realtask->get_task_link(array("prefixTaskID" => 1, "return" => "html")) . $st2;
}
$is = "was";
$wasopen and $is = "is";
示例2: unset
function edit_task($commands, $email_receive)
{
$task_fields = $this->get_fields("task");
// Task commands
if ($commands["task"]) {
unset($changes);
$taskPriorities = config::get_config_item("taskPriorities") or $taskPriorities = array();
foreach ($taskPriorities as $k => $v) {
$priorities[strtolower($v["label"])] = $k;
}
$people_by_username = person::get_people_by_username();
// Else edit/create the task ...
$task = new task();
if ($commands["task"] && strtolower($commands["task"]) != "new") {
$task->set_id($commands["task"]);
if (!$task->select()) {
alloc_error("Unable to select task with ID: " . $commands["task"]);
}
}
foreach ($commands as $k => $v) {
// transform from username to personID
if ($k == "assign") {
$changes[$k] = "personID";
$v = $people_by_username[$v]["personID"];
$v or alloc_error("Unrecognized username.");
}
if ($k == "manage") {
$changes[$k] = "managerID";
$v = $people_by_username[$v]["personID"];
$v or alloc_error("Unrecognized username.");
}
if ($k == "estimator") {
$changes[$k] = "estimatorID";
$v = $people_by_username[$v]["personID"];
$v or alloc_error("Unrecognized username.");
}
// transform from priority label to priority ID
if ($k == "priority" && !in_array($v, array(1, 2, 3, 4, 5))) {
$v = $priorities[strtolower($v)];
}
// so that --type parent becomes --type Parent
// mysql's referential integrity is case-insensitive :(
if ($k == "type") {
$v = ucwords($v);
}
// Plug the value in
if ($task_fields[$k][0]) {
$changes[$k] = $task_fields[$k][0];
$task->set_value($task_fields[$k][0], sprintf("%s", $v));
}
}
if (isset($commands["pend"])) {
$changes["pend"] = implode(",", (array) $task->get_pending_tasks());
}
if (isset($commands["reopen"])) {
$reopen_rows = $task->get_reopen_reminders();
unset($rr_bits);
foreach ($reopen_rows as $rr) {
$rr_bits[] = $rr["reminderTime"];
}
$changes["reopen"] = implode(",", (array) $rr_bits);
}
if (isset($commands["tags"])) {
$changes["tags"] = implode(",", $task->get_tags());
}
if (strtolower($commands["task"]) == "new") {
if (!$commands["desc"] && is_object($email_receive)) {
$task->set_value("taskDescription", $email_receive->get_converted_encoding());
}
}
$after_label = "After: ";
if (strtolower($commands["task"]) != "new") {
$str = $this->condense_changes($changes, $task->row());
$str and $status[] = "msg";
$str and $message[] = "Before: " . $str;
} else {
$after_label = "Fields: ";
}
// Save task
$err = $task->validate();
if (!$err && $task->save()) {
$task->select();
if (isset($commands["pend"])) {
$task->add_pending_tasks($commands["pend"]);
$changes["pend"] = implode(",", (array) $task->get_pending_tasks());
}
if (isset($commands["reopen"])) {
$task->add_reopen_reminder($commands["reopen"]);
$reopen_rows = $task->get_reopen_reminders();
unset($rr_bits);
foreach ($reopen_rows as $rr) {
$rr_bits[] = $rr["reminderTime"];
}
$changes["reopen"] = implode(",", (array) $rr_bits);
}
if (isset($commands["tags"])) {
$task->add_tags(array($commands["tags"]));
$changes["tags"] = implode(",", $task->get_tags());
}
$str = $this->condense_changes($changes, $task->row());
//.........这里部分代码省略.........