當前位置: 首頁>>代碼示例>>PHP>>正文


PHP task::update_children方法代碼示例

本文整理匯總了PHP中task::update_children方法的典型用法代碼示例。如果您正苦於以下問題:PHP task::update_children方法的具體用法?PHP task::update_children怎麽用?PHP task::update_children使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在task的用法示例。


在下文中一共展示了task::update_children方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

if ($_POST["mass_update"]) {
    if ($_POST["select"]) {
        $allowed_auto_fields = array("dateTargetStart", "dateTargetCompletion", "dateActualStart", "dateActualCompletion", "managerID", "timeLimit", "timeBest", "timeWorst", "timeExpected", "priority", "taskTypeID", "taskStatus", "personID");
        foreach ($_POST["select"] as $taskID => $selected) {
            $task = new task();
            $task->set_id($taskID);
            $task->select();
            // Special case: projectID and parentTaskID have to be done together
            if ($_POST["update_action"] == "projectIDAndParentTaskID") {
                // Can't set self to be parent
                if ($_POST["parentTaskID"] != $task->get_id()) {
                    $task->set_value("parentTaskID", $_POST["parentTaskID"]);
                }
                // If task is a parent, change the project of that tasks children
                if ($_POST["projectID"] != $task->get_value("projectID") && $task->get_value("taskTypeID") == "Parent") {
                    $task->update_children("projectID", $_POST["projectID"]);
                }
                $task->set_value("projectID", $_POST["projectID"]);
                $task->updateSearchIndexLater = true;
                $task->save();
                // All other cases are generic and can be handled by a single clause
            } else {
                if ($_POST["update_action"] && in_array($_POST["update_action"], $allowed_auto_fields)) {
                    $task->set_value($_POST["update_action"], $_POST[$_POST["update_action"]]);
                    $task->updateSearchIndexLater = true;
                    $task->save();
                }
            }
        }
        $TPL["message_good"][] = "Tasks updated.";
        $url = $_POST["returnURL"] or $url = $TPL["url_alloc_taskList"];
開發者ID:cjbayliss,項目名稱:alloc,代碼行數:31,代碼來源:taskList.php

示例2: prepare

 function update_children($field, $value = "")
 {
     $q = prepare("SELECT * FROM task WHERE parentTaskID = %d", $this->get_id());
     $db = new db_alloc();
     $db->query($q);
     while ($db->row()) {
         $t = new task();
         $t->read_db_record($db);
         $t->set_value($field, $value);
         $t->save();
         if ($t->get_value("taskTypeID") == "Parent") {
             $t->update_children($field, $value);
         }
     }
 }
開發者ID:cjbayliss,項目名稱:alloc,代碼行數:15,代碼來源:task.inc.php


注:本文中的task::update_children方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。