[REF] Move handling of form elements back to the Form
[civicrm-core.git] / templates / CRM / Contribute / Page / UserDashboard.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | Copyright CiviCRM LLC. All rights reserved. |
4 | |
5 | This work is published under the GNU AGPLv3 license with some |
6 | permitted exceptions and without any warranty. For full license |
7 | and copyright information, see https://civicrm.org/licensing |
8 +--------------------------------------------------------------------+
9 *}
10 {crmRegion name="crm-contribute-userdashboard-pre"}
11 {/crmRegion}
12 <div class="view-content">
13 {if $contribute_rows}
14 {strip}
15 <table class="selector">
16 <tr class="columnheader">
17 <th>{ts}Total Amount{/ts}</th>
18 <th>{ts}Financial Type{/ts}</th>
19 <th>{ts}Received date{/ts}</th>
20 <th>{ts}Receipt Sent{/ts}</th>
21 <th>{ts}Status{/ts}</th>
22 {if $isIncludeInvoiceLinks}
23 <th></th>
24 {/if}
25 {foreach from=$row.buttons item=button}
26 <th></th>
27 {/foreach}
28 </tr>
29
30 {foreach from=$contribute_rows item=row}
31 <tr id='rowid{$row.contribution_id}'
32 class="{cycle values="odd-row,even-row"}{if $row.cancel_date} disabled{/if}">
33 <td>{$row.total_amount|crmMoney:$row.currency} {if $row.amount_level && !is_array($row.amount_level)} - {$row.amount_level} {/if}
34 {if $row.contribution_recur_id}
35 <br/>
36 {ts}(Recurring Contribution){/ts}
37 {/if}
38 </td>
39 <td>{$row.financial_type}</td>
40 <td>{$row.receive_date|truncate:10:''|crmDate}</td>
41 <td>{$row.receipt_date|truncate:10:''|crmDate}</td>
42 <td>{$row.contribution_status}</td>
43 {if $isIncludeInvoiceLinks}
44 <td>
45 {* @todo Instead of this tpl handling assign actions as an array attached the row, iterate through - will better accomodate extension overrides and competition for scarce real estate on this page*}
46 {assign var='id' value=$row.contribution_id}
47 {assign var='contact_id' value=$row.contact_id}
48 {assign var='urlParams' value="reset=1&id=$id&cid=$contact_id"}
49 {if call_user_func(array('CRM_Core_Permission','check'), 'view my invoices') OR call_user_func(array('CRM_Core_Permission','check'), 'access CiviContribute')}
50 <a class="button no-popup nowrap"
51 href="{crmURL p='civicrm/contribute/invoice' q=$urlParams}">
52 <i class="crm-i fa-print" aria-hidden="true"></i>
53 {if $row.contribution_status_name != 'Refunded' && $row.contribution_status_name != 'Cancelled' }
54 <span>{ts}Print Invoice{/ts}</span>
55 {else}
56 <span>{ts}Print Invoice and Credit Note{/ts}</span>
57 {/if}
58 </a>
59 {/if}
60 </td>
61 {/if}
62 {foreach from=$row.buttons item=button}
63 <td><a class="{$button.class}" href="{$button.url}"><span class='nowrap'>{$button.label}</span></a></td>
64 {/foreach}
65 </tr>
66 {/foreach}
67 </table>
68 {/strip}
69 {if $contributionSummary.total.count gt 12}
70 {ts}Contact us for information about contributions prior to those listed above.{/ts}
71 {/if}
72 {else}
73 <div class="messages status no-popup">
74 <div class="icon inform-icon"></div>
75 {ts}There are no contributions on record for you.{/ts}
76 </div>
77 {/if}
78
79
80 {if $honor}
81 {if $honorRows}
82 {strip}
83 <div class="help">
84 {ts}Contributions made in your honor{/ts}:
85 </div>
86 <table class="selector">
87 <tr class="columnheader">
88 <th>{ts}Contributor{/ts}</th>
89 <th>{ts}Amount{/ts}</th>
90 <th>{ts}Type{/ts}</th>
91 <th>{ts}Financial Type{/ts}</th>
92 <th>{ts}Received date{/ts}</th>
93 <th>{ts}Receipt Sent{/ts}</th>
94 <th>{ts}Status{/ts}</th>
95 </tr>
96 {foreach from=$honorRows item=row}
97 <tr id='rowid{$row.honorId}' class="{cycle values="odd-row,even-row"}">
98 <td><a href="{crmURL p="civicrm/contact/view" q="reset=1&cid=`$row.honorId`"}"
99 id="view_contact">{$row.display_name}</a></td>
100 <td>{$row.amount}</td>
101 <td>{$row.honor_type}</td>
102 <td>{$row.type}</td>
103 <td>{$row.receive_date|truncate:10:''|crmDate}</td>
104 <td>{$row.receipt_date|truncate:10:''|crmDate}</td>
105 <td>{$row.contribution_status}</td>
106 </tr>
107 {/foreach}
108 </table>
109 {/strip}
110 {/if}
111 {/if}
112
113 {if $recur}
114 {if $recurRows}
115 {strip}
116 <div><label>{ts}Recurring Contribution(s){/ts}</label></div>
117 <table class="selector">
118 <tr class="columnheader">
119 <th>{ts}Terms:{/ts}</th>
120 <th>{ts}Status{/ts}</th>
121 <th>{ts}Installments{/ts}</th>
122 <th>{ts}Created{/ts}</th>
123 <th></th>
124 </tr>
125 {foreach from=$recurRows item=row key=id}
126 <tr class="{cycle values="odd-row,even-row"}">
127 <td><label>{$recurRows.$id.amount|crmMoney}</label>
128 every {$recurRows.$id.frequency_interval} {$recurRows.$id.frequency_unit}
129 for {$recurRows.$id.installments} installments
130 </td>
131 <td>{$recurRows.$id.recur_status}</td>
132 <td>{if $recurRows.$id.completed}<a href="{$recurRows.$id.link}">{$recurRows.$id.completed}
133 /{$recurRows.$id.installments}</a>
134 {else}0/{$recurRows.$id.installments} {/if}</td>
135 <td>{$recurRows.$id.create_date|crmDate}</td>
136 <td>{$recurRows.$id.action|replace:'xx':$recurRows.id}</td>
137 </tr>
138 {/foreach}
139 </table>
140 {/strip}
141 {/if}
142 {/if}
143 </div>
144 {crmRegion name="crm-contribute-userdashboard-post"}
145 {/crmRegion}