Marius Cramer
2013-11-14 202df8fed7b7f32b624480b6382154262e5facfb
Fixed sorting of quota columns (mail quota and web site quota)
2 files modified
20 ■■■■ changed files
interface/lib/classes/listform.inc.php 10 ●●●●● patch | view | raw | blame | history
interface/lib/classes/listform_actions.inc.php 10 ●●●● patch | view | raw | blame | history
interface/lib/classes/listform.inc.php
@@ -236,7 +236,13 @@
        }
        return ( $sql_where != '' ) ? $sql_where = substr($sql_where,0,-3) : '1';
    }
    public function getPagingValue($key) {
        if(!is_array($this->pagingValues)) return null;
        if(!array_key_exists($key, $this->pagingValues)) return null;
        return $this->pagingValues[$key];
    }
    public function getPagingSQL($sql_where = '1') 
    {
        global $app, $conf;
@@ -281,6 +287,8 @@
        $vars['max_pages']      = $pages + 1;
        $vars['records_gesamt'] = $record_count['anzahl'];
        $vars['page_params']    = (isset($this->listDef['page_params'])) ? $this->listDef['page_params'] : '';
        $vars['offset']         = $sql_von;
        $vars['records_per_page'] = $records_per_page;
        //$vars['module'] = $_SESSION['s']['module']['name'];
        if($_SESSION['search'][$list_name]['page'] > 0) $vars['show_page_back'] = 1;
interface/lib/classes/listform_actions.inc.php
@@ -126,7 +126,7 @@
        }
        
        // Getting Datasets from DB
        $records = $app->db->queryAllRecords($this->getQueryString());
        $records = $app->db->queryAllRecords($this->getQueryString($php_sort));
        $this->DataRowColor = "#FFFFFF";
        $records_new = '';
@@ -147,6 +147,9 @@
            $this->sortKeys = array($order_by => $order_dir);
            uasort($records_new, array($this, '_sort'));
        }
        if($php_sort) {
            $records_new = array_slice($records_new, $app->listform->getPagingValue('offset'), $app->listform->getPagingValue('records_per_page'));
        }
        
        $app->tpl->setLoop('records',$records_new);
@@ -185,7 +188,7 @@
        return $rec;
    }
    
    public function getQueryString() {
    public function getQueryString($no_limit = false) {
        global $app;
        $sql_where = '';
@@ -231,7 +234,8 @@
        }
        $select = implode(', ', $table_selects);
        $sql = 'SELECT '.$select.$extselect.' FROM '.$app->listform->listDef['table'].($app->listform->listDef['additional_tables'] != ''? ','.$app->listform->listDef['additional_tables'] : '')."$join WHERE $sql_where $order_by_sql $limit_sql";
        $sql = 'SELECT '.$select.$extselect.' FROM '.$app->listform->listDef['table'].($app->listform->listDef['additional_tables'] != ''? ','.$app->listform->listDef['additional_tables'] : '')."$join WHERE $sql_where $order_by_sql";
        if($no_limit == false) $sql .= " $limit_sql";
        //echo $sql;
        return $sql;
    }