Take the 2-minute tour ×
ExpressionEngine® Answers is a question and answer site for administrators, end users, developers and designers for ExpressionEngine® CMS. It's 100% free, no registration required.

I'm building a basic CRM system based on channel entries and SafeCracker forms for a client extranet. The client is asking me if it's possible to view a 'system notes/audit trail' for each entry so they can keep track of who has edited a channel entry and what they edited.

I've told them we can enable channel entry versioning, but this only lets them see the date/time and author of changes at a glance, and you have to manually re-load a version and compare it to another to see what has changed.

So my question is, is there another way to show some sort of audit trail of edits made to specific fields within ExpressionEngine? If so, how?

Using the built-in versioning is my worse case scenario, but it seems limited in how you view them at a glance. A slightly better (albeit, hacky) idea is to have a custom script that would compare entry versions between two versions, in order to list out the exact changes between them, but I'm hoping that there's a better solution out there again that someone has implemented before.

share|improve this question
1  
You know, I think you're on the right path. There isn't an existing solution (that I know of) and you're right about the obstacles in viewing the changes. Were it me, I'd create an extension to replace the existing versioning entirely and replicate the channel_data structure. –  Eric Lamb Nov 30 '12 at 19:17
    
Thanks Eric, and good to know my ideas don't sound a million miles away from something that could work. I'm keen to hook onto the native entry versioning if there's no existing solution around so I'm hopeful I can do something along these lines. –  Stephen Dec 1 '12 at 0:25
    
One other idea I've just remembered is the Continuum add-on. Although it doesn't do what I want out the box, the potential is there for it to be extended into something like I'm looking for. –  Stephen Dec 1 '12 at 0:29

1 Answer 1

up vote 3 down vote accepted

How about this: Because you are using Safecracker, you can have each new edit be actually submitted as a new entry, with the old entry_id saved in a field called original_entry_id. Then set the status of that entry to "Old" or "Audit" or something like that.

I certainly think it's not the most efficient way to store versioning data in EE, and your control panel edit screen will end up with, potentially, a LOT of entries. On the other hand, it's pretty easy to implement, it saves ALL the entries in a way that you can easily filter and compare, and you could periodically clean out the old audit entries by the "Audit" status, or move them out to a separate table if it got to be a big issue.

Meanwhile, the site would go on showing the live entries and the client would be happy.

Only catch I can immediately see is the url_title; you'd also have to change the url_title of the "Audit" versions, perhaps to something like url_title_entry_id. There'd also be an issue with any tracker data, comments, or other data attached to the entries -- but categories, tags, author, stuff like that would come through perfectly.

share|improve this answer
    
Thanks for the idea, Travis. I hadn't even thought of this, but it's definitely something worth considering. Between this, and hooking onto the native entry versioning, I think I should be able to to do something a bit nicer than the existing Versioning views that EE provides. –  Stephen Dec 1 '12 at 0:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.