| 1 | {* |
| 2 | +--------------------------------------------------------------------+ |
| 3 | | CiviCRM version 5 | |
| 4 | +--------------------------------------------------------------------+ |
| 5 | | Copyright CiviCRM LLC (c) 2004-2018 | |
| 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 | |
| 27 | {include file="CRM/common/enableDisableApi.tpl"} |
| 28 | |
| 29 | {if $action eq 4} {* when action is view *} |
| 30 | {if $recur} |
| 31 | <h3>{ts}View Recurring Payment{/ts}</h3> |
| 32 | <div class="crm-block crm-content-block crm-recurcontrib-view-block"> |
| 33 | <table class="crm-info-panel"> |
| 34 | <tr><td class="label">{ts}Amount{/ts}</td><td>{$recur.amount|crmMoney:$recur.currency}{if $is_test} ({ts}test{/ts}){/if}</td></tr> |
| 35 | <tr><td class="label">{ts}Frequency{/ts}</td><td>every {$recur.frequency_interval} {$recur.frequency_unit}</td></tr> |
| 36 | <tr><td class="label">{ts}Installments{/ts}</td><td>{$recur.installments}</td></tr> |
| 37 | <tr><td class="label">{ts}Status{/ts}</td><td>{$recur.contribution_status}</td></tr> |
| 38 | <tr><td class="label">{ts}Start Date{/ts}</td><td>{$recur.start_date|crmDate}</td></tr> |
| 39 | <tr><td class="label">{ts}Created Date{/ts}</td><td>{$recur.create_date|crmDate}</td></tr> |
| 40 | {if $recur.modified_date}<tr><td class="label">{ts}Modified Date{/ts}</td><td>{$recur.modified_date|crmDate}</td></tr>{/if} |
| 41 | {if $recur.cancel_date}<tr><td class="label">{ts}Cancelled Date{/ts}</td><td>{$recur.cancel_date|crmDate}</td></tr>{/if} |
| 42 | {if $recur.end_date}<tr><td class="label">{ts}End Date{/ts}</td><td>{$recur.end_date|crmDate}</td></tr>{/if} |
| 43 | {if $recur.processor_id}<tr><td class="label">{ts}Processor ID{/ts}</td><td>{$recur.processor_id}</td></tr>{/if} |
| 44 | <tr><td class="label">{ts}Transaction ID{/ts}</td><td>{$recur.trxn_id}</td></tr> |
| 45 | {if $recur.invoice_id}<tr><td class="label">{ts}Invoice ID{/ts}</td><td>{$recur.invoice_id}</td></tr>{/if} |
| 46 | <tr><td class="label">{ts}Cycle Day{/ts}</td><td>{$recur.cycle_day}</td></tr> |
| 47 | {if $recur.contribution_status_id neq 3}<tr><td class="label">{ts}Next Contribution{/ts}</td><td>{$recur.next_sched_contribution_date|crmDate}</td></tr>{/if} |
| 48 | <tr><td class="label">{ts}Failure Count{/ts}</td><td>{$recur.failure_count}</td></tr> |
| 49 | {if $recur.invoice_id}<tr><td class="label">{ts}Failure Retry Date{/ts}</td><td>{$recur.next_sched_contribution_date|crmDate}</td></tr>{/if} |
| 50 | <tr><td class="label">{ts}Auto Renew?{/ts}</td><td>{if $recur.auto_renew}{ts}Yes{/ts}{else}{ts}No{/ts}{/if}</td></tr> |
| 51 | {if $recur.payment_processor}<tr><td class="label">{ts}Payment Processor{/ts}</td><td>{$recur.payment_processor}</td></tr>{/if} |
| 52 | {if $recur.financial_type}<tr><td class="label">{ts}Financial Type{/ts}</td><td>{$recur.financial_type}</td></tr>{/if} |
| 53 | {if $recur.campaign}<tr><td class="label">{ts}Campaign{/ts}</td><td>{$recur.campaign}</td></tr>{/if} |
| 54 | {if $recur.membership_id}<tr> |
| 55 | <td class="label">{ts}Membership{/ts}</td> |
| 56 | <td><a class="crm-hover-button" href='{crmURL p="civicrm/contact/view/membership" q="action=view&reset=1&cid=`$contactId`&id=`$recur.membership_id`&context=membership&selectedChild=member"}'>{$recur.membership_name}</a></td> |
| 57 | </tr> |
| 58 | {/if} |
| 59 | {include file="CRM/Custom/Page/CustomDataView.tpl"} |
| 60 | |
| 61 | </table> |
| 62 | <div class="crm-submit-buttons"><a class="button cancel crm-form-submit" href="{crmURL p='civicrm/contact/view' q='action=browse&selectedChild=contribute'}">{ts}Done{/ts}</a></div> |
| 63 | </div> |
| 64 | {/if} |
| 65 | |
| 66 | <script type="text/javascript"> |
| 67 | var recurContribID = {$recur.id}; |
| 68 | var contactID = {$contactId}; |
| 69 | {literal} |
| 70 | CRM.$(function($) { |
| 71 | CRM.loadPage( |
| 72 | CRM.url( |
| 73 | 'civicrm/contribute/contributionrecur-payments', |
| 74 | { |
| 75 | reset: 1, |
| 76 | id: recurContribID, |
| 77 | cid: contactID |
| 78 | }, |
| 79 | 'back' |
| 80 | ), |
| 81 | { |
| 82 | target : '#recurring-contribution-payments', |
| 83 | dialog : false |
| 84 | } |
| 85 | ); |
| 86 | }); |
| 87 | {/literal} |
| 88 | </script> |
| 89 | <div id="recurring-contribution-payments"></div> |
| 90 | {/if} |
| 91 | {if $recurRows} |
| 92 | {strip} |
| 93 | <table class="selector row-highlight"> |
| 94 | <tr class="columnheader"> |
| 95 | <th scope="col">{ts}Amount{/ts}</th> |
| 96 | <th scope="col">{ts}Frequency{/ts}</th> |
| 97 | <th scope="col">{ts}Start Date{/ts}</th> |
| 98 | <th scope="col">{ts}Installments{/ts}</th> |
| 99 | <th scope="col">{ts}Status{/ts}</th> |
| 100 | <th scope="col"></th> |
| 101 | </tr> |
| 102 | |
| 103 | {foreach from=$recurRows item=row} |
| 104 | {assign var=id value=$row.id} |
| 105 | <tr id="contribution_recur-{$row.id}" data-action="cancel" class="crm-entity {cycle values="even-row,odd-row"}{if NOT $row.is_active} disabled{/if}"> |
| 106 | <td>{$row.amount|crmMoney:$row.currency}{if $row.is_test} ({ts}test{/ts}){/if}</td> |
| 107 | <td>{ts}Every{/ts} {$row.frequency_interval} {$row.frequency_unit} </td> |
| 108 | <td>{$row.start_date|crmDate}</td> |
| 109 | <td>{$row.installments}</td> |
| 110 | <td>{$row.contribution_status}</td> |
| 111 | <td>{$row.action|replace:'xx':$row.recurId}</td> |
| 112 | </tr> |
| 113 | {/foreach} |
| 114 | </table> |
| 115 | {/strip} |
| 116 | {/if} |