private static function showAddUserForm(Group $group, $used_ids, $entityrestrict, $crit)
{
global $CFG_GLPI, $DB;
$rand = mt_rand();
$res = User::getSqlSearchResult(true, "all", $entityrestrict, 0, $used_ids);
$nb = $res ? $DB->result($res, 0, "CPT") : 0;
if ($nb) {
echo "<form name='groupuser_form{$rand}' id='groupuser_form{$rand}' method='post'\n action='" . Toolbox::getItemTypeFormURL(__CLASS__) . "'>";
echo "<input type='hidden' name='groups_id' value='" . $group->fields['id'] . "'>";
echo "<div class='firstbloc'>";
echo "<table class='tab_cadre_fixe'>";
echo "<tr class='tab_bg_1'><th colspan='6'>" . __('Add a user') . "</th></tr>";
echo "<tr class='tab_bg_2'><td class='center'>";
User::dropdown(array('right' => "all", 'entity' => $entityrestrict, 'used' => $used_ids));
echo "</td><td>" . __('Manager') . "</td><td>";
Dropdown::showYesNo('is_manager', $crit == 'is_manager' ? 1 : 0);
echo "</td><td>" . __('Delegatee') . "</td><td>";
Dropdown::showYesNo('is_userdelegate', $crit == 'is_userdelegate' ? 1 : 0);
echo "</td><td class='tab_bg_2 center'>";
echo "<input type='hidden' name'is_dynamic' value='0'>";
echo "<input type='submit' name='add' value=\"" . _sx('button', 'Add') . "\" class='submit'>";
echo "</td></tr>";
echo "</table></div>";
Html::closeForm();
}
}