Steve ,
The point that you have raised is a valid point to consider.
So now I think of a solution :
==> The solution is in the form of jquery. The problem as we know is that what happen when the user has not edited the form and is going away so the trigger after_action_edit will
not fire and thus the record will remain in locked condition.
==> so to handle this situation I am going away from the traditional method of "after_action_edit" trigger and coding my own trigger for this in jquery.
As for example if the user entered a record in edit mode, a jquery function will trap the address bar URL. and check for it changes. The time the user moves out from
the edit form we will execute a ajax request to change the record lock condition .
for example:
function block__before_edit_record_form(){
echo "
<script type='text/javascript'>
$(window).bind('beforeunload',function(){ // this function will fire when page unloads
//Here you can place your ajax call to amend lock variable
});
</script>";
}
The suggestion of storing '0' or '1' is experimental and as you have said we can very well add name of the user, timestamp, ip address etc in the field.
So it is for the developer to decide.
-- Hope it helps.
-- samhans