I have made a standard crud application for club membership, no hooks.
I need that club members update their records on their own, but after the club administrator freezes the records, then the club members cannot update or delete those records. I can't figure out how to get that done. Any ideas will be appreciated.
Approval of records
Re: Approval of records
Check if user is admin and change record owner in HOOK after_update
Something like:
This way the user can edit the record as many times as he wants, but once ADMIN saves the record, owner will be changed and the user no longer can edit the record.
Also read this topic:
http://forums.appgini.com/phpbb/viewtopic.php?t=62#p115
Something like:
Code: Select all
$username=$memberInfo['username'];
if ($username = 'admin'){
sql("UPDATE membership_userrecords SET memberID='new_member' WHERE tableName='tablename' AND pkValue='{$data['selectedID']}'")
}
Also read this topic:
http://forums.appgini.com/phpbb/viewtopic.php?t=62#p115
AppGini 22.14 - xampp 3.3.0 - PHP 7.4.30 - Summary reports - Calendar - Mass update - Messages - AppGiniHelper
Re: Approval of records
Bu the way in AppGini 5.5 Admin can simply change owner manually from the record itself.
This will do the trick without any programing.
This will do the trick without any programing.
AppGini 22.14 - xampp 3.3.0 - PHP 7.4.30 - Summary reports - Calendar - Mass update - Messages - AppGiniHelper
Re: Approval of records
This is very useful. Thank you very much. Is there a way we can filter records by owner id? If that's possible then we have a workflow almost ready in action.
Re: Approval of records
Sure, but will require some programing (a query on membership_userrecords would return current Owner)
These links will help you understand filters:
http://bigprof.com/appgini/tips-and-tut ... ult-filter
http://bigprof.com/appgini/tips-and-tut ... ers/part-1
These links will help you understand filters:
http://bigprof.com/appgini/tips-and-tut ... ult-filter
http://bigprof.com/appgini/tips-and-tut ... ers/part-1
AppGini 22.14 - xampp 3.3.0 - PHP 7.4.30 - Summary reports - Calendar - Mass update - Messages - AppGiniHelper