This topic is locked

Limit who can fill out field

10/27/2011 3:46:05 PM
PHPRunner General questions
J
jkeagle13 author

Hello,
I am using PHPRunner 5.2. I have an internal purchase order form I am creating for our employees. They go in and fill out the details. I then want to have an administrator who can go in and approve or disapprove.
I thought what I would do is have a drop-down for approved that has Yes or No as options. I want the employees to be able to view this as read-only but not change it, so they can go back and check if their purchase order was approved. When the administrator logs on, I want him to be able to change this to Yes or No based on his decision.
I thought the best way to do this would be have a field that only administrators can edit. How would I go about making it read-only to everyone but administrators for a certain field?
Is there a more elegant solution that I am overlooking to this problem?
Thank you,

Joseph Irvine

C
cgphp 10/27/2011

Create an alias for the dropdown field and set it as readonly. When the page is accessed by an administrator show the dropdown field and hide the readonly field, when the page is requested by an employee show the readonly field and hide the dropdown field. Check this article: http://xlinesoft.com/phprunner/docs/hide_controls_on_add_edit_pages.htm

B
bussb 11/2/2011



Create an alias for the dropdown field and set it as readonly. When the page is accessed by an administrator show the dropdown field and hide the readonly field, when the page is requested by an employee show the readonly field and hide the dropdown field. Check this article: http://xlinesoft.com/phprunner/docs/hide_controls_on_add_edit_pages.htm


Cristian's solution is very elegant and simple if there is just one field. However, lets say you have a Purchase Order and you want the submitter to fill out the first 5 fields related to the request, the finance person to review and approve, and the buyer to assign a supplier name to it, you will want to have them each viewing a screen with only certain fields editable and certain fields read only. For this you would create a "Custom View" in the tables screen of PHPRunner.
PORequestorView

POFinanceView

POBuyerView
Once you have these, then its simply a matter of making the appropriate fields read only or editable and assigning your users to groups. Then some groups get to see the requestor screen, the buyer group gets to see the buyer view, and the finance group users get to see the finanace screen.
I've done many examples of this, contact me if you want to meet via Skype and I can show you examples.

B
bussb 11/2/2011

Let me Clarify, Cristian's solution will work for not just one field, but multiple. However, if you have many fields you want to toggle visibility or access rights too, creating custom views is I believe faster.