This topic is locked

Inline Edit - events, and disabling

7/24/2013 11:23:40 AM
PHPRunner General questions
M
mattd1 author

I have some invoices that will get posted in a batch process. The user would "authorise" the customer, and from that point, what's specified in the customer invoices can no longer be edited (they can "unauthorise" and then edit - only authorised ones will get posted in batch).
So, whilst the customer is "not authorised" the edit function is valid on the customer invoice rows. I am doing a simple master-detail (cust-custinv). But, if the cust is "authorised", then the user must no be able to edit.
I still want them to be able to see the invoices for the customer though.
How can I do that?
And, when in inline edit mode, where do I position validation processing - where are the events e.g. before update?
Thanks a lot!
Matt

N
nohope4you 7/30/2013

One way would be to add in your Before Display code to check the status of an invoice. if it was meeting a condition that you didn't want them to be able to edit it, have the header('Location: view.php'); run, otherwise proceed. no one can then access the edit page on anything thats not marked as you wanted it.
To get started, go to the events area, right click before display, and hit add action, then select 'check if specific record exists'. modify that to see if that record number has a status of unauthorized, if it does put header('location: view.php?editid1='.$value[editid]); and if not, leave the area blank



I have some invoices that will get posted in a batch process. The user would "authorise" the customer, and from that point, what's specified in the customer invoices can no longer be edited (they can "unauthorise" and then edit - only authorised ones will get posted in batch).
So, whilst the customer is "not authorised" the edit function is valid on the customer invoice rows. I am doing a simple master-detail (cust-custinv). But, if the cust is "authorised", then the user must no be able to edit.
I still want them to be able to see the invoices for the customer though.
How can I do that?
And, when in inline edit mode, where do I position validation processing - where are the events e.g. before update?
Thanks a lot!
Matt