================================================================================
VERSION 0.9.12 ?? ?? 2006
+New:
+
+ * Admin:
+ - Can add sorting key in Table Editor -FRU
+
Bug/Wish:
* Admin:
- #468: Can edit requests before validation -FRU
+ - #478: Sort payments by flag -FRU
* Core:
- #473: Use 'événement' instead of 'évènement' -FRU
var $table;
// joint tables to delete when deleting an entry
var $jtables = array();
+ // sorting field
+ var $sort = array();
// the id field
var $idfield;
// possibility to edit the field
if ($joindel)
$this->jtables[$name] = array("joinid" => $joinid,"joinextra" => $joinextra?(" AND ".$joinextra):"");
}
+
+ // add a sort key
+ function add_sort_field($key, $desc = false)
+ {
+ $this->sort[] = $key . ($desc ? ' DESC' : '');
+ }
+
// call when done
function apply(&$page, $action, $id = false) {
$page->changeTpl('table-editor.tpl');
$page->trig("Impossible de mette à jour.");
}
if ($list) {
- $it = XDB::iterator("SELECT * FROM {$this->table}");
+ if (count($this->sort) > 0) {
+ $sort = 'ORDER BY ' . join($this->sort, ',');
+ }
+ $it = XDB::iterator("SELECT * FROM {$this->table} $sort");
$this->nbfields = 0;
foreach ($this->vars as $field => $descr)
if ($descr['display']) $this->nbfields++;
$page->assign('title', 'Gestion des télépaiements');
$table_editor = new PLTableEditor('admin/payments','paiement.paiements','id');
$table_editor->add_join_table('paiement.transactions','ref',true);
+ $table_editor->add_sort_field('flags');
$table_editor->describe('text','intitulé',true);
$table_editor->describe('url','site web',false);
$table_editor->describe('montant_def','montant par défaut',false);