CRM-15147 - Fix bug where embedded search shows wrong content after paging and refreshing
[civicrm-core.git] / templates / CRM / Contribute / Form / Selector.tpl
CommitLineData
6a488035
TO
1{*
2 +--------------------------------------------------------------------+
819d0d41 3 | CiviCRM version 4.5 |
6a488035 4 +--------------------------------------------------------------------+
819d0d41 5 | Copyright CiviCRM LLC (c) 2004-2014 |
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*}
26{if $context EQ 'Search'}
27 {include file="CRM/common/pager.tpl" location="top"}
28{/if}
29
30{strip}
16850d34 31<table class="selector row-highlight">
6a488035
TO
32 <thead class="sticky">
33 <tr>
34 {if !$single and $context eq 'Search' }
35 <th scope="col" title="Select Rows">{$form.toggleSelect.html}</th>
36 {/if}
36bf52ef 37 {assign var="softCreditColumns" value=0}
6a488035
TO
38 {foreach from=$columnHeaders item=header}
39 <th scope="col">
40 {if $header.sort}
41 {assign var='key' value=$header.sort}
42 {$sort->_response.$key.link}
43 {else}
44 {$header.name}
36bf52ef 45 {/if}
6a488035 46 </th>
36bf52ef
DS
47 {if $header.name eq "Soft Credit For"}
48 {assign var='softCreditColumns' value=1}
49 {/if}
6a488035
TO
50 {/foreach}
51 </tr>
36bf52ef 52 </thead>
6a488035
TO
53
54 {counter start=0 skip=1 print=false}
55 {foreach from=$rows item=row}
56 <tr id="rowid{$row.contribution_id}" class="{cycle values="odd-row,even-row"}{if $row.cancel_date} cancelled{/if} crm-contribution_{$row.contribution_id}">
57 {if !$single }
58 {if $context eq 'Search' }
59 {assign var=cbName value=$row.checkbox}
60 <td>{$form.$cbName.html}</td>
61 {/if}
62 <td>{$row.contact_type}</td>
63 <td><a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=`$row.contact_id`"}">{$row.sort_name}</a></td>
64 {/if}
4f3846df
DS
65 {if $row.contribution_soft_credit_amount}
66 <td class="right bold crm-contribution-amount">&nbsp;</td>
67 {else}
68 <td class="right bold crm-contribution-amount"><span class="nowrap">{$row.total_amount|crmMoney:$row.currency}</span> {if $row.amount_level }<br /> ({$row.amount_level}){/if}
69 {if $row.contribution_recur_id}
70 <br /> {ts}(Recurring Contribution){/ts}
71 {/if}
72 </td>
73 {/if}
74 {if $softCreditColumns}
75 <td class="right bold crm-contribution-soft_credit_amount"><span class="nowrap">{$row.contribution_soft_credit_amount|crmMoney:$row.currency}</span></td>
6a488035 76 {/if}
6a488035
TO
77 <td class="crm-contribution-type crm-contribution-type_{$row.financial_type_id} crm-financial-type crm-financial-type_{$row.financial_type_id}">{$row.financial_type}</td>
78 <td class="crm-contribution-source">{$row.contribution_source}</td>
79 <td class="crm-contribution-receive_date">{$row.receive_date|crmDate}</td>
80 <td class="crm-contribution-thankyou_date">{$row.thankyou_date|crmDate}</td>
81 <td class="crm-contribution-status">
82 {$row.contribution_status}<br />
83 {if $row.cancel_date}
84 {$row.cancel_date|crmDate}
85 {/if}
86 </td>
87 <td class="crm-contribution-product_name">{$row.product_name}</td>
36bf52ef 88 {if $softCreditColumns}
4f3846df 89 <td class="crm-contribution-soft_credit_name"><a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=`$row.contribution_soft_credit_contact_id`"}">{$row.contribution_soft_credit_name}</a></td>
36bf52ef
DS
90 <td class="crm-contribution-soft_credit_type">{$row.contribution_soft_credit_type}</td>
91 {/if}
6a488035
TO
92 <td>{$row.action|replace:'xx':$row.contribution_id}</td>
93 </tr>
94 {/foreach}
95
96{* Link to "View all contributions" for Contact Summary selector display *}
97{if $limit and $pager->_totalItems GT $limit }
98 {if $context eq 'dashboard' }
99 <tr class="even-row">
100 <td colspan="10"><a href="{crmURL p='civicrm/contribute/search' q='reset=1'}">&raquo; {ts}Find more contributions{/ts}... </a></td>
101 </tr>
102 {elseif $context eq 'contribution' }
103 <tr class="even-row">
c2874d9c 104 <td colspan="8"><a href="{crmURL p='civicrm/contribute/search' q="reset=1&force=1&cid=$contactId"}">&raquo; {ts}View all contributions from this contact{/ts}... </a></td>
6a488035
TO
105 </tr>
106 {/if}
107{/if}
108</table>
109{/strip}
110
d664f648 111
6a488035
TO
112
113{if $context EQ 'Search'}
114 {include file="CRM/common/pager.tpl" location="bottom"}
115{/if}