I am looking for some code to help lock a row once a certain selection is selected from a drop down.
My drop down is if called REPORT_STATUS.
There are 4 selection options; REPORT IN PROGRESS, SUBMITTED OF REVIEW, EDITS NEEDED, APPROVED.
THERE ARE TWO WORKING GROUPS IN MY APP; OFFICER AND SUPERVISOR.
OFFICER will be doing 99.9% of entering data and will be selecting these three options only for report status; REPORT IN PROGRESS, SUBMITTED OF REVIEW, EDITS NEEDED. Once the supervisor reads the report and thinks it complete, they will mark the report status as "APPROVED". This is when I want the row to be locked out from "Officer" to only have (Read-Only) access. Basically removing Edit/Delete access to the record.
I could use code help and where to insert it.
Any help would be great!
locking row of data need some help
Re: locking row of data need some help
Hi,
you also may check if the APPROVED has been set in the /hooks/tablename.php -> before_update function. If it is set, you return FALSE from that function and any further updates will fail. Of course you can make this dependent on your usergroup as well (thus the supervisor may still edit the record).
Olaf
you also may check if the APPROVED has been set in the /hooks/tablename.php -> before_update function. If it is set, you return FALSE from that function and any further updates will fail. Of course you can make this dependent on your usergroup as well (thus the supervisor may still edit the record).
Olaf
Some postings I was involved, you might find useful:
SingleEdit - Prevent concurrent edits on records; Field Permissions; Column-Value-Based-Permissions; Custom (error) message; Audit Log; Backup your database; Two Factor Authentication; Block brute force (failed) logins; Add 2nd SAVE CHANGES button; Place a search on details view
SingleEdit - Prevent concurrent edits on records; Field Permissions; Column-Value-Based-Permissions; Custom (error) message; Audit Log; Backup your database; Two Factor Authentication; Block brute force (failed) logins; Add 2nd SAVE CHANGES button; Place a search on details view
Re: locking row of data need some help
Olaf, any example of said code for function would be much appreciated. Your help is much needed.
Re: locking row of data need some help
Some postings I was involved, you might find useful:
SingleEdit - Prevent concurrent edits on records; Field Permissions; Column-Value-Based-Permissions; Custom (error) message; Audit Log; Backup your database; Two Factor Authentication; Block brute force (failed) logins; Add 2nd SAVE CHANGES button; Place a search on details view
SingleEdit - Prevent concurrent edits on records; Field Permissions; Column-Value-Based-Permissions; Custom (error) message; Audit Log; Backup your database; Two Factor Authentication; Block brute force (failed) logins; Add 2nd SAVE CHANGES button; Place a search on details view