Best practice forum (Archived)

Add filters/columns to user data source

 
Bodo Hoenen
Add filters/columns to user data source
by Bodo Hoenen - Tuesday, 19 July 2011, 10:36 AM
 

Good day,

I would like to report on students locations using report builder, i have therefore added "country" and "city/state" columns to the user data source. I have been editing the local/reportbuilder/rb_sources/rb_source_user.php file to do so which has worked out well.

I now want to add filter options so that the report can be filtered by country and/or city and this is where i am getting stuck 

I have followed the advise given on a similar post (https://totara.community/mod/forum/discuss.php?d=16817) and looked at the documentation given on that post but cannot find what i need to do. 

this is where i believe i should be adding the filter code, could someone point me in the right direction, to add a filter for (country) and (city)

   /**
     * Creates the array of rb_filter_option objects required for $this->filteroptions
     * @return array
     */
    private function define_filteroptions() {
        $filteroptions = array();

        $this->add_user_fields_to_filters($filteroptions);
        $this->add_user_custom_fields_to_filters($filteroptions);
        $this->add_position_fields_to_filters($filteroptions);
        $this->add_manager_fields_to_filters($filteroptions);

        return $filteroptions;
    }

 

Simon Coggins
Re: Add filters/columns to user data source
by Simon Coggins - Tuesday, 19 July 2011, 12:48 PM
Group Totara

Hi Bodo,

City and country columns and filters (along with Phone, Institution, Department and Address), were added to Totara in release 1.0.16.

Just upgrade to a more recent release and they should appear under the User heading in the column and filter pulldown menus.

Simon

Bodo Hoenen
Re: Add filters/columns to user data source
by Bodo Hoenen - Tuesday, 19 July 2011, 1:39 PM
 
Thank you Simon, ill update to latest version