2013-09-24 14:50:05 +02:00
|
|
|
{include="header"}
|
|
|
|
|
|
|
|
{if condition="empty($id)"}
|
|
|
|
<h2>Global paybacks list</h2>
|
|
|
|
{if condition="$global_paybacks !== FALSE"}
|
|
|
|
<dl>
|
|
|
|
{loop="$global_paybacks"}
|
|
|
|
<dt>{$value->getDate()}</dt>
|
2013-09-25 20:28:09 +02:00
|
|
|
<dd>
|
|
|
|
{if condition="$value->getClosed() !== false"}
|
|
|
|
<a href="?do=see_paybacks&id={$value->getId()}" onclick="return confirm("Are you sure you want to confirm this payback ? This action can't be undone easily");">Payback n°{$value->getId()}</a>
|
|
|
|
{else}
|
|
|
|
[Closed] Payback n°{$value->getId()}
|
|
|
|
{/if}
|
|
|
|
</dd>
|
2013-09-24 14:50:05 +02:00
|
|
|
{/loop}
|
|
|
|
</dl>
|
|
|
|
{else}
|
|
|
|
<p>No global paybacks available.</p>
|
|
|
|
{/if}
|
|
|
|
{else}
|
2013-09-25 20:28:09 +02:00
|
|
|
{if condition="$global_paybacks === false"}
|
|
|
|
Payback doesn't exist.
|
|
|
|
{else}
|
|
|
|
<h2>Payback n°{$global_paybacks->getId()}</h2>
|
2013-09-24 14:50:05 +02:00
|
|
|
|
2013-09-25 20:28:09 +02:00
|
|
|
{$table=$global_paybacks->getUsersIn()->get()}
|
|
|
|
<table id="global_paybacks_table">
|
2013-09-24 14:50:05 +02:00
|
|
|
<tr>
|
2013-09-25 20:28:09 +02:00
|
|
|
<th>Owes / To</th>
|
2013-09-24 14:50:05 +02:00
|
|
|
{loop="$global_paybacks->getUsersIn()->get()"}
|
2013-09-25 20:28:09 +02:00
|
|
|
<th>{$users[$key1]->getDisplayName()}</th>
|
2013-09-24 14:50:05 +02:00
|
|
|
{/loop}
|
|
|
|
</tr>
|
2013-09-25 20:28:09 +02:00
|
|
|
{loop="$global_paybacks->getUsersIn()->get()"}
|
|
|
|
<tr>
|
|
|
|
<th>{$users[$key1]->getDisplayName()}</th>
|
|
|
|
{loop="$global_paybacks->getUsersIn()->get()"}
|
|
|
|
{if condition="$key1 == $key2"}
|
|
|
|
<td class="cell-disabled"></td>
|
|
|
|
{else}
|
|
|
|
<td>
|
|
|
|
{if condition="$table[$key1][$key2] != 0"}
|
|
|
|
<a href="?do=confirm_global_paybacks&from={$key1}&to={$key2}&payback_id={$global_paybacks->getId()}" title="Confirm payback">{$table[$key1][$key2]}</a>
|
|
|
|
{else}
|
|
|
|
-
|
|
|
|
{/if}
|
|
|
|
</td>
|
|
|
|
{/if}
|
|
|
|
{/loop}
|
|
|
|
</tr>
|
|
|
|
{/loop}
|
|
|
|
</table>
|
|
|
|
{/if}
|
2013-09-24 14:50:05 +02:00
|
|
|
|
|
|
|
<p class="center"><a href="?do=see_paybacks">Go back to global paybacks list</a></p>
|
|
|
|
{/if}
|
|
|
|
{include="footer"}
|