git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-460
// {{{ function get_list()
- function get_list($offset, $limit, $order, $order_inv) {
+ function get_list($offset, $limit, $order) {
if ($with_soundex = Env::has('with_soundex')) {
$nameField = new RefWithSoundexSField('name',array('rn.nom1_soundex','rn.nom2_soundex','rn.nom3_soundex'),'recherche_soundex','rn','u.matricule = rn.matricule');
$firstnameField = new RefWithSoundexSField('firstname',array('rp.prenom1_soundex','rp.prenom2_soundex'),'recherche_soundex','rp','u.matricule = rp.matricule');
LEFT JOIN watch_nonins AS w ON (w.ni_id=u.user_id AND w.uid='.Session::getInt('uid').')
'.$globals->search->result_where_statement.'
'.(empty($where) ? '' : "WHERE $where").'
- ORDER BY '.($order?($order.($order_inv?' DESC':'').', '):'')
+ ORDER BY '.($order?($order.', '):'')
.implode(',',array_filter(array($fields->get_order_statement(), 'promo DESC, NomSortKey, prenom'))).'
LIMIT '.($offset * $limit).','.$limit;
$liste = $globals->xdb->iterator($sql);
$page->assign('formulaire', 0);
// {{{ get_list
- function get_list($offset, $limit, $order, $order_inv) {
+ function get_list($offset, $limit, $order) {
global $globals;
$qSearch = new QuickSearch('quick');
$fields = new SFieldGroup(true, array($qSearch));
'.$globals->search->result_where_statement.'
WHERE '.$fields->get_where_statement().(logged() && Env::has('nonins') ? ' AND u.perms="pending" AND u.deces=0' : '').'
HAVING mark>0
- ORDER BY '.($order?($order.($order_inv?" DESC":"").', '):'')
+ ORDER BY '.($order?($order.', '):'')
.implode(',',array_filter(array($fields->get_order_statement(), 'u.promo DESC, NomSortKey, prenom'))).'
LIMIT '.$offset * $globals->search->per_page.','.$globals->search->per_page;
$list = $globals->xdb->iterator($sql);
// type of orders : (field name, default ASC, text name, auth)
var $orders = array(
'promo' =>array('promo', false, 'promotion', AUTH_PUBLIC),
- 'nom' =>array('nom', true, 'nom', AUTH_PUBLIC),
+ 'nom' =>array('nom,prenom', true, 'nom', AUTH_PUBLIC),
'date_mod' =>array('u.date', false, 'dernière modification', AUTH_COOKIE)
);
}
$order = $tab[0];
$order_inv = ($this->get_value('order_inv') != '') == $tab[1];
-
- list($list, $total) = call_user_func($this->_callback, $offset, $this->limit, $order, $order_inv);
+
+ if ($order_inv && $order)
+ $sql_order = str_replace(",", " DESC,", $order)." DESC";
+ else $sql_order = $order;
+
+ list($list, $total) = call_user_func($this->_callback, $offset, $this->limit, $sql_order);
$page_max = intval(($total-1)/$this->limit);