From 0244143fd06c8eed1ee8ec5f6a09f4652e7b4082 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Mon, 18 Feb 2019 02:41:20 +0000 Subject: [PATCH] www/dbq/dbq.php --- www/dbq/dbq.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/www/dbq/dbq.php b/www/dbq/dbq.php index 79cb3a53..0e5ada16 100644 --- a/www/dbq/dbq.php +++ b/www/dbq/dbq.php @@ -254,10 +254,15 @@ class DbQ extends nb { return $rows; } - public function page_table_ls($args=null) { + public function page_table_ls($fields=null) { $this->deniedUnless($this->perm >= self::READ); - $fields_only = (string)$args === '' ? [] : explode(',',$args); + $fields_only = (string)$fields === '' ? [] : explode(',',$fields); + $table_fields = array_keys($this->table->fields()); + foreach ($fields_only as $k=>$v) { + if (preg_match('/^(\d+)$/',$v,$m)) $fields_only[$k] = $table_fields[$v]; + } + if (!empty($fields_only)) $this->table->fields_only = $fields_only; $this->page($this,'table_rows'); -- 2.47.3