More progress on refactoring expenses for subgroups.
[timetracker.git] / WEB-INF / templates / users.tpl
index 85d6efc..4faf124 100644 (file)
@@ -6,14 +6,24 @@
   <tr>
     <td valign="top">
 {if $user->can('manage_users')}
+  {if $group_dropdown}
+{$forms.usersForm.open} {* usersForm consists only of one dropdown group control *}
+      <table width="100%">
+        <tr>
+          <td align="center">{$i18n.label.group}: {$forms.usersForm.group.control}</td>
+        </tr>
+      </table>
+{$forms.usersForm.close}
+  {/if}
+
       <table cellspacing="1" cellpadding="3" border="0" width="100%">
   {if $inactive_users}
         <tr><td class="sectionHeaderNoBorder">{$i18n.form.users.active_users}</td></tr>
   {/if}
         <tr>
-          <td width="35%" class="tableHeader">{$i18n.label.person_name}</td>
-          <td width="35%" class="tableHeader">{$i18n.label.login}</td>
-          <td width="10%" class="tableHeader">{$i18n.form.users.role}</td>
+          <td width="30%" class="tableHeader">{$i18n.label.person_name}</td>
+          <td width="30%" class="tableHeader">{$i18n.label.login}</td>
+          <td width="20%" class="tableHeader">{$i18n.form.users.role}</td>
           <td width="10%" class="tableHeader">{$i18n.label.edit}</td>
           <td width="10%" class="tableHeader">{$i18n.label.delete}</td>
         </tr>
     {foreach $active_users as $u}
         <tr bgcolor="{cycle values="#f5f5f5,#ffffff"}">
           <td>
-          {if $user->uncompleted_indicators}
+          {if $uncompleted_indicators}
             <span class="uncompleted-entry{if $u.has_uncompleted_entry} active{/if}"{if $u.has_uncompleted_entry} title="{$i18n.form.users.uncompleted_entry}"{/if}></span>
           {/if}
             {$u.name|escape}
           </td>
           <td>{$u.login|escape}</td>
           <td>{$u.role_name|escape}</td>
-      {if $u.rank <= $user->rank}
+      {if $u.group_id != $user->group_id || $u.rank < $user->rank || ($u.rank == $user->rank && $u.id == $user->id)}
           <td><a href="user_edit.php?id={$u.id}">{$i18n.label.edit}</a></td>
          {if $u.id != $user->id}<td><a href="user_delete.php?id={$u.id}">{$i18n.label.delete}</a></td>{else}<td></td>{/if}
       {else}
@@ -52,9 +62,9 @@
       <table cellspacing="1" cellpadding="3" border="0" width="100%">
         <tr><td class="sectionHeaderNoBorder">{$i18n.form.users.inactive_users}</td></tr>
         <tr>
-          <td width="35%" class="tableHeader">{$i18n.label.person_name}</td>
-          <td width="35%" class="tableHeader">{$i18n.label.login}</td>
-          <td width="10%" class="tableHeader">{$i18n.form.users.role}</td>
+          <td width="30%" class="tableHeader">{$i18n.label.person_name}</td>
+          <td width="30%" class="tableHeader">{$i18n.label.login}</td>
+          <td width="20%" class="tableHeader">{$i18n.form.users.role}</td>
           <td width="10%" class="tableHeader">{$i18n.label.edit}</td>
           <td width="10%" class="tableHeader">{$i18n.label.delete}</td>
         </tr>
@@ -63,9 +73,9 @@
           <td>{$u.name|escape}</td>
           <td>{$u.login|escape}</td>
           <td>{$u.role_name|escape}</td>
-      {if $u.rank <= $user->rank}
+      {if $u.group_id != $user->group_id || $u.rank < $user->rank}
           <td><a href="user_edit.php?id={$u.id}">{$i18n.label.edit}</a></td>
-         {if $u.id != $user->id}<td><a href="user_delete.php?id={$u.id}">{$i18n.label.delete}</a></td>{else}<td></td>{/if}
+          <td><a href="user_delete.php?id={$u.id}">{$i18n.label.delete}</a></td>
       {else}
           <td></td>
           <td></td>