Overview
Comment: | Vérifier que le champ existe avant de l'utiliser comme critère de tri |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
a812eb71bf685b299f93681a8bf73aec |
User & Date: | bohwaz on 2016-11-18 02:29:16 |
Other Links: | manifest | tags |
Context
2016-11-27
| ||
00:04 | Fix typo dans fallback détection langue check-in: 594c02079c user: bohwaz tags: trunk, stable | |
2016-11-18
| ||
02:29 | Vérifier que le champ existe avant de l'utiliser comme critère de tri check-in: a812eb71bf user: bohwaz tags: trunk | |
02:24 | Mettre l'ordre par défaut à champ_identite au lieu du premier champ de la table membres check-in: c5cd13a81f user: bohwaz tags: trunk | |
Changes
Modified src/www/admin/membres/index.php from [b26172e579] to [e09c25c0fe].
︙ | ︙ | |||
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | } if (!$cat_id) { $cat_id = array_diff(array_keys($membres_cats), array_keys($membres_cats_cachees)); } $order = $config->get('champ_identite'); $desc = false; if (Utils::get('o')) $order = Utils::get('o'); if (isset($_GET['d'])) $desc = true; $tpl->assign('order', $order); $tpl->assign('desc', $desc); | > > > > > > > > > > < < | 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | } if (!$cat_id) { $cat_id = array_diff(array_keys($membres_cats), array_keys($membres_cats_cachees)); } // Par défaut le champ de tri c'est l'identité $order = $config->get('champ_identite'); $desc = false; if (Utils::get('o')) $order = Utils::get('o'); if (isset($_GET['d'])) $desc = true; $fields = $champs->getListedFields(); // Vérifier que le champ de tri existe bien dans la table if (!array_key_exists($order, $fields)) { // Sinon par défaut c'est le premier champ de la table qui fait le tri $order = key($fields); } $tpl->assign('order', $order); $tpl->assign('desc', $desc); $tpl->assign('champs', $fields); $tpl->assign('liste', $membres->listByCategory($cat_id, array_keys($fields), $page, $order, $desc)); $tpl->assign('total', $membres->countByCategory($cat_id)); $tpl->assign('pagination_url', Utils::getSelfUrl(true) . '?p=[ID]&o=' . $order . ($desc ? '&d' : '') . ($cat_id? '&cat='. (int) Utils::get('cat') : '')); |
︙ | ︙ |