|
22 | 22 | <tr class="rowReportSubtotal"> |
23 | 23 | <td class="cellLeftAlignedSubtotal">{if $subtotal['name']}{$subtotal['name']|escape}{else} {/if}</td> |
24 | 24 | {if $bean->getAttribute('chduration')}<td class="cellRightAlignedSubtotal">{$subtotal['time']}</td>{/if} |
25 | | - {if $bean->getAttribute('chcost')}<td class="cellRightAlignedSubtotal">{if $user->canManageTeam() || $user->isClient()}{$subtotal['cost']}{else}{$subtotal['expenses']}{/if}</td>{/if} |
| 25 | + {if $bean->getAttribute('chcost')}<td class="cellRightAlignedSubtotal">{if $user->can('manage_invoices') || $user->isClient()}{$subtotal['cost']}{else}{$subtotal['expenses']}{/if}</td>{/if} |
26 | 26 | </tr> |
27 | 27 | {/foreach} |
28 | 28 | <!-- print totals --> |
29 | 29 | <tr><td> </td></tr> |
30 | 30 | <tr class="rowReportSubtotal"> |
31 | 31 | <td class="cellLeftAlignedSubtotal">{$i18n.label.total}</td> |
32 | 32 | {if $bean->getAttribute('chduration')}<td nowrap class="cellRightAlignedSubtotal">{$totals['time']}</td>{/if} |
33 | | - {if $bean->getAttribute('chcost')}<td nowrap class="cellRightAlignedSubtotal">{$user->currency|escape} {if $user->canManageTeam() || $user->isClient()}{$totals['cost']}{else}{$totals['expenses']}{/if}</td>{/if} |
| 33 | + {if $bean->getAttribute('chcost')}<td nowrap class="cellRightAlignedSubtotal">{$user->currency|escape} {if $user->can('manage_invoices') || $user->isClient()}{$totals['cost']}{else}{$totals['expenses']}{/if}</td>{/if} |
34 | 34 | </tr> |
35 | 35 | {else} |
36 | 36 | <!-- normal report --> |
37 | 37 | <tr> |
38 | 38 | <td class="tableHeader">{$i18n.label.date}</td> |
39 | | - {if $user->canManageTeam() || $user->isClient()}<td class="tableHeader">{$i18n.label.user}</td>{/if} |
| 39 | + {if $user->can('view_reports') || $user->can('view_all_reports') || $user->isClient()}<td class="tableHeader">{$i18n.label.user}</td>{/if} |
40 | 40 | {if $bean->getAttribute('chclient')}<td class="tableHeader">{$i18n.label.client}</td>{/if} |
41 | 41 | {if $bean->getAttribute('chproject')}<td class="tableHeader">{$i18n.label.project}</td>{/if} |
42 | 42 | {if $bean->getAttribute('chtask')}<td class="tableHeader">{$i18n.label.task}</td>{/if} |
|
58 | 58 | {if $cur_grouped_by != $prev_grouped_by && !$first_pass} |
59 | 59 | <tr class="rowReportSubtotal"> |
60 | 60 | <td class="cellLeftAlignedSubtotal">{$i18n.label.subtotal} |
61 | | - {if $user->canManageTeam() || $user->isClient()}<td class="cellLeftAlignedSubtotal">{if $group_by == 'user'}{$subtotals[$prev_grouped_by]['name']|escape}</td>{/if}{/if} |
| 61 | + {if $user->can('view_reports') || $user->can('view_all_reports') || $user->isClient()}<td class="cellLeftAlignedSubtotal">{if $group_by == 'user'}{$subtotals[$prev_grouped_by]['name']|escape}</td>{/if}{/if} |
62 | 62 | {if $bean->getAttribute('chclient')}<td class="cellLeftAlignedSubtotal">{if $group_by == 'client'}{$subtotals[$prev_grouped_by]['name']|escape}</td>{/if}{/if} |
63 | 63 | {if $bean->getAttribute('chproject')}<td class="cellLeftAlignedSubtotal">{if $group_by == 'project'}{$subtotals[$prev_grouped_by]['name']|escape}</td>{/if}{/if} |
64 | 64 | {if $bean->getAttribute('chtask')}<td class="cellLeftAlignedSubtotal">{if $group_by == 'task'}{$subtotals[$prev_grouped_by]['name']|escape}</td>{/if}{/if} |
|
67 | 67 | {if $bean->getAttribute('chfinish')}<td></td>{/if} |
68 | 68 | {if $bean->getAttribute('chduration')}<td class="cellRightAlignedSubtotal">{$subtotals[$prev_grouped_by]['time']}</td>{/if} |
69 | 69 | {if $bean->getAttribute('chnote')}<td></td>{/if} |
70 | | - {if $bean->getAttribute('chcost')}<td class="cellRightAlignedSubtotal">{if $user->canManageTeam() || $user->isClient()}{$subtotals[$prev_grouped_by]['cost']}{else}{$subtotals[$prev_grouped_by]['expenses']}{/if}</td>{/if} |
| 70 | + {if $bean->getAttribute('chcost')}<td class="cellRightAlignedSubtotal">{if $user->can('manage_invoices') || $user->isClient()}{$subtotals[$prev_grouped_by]['cost']}{else}{$subtotals[$prev_grouped_by]['expenses']}{/if}</td>{/if} |
71 | 71 | {if $bean->getAttribute('chpaid')}<td></td>{/if} |
72 | 72 | {if $bean->getAttribute('chip')}<td></td>{/if} |
73 | 73 | {if $bean->getAttribute('chinvoice')}<td></td>{/if} |
|
83 | 83 | {/if} |
84 | 84 | <tr class="{$report_row_class}"> |
85 | 85 | <td class="cellLeftAligned">{$item.date}</td> |
86 | | - {if $user->canManageTeam() || $user->isClient()}<td class="cellLeftAligned">{$item.user|escape}</td>{/if} |
| 86 | + {if $user->can('view_reports') || $user->can('view_all_reports') || $user->isClient()}<td class="cellLeftAligned">{$item.user|escape}</td>{/if} |
87 | 87 | {if $bean->getAttribute('chclient')}<td class="cellLeftAligned">{$item.client|escape}</td>{/if} |
88 | 88 | {if $bean->getAttribute('chproject')}<td class="cellLeftAligned">{$item.project|escape}</td>{/if} |
89 | 89 | {if $bean->getAttribute('chtask')}<td class="cellLeftAligned">{$item.task|escape}</td>{/if} |
|
92 | 92 | {if $bean->getAttribute('chfinish')}<td nowrap class="cellRightAligned">{$item.finish}</td>{/if} |
93 | 93 | {if $bean->getAttribute('chduration')}<td class="cellRightAligned">{$item.duration}</td>{/if} |
94 | 94 | {if $bean->getAttribute('chnote')}<td class="cellLeftAligned">{$item.note|escape}</td>{/if} |
95 | | - {if $bean->getAttribute('chcost')}<td class="cellRightAligned">{if $user->canManageTeam() || $user->isClient()}{$item.cost}{else}{$item.expense}{/if}</td>{/if} |
| 95 | + {if $bean->getAttribute('chcost')}<td class="cellRightAligned">{if $user->can('manage_invoices') || $user->isClient()}{$item.cost}{else}{$item.expense}{/if}</td>{/if} |
96 | 96 | {if $bean->getAttribute('chpaid')}<td class="cellRightAligned">{if $item.paid == 1}{$i18n.label.yes}{else}{$i18n.label.no}{/if}{/if} |
97 | 97 | {if $bean->getAttribute('chip')}<td class="cellRightAligned">{if $item.modified}{$item.modified_ip} {$item.modified}{else}{$item.created_ip} {$item.created}{/if}{/if} |
98 | 98 | {if $bean->getAttribute('chinvoice')}<td class="cellRightAligned">{$item.invoice|escape}</td>{/if} |
|
108 | 108 | {if $print_subtotals} |
109 | 109 | <tr class="rowReportSubtotal"> |
110 | 110 | <td class="cellLeftAlignedSubtotal">{$i18n.label.subtotal} |
111 | | - {if $user->canManageTeam() || $user->isClient()}<td class="cellLeftAlignedSubtotal">{if $group_by == 'user'}{$subtotals[$cur_grouped_by]['name']|escape}</td>{/if}{/if} |
| 111 | + {if $user->can('view_reports') || $user->can('view_all_reports') || $user->isClient()}<td class="cellLeftAlignedSubtotal">{if $group_by == 'user'}{$subtotals[$cur_grouped_by]['name']|escape}</td>{/if}{/if} |
112 | 112 | {if $bean->getAttribute('chclient')}<td class="cellLeftAlignedSubtotal">{if $group_by == 'client'}{$subtotals[$cur_grouped_by]['name']|escape}</td>{/if}{/if} |
113 | 113 | {if $bean->getAttribute('chproject')}<td class="cellLeftAlignedSubtotal">{if $group_by == 'project'}{$subtotals[$cur_grouped_by]['name']|escape}</td>{/if}{/if} |
114 | 114 | {if $bean->getAttribute('chtask')}<td class="cellLeftAlignedSubtotal">{if $group_by == 'task'}{$subtotals[$cur_grouped_by]['name']|escape}</td>{/if}{/if} |
|
117 | 117 | {if $bean->getAttribute('chfinish')}<td></td>{/if} |
118 | 118 | {if $bean->getAttribute('chduration')}<td class="cellRightAlignedSubtotal">{$subtotals[$cur_grouped_by]['time']}</td>{/if} |
119 | 119 | {if $bean->getAttribute('chnote')}<td></td>{/if} |
120 | | - {if $bean->getAttribute('chcost')}<td class="cellRightAlignedSubtotal">{if $user->canManageTeam() || $user->isClient()}{$subtotals[$cur_grouped_by]['cost']}{else}{$subtotals[$cur_grouped_by]['expenses']}{/if}</td>{/if} |
| 120 | + {if $bean->getAttribute('chcost')}<td class="cellRightAlignedSubtotal">{if $user->can('manage_invoices') || $user->isClient()}{$subtotals[$cur_grouped_by]['cost']}{else}{$subtotals[$cur_grouped_by]['expenses']}{/if}</td>{/if} |
121 | 121 | {if $bean->getAttribute('chpaid')}<td></td>{/if} |
122 | 122 | {if $bean->getAttribute('chip')}<td></td>{/if} |
123 | 123 | {if $bean->getAttribute('chinvoice')}<td></td>{/if} |
|
128 | 128 | <tr><td> </td></tr> |
129 | 129 | <tr class="rowReportSubtotal"> |
130 | 130 | <td class="cellLeftAlignedSubtotal">{$i18n.label.total}</td> |
131 | | - {if $user->canManageTeam() || $user->isClient()}<td></td>{/if} |
| 131 | + {if $user->can('view_reports') || $user->can('view_all_reports') || $user->isClient()}<td></td>{/if} |
132 | 132 | {if $bean->getAttribute('chclient')}<td></td>{/if} |
133 | 133 | {if $bean->getAttribute('chproject')}<td></td>{/if} |
134 | 134 | {if $bean->getAttribute('chtask')}<td></td>{/if} |
|
137 | 137 | {if $bean->getAttribute('chfinish')}<td></td>{/if} |
138 | 138 | {if $bean->getAttribute('chduration')}<td class="cellRightAlignedSubtotal">{$totals['time']}</td>{/if} |
139 | 139 | {if $bean->getAttribute('chnote')}<td></td>{/if} |
140 | | - {if $bean->getAttribute('chcost')}<td nowrap class="cellRightAlignedSubtotal">{$user->currency|escape} {if $user->canManageTeam() || $user->isClient()}{$totals['cost']}{else}{$totals['expenses']}{/if}</td>{/if} |
| 140 | + {if $bean->getAttribute('chcost')}<td nowrap class="cellRightAlignedSubtotal">{$user->currency|escape} {if $user->can('manage_invoices') || $user->isClient()}{$totals['cost']}{else}{$totals['expenses']}{/if}</td>{/if} |
141 | 141 | {if $bean->getAttribute('chpaid')}<td></td>{/if} |
142 | 142 | {if $bean->getAttribute('chip')}<td></td>{/if} |
143 | 143 | {if $bean->getAttribute('chinvoice')}<td></td>{/if} |
|
0 commit comments