Skip to content
Snippets Groups Projects
Commit ab74b480 authored by David Siegfried's avatar David Siegfried Committed by Elmar Ludwig
Browse files

replace role-information into view, closes #2009

Closes #2009

Merge request studip/studip!1964
parent e5fcf814
No related branches found
No related tags found
No related merge requests found
......@@ -401,8 +401,8 @@ class Admin_UserController extends AuthenticatedController
}
}
//get user
$this->user = User::find($user_id);
$this->user_roles = $this->user->getRoles();
// Änderungen speichern
if (Request::submitted('edit')) {
......@@ -1805,25 +1805,12 @@ class Admin_UserController extends AuthenticatedController
);
}
// Create link to role administration for this user
$extra = '';
$roles = $this->user->getRoles();
$roles_attributes = [];
if ($roles) {
$extra = ' (' . count($roles) . ')';
$title = '• ' . implode("\n• ", array_map(function ($role) {
return $role->rolename;
}, $roles));
$roles_attributes['data-tooltip'] = json_encode([
'html' => htmlReady($title, true, true),
]);
}
$views->addLink(
_('Zur Rollenverwaltung') . $extra,
_('Zur Rollenverwaltung'),
$this->url_for("admin/role/assign_role/{$this->user->id}"),
Icon::create('roles2'),
$roles_attributes
Icon::create('roles2')
);
}
$sidebar->insertWidget($views, 'user_actions', 'views');
......
......@@ -203,6 +203,20 @@ use Studip\Button, Studip\LinkButton;
</label>
</div>
</section>
<? if (!empty($user_roles)) : ?>
<section>
<span class="label-text">
<?= _('Zugewiesene Rollen') ?>
</span>
<ul>
<? foreach($user_roles as $role) : ?>
<li><?= htmlReady($role->rolename) ?> </li>
<? endforeach ?>
</ul>
</section>
<? endif ?>
</fieldset>
......@@ -272,7 +286,7 @@ use Studip\Button, Studip\LinkButton;
</select>
</label>
<section class="col-2">
<label for="expiration_date">
<?= _('Ablaufdatum') ?>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment