What is the best way to have group capacity limit in joomla?
Background:
I have three groups "Police", "Lawyer", "Programmer".
Users can choose which group they would like to belong.
Groups have their capacity limit like "Programmer" capacity limit is 10, if 10 user assign them self to "Programmer", no more user can assign to this group because it's already reach to limit 10.
I decided to create plugin for this, first problem is how to add extra field in edit group details?
I tried onContentPrepareForm to insert field but no luck. I guess it's because backend?
public function onContentPrepareForm($form, $data)
{
$app = JFactory::getApplication();
if ($form->getName() == 'com_users.group') {
print_r($form->getName());
$form->loadFile(dirname(__FILE__).'/forms/form.xml');
}
}
form.xml
no problem.
Using the same plugin to insert field in registration page no problem.