Hello All,
Using AppGini 5.75 in and working in MyTable.php in Hooks.
I am trying to limit the ability to filter tables by position. I have added Position as memberInfo['custom'][1]. The problem I have is being able to add multiple positions. I used the code below in the function MyTable_init(&$options, $memberInfo, &$args){
if($memberInfo['custom'][1]== 'Manager'){
$options->AllowFilters=1;
}else{
$options->AllowFilters=0;
}
and tried to include multiple positions as the variables to if($memberInfo['custom'][1]== 'Manager') something like if($memberInfo['custom'][1]== 'Manager' or 'Director') and other variations. Any input is appreciated.
Show filering
Re: Show filering
Hi,
maybe you can use something like
switch($memberInfo['custom'][1]) {
case "Manager": $options->AllowFilters=1; break;
case "Director": SET OTHER OPTION; break;
default: $options->AllowFilters=0; break;
}
maybe you can use something like
switch($memberInfo['custom'][1]) {
case "Manager": $options->AllowFilters=1; break;
case "Director": SET OTHER OPTION; break;
default: $options->AllowFilters=0; break;
}
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: Show filering
Hi,
Tried the code:
switch($memberInfo['custom'][1]) {
case "Manager": $options->AllowFilters=1; break;
case "Director": SET OTHER OPTION; break;
default: $options->AllowFilters=0; break;
}
but the following error string was returned:
Parse error: syntax error, unexpected 'OPTION' (T_STRING) in C:\xampp\htdocs\project\hooks\MyTable.php Did I miss something?
Tried the code:
switch($memberInfo['custom'][1]) {
case "Manager": $options->AllowFilters=1; break;
case "Director": SET OTHER OPTION; break;
default: $options->AllowFilters=0; break;
}
but the following error string was returned:
Parse error: syntax error, unexpected 'OPTION' (T_STRING) in C:\xampp\htdocs\project\hooks\MyTable.php Did I miss something?
Re: Show filtering
BAH!
Colour me thick! I figured it out! Many thanks again!
Kevin
Colour me thick! I figured it out! Many thanks again!
Kevin