This topic is locked

Dynamically Hide the totals / sums on list page

1/17/2017 5:03:06 PM
PHPRunner General questions
M
mmakis2000 author

Hi,
in the list page I display some column totals which I need to hide if the user does not belong to a certain group.
$pageObject->hideField("field_name") will not work because it will hide the whole column.
Any ideas? Or alternatively how could I hide the whole table row (the one with the totals/sums)
Thanks
Makis

lefty 1/20/2017



Hi,
in the list page I display some column totals which I need to hide if the user does not belong to a certain group.
$pageObject->hideField("field_name") will not work because it will hide the whole column.
Any ideas? Or alternatively how could I hide the whole table row (the one with the totals/sums)
Thanks
Makis



Make a custom view of this table and do not include totals or sums in this view. Then point this table in security to the certain group that cannot see. Now you have two views one for 1 group to see and one group not to see.

Right click on table and make custom view - rename - take totals out of query or page in visual editor adding second table . Then Set menu in visual editor . The group that cannot see will not see your total/sums records and other group will.

For Dynamic permissions or static . It's a little easier with static see below.
or without custom view.

Or on list page you can use if using _static permissions_you can use beforeprocessrowlist event.

something like
if ($_SESSION["AccessLevel"]!=ACCESS_LEVEL_ADMINGROUP) {
foreach($data as $fldtotals => $value) {

if ($value > 0)

$data["fldtotals"]=="";

}
} else {

}
return true;