Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | {* |
2 | +--------------------------------------------------------------------+ | |
39de6fd5 | 3 | | CiviCRM version 4.6 | |
6a488035 | 4 | +--------------------------------------------------------------------+ |
e7112fa7 | 5 | | Copyright CiviCRM LLC (c) 2004-2015 | |
6a488035 TO |
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 | *} | |
6a488035 | 26 | {include file="CRM/common/pager.tpl" location="top"} |
6a488035 | 27 | |
3bba4de0 CW |
28 | <p class="description"> |
29 | {ts}Click arrow to view pledge payments.{/ts} | |
30 | </p> | |
6a488035 | 31 | {strip} |
16850d34 | 32 | <table class="selector row-highlight"> |
6a488035 TO |
33 | <thead class="sticky"> |
34 | {if ! $single and $context eq 'Search' } | |
35 | <th scope="col" title="Select Rows">{$form.toggleSelect.html}</th> | |
36 | {/if} | |
37 | {if $single} | |
38 | <th></th> | |
39 | {/if} | |
40 | {foreach from=$columnHeaders item=header} | |
41 | <th scope="col"> | |
42 | {if $header.sort} | |
43 | {assign var='key' value=$header.sort} | |
44 | {$sort->_response.$key.link} | |
45 | {else} | |
46 | {$header.name} | |
47 | {/if} | |
48 | </th> | |
49 | {/foreach} | |
50 | </thead> | |
51 | {counter start=0 skip=1 print=false} | |
52 | {foreach from=$rows item=row} | |
53 | {cycle values="odd-row,even-row" assign=rowClass} | |
54 | <tr id='rowid{$row.pledge_id}' class='{$rowClass} {if $row.pledge_status_name eq 'Overdue' } status-overdue{/if}'> | |
55 | {if $context eq 'Search' } | |
56 | {assign var=cbName value=$row.checkbox} | |
57 | <td>{$form.$cbName.html}</td> | |
58 | {/if} | |
59 | <td> | |
60 | {if ! $single } | |
61 | {$row.contact_type}<br/> | |
62 | {/if} | |
3bba4de0 | 63 | <span id="{$row.pledge_id}_show" title="{ts}Show payments{/ts}"> |
6a488035 TO |
64 | <a href="#" onclick="cj('#paymentDetails{$row.pledge_id},#minus{$row.pledge_id}_hide,#{$row.pledge_id}_hide').show(); |
65 | buildPaymentDetails('{$row.pledge_id}','{$row.contact_id}'); | |
66 | cj('#{$row.pledge_id}_show').hide(); | |
3bba4de0 | 67 | return false;"><img src="{$config->resourceBase}i/TreePlus.gif" class="action-icon" alt=">"/></a> |
6a488035 | 68 | </span> |
3bba4de0 | 69 | <span id="minus{$row.pledge_id}_hide" title="{ts}Hide payments{/ts}"> |
6a488035 TO |
70 | <a href="#" onclick="cj('#paymentDetails{$row.pledge_id},#{$row.pledge_id}_hide,#minus{$row.pledge_id}_hide').hide(); |
71 | cj('#{$row.pledge_id}_show').show(); | |
3bba4de0 | 72 | return false;"><img src="{$config->resourceBase}i/TreeMinus.gif" class="action-icon" alt="^"/></a> |
6a488035 TO |
73 | </span> |
74 | </td> | |
75 | {if ! $single } | |
76 | <td><a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=`$row.contact_id`"}">{$row.sort_name}</a></td> | |
77 | {/if} | |
78 | <td class="right">{$row.pledge_amount|crmMoney:$row.pledge_currency}</td> | |
79 | <td class="right">{$row.pledge_total_paid|crmMoney:$row.pledge_currency}</td> | |
80 | <td class="right">{$row.pledge_amount-$row.pledge_total_paid|crmMoney:$row.pledge_currency}</td> | |
6d3864ef | 81 | <td>{$row.pledge_financial_type}</td> |
6a488035 TO |
82 | <td>{$row.pledge_create_date|truncate:10:''|crmDate}</td> |
83 | <td>{$row.pledge_next_pay_date|truncate:10:''|crmDate}</td> | |
84 | <td class="right">{$row.pledge_next_pay_amount|crmMoney:$row.pledge_currency}</td> | |
85 | <td>{$row.pledge_status}</td> | |
86 | <td>{$row.action|replace:'xx':$row.pledge_id}</td> | |
87 | </tr> | |
88 | <tr id="{$row.pledge_id}_hide" class='{$rowClass}'> | |
89 | <td style="border-right: none;"></td> | |
90 | <td colspan= {if $context EQ 'Search'} "10" {else} "8" {/if} class="enclosingNested" id="paymentDetails{$row.pledge_id}"> </td> | |
91 | </tr> | |
92 | <script type="text/javascript"> | |
93 | cj('#{$row.pledge_id}_hide').hide(); | |
94 | cj('#minus{$row.pledge_id}_hide').hide(); | |
95 | </script> | |
96 | {/foreach} | |
97 | ||
98 | {* Dashboard only lists 10 most recent pledges. *} | |
99 | {if $context EQ 'dashboard' and $limit and $pager->_totalItems GT $limit } | |
100 | <tr class="even-row"> | |
101 | <td colspan="10"><a href="{crmURL p='civicrm/pledge/search' q='reset=1'}">» {ts}Find more pledges{/ts}... </a></td> | |
102 | </tr> | |
103 | {/if} | |
104 | ||
105 | </table> | |
106 | {/strip} | |
107 | ||
6a488035 | 108 | {include file="CRM/common/pager.tpl" location="bottom"} |
6a488035 TO |
109 | |
110 | {* Build pledge payment details*} | |
111 | {literal} | |
112 | <script type="text/javascript"> | |
d28b0643 CW |
113 | (function($) { |
114 | // FIXME global function | |
115 | window.buildPaymentDetails = function(pledgeId, contactId) { | |
116 | var dataUrl = {/literal}"{crmURL p='civicrm/pledge/payment' h=0 q="action=browse&snippet=4&context=`$context`&pledgeId="}"{literal} + pledgeId + '&cid=' + contactId; | |
117 | $('#paymentDetails' + pledgeId).load(dataUrl, function() { | |
118 | $(this).trigger('crmLoad'); | |
119 | }); | |
120 | }; | |
121 | })(CRM.$); | |
6a488035 TO |
122 | </script> |
123 | {/literal} |