Index: tasks_advanced.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/tasks_advanced/tasks_advanced.module,v retrieving revision 1.16 diff -u -r1.16 tasks_advanced.module --- tasks_advanced.module 19 Jan 2007 19:26:43 -0000 1.16 +++ tasks_advanced.module 18 Jan 2008 01:01:11 -0000 @@ -139,7 +139,7 @@ if (!$nid) { $nid = 0; } - $result = db_query("SELECT n.nid, n.title, t.parent FROM {node} n INNER JOIN {tasks} t ON t.nid = n.nid INNER JOIN {tasks_advanced} a ON a.nid = n.nid WHERE n.type='tasks' AND t.completed = '0000-00-00' AND a.tasktype = 'project' AND n.nid != {$nid} ORDER BY IF(t.parent = 0,0,1), n.title ASC"); + $result = db_query("SELECT n.nid, n.title, t.task_parent FROM {node} n INNER JOIN {tasks} t ON t.nid = n.nid INNER JOIN {tasks_advanced} a ON a.nid = n.nid WHERE n.type='tasks' AND t.completed = '0000-00-00' AND a.tasktype = 'project' AND n.nid != {$nid} ORDER BY IF(t.task_parent = 0,0,1), n.title ASC"); while ($tasklist = db_fetch_object($result)) { if ($tasklist->parent == 0) { @@ -584,7 +584,7 @@ } } - $sql_str = "SELECT n.nid, t.parent, u.name AS assigned_name, t.assigned_to, a.taskcategory, a.tasktype, a.task_tree_left, a.task_tree_right, a.task_tree_depth, u.data + $sql_str = "SELECT n.nid, t.task_parent, u.name AS assigned_name, t.assigned_to, a.taskcategory, a.tasktype, a.task_tree_left, a.task_tree_right, a.task_tree_depth, u.data FROM {node} n INNER JOIN {tasks} t ON t.nid = n.nid INNER JOIN {tasks_advanced} a ON a.nid = n.nid @@ -615,14 +615,14 @@ $right = $left + 1; // get all children of this node - $result = db_query("SELECT nid parent FROM {tasks} WHERE parent = %d", $parent); + $result = db_query("SELECT nid AS child FROM {tasks} WHERE task_parent = %d", $parent); while ($row = db_fetch_object($result)) { // recursive execution of this function for each // child of this node // $right is the current right value, which is // incremented by the rebuild_tree function - $right = tasks_advanced_rebuild_tree($row->parent, $right, $depth + 1); + $right = tasks_advanced_rebuild_tree($row->child, $right, $depth + 1); } // we've got the left value, and now that we've processed @@ -648,7 +648,7 @@ * @return void */ function _tasks_advanced_get_node($nid) { - $record = db_query('SELECT t.nid, t.parent, a.tasktype, a.task_tree_left, a.task_tree_right, a.task_tree_depth FROM {tasks} t INNER JOIN {tasks_advanced} a ON a.nid = t.nid WHERE t.nid = %d LIMIT 1', $nid); + $record = db_query('SELECT t.nid, t.task_parent, a.tasktype, a.task_tree_left, a.task_tree_right, a.task_tree_depth FROM {tasks} t INNER JOIN {tasks_advanced} a ON a.nid = t.nid WHERE t.nid = %d LIMIT 1', $nid); $object = db_fetch_object($record); return $object; } Index: tasks_advanced.install =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/tasks_advanced/tasks_advanced.install,v retrieving revision 1.5 diff -u -r1.5 tasks_advanced.install --- tasks_advanced.install 19 Jan 2007 19:26:43 -0000 1.5 +++ tasks_advanced.install 18 Jan 2008 01:01:11 -0000 @@ -33,16 +33,16 @@ // let's make sure that there's an entry in {tasks_advanced} for each existing entry in {tasks} // need to make sure all parents are turned into projects db_query("INSERT INTO {tasks_advanced} (nid, taskcategory, tasktype) - SELECT t.nid, 'unknown', IF(t.nid IN (SELECT parent FROM tasks), 'project', 'action') + SELECT t.nid, 'unknown', IF(t.nid IN (SELECT task_parent FROM {tasks}), 'project', 'action') FROM {tasks} t LEFT JOIN {tasks_advanced} a ON t.nid = a.nid WHERE ISNULL(a.nid)"); // mark the master tasklist as a project - db_query("UPDATE {tasks_advanced} SET tasktype = 'project' WHERE nid = (SELECT nid FROM {tasks} WHERE parent = 0)"); + db_query("UPDATE {tasks_advanced} SET tasktype = 'project' WHERE nid = (SELECT nid FROM {tasks} WHERE task_parent = 0)"); // build the tree structure - include_once 'tasks_advanced.module'; + include_once(drupal_get_path('module', 'tasks_advanced'). '/tasks_advanced.module'); tasks_advanced_rebuild_tree(0, 0, -1); }