コード例 #1
0
ファイル: wbsElement.class.php プロジェクト: fg-ok/codev
        } else {
            $bug_id = $dynatreeDict['key'];
            // find $id (if exists)
            // Note: parent_id may have changed (if issue moved)
            // Note: $root_id cannot be null because a WBS always starts with a folder (created at Command init)
            $query = "SELECT id FROM `codev_wbs_table` WHERE bug_id = {$bug_id} AND root_id = {$root_id}";
            $result = SqlWrapper::getInstance()->sql_query($query);
            if (!$result) {
                echo "<span style='color:red'>ERROR: Query FAILED</span>";
                exit;
            }
            $row = SqlWrapper::getInstance()->sql_fetch_object($result);
            if (!is_null($row)) {
                $id = $row->id;
            }
        }
        // create Element
        $wbse = new WBSElement($id, $root_id, $bug_id, $parent_id, $order, $title, $icon, $font, $color, $isExpand);
        // create children
        $children = $dynatreeDict['children'];
        if (!is_null($children)) {
            $childOrder = 1;
            foreach ($children as $childDict) {
                self::updateFromDynatree(get_object_vars($childDict), $root_id, $wbse->getId(), $childOrder);
                $childOrder += 1;
            }
        }
    }
}
WBSElement::staticInit();