Mar 2nd, 2009, 11:26 AM
Tricky one... Mostly it's a question of how to manage the permissions to ensure that only the person who created the submission can delete it. I think your best bet it to stick with the Submission Accounts module, like you suggested.
Here's one solution (in brief):
1. after creating your form, create a new "Delete Account" field, with two options: Yes & No. Set it to "No" by default (this can be done by just passing a hidden field in your form with that value).
2. Assign the field to whatever View is used by the Submission Accounts module for your form. Now when the user can log in through the Submission Accounts module, they'd see the "Delete Account" field, which they can set to "Yes" if they want.
3. Create a new View for you, the administrator. Give it one filter: "Delete Account" => "Yes". Whenever you log in, select the View. That'll show all submissions that are slated for deletion. Select 'em all and delete 'em.
Perfect? Nope! But workable.
Another solution would be to again use the Submission Pre-Parser module. This time, create a Rule to act on the "Update Submission" event. For the PHP, it would check the value of the Delete Account field. If set to Yes, it would delete the actual submission then redirect the user somewhere. If you're interested in doing this one, let me know and I'll explain it more fully.
- Ben
Here's one solution (in brief):
1. after creating your form, create a new "Delete Account" field, with two options: Yes & No. Set it to "No" by default (this can be done by just passing a hidden field in your form with that value).
2. Assign the field to whatever View is used by the Submission Accounts module for your form. Now when the user can log in through the Submission Accounts module, they'd see the "Delete Account" field, which they can set to "Yes" if they want.
3. Create a new View for you, the administrator. Give it one filter: "Delete Account" => "Yes". Whenever you log in, select the View. That'll show all submissions that are slated for deletion. Select 'em all and delete 'em.
Perfect? Nope! But workable.
Another solution would be to again use the Submission Pre-Parser module. This time, create a Rule to act on the "Update Submission" event. For the PHP, it would check the value of the Delete Account field. If set to Yes, it would delete the actual submission then redirect the user somewhere. If you're interested in doing this one, let me know and I'll explain it more fully.
- Ben