• Home
  • How-To
  • Dealing with very large registered user base

How-To

Dealing with very large registered user base

ABPro has 2 screens that populate lists with all registered users so you can choose one. 

The screens are:

Staff Booking screen - registered users are in a drop down list for the staff member to choose which customer they are booking for.

Resource setup screen - assignment of resource admin, so any user can be made a resource administrator.

Putting all users in a list can be problematic for very large user bases. In extreme cases it can case 'Out of Memory' errors and the screens fail to open. ABPro has been tested with 4000 users and the screen operate fine, a customer with 8000 users reported failure.

Staff Booking screen

## UPDATE ##
As of ABPro 2.0.5 and 3.0, the drop down is not displayed if there are more than 100 registered users, the operator would use the Search function to locate the desired user.

As of ABPro 2.0.4, the staff booking screen has a 'Search' function that allows you to find a specific user in the large list. If you have so many users that you are encountering 'Out of Memory' errors you will need to limit the list
One way to do that is by adding a condition to the query that will filter out very old user accounts. 
Edit file: \com_rsappt_pro2\views\front_desk\tmpl\default.php

Around line 270 look for:
// get users
$sql = 'SELECT id,name FROM #__users WHERE block = 0 order by name';

Add a condition to the query like..
// get users
$sql = 'SELECT id,name FROM #__users WHERE block = 0 AND registerDate > "2010-01-01" order by name';

 

Resource setup screen

ABPro offers te ability for any user to be assigned as a resource administrator.

If you have a large user base you will need to limit the list. One way is to create a Joomla Group and add the users that you want to be resource admins, to that group. Then filter the list to only show people in the new group.

Example:
Create a new Joomla users Group called 'ABPro Admins'.

 

Assign user(s) to it..

 

 

Now modify the query that populates the drop down list..

Edit file: 
\administrator\components\com_rsappt_pro2\views\resources_detail\tmpl\form.php 

Around line 28 look for:
// get data for dropdowns
$database = &JFactory::getDBO();
$database->setQuery("SELECT * FROM #__users ORDER BY name" );

 

Change to:
// get data for dropdowns
$database = &JFactory::getDBO();
//
$database->setQuery("SELECT * FROM #__users ORDER BY name" );
$sql = "SELECT #__users.* FROM #__user_usergroup_map ".
" INNER JOIN #__users ON #__user_usergroup_map.user_id = #__users.id ".
" INNER JOIN #__usergroups ON #__user_usergroup_map.group_id = #__usergroups.id ".
" WHERE ".
" #__usergroups.title = 'ABPro Admins'";
$database->setQuery($sql); 

Now the resource setup screen, where you assgn resource admins, will only show people you have added to the group 'ABPro Admins'.