emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Project management > Dynamic block per tag + [Babel]
@ 2010-11-22 11:21 Francesco Pizzolante
  2010-11-26 13:40 ` Christian Egli
  2010-11-28 20:40 ` Matt Lundin
  0 siblings, 2 replies; 7+ messages in thread
From: Francesco Pizzolante @ 2010-11-22 11:21 UTC (permalink / raw)
  To: mailing-list-org-mode

Hi,

I'm using Org to manage a project.

I need to output a tasks list for every of my colleagues, person per person.

I'm currently using tags to assing people to tasks (even if I'm not completely
convinced that this is the right way to go).

What I would like is to generate a dynamic block for each person with all
tasks assigned to that person. This means, list all headings with a given tag.

Could someone tell me how to do that?


I tried using Babel to output a custom report where I will be able to (not yet
done) easily filter by tag.

But I'm already blocked with such a code:

--8<---------------cut here---------------start------------->8---
#+begin_src emacs-lisp :results output
(with-output-to-string
  (org-agenda nil "a"))
#+end_src
--8<---------------cut here---------------end--------------->8---

It does not produce any output. Any idea?


Thanks,
Francesco

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode-mXXj517/zsQ@public.gmane.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Project management > Dynamic block per tag + [Babel]
  2010-11-22 11:21 Project management > Dynamic block per tag + [Babel] Francesco Pizzolante
@ 2010-11-26 13:40 ` Christian Egli
  2010-11-28 20:40 ` Matt Lundin
  1 sibling, 0 replies; 7+ messages in thread
From: Christian Egli @ 2010-11-26 13:40 UTC (permalink / raw)
  To: emacs-orgmode

Francesco Pizzolante
<fpz@missioncriticalit.com> writes:

> I'm using Org to manage a project.
>
> I need to output a tasks list for every of my colleagues, person per person.
>
> I'm currently using tags to assing people to tasks (even if I'm not completely
> convinced that this is the right way to go).

Babel is of course one way to do this. Another way would be to export
your org file to taskjuggler[1] and define a resourcereport[2] which
shows you all the resources and their tasks. The tutorial has an
example screen shot where you see a resource report[3].

Hope that helps
Christian

Footnotes: 
[1]  http://orgmode.org/worg/org-tutorials/org-taskjuggler.php
[2]  http://www.taskjuggler.org/manual-2.4.3/generating_reports_of_the_scheduled_projects.html
[3]  http://orgmode.org/worg/images/taskjuggler/resource-graph.png
-- 
Christian Egli
Swiss Library for the Blind, Visually Impaired and Print Disabled
Grubenstrasse 12, CH-8045 Zürich, Switzerland

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Project management > Dynamic block per tag + [Babel]
  2010-11-22 11:21 Project management > Dynamic block per tag + [Babel] Francesco Pizzolante
  2010-11-26 13:40 ` Christian Egli
@ 2010-11-28 20:40 ` Matt Lundin
  2010-12-09 17:03   ` Francesco Pizzolante
                     ` (2 more replies)
  1 sibling, 3 replies; 7+ messages in thread
From: Matt Lundin @ 2010-11-28 20:40 UTC (permalink / raw)
  To: Francesco Pizzolante; +Cc: mailing-list-org-mode



Francesco Pizzolante
<fpz-djc/iPCCuDYQheJpep6IedvLeJWuRmrY@public.gmane.org> writes:

> Hi,
>
> I'm using Org to manage a project.
>
> I need to output a tasks list for every of my colleagues, person per person.
>
> I'm currently using tags to assing people to tasks (even if I'm not completely
> convinced that this is the right way to go).
>
> What I would like is to generate a dynamic block for each person with all
> tasks assigned to that person. This means, list all headings with a given tag.
>
> Could someone tell me how to do that?

I'm not sure if this is what you are after, but one way is to use custom
agenda commands and then to save the agenda as a txt file:

The following pages have good information on creating block agenda with
custom commands:

http://orgmode.org/worg/org-tutorials/org-custom-agenda-commands.php
http://orgmode.org/manual/Block-agenda.html#Block-agenda

E.g., 

--8<---------------cut here---------------start------------->8---
(add-to-list 'org-agenda-custom-commands 
	     '("D" "Delegated tasks" 
	       ((tags-todo "Jenny")
		(tags-todo "Archie")
		(tags-todo "George"))))
--8<---------------cut here---------------end--------------->8---

Once you create a custom agenda command, you can simply save it as txt
by typing C-x C-w and the filename + relevant extension.

Another option is to use a babel block and org-map-entries to spit out a
simple list of tasks for each person:

