Aaron E Krohn

Fixed text summary report page

... ... @@ -98,6 +98,7 @@
(let ((uri-params)
(c-item-id)
(item-list))
(setf uri-params (parse-uri-params (request-uri* *REQUEST*)))
(handler-case (setf c-item-id (parse-integer (nth 2 uri-params)))
... ... @@ -115,15 +116,19 @@
(setf uri-params (parse-uri-params (request-uri* *REQUEST*)))
;; Ensure argument ID is an integer
(handler-case (setf item-id (parse-integer (nth 1 uri-params)))
(error () (smart-redirect (referer *REQUEST*) "/objectives")))
;; Ensure that new priority is an integer
(handler-case (setf new-priority (parse-integer (nth 3 uri-params)))
(error () (smart-redirect (referer *REQUEST*) "/objectives")))
;; Ensure the provided objective ID is valid
(handler-case (setf item-obj (action-item-get-by-id item-id))
(error () (smart-redirect (referer *REQUEST*) "/objectives")))
;; 0 < new-priority < max-priority
(if (or
(< new-priority 1)
(> new-priority (get-max-priority (parent-id item-obj))))
... ... @@ -131,13 +136,15 @@
(setf old-priority (priority item-obj))
;; Do nothing if old-priority == new-priority
(if (equal new-priority old-priority)
(smart-redirect (referer *REQUEST*) "/objectives"))
;; I don't know why this is a handler-case
(handler-case (setf (priority item-obj) new-priority)
(error () (smart-redirect (referer *REQUEST*) "/objectives")))
;; Set session message for successs/failure
;; TODO: Set session message for successs/failure
(action-item-set-priority item-obj old-priority)
(smart-redirect (referer *REQUEST*) "/objectives")))
... ... @@ -155,6 +162,9 @@ Param 1+: Any parameter that is an integer will be selected as
(in-status-types '())
(ex-status-types '())
(h-title "Filtered Objectives List"))
(no-cache)
(setf uri-params (parse-uri-params (request-uri* *REQUEST*)))
(setf status-types (action-item-status-types-list-all))
(dolist (sti status-types)
... ... @@ -300,10 +310,9 @@ Param 1+: Any parameter that is an integer will be selected as
(redirect (format nil "/objective/~A/view" item-id))))
(defun project-text-summary-page ()
(defun action-items-text-summary-page ()
(let ((item-list))
(setf item-list (action-items-build-select nil nil '("complete")))
(setf item-list (action-items-list-tree-by-root 0))
(action-items-list-text-view item-list)))
(defun action-item-set-status-data ()
... ...
... ... @@ -44,7 +44,7 @@
(create-regex-dispatcher "/objectives/.*" 'action-items-list-filter-page)
(create-prefix-dispatcher "/objective/new" 'action-item-create-page)
(create-prefix-dispatcher "/objective/add" 'action-item-create-data)
(create-prefix-dispatcher "/objectives/report" 'action-item-text-summary-page)
(create-prefix-dispatcher "/objectives/report" 'action-items-text-summary-page)
;; Regex dispatchers
(create-regex-dispatcher "/objective/(-?\\d+)" 'action-item-view-redirect)
... ...
... ... @@ -39,18 +39,33 @@
(if (eq status :custom)
(htm (:li (:strong "Filtered")))))))
(defun action-items-list-nested-text-view (item-list &optional (root 0) (depth 0))
(defun action-items-list-nested-text-view (the-list &optional (root 0) (depth 0))
(let ((this-list '())
(the-list-new '()))))
(the-list-new '()))
(dolist (item the-list)
(if (eq root (parent-id item))
(push item this-list)
(push item the-list-new)))
;; This would be obsolete if I could get the query's ORDER BY correct
(setf this-list (sort this-list #'< :key 'priority))
(with-html-output-to-string (*standard-output* nil :indent t)
(htm
(dolist (item this-list)
(fmt "~v@{~A~:*~}~A~A. ~A~&" depth " " (priority item) (name item))
(fmt "~A"
(action-items-list-nested-text-view
the-list-new
(id item)
(1+ depth))))))))
(defun action-items-list-text-view (item-list)
(standard-page
(:title "Activity summary")
(:pre
(dolist (project proj-list)
(fmt "~%~A. ~A~%" (priority project) (name project))
(dolist (task (tasks project))
(fmt " - ~A~%" (name task)))))))
(fmt "~A" (action-items-list-nested-text-view item-list)))))
(defun action-items-list-nested-view (the-list status-list &optional (root 0))
(let ((this-list '())
... ...