]> git.agnieray.net Git - galette.git/commitdiff
Can impersonate from groups persons lists
authorJohan Cwiklinski <johan@x-tnd.be>
Fri, 1 Oct 2021 09:15:56 +0000 (11:15 +0200)
committerJohan Cwiklinski <johan@x-tnd.be>
Fri, 1 Oct 2021 09:18:51 +0000 (11:18 +0200)
galette/templates/default/group_persons.tpl

index a5c7e0075dc1eb1160e99dff58c1a01fba117d8d..37ca363ed7f3f3a6afe7778e7cc201de03497d81 100644 (file)
@@ -7,33 +7,46 @@
                                 <th class="left">
                                     {_T string="Nickname"}
                                 </th>
+                                {if $login->isSuperAdmin()}
+                                <th>&nbsp;</th>
+                                {/if}
                             </tr>
                         </thead>
                         <tbody>
 {foreach from=$persons item=person name=allpersons}
                             <tr class="{if $smarty.foreach.allpersons.iteration % 2 eq 0}even{else}odd{/if}">
                                 <td class="nowrap username_row">
-                                <input type="hidden" name="{$person_mode}[]" value="{$person->id}"/>
-                                {if $person->isCompany()}
+                                    <input type="hidden" name="{$person_mode}[]" value="{$person->id}"/>
+    {if $person->isCompany()}
                                     <img src="{base_url}/{$template_subdir}images/icon-company.png" alt="{_T string="[W]"}" width="16" height="16"/>
-                                {elseif $person->isMan()}
+    {elseif $person->isMan()}
                                     <img src="{base_url}/{$template_subdir}images/icon-male.png" alt="{_T string="[M]"}" width="16" height="16"/>
-                                {elseif $person->isWoman()}
+    {elseif $person->isWoman()}
                                     <img src="{base_url}/{$template_subdir}images/icon-female.png" alt="{_T string="[W]"}" width="16" height="16"/>
-                                {else}
+    {else}
                                     <img src="{base_url}/{$template_subdir}images/icon-empty.png" alt="" width="10" height="12"/>
-                                {/if}
-                                {if $person->isAdmin()}
+    {/if}
+    {if $person->isAdmin()}
                                     <img src="{base_url}/{$template_subdir}images/icon-star.png" alt="{_T string="[admin]"}" width="16" height="16"/>
-                                {elseif $person->isStaff()}
+    {elseif $person->isStaff()}
                                     <img src="{base_url}/{$template_subdir}images/icon-staff.png" alt="{_T string="[staff]"}" width="16" height="16"/>
-                                {else}
+    {else}
                                     <img src="{base_url}/{$template_subdir}images/icon-empty.png" alt="" width="16" height="16"/>
-                                {/if}
-                                <a href="{path_for name="member" data=["id" => $person->id]}">{$person->sfullname}</a>
+    {/if}
+                                    <a href="{path_for name="member" data=["id" => $person->id]}">{$person->sfullname}</a>
                                 </td>
                                 <td class="nowrap">{$person->nickname|htmlspecialchars}</td>
-                            </tr>
+    {if $login->isSuperAdmin()}
+                                <td class="actions_row">
+                                    <a
+                                            href="{path_for name="impersonate" data=["id" => $person->id]}"
+                                            class="tooltip"
+                                    >
+                                        <i class="fas fa-user-secret fa-fw" aria-hidden="true"></i>
+                                        <span class="sr-only">{_T string="Log in in as %membername" pattern="/%membername/" replace=$person->sname}</span>
+                                    </a>
+                                </td>
+    {/if}
 {foreachelse}
                             <tr>
                                 <td colspan="2">