本文整理汇总了PHP中task::add_pending_tasks方法的典型用法代码示例。如果您正苦于以下问题:PHP task::add_pending_tasks方法的具体用法?PHP task::add_pending_tasks怎么用?PHP task::add_pending_tasks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类task
的用法示例。
在下文中一共展示了task::add_pending_tasks方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: singleton
//.........这里部分代码省略.........
$p2->select();
$recipients[$p1->get_value("emailAddress")] = array("name" => $p1->get_name(), "addIP" => true, "internal" => true);
$recipients[$p2->get_value("emailAddress")] = array("name" => $p2->get_name(), "addIP" => true, "internal" => true);
$comment = $p2->get_name() . ",\n\n" . $taskname1 . "\n\n" . $taskDesc;
$commentID = comment::add_comment("task", $task->get_id(), $comment, "task", $task->get_id());
$emailRecipients = comment::add_interested_parties($commentID, null, $recipients);
// Re-email the comment out, including any attachments
if (!comment::send_comment($commentID, $emailRecipients)) {
alloc_error("Email failed to send.");
} else {
$TPL["message_good"][] = "Emailed task comment to " . $p1->get_value("emailAddress") . ", " . $p2->get_value("emailAddress") . ".";
}
}
} else {
if ($status == "admin" && $this->have_perm(PERM_APPROVE_PRODUCT_TRANSACTIONS)) {
$this->set_value("status", "finished");
if ($_REQUEST["changeTransactionStatus"]) {
$rows = $this->get_productSaleItems();
foreach ($rows as $row) {
$ids[] = $row["productSaleItemID"];
}
if ($ids) {
$q = prepare("UPDATE transaction SET status = '%s' WHERE productSaleItemID in (%s)", $_REQUEST["changeTransactionStatus"], $ids);
$db = new db_alloc();
$db->query($q);
}
}
// 2. from admin to salesperson
$q = prepare("SELECT * FROM task WHERE projectID = %d AND taskName = '%s'", $cyberadmin, $taskname2);
if (config::for_cyber() && !$db->qr($q)) {
$task = new task();
$task->set_value("projectID", $cyberadmin);
// Cyber Admin Project
$task->set_value("taskName", $taskname2);
$task->set_value("managerID", 67);
// Cyber Support people (jane)
$task->set_value("personID", $this->get_value("personID"));
// salesperson
$task->set_value("priority", 3);
$task->set_value("taskTypeID", "Task");
$task->set_value("taskDescription", $taskDesc);
$task->set_value("dateTargetStart", date("Y-m-d"));
$task->set_value("dateTargetCompletion", date("Y-m-d", date("U") + 60 * 60 * 24 * 7));
$task->save();
$q = prepare("SELECT * FROM task WHERE projectID = %d AND taskName = '%s'", $cyberadmin, $taskname1);
$rai_row = $db->qr($q);
if ($rai_row) {
$task->add_pending_tasks($rai_row["taskID"]);
}
$order_the_hardware_taskID = $task->get_id();
$TPL["message_good"][] = "Task created: " . $task->get_id() . " " . $task->get_value("taskName");
$task->add_notification(3, 1, "Task " . $task->get_id() . " " . $taskname2, "Task status moved from pending to open.", array(array("field" => "metaPersonID", "who" => -2)));
}
// 3. from salesperson to admin
$q = prepare("SELECT * FROM task WHERE projectID = %d AND taskName = '%s'", $cyberadmin, $taskname3);
if (config::for_cyber() && !$db->qr($q)) {
$task = new task();
$task->set_value("projectID", $cyberadmin);
// Cyber Admin Project
$task->set_value("taskName", $taskname3);
$task->set_value("managerID", $this->get_value("personID"));
// salesperson
$task->set_value("personID", 67);
// Cyber Support people (jane)
$task->set_value("priority", 3);
$task->set_value("taskTypeID", "Task");
$task->set_value("taskDescription", $taskDesc);
$task->set_value("dateTargetStart", date("Y-m-d"));
$task->set_value("dateTargetCompletion", date("Y-m-d", date("U") + 60 * 60 * 24 * 7));
$task->save();
$task->add_pending_tasks($order_the_hardware_taskID);
$pay_the_supplier_taskID = $task->get_id();
$TPL["message_good"][] = "Task created: " . $task->get_id() . " " . $task->get_value("taskName");
$task->add_notification(3, 1, "Task " . $task->get_id() . " " . $taskname3, "Task status moved from pending to open.", array(array("field" => "metaPersonID", "who" => -2)));
}
// 4. from admin to salesperson
$q = prepare("SELECT * FROM task WHERE projectID = %d AND taskName = '%s'", $cyberadmin, $taskname4);
if (config::for_cyber() && !$db->qr($q)) {
$task = new task();
$task->set_value("projectID", $cyberadmin);
// Cyber Admin Project
$task->set_value("taskName", $taskname4);
$task->set_value("managerID", 67);
// Cyber Support people
$task->set_value("personID", $this->get_value("personID"));
// salesperson
$task->set_value("priority", 3);
$task->set_value("taskTypeID", "Task");
$task->set_value("taskDescription", $taskDesc);
$task->set_value("dateTargetStart", date("Y-m-d"));
$task->set_value("dateTargetCompletion", date("Y-m-d", date("U") + 60 * 60 * 24 * 7));
$task->save();
$task->add_pending_tasks($pay_the_supplier_taskID);
$TPL["message_good"][] = "Task created: " . $task->get_id() . " " . $task->get_value("taskName");
$task->add_notification(3, 1, "Task " . $task->get_id() . " " . $taskname4, "Task status moved from pending to open.", array(array("field" => "metaPersonID", "who" => -2)));
}
}
}
}
}
示例2: count
}
}
// if someone uploads an attachment
if ($_POST["save_attachment"]) {
move_attachment("task", $taskID);
alloc_redirect($TPL["url_alloc_task"] . "taskID=" . $taskID . "&sbs_link=attachments");
}
// If saving a record
if ($_POST["save"] || $_POST["save_and_back"] || $_POST["save_and_new"] || $_POST["save_and_summary"] || $_POST["timeSheet_save"] || $_POST["close_task"]) {
$task->read_globals();
if ($_POST["close_task"]) {
$task->set_value("taskStatus", "closed_complete");
}
// If we're auto-nuking the pending tasks, we need to do that before the call to task->save()
if ($task->get_id() && !$_POST["pendingTasksIDs"]) {
$task->add_pending_tasks($_POST["pendingTasksIDs"]);
}
// Moved all validation over into task.inc.php save()
$success = $task->save();
count($msg) and $msg = "&message_good=" . urlencode(implode("<br>", $msg));
if ($success) {
interestedParty::make_interested_parties("task", $task->get_id(), $_POST["interestedParty"]);
// A task can only have a pending task or pending reopen date - pending task is fixed up in JS, but check here too
if ($task->get_value("taskStatus") != "pending_tasks") {
$_POST['pendingTaskIDs'] = '';
}
$task->add_pending_tasks($_POST["pendingTasksIDs"]);
$task->add_tags($_POST["tags"]);
// This is only valid on pending_, but not on pending_task (because it has a different field)
if (strpos($task->get_value("taskStatus"), "pending_") !== 0 || $task->get_value("taskStatus") == "pending_tasks") {
$_POST['reopen_task'] = '';
示例3: 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());
//.........这里部分代码省略.........