--8<---------------cut here---------------start------------->8---
#+source: tasklist
#+begin_src emacs-lisp :var person="me"
  (let (tasklist)
    (org-map-entries 
     (lambda ()
       (add-to-list 'tasklist 
                    (concat "- " (nth 4 (org-heading-components)))))
     (concat person "/!TODO") 'agenda)
    (mapconcat 'identity tasklist "\n"))
#+end_src

#+call: tasklist(person="Jenny")
--8<---------------cut here---------------end--------------->8---

Add this to an org file, replace Jenny with the appropriate name, and
type C-c C-c to spit out a list (of all TODO items tagged with the
relevant name) that looks like this:

--8<---------------cut here---------------start------------->8---
#+results: tasklist(person="Jenny")
#+begin_example
- Call George
- Call Archie
- Estimate cost of widgets
--8<---------------cut here---------------end--------------->8---

You could do something similar with dynamic block function.

HTH,
Matt

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Project management > Dynamic block per tag + [Babel]
  2010-11-28 20:40 ` Matt Lundin
@ 2010-12-09 17:03   ` Francesco Pizzolante
  2010-12-16 12:19   ` Francesco Pizzolante
       [not found]   ` <87tyiw6rmg.fsf@mundaneum.com>
  2 siblings, 0 replies; 7+ messages in thread
From: Francesco Pizzolante @ 2010-12-09 17:03 UTC (permalink / raw)
  To: Matt Lundin; +Cc: mailing-list-org-mode



Hi Matt,

Thanks a lor for you answer.

I preferred your second suggestion as I can add it directly to my Org buffer:

> --8<---------------cut here---------------start------------->8---
> #+source: tasklist
> #+begin_src emacs-lisp :var person="me"
>  (let (tasklist)
>    (org-map-entries
>     (lambda ()
>       (add-to-list 'tasklist
>                    (concat "- " (nth 4 (org-heading-components)))))
>     (concat person "/!TODO") 'agenda)
>    (mapconcat 'identity tasklist "\n"))
> #+end_src
>
> #+call: tasklist(person="Jenny")
> --8<---------------cut here---------------end--------------->8---
>
> Add this to an org file, replace Jenny with the appropriate name, and
> type C-c C-c to spit out a list (of all TODO items tagged with the
> relevant name) that looks like this:
>
> --8<---------------cut here---------------start------------->8---
> #+results: tasklist(person="Jenny")
> #+begin_example
> - Call George
> - Call Archie
> - Estimate cost of widgets
> --8<---------------cut here---------------end--------------->8---

Currently you code returns todo items with the todo keyword "TODO" only.

What do I have to change in order to get all todo items with selected todo
keyword? As an example, I'd like to keep in the lists the todo items with TODO
and STARTED but not the ones marked as DONE, WAIT or NEW.

Thanks again for your help.

Regards,
Francesco

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Project management > Dynamic block per tag + [Babel]
  2010-11-28 20:40 ` Matt Lundin
  2010-12-09 17:03   ` Francesco Pizzolante
@ 2010-12-16 12:19   ` Francesco Pizzolante
  2011-01-19 15:15     ` Juan Reyero
       [not found]   ` <87tyiw6rmg.fsf@mundaneum.com>
  2 siblings, 1 reply; 7+ messages in thread
From: Francesco Pizzolante @ 2010-12-16 12:19 UTC (permalink / raw)
  To: Matt Lundin; +Cc: mailing-list-org-mode



Hi Matt,

> Another option is to use a babel block and org-map-entries to spit out a
> simple list of tasks for each person:
>
> --8<---------------cut here---------------start------------->8---
> #+source: tasklist
> #+begin_src emacs-lisp :var person="me"
>  (let (tasklist)
>    (org-map-entries
>     (lambda ()
>       (add-to-list 'tasklist
>                    (concat "- " (nth 4 (org-heading-components)))))
>     (concat person "/!TODO") 'agenda)
>    (mapconcat 'identity tasklist "\n"))
> #+end_src
>
> #+call: tasklist(person="Jenny")
> --8<---------------cut here---------------end--------------->8---
>
> Add this to an org file, replace Jenny with the appropriate name, and
> type C-c C-c to spit out a list (of all TODO items tagged with the
> relevant name) that looks like this:
>
> --8<---------------cut here---------------start------------->8---
> #+results: tasklist(person="Jenny")
> #+begin_example
> - Call George
> - Call Archie
> - Estimate cost of widgets
> --8<---------------cut here---------------end--------------->8---

Thanks a lot for your great help.

I've played a little with the code you've sent and here's what I end up with:

--8<---------------cut here---------------start------------->8---
#+source: tasklist
#+begin_src emacs-lisp :var person="FPZ" :results raw
(setq org-agenda-files (list (buffer-file-name)))
(let (tasklist)
  (add-to-list 'tasklist "|<c>|||" t)
  (org-map-entries
   (lambda ()
     (let ((priority (nth 3 (org-heading-components))))
       (add-to-list 'tasklist
                    (concat "| *" (nth 2 (org-heading-components)) "* "
                            "|/[#" (char-to-string (if priority
priority ?B)) "]/ "
                            "| [[" (nth 4 (org-heading-components)) "]]|") t)))
   (concat person "/!TODO|STARTED|WAIT") 'agenda)
  (mapconcat 'identity tasklist "\n"))
#+end_src
--8<---------------cut here---------------end--------------->8---

This enables to get a table with a task per row. For each task, I get the TODO
keywork, the priority and a link to the corresponding section in my Org
buffer.

Here'a an example from one of my document:
--8<---------------cut here---------------start------------->8---
#+results: tasklist
| <c>       |        |
                                 |
| *WAIT*    | /[#C]/ | [[See if we have to filter the processes
against something else]]                |
| *WAIT*    | /[#C]/ | [[See if we have to filter the products against
something else than the branch]] |
| *STARTED* | /[#A]/ | [[Display static party questions block]]
                                 |
| *WAIT*    | /[#C]/ | [[Analyse the risk management screen]]
                                 |
--8<---------------cut here---------------end--------------->8---

This is really great as each person can now have a quick overview of their
tasks and they just jave to click to get the details of the tasks!

The next step for me, would be to be able to sort this table against
priorities for instance.

If you think about a simple way of doing this, please let me know.

Regards,
Francesco

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Re: Project management > Dynamic block per tag + [Babel]
  2010-12-16 12:19   ` Francesco Pizzolante
@ 2011-01-19 15:15     ` Juan Reyero
  0 siblings, 0 replies; 7+ messages in thread
From: Juan Reyero @ 2011-01-19 15:15 UTC (permalink / raw)
  To: Francesco Pizzolante, mailing-list-org-mode

On Thu, Dec 16, 2010 at 1:19 PM, Francesco Pizzolante
<fpz@missioncriticalit.com> wrote:
> > Another option is to use a babel block and org-map-entries to spit out a
> > simple list of tasks for each person:
> I've played a little with the code you've sent and here's what I end up with:
>
> --8<---------------cut here---------------start------------->8---
> #+source: tasklist
> #+begin_src emacs-lisp :var person="FPZ" :results raw
> (setq org-agenda-files (list (buffer-file-name)))
> (let (tasklist)
>  (add-to-list 'tasklist "|<c>|||" t)
>  (org-map-entries
>   (lambda ()
>     (let ((priority (nth 3 (org-heading-components))))
>       (add-to-list 'tasklist
>                    (concat "| *" (nth 2 (org-heading-components)) "* "
>                            "|/[#" (char-to-string (if priority
> priority ?B)) "]/ "
>                            "| [[" (nth 4 (org-heading-components)) "]]|") t)))
>   (concat person "/!TODO|STARTED|WAIT") 'agenda)
>  (mapconcat 'identity tasklist "\n"))
> #+end_src
> --8<---------------cut here---------------end--------------->8---
>
> The next step for me, would be to be able to sort this table against
> priorities for instance.
>
> If you think about a simple way of doing this, please let me know.

I had the same problem, and tweaking your code (I think org-mode
doesn't like the modification of org-agenda-files) this is what I've
ended up with:

(defun tasks-with-tag (person &optional scope)
  (let ((tasklist ()))
    (org-map-entries
     (lambda ()
       (let ((priority (nth 3 (org-heading-components))))
         (add-to-list 'tasklist
                      (list (if priority (char-to-string priority) "C")
                            (concat "[[" (nth 4 (org-heading-components)) "]]"))
                      t)))
         (concat person "/!TASK") scope)
    (sort tasklist (lambda (f s)
                     (string-lessp (car f) (car s))))))

The output is sorted and makes a nice table.  Scope is passed directly
to org-map-entries, so if you leave it out the scope will be the
current buffer.

Greetings,

jm
--
http://juanreyero.com/
http://alandair.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Re: Project management > Dynamic block per tag + [Babel]
       [not found]   ` <87tyiw6rmg.fsf@mundaneum.com>
@ 2011-01-28 15:57     ` Matt Lundin
  0 siblings, 0 replies; 7+ messages in thread
From: Matt Lundin @ 2011-01-28 15:57 UTC (permalink / raw)
  To: Francesco Pizzolante; +Cc: mailing-list-org-mode



Hi Francesco,

Sorry for the delay in responding...

Francesco Pizzolante <fpz@missioncriticalit.com> writes:

> It seems to work at first sight, but when I try C-c C-v e on this line
> "#+call: tasklist(person="me") :exports results" then the end of my buffer
> gets modified this way:
>
> #+call: tasklist(person="me") :exports results
>
> #+results: tasklist(person="me")
> #+begin_example
> - Lui écrire un mail
> - Tester le bout de code de mon élève
>
>
> ** For Jenny
>
> #+end_example
> #+call: tasklist(person="me") :exports results
>
> #+results: tasklist(person="Jenny")
> #+begin_example
> - Voir si le pantalon lui va bien
> - Appeler Georges
> #+end_example
>
> Which is a complete mess...

Could you please explain what is a complete mess above? The lack of an
enclosing comment block? You can tweak the way in which the results are
placed in the buffer by modifying the :results header. For
instance, :results raw will simply spit out an unadorned org-mode list.

(info "(org) results")

Best,
Matt

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-01-28 15:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-22 11:21 Project management > Dynamic block per tag + [Babel] Francesco Pizzolante
2010-11-26 13:40 ` Christian Egli
2010-11-28 20:40 ` Matt Lundin
2010-12-09 17:03   ` Francesco Pizzolante
2010-12-16 12:19   ` Francesco Pizzolante
2011-01-19 15:15     ` Juan Reyero
     [not found]   ` <87tyiw6rmg.fsf@mundaneum.com>
2011-01-28 15:57     ` Matt Lundin

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).