Merge pull request #23156 from eileenmcnaughton/pppro
[civicrm-core.git] / templates / CRM / Pledge / Page / Payment.tpl
CommitLineData
6a488035
TO
1{*
2 +--------------------------------------------------------------------+
1188c7a8 3 | Copyright CiviCRM LLC. All rights reserved. |
6a488035 4 | |
1188c7a8
TO
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 |
6a488035
TO
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>
154f7b39 34{if $context neq 'user'}
6a488035 35 {if $permission EQ 'edit' and ($row.status eq 'Pending' or $row.status eq 'Overdue' or $row.status eq 'Completed') }
e2046b33 36 <td class="nowrap">
6a488035
TO
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}
e2046b33 39 <a class="crm-hover-button action-item" href="{$viewContribURL}">{ts}View Payment{/ts}</a>
6a488035
TO
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}
5fffbbe4 42 <a class="open-inline-noreturn crm-hover-button action-item" href="{$newContribURL}">{ts}Record Payment{/ts}</a>
6a488035 43 {if $newCredit}
6a488035 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}
5fffbbe4 45 <a class="open-inline-noreturn action-item crm-hover-button" href="{$newCreditURL}">{ts}Credit Card Payment{/ts}</a>
6a488035 46 {/if}
6a488035 47 {capture assign=editURL}{crmURL p="civicrm/pledge/payment" q="reset=1&action=update&cid=`$contactId`&context=`$context`&ppId=`$row.id`"}{/capture}
e2046b33 48 <a class="crm-hover-button action-item" href="{$editURL}">{ts}Edit Scheduled Payment{/ts}</a>
6a488035
TO
49 {/if}
50 </td>
51 {/if}
52{/if}
53 </tr>
54 {/foreach}
55</table>
232624b1 56{/if}