*
* PHP version 5
*
- * Copyright © 2016 The Galette Team
+ * Copyright © 2016-2021 The Galette Team
*
* This file is part of Galette (http://galette.tuxfamily.org).
*
* @package Galette
*
* @author Johan Cwiklinski <johan@x-tnd.be>
- * @copyright 2016 The Galette Team
+ * @copyright 2016-202 The Galette Team
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version
* @link http://galette.tuxfamily.org
* @since june, 12th 2016
* @package Galette
*
* @author Johan Cwiklinski <johan@x-tnd.be>
- * @copyright 2016 The Galette Team
+ * @copyright 2016-2021 The Galette Team
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version
* @link http://galette.tuxfamily.org
*/
class ContributionsList extends Pagination
{
-
public const ORDERBY_DATE = 0;
public const ORDERBY_BEGIN_DATE = 1;
public const ORDERBY_END_DATE = 2;
public const ORDERBY_AMOUNT = 5;
public const ORDERBY_DURATION = 6;
public const ORDERBY_PAYMENT_TYPE = 7;
+ public const ORDERBY_ID = 8;
public const DATE_BEGIN = 0;
public const DATE_END = 1;
*
* PHP version 5
*
- * Copyright © 2016 The Galette Team
+ * Copyright © 2016-2021 The Galette Team
*
* This file is part of Galette (http://galette.tuxfamily.org).
*
* @package Galette
*
* @author Johan Cwiklinski <johan@x-tnd.be>
- * @copyright 2016 The Galette Team
+ * @copyright 2016-2021 The Galette Team
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version
* @link http://galette.tuxfamily.org
* @since june, 12th 2016
* @package Galette
*
* @author Johan Cwiklinski <johan@x-tnd.be>
- * @copyright 2016 The Galette Team
+ * @copyright 2016-2021 The Galette Team
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version
* @link http://galette.tuxfamily.org
*/
public const ORDERBY_DATE = 0;
public const ORDERBY_MEMBER = 3;
public const ORDERBY_AMOUNT = 5;
+ public const ORDERBY_ID = 8;
//filters
private $start_date_filter;
*
* PHP version 5
*
- * Copyright © 2010-2014 The Galette Team
+ * Copyright © 2010-2021 The Galette Team
*
* This file is part of Galette (http://galette.tuxfamily.org).
*
* @package Galette
*
* @author Johan Cwiklinski <johan@x-tnd.be>
- * @copyright 2010-2014 The Galette Team
+ * @copyright 2010-2021 The Galette Team
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version
* @link http://galette.tuxfamily.org
* @since Available since 0.7dev - 2010-03-11
* @package Galette
*
* @author Johan Cwiklinski <johan@x-tnd.be>
- * @copyright 2009-2014 The Galette Team
+ * @copyright 2009-2021 The Galette Team
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version
* @link http://galette.tuxfamily.org
*/
'Cannot list contributions | ' . $e->getMessage(),
Analog::WARNING
);
- return false;
+ throw $e;
}
}
$order = array();
switch ($this->filters->orderby) {
+ case ContributionsList::ORDERBY_ID:
+ $order[] = Contribution::PK . ' ' . $this->filters->ordered;
+ break;
case ContributionsList::ORDERBY_DATE:
$order[] = 'date_enreg ' . $this->filters->ordered;
break;
*
* PHP version 5
*
- * Copyright © 2011-2014 The Galette Team
+ * Copyright © 2011-2021 The Galette Team
*
* This file is part of Galette (http://galette.tuxfamily.org).
*
* @package Galette
*
* @author Johan Cwiklinski <johan@x-tnd.be>
- * @copyright 2011-2014 The Galette Team
+ * @copyright 2011-2021 The Galette Team
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version
* @link http://galette.tuxfamily.org
* @since Available since 0.7dev - 2011-07-31
* @package Galette
*
* @author Johan Cwiklinski <johan@x-tnd.be>
- * @copyright 2011-2014 The Galette Team
+ * @copyright 2011-2021 The Galette Team
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version
* @link http://galette.tuxfamily.org
*/
$order = array();
switch ($this->filters->orderby) {
+ case TransactionsList::ORDERBY_ID:
+ $order[] = Transaction::PK . ' ' . $this->filters->ordered;
+ break;
case TransactionsList::ORDERBY_DATE:
$order[] = 'trans_date' . ' ' . $this->filters->ordered;
break;
<table class="listing">
<thead>
<tr>
- <th class="id_row">#</th>
+ <th class="id_row">
+ <a href="{path_for name="contributions" data=["type" => "contributions", "option" => "order", "value" => "Galette\Filters\ContributionsList::ORDERBY_ID"|constant]}">#
+ {if $filters->orderby eq constant('Galette\Filters\ContributionsList::ORDERBY_ID')}
+ {if $filters->ordered eq constant('Galette\Filters\ContributionsList::ORDER_ASC')}
+ <img src="{base_url}/{$template_subdir}images/down.png" width="10" height="6" alt=""/>
+ {else}
+ <img src="{base_url}/{$template_subdir}images/up.png" width="10" height="6" alt=""/>
+ {/if}
+ {/if}
+ </a>
+ </th>
<th class="left date_row">
<a href="{path_for name="contributions" data=["type" => "contributions", "option" => "order", "value" => "Galette\Filters\ContributionsList::ORDERBY_DATE"|constant]}">{_T string="Date"}
{if $filters->orderby eq constant('Galette\Filters\ContributionsList::ORDERBY_DATE')}
<table class="listing">
<thead>
<tr>
- <th class="id_row">#</th>
+ <th class="id_row">
+ <a href="{path_for name="contributions" data=["type" => "transactions", "option" => "order", "value" => "Galette\Filters\TransactionsList::ORDERBY_ID"|constant]}">#
+ {if $filters->orderby eq constant('Galette\Filters\TransactionsList::ORDERBY_ID')}
+ {if $filters->ordered eq constant('Galette\Filters\TransactionsList::ORDER_ASC')}
+ <img src="{base_url}/{$template_subdir}images/down.png" width="10" height="6" alt=""/>
+ {else}
+ <img src="{base_url}/{$template_subdir}images/up.png" width="10" height="6" alt=""/>
+ {/if}
+ {/if}
+ </a>
+ </th>
<th class="left date_row">
<a href="{path_for name="contributions" data=["type" => "transactions", "option" => "order", "value" => "Galette\Filters\TransactionsList::ORDERBY_DATE"|constant]}">{_T string="Date"}
{if $filters->orderby eq constant('Galette\Filters\TransactionsList::ORDERBY_DATE')}