21492 Posts in 5783 Topics by 2621 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 247 Views |
-
Save the member on editing a dataobject

1 March 2012 at 3:24am Last edited: 1 March 2012 3:34am
Hi and Hello.
I've got a dataobject (projects) on a webpage. And there are a bunch of editors allowed to edit this dataobjects. My client want to see, which single dataobject item is edited by which editor (currentMember). So what i need is a startingpoint (or a simple tutorial) to get this problem solved.
It is neccesary to use a hook like onBeforeWrite()? Is there something like "lasteditedby"?I guess its a simple task but i dont got a clue where to start. Thanks a lot, Pipifix
-
Re: Save the member on editing a dataobject

1 March 2012 at 6:39am
hi
you can add a new field to the dataobject, for example "lasteditby"
and then set a value for it with onBeforeWrite()
function onBeforeWrite() {
if( $member = Member::currentUser() ) {
$this->lasteditby = $member->ID;
}
parent::onBeforeWrite();}
dont tested this, but should point to right direction...
-
Re: Save the member on editing a dataobject

1 March 2012 at 10:59pm
Hi danzzz
Thanks for your response. I'll give it a try.
Pipifix
| 247 Views | ||
|
Page:
1
|
Go to Top |


