| 1 | {* |
| 2 | +--------------------------------------------------------------------+ |
| 3 | | CiviCRM version 5 | |
| 4 | +--------------------------------------------------------------------+ |
| 5 | | Copyright CiviCRM LLC (c) 2004-2019 | |
| 6 | +--------------------------------------------------------------------+ |
| 7 | | This file is a part of CiviCRM. | |
| 8 | | | |
| 9 | | CiviCRM is free software; you can copy, modify, and distribute it | |
| 10 | | under the terms of the GNU Affero General Public License | |
| 11 | | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | |
| 12 | | | |
| 13 | | CiviCRM is distributed in the hope that it will be useful, but | |
| 14 | | WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 15 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
| 16 | | See the GNU Affero General Public License for more details. | |
| 17 | | | |
| 18 | | You should have received a copy of the GNU Affero General Public | |
| 19 | | License and the CiviCRM Licensing Exception along | |
| 20 | | with this program; if not, contact CiviCRM LLC | |
| 21 | | at info[AT]civicrm[DOT]org. If you have questions about the | |
| 22 | | GNU Affero General Public License or the licensing of CiviCRM, | |
| 23 | | see the CiviCRM license FAQ at http://civicrm.org/licensing | |
| 24 | +--------------------------------------------------------------------+ |
| 25 | *} |
| 26 | {crmRegion name="crm-contribute-userdashboard-pre"} |
| 27 | {/crmRegion} |
| 28 | <div class="view-content"> |
| 29 | {if $contribute_rows} |
| 30 | {strip} |
| 31 | <table class="selector"> |
| 32 | <tr class="columnheader"> |
| 33 | <th>{ts}Total Amount{/ts}</th> |
| 34 | <th>{ts}Financial Type{/ts}</th> |
| 35 | <th>{ts}Received date{/ts}</th> |
| 36 | <th>{ts}Receipt Sent{/ts}</th> |
| 37 | <th>{ts}Status{/ts}</th> |
| 38 | {if $isIncludeInvoiceLinks} |
| 39 | <th></th> |
| 40 | {/if} |
| 41 | {foreach from=$row.buttons item=button} |
| 42 | <th></th> |
| 43 | {/foreach} |
| 44 | </tr> |
| 45 | |
| 46 | {foreach from=$contribute_rows item=row} |
| 47 | <tr id='rowid{$row.contribution_id}' |
| 48 | class="{cycle values="odd-row,even-row"}{if $row.cancel_date} disabled{/if}"> |
| 49 | <td>{$row.total_amount|crmMoney:$row.currency} {if $row.amount_level && !is_array($row.amount_level)} - {$row.amount_level} {/if} |
| 50 | {if $row.contribution_recur_id} |
| 51 | <br/> |
| 52 | {ts}(Recurring Contribution){/ts} |
| 53 | {/if} |
| 54 | </td> |
| 55 | <td>{$row.financial_type}</td> |
| 56 | <td>{$row.receive_date|truncate:10:''|crmDate}</td> |
| 57 | <td>{$row.receipt_date|truncate:10:''|crmDate}</td> |
| 58 | <td>{$row.contribution_status}</td> |
| 59 | {if $isIncludeInvoiceLinks} |
| 60 | <td> |
| 61 | {* @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*} |
| 62 | {assign var='id' value=$row.contribution_id} |
| 63 | {assign var='contact_id' value=$row.contact_id} |
| 64 | {assign var='urlParams' value="reset=1&id=$id&cid=$contact_id"} |
| 65 | {if call_user_func(array('CRM_Core_Permission','check'), 'view my invoices') OR call_user_func(array('CRM_Core_Permission','check'), 'access CiviContribute')} |
| 66 | <a class="button no-popup nowrap" |
| 67 | href="{crmURL p='civicrm/contribute/invoice' q=$urlParams}"> |
| 68 | <i class="crm-i fa-print"></i> |
| 69 | {if $row.contribution_status_name != 'Refunded' && $row.contribution_status_name != 'Cancelled' } |
| 70 | <span>{ts}Print Invoice{/ts}</span> |
| 71 | {else} |
| 72 | <span>{ts}Print Invoice and Credit Note{/ts}</span> |
| 73 | {/if} |
| 74 | </a> |
| 75 | {/if} |
| 76 | </td> |
| 77 | {/if} |
| 78 | {foreach from=$row.buttons item=button} |
| 79 | <td><a class="{$button.class}" href="{$button.url}"><span class='nowrap'>{$button.label}</span></a></td> |
| 80 | {/foreach} |
| 81 | </tr> |
| 82 | {/foreach} |
| 83 | </table> |
| 84 | {/strip} |
| 85 | {if $contributionSummary.total.count gt 12} |
| 86 | {ts}Contact us for information about contributions prior to those listed above.{/ts} |
| 87 | {/if} |
| 88 | {else} |
| 89 | <div class="messages status no-popup"> |
| 90 | <div class="icon inform-icon"></div> |
| 91 | {ts}There are no contributions on record for you.{/ts} |
| 92 | </div> |
| 93 | {/if} |
| 94 | |
| 95 | |
| 96 | {if $honor} |
| 97 | {if $honorRows} |
| 98 | {strip} |
| 99 | <div class="help"> |
| 100 | {ts}Contributions made in your honor{/ts}: |
| 101 | </div> |
| 102 | <table class="selector"> |
| 103 | <tr class="columnheader"> |
| 104 | <th>{ts}Contributor{/ts}</th> |
| 105 | <th>{ts}Amount{/ts}</th> |
| 106 | <th>{ts}Type{/ts}</th> |
| 107 | <th>{ts}Financial Type{/ts}</th> |
| 108 | <th>{ts}Received date{/ts}</th> |
| 109 | <th>{ts}Receipt Sent{/ts}</th> |
| 110 | <th>{ts}Status{/ts}</th> |
| 111 | </tr> |
| 112 | {foreach from=$honorRows item=row} |
| 113 | <tr id='rowid{$row.honorId}' class="{cycle values="odd-row,even-row"}"> |
| 114 | <td><a href="{crmURL p="civicrm/contact/view" q="reset=1&cid=`$row.honorId`"}" |
| 115 | id="view_contact">{$row.display_name}</a></td> |
| 116 | <td>{$row.amount}</td> |
| 117 | <td>{$row.honor_type}</td> |
| 118 | <td>{$row.type}</td> |
| 119 | <td>{$row.receive_date|truncate:10:''|crmDate}</td> |
| 120 | <td>{$row.receipt_date|truncate:10:''|crmDate}</td> |
| 121 | <td>{$row.contribution_status}</td> |
| 122 | </tr> |
| 123 | {/foreach} |
| 124 | </table> |
| 125 | {/strip} |
| 126 | {/if} |
| 127 | {/if} |
| 128 | |
| 129 | {if $recur} |
| 130 | {if $recurRows} |
| 131 | {strip} |
| 132 | <div><label>{ts}Recurring Contribution(s){/ts}</label></div> |
| 133 | <table class="selector"> |
| 134 | <tr class="columnheader"> |
| 135 | <th>{ts}Terms:{/ts}</th> |
| 136 | <th>{ts}Status{/ts}</th> |
| 137 | <th>{ts}Installments{/ts}</th> |
| 138 | <th>{ts}Created{/ts}</th> |
| 139 | <th></th> |
| 140 | </tr> |
| 141 | {foreach from=$recurRows item=row key=id} |
| 142 | <tr class="{cycle values="odd-row,even-row"}"> |
| 143 | <td><label>{$recurRows.$id.amount|crmMoney}</label> |
| 144 | every {$recurRows.$id.frequency_interval} {$recurRows.$id.frequency_unit} |
| 145 | for {$recurRows.$id.installments} installments |
| 146 | </td> |
| 147 | <td>{$recurRows.$id.recur_status}</td> |
| 148 | <td>{if $recurRows.$id.completed}<a href="{$recurRows.$id.link}">{$recurRows.$id.completed} |
| 149 | /{$recurRows.$id.installments}</a> |
| 150 | {else}0/{$recurRows.$id.installments} {/if}</td> |
| 151 | <td>{$recurRows.$id.create_date|crmDate}</td> |
| 152 | <td>{$recurRows.$id.action|replace:'xx':$recurRows.id}</td> |
| 153 | </tr> |
| 154 | {/foreach} |
| 155 | </table> |
| 156 | {/strip} |
| 157 | {/if} |
| 158 | {/if} |
| 159 | </div> |
| 160 | {crmRegion name="crm-contribute-userdashboard-post"} |
| 161 | {/crmRegion} |