With your help, this is what I did and it works perfect.
Changed;
$grid->set_condition("context='$context' AND (owner='$extension' OR (owner<>'$extension' AND private='yes'))");
To;
$grid->set_condition("context='$context' AND (owner='$extension')");
Then it make no difference if they choose private or public. No one can see anything but their own extension phone book.
This works as well so that all records will be "yes" by default
$grid->set_default_values("private",'yes');
A future feature would be great so that each user can decide which extensions can see their visual phone book.
Comments
$grid->set_condition("context='$context' AND (owner='$extension' OR (owner<>'$extension' AND private='no'))");
You want to change it to private='yes' so only private records are shown. Then you have to force the private field to be "yes", perhaps with
$grid->set_default_values("private",'yes');
I have not tried this, but it might work.
Changed;
$grid->set_condition("context='$context' AND (owner='$extension' OR (owner<>'$extension' AND private='yes'))");
To;
$grid->set_condition("context='$context' AND (owner='$extension')");
Then it make no difference if they choose private or public. No one can see anything but their own extension phone book.
This works as well so that all records will be "yes" by default
$grid->set_default_values("private",'yes');
A future feature would be great so that each user can decide which extensions can see their visual phone book.
Thanks for the help!!!