"Field Visibility" Extension Help

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
cavemanharris
User
Posts: 21

"Field Visibility" Extension Help

Post by cavemanharris »

Does anyone have any more information on the extension ?

only 4 places it is mentioned in Help and not much help with the "whats new notes" either.

Screenshot or help on what needs to be done on the second screen for Field Visibility fields

What happens here I can figure out.

What needs to be done?


Webmaster
User
Posts: 9425

Post by Webmaster »

As said in Tools -> Extensions of the help file, before using any extension, read the notes. As explained in the notes:

IMPORTANT NOTES:

  1. This extension only sets the Visible property according to your settings. Be careful that hiding a field may break server side or client side code.
  2. The settings in this extension may be overridden by server events which also set the Visible property of the field.

Table Setting:
Permission Type - Possile values are: "bool", "userid", or "userlevel".

Field Setting:

  • The setting must be a valid PHP expression,
  • If Permission Type is "bool", value should be 1 or 0 or boolean,
  • If Permission Type is "userid", data type of value should be same as the User ID field,
    the value can be a single value, comma separated values, or array.
  • If Permission Type is "userlevel", data type of value must be integer,
    the value can be a single value, comma separated values or array of integer.
  • Complex permission type is supported, the value must be a valid JSON object, e.g.
    { "bool": <xxx>, "userid": <yyy>, "userlevel": <zzz> }
    If JSON object is detected, the table level Permission Type setting will be ignored.

cavemanharris
User
Posts: 21

Post by cavemanharris »

Thank you!

it works!


bioaroma
User
Posts: 24

Post by bioaroma »

I did test "Field Visibility extension of a mysql table and is not working for all fields.
For example I have table A and filed visibility type userlevel

For field 'name' I put userlevel -1 (Administrator) and I see the field name only if I am logged in as Administrator
I did the same for field "customer_id" which is integer and I am able so see the field "customer_id" both as normal user and as administrator
so field is visible for every user
I am not doing something properly?


kirondedshem
User
Posts: 642

Post by kirondedshem »

I know the filed visibility extension works but I always go with setting the Visible on page_load manually as I can sorround it with as much logic and if statements as i want.
So if you still cant get it right just set it manually eg just put this in page_load event of page you want.
// Page Load event
function Page_Load() {
//echo "Page Load";
// if(condition)
$this->customer_id->Visible = FALSE;
}


Post Reply