Merge pull request #15307 from seamuslee001/dev_core_1249
[civicrm-core.git] / templates / CRM / Pledge / Page / Payment.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 {if $action eq 2 } {* update *}
11 {include file="CRM/Pledge/Form/Payment.tpl"}
12 {else}
13 {if $context eq 'dashboard'}{assign var='context' value='pledgeDashboard'}{/if}
14 <table class="nestedSelector">
15 <tr class="columnheader">
16 <th>{ts}Amount Due{/ts}</th>
17 <th>{ts}Due Date{/ts}</th>
18 <th>{ts}Amount Paid{/ts}</th>
19 <th>{ts}Paid Date{/ts}</th>
20 <th>{ts}Last Reminder{/ts}</th>
21 <th>{ts}Reminders Sent{/ts}</th>
22 <th colspan="2">{ts}Status{/ts}</th>
23 </tr>
24
25 {foreach from=$rows item=row}
26 <tr class="{cycle values="odd-row,even-row"} {if $row.status eq 'Overdue' } status-overdue{/if}">
27 <td class="right">{$row.scheduled_amount|crmMoney:$row.currency}</td>
28 <td>{$row.scheduled_date|truncate:10:''|crmDate}</td>
29 <td class="right">{$row.total_amount|crmMoney:$row.currency}</td>
30 <td>{$row.receive_date|truncate:10:''|crmDate}</td>
31 <td>{$row.reminder_date|truncate:10:''|crmDate}</td>
32 <td class="right">{if $row.reminder_count}{$row.reminder_count}{/if}</td>
33 <td {if ! ($permission EQ 'edit' and ($row.status eq 'Pending' or $row.status eq 'Overdue' or $row.status eq 'Completed')) } colspan="2"{/if} >{$row.label}</td>
34 {if $context neq user}
35 {if $permission EQ 'edit' and ($row.status eq 'Pending' or $row.status eq 'Overdue' or $row.status eq 'Completed') }
36 <td class="nowrap">
37 {if $row.status eq 'Completed'} {* Link to view contribution record for completed payment.*}
38 {capture assign=viewContribURL}{crmURL p="civicrm/contact/view/contribution" q="reset=1&id=`$row.contribution_id`&cid=`$contactId`&action=view&context=`$context`"}{/capture}
39 <a class="crm-hover-button action-item" href="{$viewContribURL}">{ts}View Payment{/ts}</a>
40 {else} {* Links to record / submit a payment. *}
41 {capture assign=newContribURL}{crmURL p="civicrm/contact/view/contribution" q="reset=1&action=add&cid=`$contactId`&context=`$context`&ppid=`$row.id`"}{/capture}
42 <a class="open-inline-noreturn crm-hover-button action-item" href="{$newContribURL}">{ts}Record Payment{/ts}</a>
43 {if $newCredit}
44 {capture assign=newCreditURL}{crmURL p="civicrm/contact/view/contribution" q="reset=1&action=add&cid=`$contactId`&ppid=`$row.id`&context=`$context`&mode=live"}{/capture}
45 <a class="open-inline-noreturn action-item crm-hover-button" href="{$newCreditURL}">{ts}Credit Card Payment{/ts}</a>
46 {/if}
47 {capture assign=editURL}{crmURL p="civicrm/pledge/payment" q="reset=1&action=update&cid=`$contactId`&context=`$context`&ppId=`$row.id`"}{/capture}
48 <a class="crm-hover-button action-item" href="{$editURL}">{ts}Edit Scheduled Payment{/ts}</a>
49 {/if}
50 </td>
51 {/if}
52 {/if}
53 </tr>
54 {/foreach}
55 </table>
56 {/if}