Date index for Mar 2003


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

Re: [achievo] PostAdd -> PostEdit for project class



Pietro Ravasio wrote:
I'd like to extend project class to be able to send an email to everybody is involved in the project whenever this project is created, updated or deleted (I've already added a "team" associated with the project)

I was thinking to "copy" from todo node and use PostAdd, PostUpdate and PostDel, but I've got a problem with them since, for instance, PostAdd is called after the first insertion into the db of only the "name" of the project (then the dispatcher calls an edit action on it), and since there's not a "PostEdit" function in AtkNode class... Is there a way to override the moment in wich PostAdd is called? (the problem is that $rec is void after "add" action on a project, since it contains only the name)

If I understand you correctly the team gets associated in the edit form and not in the add form? That probably means the team n:1 relation has probably the flag AF_HIDE_EDIT, right? So why don't you change that, and let the user directly associate the project with a certain team when creating a new project? This makes it possible to use the postAdd method because the team information will be available then.


If for some reason this is not what you want (or is impossible for your situation), use the postUpdate(...) method. Like you said, this method *does* exists and is called after editing (ans saving) a record.

Regards,

Peter



http://www.achievo.org/lists achievo.org - ©1999-2002 ibuildings.nl BV