2 {assign var="extend" value='ajax.tpl'}
4 {assign var="extend" value='page.tpl'}
8 <form action="{path_for name="payments_filter" data=["type" => "contributions"]}" method="post" id="filtre">
10 <label for="date_field_filter">{_T string="Show contributions by"}</label>
11 <select name="date_field_filter" id="date_field_filter">
12 <option value="{Galette\Filters\ContributionsList::DATE_BEGIN}"{if $filters->date_field eq constant('Galette\Filters\ContributionsList::DATE_BEGIN')} selected="selected"{/if}>{_T string="Begin"}</option>
13 <option value="{Galette\Filters\ContributionsList::DATE_END}"{if $filters->date_field eq constant('Galette\Filters\ContributionsList::DATE_END')} selected="selected"{/if}>{_T string="End"}</option>
14 <option value="{Galette\Filters\ContributionsList::DATE_RECORD}"{if $filters->date_field eq constant('Galette\Filters\ContributionsList::DATE_RECORD')} selected="selected"{/if}>{_T string="Record"}</option>
16 <label for="start_date_filter">{_T string="since"}</label>
17 <input type="text" name="start_date_filter" id="start_date_filter" maxlength="10" size="10" value="{$filters->start_date_filter}"/>
18 <label for="end_date_filter">{_T string="until"}</label>
19 <input type="text" name="end_date_filter" id="end_date_filter" maxlength="10" size="10" value="{$filters->end_date_filter}"/>
20 {include file="forms_types/payment_types.tpl"
21 current=$filters->payment_type_filter varname="payment_type_filter"
24 empty=['value' => -1, 'label' => {_T string="Select"}]
26 <input type="submit" class="inline" value="{_T string="Filter"}"/>
27 <input type="submit" name="clear_filter" class="inline" value="{_T string="Clear filter"}"/>
30 <div id="member_stateofdue" class="{$member->getRowClass()}{if not $member->isActive()} inactive{/if}">{$member->getDues()}</div>
32 <div class="infoline">
33 {if isset($member) && $mode neq 'ajax'}
34 {if $login->isAdmin() or $login->isStaff()}
36 href="{path_for name="contributions" data=["type" => "contributions", "option" => "member", "value" => "all"]}"
39 <i class="fas fa-eraser"></i>
40 <span class="sr-only">{_T string="Show all members contributions"}</span>
43 <strong>{$member->sname}</strong>
44 {if not $member->isActive() } ({_T string="Inactive"}){/if}
45 {if $login->isAdmin() or $login->isStaff()}
46 (<a href="{path_for name="member" data=["id" => $member->id]}">{_T string="See member profile"}</a> -
47 <a href="{path_for name="addContribution" data=["type" => "fee"]}?id_adh={$member->id}">{_T string="Add a membership fee"}</a> -
48 <a href="{path_for name="addContribution" data=["type" => "donation"]}?id_adh={$member->id}">{_T string="Add a donation"}</a>)
52 {_T string="%count contribution" plural="%count contributions" count=$nb pattern="/%count/" replace=$nb}
55 <input type="hidden" name="ajax" value="true"/>
56 <input type="hidden" name="max_amount" value="{$filters->max_amount}"/>
58 <label for="nbshow">{_T string="Records per page:"}</label>
59 <select name="nbshow" id="nbshow">
60 {html_options options=$nbshow_options selected=$numrows}
62 <noscript> <span><input type="submit" value="{_T string="Change"}" /></span></noscript>
66 <form action="" method="post" id="listform">
67 <table class="listing">
70 <th class="id_row">#</th>
71 <th class="left date_row">
72 <a href="{path_for name="contributions" data=["type" => "contributions", "option" => "order", "value" => "Galette\Filters\ContributionsList::ORDERBY_DATE"|constant]}">{_T string="Date"}
73 {if $filters->orderby eq constant('Galette\Filters\ContributionsList::ORDERBY_DATE')}
74 {if $filters->ordered eq constant('Galette\Filters\ContributionsList::ORDER_ASC')}
75 <img src="{base_url}/{$template_subdir}images/down.png" width="10" height="6" alt=""/>
77 <img src="{base_url}/{$template_subdir}images/up.png" width="10" height="6" alt=""/>
82 <th class="left date_row">
83 <a href="{path_for name="contributions" data=["type" => "contributions", "option" => "order", "value" => "Galette\Filters\ContributionsList::ORDERBY_BEGIN_DATE"|constant]}">{_T string="Begin"}
84 {if $filters->orderby eq constant('Galette\Filters\ContributionsList::ORDERBY_BEGIN_DATE')}
85 {if $filters->ordered eq constant('Galette\Filters\ContributionsList::ORDER_ASC')}
86 <img src="{base_url}/{$template_subdir}images/down.png" width="10" height="6" alt=""/>
88 <img src="{base_url}/{$template_subdir}images/up.png" width="10" height="6" alt=""/>
93 <th class="left date_row">
94 <a href="{path_for name="contributions" data=["type" => "contributions", "option" => "order", "value" => "Galette\Filters\ContributionsList::ORDERBY_END_DATE"|constant]}">{_T string="End"}
95 {if $filters->orderby eq constant('Galette\Filters\ContributionsList::ORDERBY_END_DATE')}
96 {if $filters->ordered eq constant('Galette\Filters\ContributionsList::ORDER_ASC')}
97 <img src="{base_url}/{$template_subdir}images/down.png" width="10" height="6" alt=""/>
99 <img src="{base_url}/{$template_subdir}images/up.png" width="10" height="6" alt=""/>
104 {if ($login->isAdmin() or $login->isStaff()) and !isset($member)}
106 <a href="{path_for name="contributions" data=["type" => "contributions", "option" => "order", "value" => "Galette\Filters\ContributionsList::ORDERBY_MEMBER"|constant]}">{_T string="Member"}
107 {if $filters->orderby eq constant('Galette\Filters\ContributionsList::ORDERBY_MEMBER')}
108 {if $filters->ordered eq constant('Galette\Filters\ContributionsList::ORDER_ASC')}
109 <img src="{base_url}/{$template_subdir}images/down.png" width="10" height="6" alt=""/>
111 <img src="{base_url}/{$template_subdir}images/up.png" width="10" height="6" alt=""/>
118 <a href="{path_for name="contributions" data=["type" => "contributions", "option" => "order", "value" => "Galette\Filters\ContributionsList::ORDERBY_TYPE"|constant]}">{_T string="Type"}
119 {if $filters->orderby eq constant('Galette\Filters\ContributionsList::ORDERBY_TYPE')}
120 {if $filters->ordered eq constant('Galette\Filters\ContributionsList::ORDER_ASC')}
121 <img src="{base_url}/{$template_subdir}images/down.png" width="10" height="6" alt=""/>
123 <img src="{base_url}/{$template_subdir}images/up.png" width="10" height="6" alt=""/>
129 <a href="{path_for name="contributions" data=["type" => "contributions", "option" => "order", "value" => "Galette\Filters\ContributionsList::ORDERBY_AMOUNT"|constant]}">{_T string="Amount"}
130 {if $filters->orderby eq constant('Galette\Filters\ContributionsList::ORDERBY_AMOUNT')}
131 {if $filters->ordered eq constant('Galette\Filters\ContributionsList::ORDER_ASC')}
132 <img src="{base_url}/{$template_subdir}images/down.png" width="10" height="6" alt=""/>
134 <img src="{base_url}/{$template_subdir}images/up.png" width="10" height="6" alt=""/>
140 <a href="{path_for name="contributions" data=["type" => "contributions", "option" => "order", "value" => "Galette\Filters\ContributionsList::ORDERBY_PAYMENT_TYPE"|constant]}">{_T string="Payment type"}
141 {if $filters->orderby eq constant('Galette\Filters\ContributionsList::ORDERBY_PAYMENT_TYPE')}
142 {if $filters->ordered eq constant('Galette\Filters\ContributionsList::ORDER_ASC')}
143 <img src="{base_url}/{$template_subdir}images/down.png" width="10" height="6" alt=""/>
145 <img src="{base_url}/{$template_subdir}images/up.png" width="10" height="6" alt=""/>
151 {_T string="Duration"}
153 {if $mode neq 'ajax'}
154 <th class="nowrap actions_row">{_T string="Actions"}</th>
161 <th class="right" colspan="{if ($login->isAdmin() or $login->isStaff()) && !isset($member)}10{else}9{/if}">
162 {_T string="Found contributions total %f" pattern="/%f/" replace=$contribs->getSum()}
168 {foreach from=$list item=contribution key=ordre}
169 {assign var="mid" value=$contribution->member}
170 {assign var="cclass" value=$contribution->getRowClass()}
171 {if $contribution->isCotis()}
172 {assign var="ctype" value="fee"}
174 {assign var="ctype" value="donation"}
177 <tr{if $mode eq 'ajax'} class="contribution_row" id="row_{$contribution->id}"{/if}>
178 <td class="{$cclass} nowrap" data-scope="row">
179 {if ($login->isAdmin() or $login->isStaff()) or $mode eq 'ajax'}
180 <input type="checkbox" name="contrib_sel[]" value="{$contribution->id}"/>
182 <input type="hidden" name="contrib_id" value="{$contribution->id}"/>
184 {if $preferences->pref_show_id}
187 {$ordre+1+($filters->current_page - 1)*$numrows}
189 {if ($login->isAdmin() or $login->isStaff()) or $mode eq 'ajax'}
190 <span class="row-title">
191 <a href="{path_for name="editContribution" data=["type" => $ctype, "id" => $contribution->id]}">
192 {_T string="Contribution %id" pattern="/%id/" replace=$contribution->id}
195 {if $contribution->isTransactionPart() }
197 href="{path_for name="editTransaction" data=["id" => $contribution->transaction->id]}"
200 <i class="fas fa-link"></i>
201 <span class="sr-only">{_T string="Transaction: %s" pattern="/%s/" replace=$contribution->transaction->description}</span>
205 <span class="row-title">
206 {_T string="Contribution %id" pattern="/%id/" replace=$contribution->id}
208 {if $contribution->isTransactionPart() }
209 <i class="fas fa-link"></i>
210 <span class="sr-only">{_T string="Transaction: %s" pattern="/%s/" replace=$contribution->transaction->description}</span>
213 {if !$contribution->isTransactionPart() }
214 <img src="{base_url}/{$template_subdir}images/icon-empty.png"
220 <td class="{$cclass} nowrap" data-title="{_T string="Date"}">{$contribution->date}</td>
221 <td class="{$cclass} nowrap" data-title="{_T string="Begin"}">{$contribution->begin_date}</td>
222 <td class="{$cclass} nowrap" data-title="{_T string="End"}">{$contribution->end_date}</td>
223 {if ($login->isAdmin() or $login->isStaff()) && !isset($member)}
224 <td class="{$cclass}" data-title="{_T string="Member"}">
225 {if $filters->filtre_cotis_adh eq ""}
226 <a href="{path_for name="contributions" data=["type" => "contributions", "option" => "member", "value" => $mid]}">{if isset($member)}{$member->sname}{else}{memberName id="$mid"}{/if}</a>
228 <a href="{path_for name="member" data=["id" => $mid]}">{if isset($member)}{$member->sname}{else}{memberName id="$mid"}{/if}</a>
232 <td class="{$cclass}" data-title="{_T string="Type"}">{$contribution->type->libelle}</td>
233 <td class="{$cclass} nowrap" data-title="{_T string="Amount"}">{$contribution->amount}</td>
234 <td class="{$cclass} nowrap" data-title="{_T string="Payment type"}">{$contribution->spayment_type}</td>
235 <td class="{$cclass} nowrap" data-title="{_T string="Duration"}">{$contribution->duration}</td>
236 {if $mode neq 'ajax'}
237 <td class="{$cclass} center nowrap">
239 href="{path_for name="printContribution" data=["id" => $contribution->id]}"
242 <i class="fas fa-file-pdf"></i>
243 <span class="sr-only">{_T string="Print an invoice or a receipt (depending on contribution type)"}</span>
245 {if ($login->isAdmin() or $login->isStaff()) and $mode neq 'ajax'}
247 href="{path_for name="editContribution" data=["type" => $ctype, "id" => $contribution->id]}"
248 class="tooltip action"
250 <i class="fas fa-edit"></i>
251 <span class="sr-only">{_T string="Edit the contribution"}</span>
254 href="{path_for name="removeContribution" data=["type" => "contributions", "id" => $contribution->id]}"
255 class="tooltip delete"
257 <i class="fas fa-trash"></i>
258 <span class="sr-only">{_T string="Delete the contribution"}</span>
265 <tr><td colspan="{if ($login->isAdmin() or $login->isStaff()) && !isset($member)}10{elseif $login->isAdmin() or $login->isStaff()}9{else}8{/if}" class="emptylist">{_T string="no contribution"}</td></tr>
270 <div class="center cright">
271 {_T string="Pages:"}<br/>
272 <ul class="pages">{$pagination}</ul>
274 {if ($login->isAdmin() or $login->isStaff()) && $mode neq 'ajax'}
275 <ul class="selection_menu">
276 <li>{_T string="For the selection:"}</li>
278 <button type="submit" id="delete" name="delete">
279 <i class="fas fa-trash fa-fw"></i> {_T string="Delete"}
286 <div id="legende" title="{_T string="Legend"}">
287 <h1>{_T string="Legend"}</h1>
289 {if ($login->isAdmin() or $login->isStaff()) and $mode neq 'ajax'}
292 <i class="fas fa-edit fa-fw"></i>
294 <td class="back">{_T string="Modification"}</td>
298 <i class="fas fa-trash fa-fw"></i>
300 <td class="back">{_T string="Deletion"}</td>
304 <th class="cotis-normal color-sample"> </th>
305 <td class="back">{_T string="Contribution"}</td>
308 <th class="cotis-give color-sample"> </th>
309 <td class="back">{_T string="Gift"}</td>
315 {block name="javascripts"}
316 <script type="text/javascript">
317 var _checkselection = function() {
318 var _checkeds = $('table.listing').find('input[type=checkbox]:checked').length;
319 if ( _checkeds == 0 ) {
320 var _el = $('<div id="pleaseselect" title="{_T string="No contribution selected" escape="js"}">{_T string="Please make sure to select at least one contribution from the list to perform this action." escape="js"}</div>');
321 _el.appendTo('body').dialog({
325 $(this).dialog( "close" );
328 close: function(event, ui){
337 var _init_contribs_page = function(res){
338 {if ($login->isAdmin() or $login->isStaff())}
339 var _checklinks = '<div class="checkboxes"><span class="fleft"><a href="#" class="checkall tooltip"><i class="fas fa-check-square"></i> {_T string="(Un)Check all" escape="js"}</a> | <a href="#" class="checkinvert tooltip"><i class="fas fa-exchange-alt"></i> {_T string="Invert selection" escape="js"}</a></span><a href="#" class="show_legend fright">{_T string="Show legend" escape="js"}</a></div>';
341 $('.listing').before(_checklinks);
342 $('.listing').after(_checklinks);
343 _bind_check('contrib_sel');
347 $('#start_date_filter, #end_date_filter').datepicker({
351 buttonText: '<i class="far fa-calendar-alt"></i> <span class="sr-only">{_T string="Select a date" escape="js"}</span>'
354 _init_contribs_page();
356 {include file="js_removal.tpl"}
357 {include file="js_removal.tpl" selector="#delete" deleteurl="'{path_for name="removeContributions" data=["type" => "contributions"]}'" extra_check="if (!_checkselection()) {ldelim}return false;{rdelim}" extra_data="delete: true, contrib_sel: $('#listform input[type=\"checkbox\"]:checked').map(function(){ return $(this).val(); }).get()" method="POST"}