From mboxrd@z Thu Jan 1 00:00:00 1970 From: Niels Giesen Subject: Re: lisp/org-clock.el: Add param :properties to list properties in clocktable Date: Sun, 27 Mar 2011 12:13:41 +0200 Message-ID: <87bp0w6fca.fsf@gmail.com> References: <874o6pocat.fsf@gmail.com> <87y641ehep.fsf@norang.ca> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=39903 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q3mxJ-0007j2-03 for emacs-orgmode@gnu.org; Sun, 27 Mar 2011 06:12:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q3mxH-0000UP-Gv for emacs-orgmode@gnu.org; Sun, 27 Mar 2011 06:12:20 -0400 Received: from mail-ew0-f41.google.com ([209.85.215.41]:44599) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q3mxH-0000UE-5Y for emacs-orgmode@gnu.org; Sun, 27 Mar 2011 06:12:19 -0400 Received: by ewy9 with SMTP id 9so944013ewy.0 for ; Sun, 27 Mar 2011 03:12:18 -0700 (PDT) In-Reply-To: <87y641ehep.fsf@norang.ca> (Bernt Hansen's message of "Sat, 26 Mar 2011 16:49:34 -0400") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Bernt Hansen Cc: emacs-orgmode@gnu.org Bernt Hansen writes: [...] > Could you provide a sample clock report using this patch to get a > better idea of why you find this useful? Yes, here you are, along with the contents of a sample file, so that you may get a gist of my need for inheritance. * Clocktables #+BEGIN: clocktable :maxlevel 2 :scope file :properties ("Costcenter" "Billable") :inherit-props t Clock summary at [2011-03-27 Sun 12:04] | Costcenter | Billable | Headline | Time | | |-----------------------------------+----------+---------------------------------+--------+------| | | | *Total time* | *3:08* | | |-----------------------------------+----------+---------------------------------+--------+------| | A-102: General Administration | | TODO Travel cost declaration | 0:42 | | | A-102: General Administration | | TODO December 2007-2009 | | 0:37 | | O-100: General overhead | | Making coffee for the lot of us | 0:06 | | | C-100: Customer relations general | | Helpdesk | 1:10 | | | C-100: Customer relations general | | Categorize our helpdesk e-mails | | 0:20 | | C-101: Customer A | [X] | Help out customer a | | 0:10 | | C-102: Customer B | [?] | Help out customer b on issue x | | 0:20 | | C-100: Customer relations general | | Help out potential customer c | | 0:20 | | W-100: Web Development | | Develop our main web app | 1:10 | | | W-100: Web Development | | that | | 0:41 | | C-102: Customer B | [?] | something only customer b wants | | 0:29 | #+END: Actually, my boss needs something more like the table below, which I can export to something that Outlook Times also spits out (some clocking plugin for MS Outlook that the rest of us uses, and I was supposed to use too, you may understand that that is just a silly idea for someone used to org-mode). Patches 1 and 3 allowed me to get this specific output using a custom formatter and a #+TBLFM: line, which I may post to Worg if people are interested. #+BEGIN: clocktable :formatter org-clocktable-write-outlook-times-style :maxlevel 2 :scope file :inherit-props t :properties ("Costcenter" "Billable") :date t :block day Clock summary at [2011-03-27 Sun 12:04], for Sunday, March 27, 2011. | Date | Headline | Time | Costcenter | Billable | |------------+-----------------------------------------------------------+--------+-----------------------------------+----------| | | *Total time* | *3.05* | | | |------------+-----------------------------------------------------------+--------+-----------------------------------+----------| | 27-03-2011 | TODO Travel cost declaration | 0.00 | A-102: General Administration | | | 27-03-2011 | TODO Travel cost declaration, TODO December 2007-2009 | 0.62 | A-102: General Administration | | |------------+-----------------------------------------------------------+--------+-----------------------------------+----------| | 27-03-2011 | Making coffee for the lot of us | 0.10 | O-100: General overhead | | |------------+-----------------------------------------------------------+--------+-----------------------------------+----------| | 27-03-2011 | Helpdesk | 0.00 | C-100: Customer relations general | | | 27-03-2011 | Helpdesk, Categorize our helpdesk e-mails | 0.33 | C-100: Customer relations general | | | 27-03-2011 | Helpdesk, Help out customer a | 0.17 | C-101: Customer A | [X] | | 27-03-2011 | Helpdesk, Help out customer b on issue x | 0.33 | C-102: Customer B | [?] | | 27-03-2011 | Helpdesk, Help out potential customer c | 0.33 | C-100: Customer relations general | | |------------+-----------------------------------------------------------+--------+-----------------------------------+----------| | 27-03-2011 | Develop our main web app | 0.00 | W-100: Web Development | | | 27-03-2011 | Develop our main web app, that | 0.68 | W-100: Web Development | | | 27-03-2011 | Develop our main web app, something only customer b wants | 0.48 | C-102: Customer B | [?] | #+TBLFM: $2='(if (string= "$0" "@-I") "$0" (concat "@-I" ", " "$0"));L::$4='(if (string= "$0" "") "@-I" "$0");L #+END: * TODO Travel cost declaration DEADLINE: <2011-04-01 vr .+1m> - State "DONE" from "TESTING" [2011-02-01 di 10:02] :LOGBOOK: CLOCK: [2011-03-02 wo 09:17]--[2011-03-02 wo 09:22] => 0:05 :END: - State "DONE" from "TESTING" [2011-01-04 di 09:40] :PROPERTIES: :COSTCENTER: A-102: General Administration :END: ** TODO December 2007-2009 :CLOCK: CLOCK: [2011-03-27 Sun 09:28]--[2011-03-27 Sun 10:05] => 0:37 :END: Find out what were my costs during this hazy period of my life. * Dishes :daily: :PROPERTIES: :COSTCENTER: O-100: General overhead :END: * Making coffee for the lot of us :daily: :CLOCK: CLOCK: [2011-03-27 Sun 09:22]--[2011-03-27 Sun 09:28] => 0:06 :END: :PROPERTIES: :COSTCENTER: O-100: General overhead :END: * Helpdesk :PROPERTIES: :COSTCENTER: C-100: Customer relations general :END: ** Categorize our helpdesk e-mails :daily: :CLOCK: CLOCK: [2011-03-27 Sun 10:05]--[2011-03-27 Sun 10:25] => 0:20 :END: ** Help out customer a :CLOCK: CLOCK: [2011-03-27 Sun 10:25]--[2011-03-27 Sun 10:35] => 0:10 :END: :PROPERTIES: :COSTCENTER: C-101: Customer A :BILLABLE: [X] :END: ** Help out customer b on issue x :CLOCK: CLOCK: [2011-03-27 Sun 10:35]--[2011-03-27 Sun 10:55] => 0:20 :END: :PROPERTIES: :COSTCENTER: C-102: Customer B :BILLABLE: [?] :END: ** Help out potential customer c :CLOCK: CLOCK: [2011-03-27 Sun 10:55]--[2011-03-27 Sun 11:15] => 0:20 :END: Does not yet have a cost center * Develop our main web app :PROPERTIES: :COSTCENTER: W-100: Web Development :END: ** this ** that :CLOCK: CLOCK: [2011-03-27 Sun 11:44]--[2011-03-27 Sun 12:25] => 0:45 :END: ** something only customer b wants :CLOCK: CLOCK: [2011-03-27 Sun 11:15]--[2011-03-27 Sun 11:44] => 0:29 :END: :PROPERTIES: :COSTCENTER: C-102: Customer B :BILLABLE: [?] :END: > > Thanks, -- http://pft.github.com/