Commit 202df8fe authored by Marius Cramer's avatar Marius Cramer
Browse files

Fixed sorting of quota columns (mail quota and web site quota)

parent 213e0bc6
......@@ -236,7 +236,13 @@ class listform {
}
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 @@ class listform {
$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;
......
......@@ -126,7 +126,7 @@ class listform_actions {
}
// 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 @@ class listform_actions {
$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 @@ class listform_actions {
return $rec;
}
public function getQueryString() {
public function getQueryString($no_limit = false) {
global $app;
$sql_where = '';
......@@ -231,7 +234,8 @@ class listform_actions {
}
$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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment