Fix table for Contribute
[civicrm-core.git] / templates / CRM / Contribute / Form / Selector.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.7 |
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 {include file="CRM/common/pager.tpl" location="top"}
27
28 {strip}
29 <table class="selector row-highlight">
30 <thead class="sticky">
31 <tr>
32 {if !$single and $context eq 'Search' }
33 <th scope="col" title="Select Rows">{$form.toggleSelect.html}</th>
34 {/if}
35 {if !$single}
36 <th scope="col"></th>
37 {/if}
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}
45 {/if}
46 </th>
47 {/foreach}
48 </tr>
49 </thead>
50
51 <p class="description">
52 {ts}Click arrow to view payment details.{/ts}
53 </p>
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}
65 <td class="crm-contribution-amount">
66 {if !$row.contribution_soft_credit_amount}
67 <a class="nowrap bold crm-expand-row" title="{ts}view payments{/ts}" href="{crmURL p='civicrm/payment' q="view=transaction&component=contribution&action=browse&cid=`$row.contact_id`&id=`$row.contribution_id`&selector=1"}">
68 &nbsp; {$row.total_amount|crmMoney:$row.currency}
69 </a>
70 {/if}
71 {if $row.amount_level }<br/>({$row.amount_level}){/if}
72 {if $row.contribution_recur_id}<br/>{ts}(Recurring){/ts}{/if}
73 </td>
74 {if $softCreditColumns}
75 <td class="right bold crm-contribution-soft_credit_amount">
76 <span class="nowrap">{$row.contribution_soft_credit_amount|crmMoney:$row.currency}</span>
77 </td>
78 {/if}
79 {foreach from=$columnHeaders item=column}
80 {assign var='columnName' value=$column.field_name}
81 {if !$columnName}{* if field_name has not been set skip, this helps with not changing anything not specifically edited *}
82 {elseif $columnName === 'total_amount'}{* rendered above as soft credit columns = confusing *}
83 {elseif $column.type === 'actions'}{* rendered below as soft credit column handling = not fixed *}
84 {elseif $columnName == 'contribution-status'}
85 <td class="crm-contribution-status">
86 {$row.contribution_status}<br/>
87 {if $row.cancel_date}
88 {$row.cancel_date|crmDate}
89 {/if}
90 </td>
91 {else}
92 {if $column.type == 'date'}
93 <td class="crm-contribution-{$columnName}">
94 {$row.$columnName|crmDate}
95 </td>
96 {else}
97 <td class="crm-{$columnName} crm-{$columnName}_{$row.columnName}">
98 {$row.$columnName}
99 </td>
100 {/if}
101 {/if}
102 {/foreach}
103 {if $softCreditColumns}
104 <td class="crm-contribution-soft_credit_name">
105 <a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=`$row.contribution_soft_credit_contact_id`"}">{$row.contribution_soft_credit_name}</a>
106 </td>
107 <td class="crm-contribution-soft_credit_type">{$row.contribution_soft_credit_type}</td>
108 {/if}
109 <td>{$row.action|replace:'xx':$row.contribution_id}</td>
110 </tr>
111 {/foreach}
112
113 </table>
114 {/strip}
115
116 {include file="CRM/common/pager.tpl" location="bottom"}
117 {crmScript file='js/crm.expandRow.js'}