From: Hugues B. <hbe...@gy...> - 2003-04-02 20:09:23
|
Hi, Playing with triggers, it seems to me that one case is missing. Let me explain : Currently, before_update_triggers are called just before sending data to the database. It means that a user may have edited the record before the call. The user won't be able to _commit_ the changes, but there is no way to forbid record edition with current triggers. I have tables with lot of fields and want to avoid the user doing his stuff and then be notified (after clicking on the change or apply button) that he can't, and that he'll have to try again later. So, I added a [trigger][update][pre] = something.inc and hack a bit the display_record function in order to include this file _before_ the Change View. A simple (but very useful, I think) use-case is to be able to prevent the user to edit a record that is (for example) locked by another (using extra time and IP fields in the table). Sorry for bad english. I hope you'll understand what I mean. Do you want a patch and sample use ? Or am I missing something ? Hugues -- Hugues Bernard <hbe...@gy...> gynov.org |