Aaron E Krohn

Nested projects working, priority modification matches change.

... ... @@ -33,7 +33,8 @@
:col-type serial)
(fk-parent-id :accessor parent-id
:initarg :parent
:col-type (or db-null integer))
:col-type integer
:init-form 0)
(archived :accessor archived
:initarg :archived
:initform nil
... ... @@ -126,4 +127,4 @@
:col-type string))
(:table-name "resources")
(:keys pk-resource-id)
(:metaclass dao-class))
\ No newline at end of file
(:metaclass dao-class))
... ...
... ... @@ -73,33 +73,33 @@
(defun projects-list-inactive-page ()
"View projects whose tasks are all in the 'complete' state,
and all tasks belonging to these projects"
(let ((project-list))
(setf project-list (project-list-inactive))
(dolist (project project-list)
(setf (tasks project) (task-list-all (id project))))
(let ((item-list))
(setf item-list
(append
(project-list-inactive)
(task-list-by-status "complete")))
(projects-list-inactive-view
"Inactive Projects :: pr0nage"
:inactive
"Inactive Projects"
project-list
item-list
(task-status-list-all))))
(defun projects-list-archived-page ()
"View all tasks whose archived attribute is true,
and all tasks belonging to these projects"
(let ((project-list))
(setf project-list (project-list-archived))
(dolist (project project-list)
(setf (tasks project) (task-list-all (id project))))
(let ((item-list))
(setf item-list
(append
(project-list-archived)
(task-list-all)))
(projects-list-archived-view
"Archived Projects :: pr0nage"
:archived
"Archived Projects"
project-list
item-list
(select-dao 'task-status))))
(defun project-create-data ()
... ... @@ -180,7 +180,7 @@
(handler-case (setf project-id (parse-integer (nth 1 uri-params)))
(error () (redirect "/projects")))
(setf project-obj (project-get-by-id project-id))
(setf task-list (task-list-all project-id))
(setf task-list (task-list-by-pid project-id))
(project-view-view
project-id
(name project-obj)
... ...
... ... @@ -74,7 +74,7 @@
GROUP BY p.pk_project_id
)
SELECT
d.pk_project_id, p.project_name, p.priority, p.archived
d.pk_project_id, p.project_name, p.priority, p.archived, p.fk_parent_id
FROM doot AS d
JOIN projects p on p.pk_project_id = d.pk_project_id
WHERE d.complete_sum = d.total_tasks" complete-task-id))
... ... @@ -149,8 +149,9 @@
"UPDATE projects
SET priority = projects.priority ~A 1
WHERE projects.priority
BETWEEN SYMMETRIC ~A AND ~A"
adj-func old-pri new-pri))
BETWEEN SYMMETRIC ~A AND ~A
AND projects.fk_parent_id = ~A"
adj-func old-pri new-pri (parent-id project-obj)))
(with-transaction ()
;; For simplicity, we modify all affected projects' priority before
;; we set the priority of our target project.
... ...
... ... @@ -131,8 +131,14 @@
(task-list-by-status-pid "in-progress"))
(defun task-list-by-status (status)
(query
"SELECT *
(query-dao 'task
"SELECT pk_task_id,
fk_project_id,
task_name,
fk_status_id,
details,
complete_by,
priority
FROM tasks AS t
JOIN task_status AS s
ON (t.fk_status_id = s.pk_task_status_id)
... ...