Fix some regression with new architecture for groups

This commit is contained in:
Laurent Destailleur 2020-04-19 14:19:34 +02:00
parent 01f96b35ed
commit 200c29bd14
2 changed files with 7 additions and 5 deletions

View File

@ -1993,6 +1993,8 @@ else
if ($canreadgroup)
{
print '<!-- Group section -->'."\n";
print load_fiche_titre($langs->trans("ListOfGroupsForUser"), '', '');
// On selectionne les groupes auquel fait parti le user
@ -2031,13 +2033,11 @@ else
print $form->select_dolgroups('', 'group', 1, $exclude, 0, '', '', $object->entity);
print ' &nbsp; ';
print '<input type="hidden" name="entity" value="'.$conf->entity.'" />';
print '<input type="submit" class="button" value="'.$langs->trans("Add").'" />';
print '<input type="submit" class="button buttongen" value="'.$langs->trans("Add").'" />';
}
print '</th></tr>'."\n";
/*
* Groups assigned to user
*/
// List of groups of user
if (!empty($groupslist))
{
foreach ($groupslist as $group)
@ -2085,7 +2085,7 @@ else
}
/*
* Fiche en mode edition
* Card in edit mode
*/
if ($action == 'edit' && ($canedituser || $caneditfield || $caneditpassword || ($user->id == $object->id)))
{

View File

@ -160,6 +160,8 @@ class UserGroup extends CommonObject
$result = $this->fetchCommon($id);
}
$this->name = $this->nom; // For compatibility with field name
if($result)
{
if ($load_members)