emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Remaining Work Report


From: Myles English
Subject: Re: [O] Remaining Work Report
Date: Thu, 22 Mar 2012 14:33:28 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux)

Hi Sebastian,

>> On Mon, 19 Mar 2012 14:33:17 +0100, Sebastien Vauban said:

  > #+COLUMNS: %40ITEM(Task) %6Effort(Estim.){:} * Context

  > The question I'm trying to give an answer to is: *what's the
  > remaining number of hours (or days) to finish my project*?

I have just been through this myself so I hope I will be able to help.

To exclude DONE items from the columnview I moved the Effort property
out of the way to the Old_Effort property when the state changes to
DONE:

,-----------------------------------------------------------------------------------------------
| (require 'org)                                                                
                
| (defun my-move-effort-if-done ()                                              
                
|     "For TOC style columnview table.  Don't want to include DONE              
                
|   items in the TODO Effort column so copy Effort to Old_Effort                
                
|   property"                                                                   
                
|     (interactive)                                                             
                
|     ( when (string= (org-get-todo-state) "DONE")                              
                
|       (member (org-get-todo-state) org-done-keywords)                         
                
|       ;; check if changing to DONE                                            
                
|       (org-entry-put nil "Old_Effort" (org-get-effort))                       
                
|       ;; get the :Effort: property                                            
                
|       ;(message (format "Got: %s when changin to %s" ( org-get-effort ) 
(org-get-todo-state)))
|       (setq org-clock-effort (org-get-effort))                                
                
|       (org-entry-delete nil "Effort")))                                       
                
|                                                                               
                
| (setq org-after-todo-state-change-hook nil)                                   
                
|                                                                               
                
| (add-hook 'org-after-todo-state-change-hook                                   
                
|           'my-move-effort-if-done)                                            
                
`-----------------------------------------------------------------------------------------------

Unlike your example I made heavy use of inline tasks and also wanted
heading numbers instead of asterisks, so that the final table looks like
a table of contents with estimated times remaining.  I had to do some
more things to achieve this and can elaborate if you like.

Myles



reply via email to

[Prev in Thread] Current Thread [Next in Thread]