guyfromnola
New Member
I've been working with the following issue, to the point of pulling my hair out.
I have 3 tables - ENTITIES, CONTACTS, and REGISTRATIONS
There is a databasejoin (related data link) between ENTITIES and CONTACTS. There is also a databasejoin (related data link) between ENTITIES and REGISTRATIONS.
Each CONTACT is tied to one ENTITY. When a user logs into their profile, they have a menu link to view their list of REGISTRATIONS, and the option to add new REGISTRATIONS. However, since the user is not initiating an add from the parent table using the related data add (something admins can do, but users cannot), the row id is not included in the url and therefore does not default to the related ENTITY of the CONTACT.
I have a user plugin running that defaults the new REGISTRATION to be tied to that CONTACT. However, the database join that exists is currently rendered as a dropdown with a list of all ENTITIES. What I want to do is have that dropdown default to the ENTITY the CONTACT is tied to and make it read-only for users. The current setup is fine for administrators, but as it currently stands, a user adding a new REGISTRATION has the autonomy to adjust the entity based on selecting one from the dropdown list.
I've tried to do this through PHP eval and some other code snippets and tutorials I have found online, but nothing seems to have any effect in defaulting to the proper value from the dropdown list. I would assume that all I have to do is lookup the ENTITY value found in the CONTACT's record/profile, but I'm hitting a brick wall.
If anyone has any advice, can provide some valid code snippets, or anything insightful, I would be most grateful. Although I am not too fluent in writing the PHP snippet(s), I would imagine this is something easily done.
Thanks
I have 3 tables - ENTITIES, CONTACTS, and REGISTRATIONS
There is a databasejoin (related data link) between ENTITIES and CONTACTS. There is also a databasejoin (related data link) between ENTITIES and REGISTRATIONS.
Each CONTACT is tied to one ENTITY. When a user logs into their profile, they have a menu link to view their list of REGISTRATIONS, and the option to add new REGISTRATIONS. However, since the user is not initiating an add from the parent table using the related data add (something admins can do, but users cannot), the row id is not included in the url and therefore does not default to the related ENTITY of the CONTACT.
I have a user plugin running that defaults the new REGISTRATION to be tied to that CONTACT. However, the database join that exists is currently rendered as a dropdown with a list of all ENTITIES. What I want to do is have that dropdown default to the ENTITY the CONTACT is tied to and make it read-only for users. The current setup is fine for administrators, but as it currently stands, a user adding a new REGISTRATION has the autonomy to adjust the entity based on selecting one from the dropdown list.
I've tried to do this through PHP eval and some other code snippets and tutorials I have found online, but nothing seems to have any effect in defaulting to the proper value from the dropdown list. I would assume that all I have to do is lookup the ENTITY value found in the CONTACT's record/profile, but I'm hitting a brick wall.
If anyone has any advice, can provide some valid code snippets, or anything insightful, I would be most grateful. Although I am not too fluent in writing the PHP snippet(s), I would imagine this is something easily done.
Thanks