This topic is locked

Modify behavior for locked records

2/18/2014 7:39:37 AM
PHPRunner General questions
K
kalani author

Hi All--I am trying to do two things when a user encounters a record that is locked (e.g. being edited by another user):

  1. I would like to redirect them to a different page (rather that sit on the same record page--which allows them to edit/change but not save content to that page).
  2. In addition, I would like to include the option of sending them an email when the page is released for editing (or at the very least refresh the page so that they are notified that the record is released).
    I can't see an obvious path using events, and am not even sure what variables I would need to monitor in order to change page and send email.
    Has anyone implemented something like this? Any ideas to get me started?
    Thanks,
    Kalani
    *I am pretty "rusty" as a programmer at this point--so any advice would be much appreciated!

Sergey Kornilov admin 2/18/2014

Here is a SQL query you can run to see if any specific record is locked.

select * from Project28_locking where table='Cars' and keys=1


In this example:

Project28_locking - name of the table that stores lock data

'Cars' - name of the table to be edited

1 - the value of key column that points to the record edited
If such record exists on lock table this means record is currently being locked.