I don't think it has been attempted yet - at least not to my knowledge.
You have two options:
Use an append only database and just roll back as required
Store the information that was changed in a set of variables (or an array if you want multi-level undo) which will give you the ability to send a new request to reset it to the old data.
Where it gets interesting is considering the concurrency of multiple users and sessions. You would presumably only want to undo the last change for that session - or possibly even that browser window.
This retains the current user's previous state (all edits by timestamp)
An undo function might not even depend on a session. A single inline edit could be undone.
If anyone wants to write the undo portion - I hope they post it.
I plan to do this in about 60 days, and will post if no one else has offered a solution
The code above creates a historical record of all changes, who made the change, and when the change occurred. It establishes an audit-able trail of changes. How to report on this is left as an exercise for the user (meaning I have not figure that out yet )
I'm about to tackle this project with the array-based solution, storing row edits as they are triggered. We'll see how this plays out, thanks for the sample of code!
Answers
I don't think it has been attempted yet - at least not to my knowledge.
You have two options:
Where it gets interesting is considering the concurrency of multiple users and sessions. You would presumably only want to undo the last change for that session - or possibly even that browser window.
Allan
Allan,
I am considering how to do this. In the PHP side:
.
.
.
This retains the current user's previous state (all edits by timestamp)
An undo function might not even depend on a session. A single inline edit could be undone.
If anyone wants to write the undo portion - I hope they post it.
I plan to do this in about 60 days, and will post if no one else has offered a solution
The code above creates a historical record of all changes, who made the change, and when the change occurred. It establishes an audit-able trail of changes. How to report on this is left as an exercise for the user (meaning I have not figure that out yet )
Thanks for sharing this, its an interesting issue. I can't promise to look into it myself, but if I have time I will do so.
Allan
I wish I could add to this work! An undo feature would be an excellent addition to Editor.
Agreed!
I'm about to tackle this project with the array-based solution, storing row edits as they are triggered. We'll see how this plays out, thanks for the sample of code!