Implementing audits...

Implementing audits...

luisrortegaluisrortega Posts: 79Questions: 6Answers: 1
edited January 2014 in Editor
hi,

I'm looking to implement record audits... the idea is to have a side table that display's a description of what changed on the last updates. However I noticed that the 'Update' command on the edit sends all fields, even if only was changed.

Post data
[code]
{"action":"edit","table":"","id":"row_10008","data":{"itemtype":"5","product":"28","title":"Wrap home into table (for proper page div)","description":"Using Divs are not resizing appropiately...","devNotes":"","testNotes":"","customer":"","reportedby":"-1","assignedto":"-1","testedby":"-1","priority":"3","status":"28"}}
[/code]

I guess i can 'reselect' from table and compare field by field, but I wonder if there is a way to tell the editor to only send changed fields... Or maybe a way to trap changes on the php side...

Also, I'm not sure why the "table" field is not passed, did I forgot to populate any property?

Any suggestion is welcome!

Tks,
Luis

Replies

  • allanallan Posts: 63,531Questions: 1Answers: 10,474 Site admin
    > I wonder if there is a way to tell the editor to only send changed fields...

    Currently no - Editor is a row based editor, so the entire row data is sent. If you want to see what data has changed, you would need to do a diff on the server, getting the old data and comparing to the new. You could possibly also have the client send the old data using the onPreSubmit event to add extra information to the data being sent, but it would still need the server to do the diff most likely.

    > Also, I'm not sure why the "table" field is not passed, did I forgot to populate any property?

    No - you can safely ignore that! Its an old parameter than is there for backwards compatibility. I'll be removing it in 1.3 I think.

    Regards,
    Allan
This discussion has been closed.