| 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 | {if $action eq 1 or $action eq 2 or $action eq 8} {* add, update or view *} |
| 27 | {include file="CRM/Contribute/Form/Contribution.tpl"} |
| 28 | {elseif $action eq 4} |
| 29 | {include file="CRM/Contribute/Form/ContributionView.tpl"} |
| 30 | {else} |
| 31 | <div class="contact-summary-contribute-tab view-content"> |
| 32 | |
| 33 | <div id="secondaryTabContainer" class="ui-tabs ui-widget ui-widget-content ui-corner-all"> |
| 34 | {* Tab management *} |
| 35 | <script type="text/javascript"> |
| 36 | var selectedTab = 'contributions'; |
| 37 | |
| 38 | {literal} |
| 39 | CRM.$(function($) { |
| 40 | var tabIndex = $('#tab_' + selectedTab).prevAll().length; |
| 41 | $("#secondaryTabContainer").tabs({active: tabIndex}); |
| 42 | $(".crm-tab-button").addClass("ui-corner-bottom"); |
| 43 | }); |
| 44 | {/literal} |
| 45 | </script> |
| 46 | <ul class="ui-tabs-nav ui-corner-all ui-helper-reset ui-helper-clearfix ui-widget-header"> |
| 47 | <li id="tab_contributions" class="crm-tab-button ui-corner-all ui-tabs-tab ui-corner-top ui-state-default ui-tab ui-tabs-active ui-state-active"> |
| 48 | <a href="#contributions-subtab" title="{ts}Contributions{/ts}"> |
| 49 | {ts}Contributions{/ts} <em>{$tabCount}</em> |
| 50 | </a> |
| 51 | </li> |
| 52 | <li id="tab_recurring" class="crm-tab-button ui-corner-all ui-tabs-tab ui-corner-top ui-state-default ui-tab"> |
| 53 | <a href="#recurring-subtab" title="{ts}Recurring Contributions{/ts}"> |
| 54 | {ts}Recurring Contributions{/ts} <em>{$contributionRecurCount}</em> |
| 55 | </a> |
| 56 | </li> |
| 57 | </ul> |
| 58 | |
| 59 | <div id="contributions-subtab" class="ui-tabs-panel ui-widget-content ui-corner-bottom"> |
| 60 | <div class="help"> |
| 61 | {if $permission EQ 'edit'} |
| 62 | {capture assign=newContribURL}{crmURL p="civicrm/contact/view/contribution" q="reset=1&action=add&cid=`$contactId`&context=contribution"}{/capture} |
| 63 | {capture assign=link}class="action-item" href="{$newContribURL}"{/capture} |
| 64 | {ts 1=$link}Click <a %1>Record Contribution</a> to record a new contribution received from this contact.{/ts} |
| 65 | {if $newCredit} |
| 66 | {capture assign=newCreditURL}{crmURL p="civicrm/contact/view/contribution" q="reset=1&action=add&cid=`$contactId`&context=contribution&mode=live"}{/capture} |
| 67 | {capture assign=link}class="action-item" href="{$newCreditURL}"{/capture} |
| 68 | {ts 1=$link}Click <a %1>Submit Credit Card Contribution</a> to process a new contribution on behalf of the contributor using their credit card.{/ts} |
| 69 | {/if} |
| 70 | {else} |
| 71 | {ts 1=$displayName}Contributions received from %1 since inception.{/ts} |
| 72 | {/if} |
| 73 | </div> |
| 74 | |
| 75 | {if $action eq 16 and $permission EQ 'edit'} |
| 76 | <div class="action-link"> |
| 77 | <a accesskey="N" href="{$newContribURL}" class="button"><span><i class="crm-i fa-plus-circle"></i> {ts}Record Contribution (Check, Cash, EFT ...){/ts}</span></a> |
| 78 | {if $newCredit} |
| 79 | <a accesskey="N" href="{$newCreditURL}" class="button"><span><i class="crm-i fa-credit-card"></i> {ts}Submit Credit Card Contribution{/ts}</span></a> |
| 80 | {/if} |
| 81 | <br /><br /> |
| 82 | </div> |
| 83 | <div class='clear'></div> |
| 84 | {/if} |
| 85 | |
| 86 | {if $rows} |
| 87 | {include file="CRM/Contribute/Page/ContributionTotals.tpl" mode="view"} |
| 88 | <div class='clear'></div> |
| 89 | {include file="CRM/Contribute/Form/Selector.tpl"} |
| 90 | {else} |
| 91 | <div class="messages status no-popup"> |
| 92 | <div class="icon inform-icon"></div> |
| 93 | {ts}No contributions have been recorded from this contact.{/ts} |
| 94 | </div> |
| 95 | {/if} |
| 96 | |
| 97 | {if $softCredit} |
| 98 | <div class="crm-block crm-contact-contribute-softcredit"> |
| 99 | <h3>{ts}Soft credits{/ts} {help id="id-soft_credit"}</h3> |
| 100 | {include file="CRM/Contribute/Page/ContributionSoft.tpl"} |
| 101 | </div> |
| 102 | {/if} |
| 103 | </div> |
| 104 | <div id="recurring-subtab" class="ui-tabs-panel ui-widget-content ui-corner-bottom"> |
| 105 | {if $recur} |
| 106 | <div class="crm-block crm-contact-contribute-recur crm-contact-contribute-recur-active"> |
| 107 | <h3>{ts}Active Recurring Contributions{/ts}</h3> |
| 108 | {include file="CRM/Contribute/Page/ContributionRecur.tpl" recurRows=$activeRecurRows} |
| 109 | </div> |
| 110 | <div class="crm-block crm-contact-contribute-recur crm-contact-contribute-recur-inactive"> |
| 111 | <h3>{ts}Inactive Recurring Contributions{/ts}</h3> |
| 112 | {include file="CRM/Contribute/Page/ContributionRecur.tpl" recurRows=$inactiveRecurRows} |
| 113 | </div> |
| 114 | {/if} |
| 115 | </div> |
| 116 | <div class="clear"></div> |
| 117 | </div> |
| 118 | </div> |
| 119 | {/if} |