Actually we implemented this idea several years ago in our issue tracker (one we use at Intechnic).
There it was done as a safety measure against accidental deletion. Then in each page with a list of items (only, when user had special permission) checkbox "Show Deleted" (unchecked by default) was displayed.
When enabled records, that were deleted before (in this list only) were displayed and even were available for editing.
Following this idea we can:
- Create "Delete Button Behavior" setting with these values: "Delete immediately" / "Hide from list" / "Hide from list and delete later automatically"
- Add "advanced:show_deleted" permission to each section and if user have it, then show "[ ] Show Deleted" checkbox above the lists. Clicking on a checkbox would toggle deleted record display.
Note that setting is called "Delete Button Behavior" and this means, that items won't be deleted instantly and will obey this setting only if user is deleting them via Front-End/Admin Console. If item is being deleted internally via direct call to kDBItem::Delete method, then of course it will be instantly deleted.
Delete Button Behavior in depth:
- Delete immediately - item is deleted instantly after "Delete" button in the list is pressed (as it works right now)
- Hide from list - will mark item as deleted and hide it from list (user with "advanced:show_deleted" in that list still will be able to see that item if "Show Deleted" checkbox is checked).
- Hide from list and delete later automatically - same as "Hide from list", but this time a scheduled task will delete records marked for deletion as it see fit.
What isn't obvious, but would be good to have too:
- Restore of deleted items. When "Show Deleted" mode enabled item should be visible and by selecting it and pressing new "Restore" toolbar button (or "restore" link somewhere in that record) would revive it and all related records (e.g. images, custom data).
- Prevent any operations on deleted item and force user to restore it first. Deleting item just to be able to modify it isn't good idea.
- Mode, when you only see deleted items (not real + deleted as I've explained before). This is sort of "Recycle Bin" emulation for Windows. Converting "Show Deleted" checkbox into more complex control (like adding 2nd checkbox "Show Not Deleted" or even transforming both checkboxes into dropdown) isn't good idea.