Invoice show worklog description

bubbasan - August 23, 2006 - 19:35
Project:Worklog
Version:4.7.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

Is there anyway to show descriptions from worklog's in the worklog invoice view. I took a look at the custom worklog_views_default_views, but I don't know enough about views to show a second row with the description (or if it is even possible for that matter). Would a custom table be the only way?

#1

Dave Cohen - August 23, 2006 - 21:59

worklog provides a default view called worklog_invoice. Go to administer >> views and find the 'add' link to modify it. Change it from a table view to a teaser list, and then teasers of each worklog entry will be shown.

The views module is very flexible, so there's a lot you can do here to customize the invoice view.

There's also a hook_worklog, which you can implement in your own module, if you need custom code to modify the header or footer of the invoice (which appears before and after the embedded view). I use this to grab the address of the client. I already have that stored in another node, so I grab the contents of that node based on the client vocabulary term associated with the invoice. That's a bit more involved to do, but I did it that way because I did not want to retype addresses into each invoice. There may be a better mechanism but I'm not sure what it is.

And BTW, I'm not ignoring your worklog.install patch. I appreciate it, but haven't gotten around to checking in.

#2

bubbasan - August 24, 2006 - 00:08

Thanks for the fast responce. I tried out adding a custom variation of the worklog view with teaser list and lost the pretty table. I guess, for now, its one or the other. Earlier today, I edited the _worklog_invoice_view to show the worklogs as tables, but I would much rather use views because of the ordering capability and the fact that its just so pretty!

Also, I created an action that updates the workflow of a worklog(open to invoiced) when an invoice is created for it. Its actually more of an update for workflow then worklog, but the database query is specific to worklog for now.

I am working on an action to add the address (module profiles) of a user based on a particular taxonomy term. And one to move the workflow to an overdue state after a period of time. Also, on a custom printer-friendly page for invoices.

Again, thanks for the quick responce.

#3

Dave Cohen - August 24, 2006 - 07:01

I tried out adding a custom variation of the worklog view with teaser list and lost the pretty table.

If you want the table, and description (teaser) in the same view, you can customize the theme of the view. The documentation for views is somewhere on drupal.org and it will tell you how to do it.

I'm totally interested in the workflow actions you're writing. I think they belong in worklog. Send patches, please.

#4

bubbasan - August 30, 2006 - 13:31

Only way to setup custom rows for a view is to do it from the themes (template.php anyone...). I was thinking of two seperate views. One with the current info and one for descriptions only with one referencing the other. THoughts?

#5

Dave Cohen - August 30, 2006 - 15:37

Well, each row in the invoice contains a link to the worklog node, which has the description. Isn't that enough?

If not, it may still be possible to do this with the view header or something that doesn't require changing the worklog module.

 
 

Drupal is a registered trademark of Dries Buytaert.