interface/lib/classes/listform_actions.inc.php | ●●●●● patch | view | raw | blame | history | |
interface/web/mail/lib/lang/de_user_quota_stats_list.lng | ●●●●● patch | view | raw | blame | history | |
interface/web/mail/lib/lang/en_user_quota_stats_list.lng | ●●●●● patch | view | raw | blame | history | |
interface/web/mail/list/user_quota_stats.list.php | ●●●●● patch | view | raw | blame | history | |
interface/web/mail/templates/user_quota_stats_list.htm | ●●●●● patch | view | raw | blame | history | |
interface/web/mail/user_quota_stats.php | ●●●●● patch | view | raw | blame | history |
interface/lib/classes/listform_actions.inc.php
@@ -36,6 +36,26 @@ public $SQLExtWhere = ''; public $SQLOrderBy = ''; public $SQLExtSelect = ''; private $sortKeys; private function _sort($aOne, $aTwo) { if(!is_array($aOne) || !is_array($aTwo)) return 0; if(!is_array($this->sortKeys)) $this->sortKeys = array($this->sortKeys); foreach($this->sortKeys as $sKey => $sDir) { if(is_numeric($sKey)) { $sKey = $sDir; $sDir = 'ASC'; } $a = $aOne[$sKey]; $b = $aTwo[$sKey]; if(is_string($a)) $a = strtolower($a); if(is_string($b)) $b = strtolower($b); if($a < $b) return ($sDir == 'DESC' ? 1 : -1); elseif($a > $b) return ($sDir == 'DESC' ? -1 : 1); } return 0; } public function onLoad() { @@ -63,12 +83,17 @@ $_SESSION['search'][$_SESSION['s']['module']['name'].$app->listform->listDef["name"].$app->listform->listDef['table']]['order'] = ''; } $php_sort = false; if(!empty($_GET['orderby'])){ $order = str_replace('tbl_col_','',$_GET['orderby']); //* Check the css class submited value if (preg_match("/^[a-z\_]{1,}$/",$order)) { if(isset($app->listform->listDef['phpsort']) && is_array($app->listform->listDef['phpsort']) && in_array($order, $app->listform->listDef['phpsort'])) { $php_sort = true; } else { // prepend correct table $prepend_table = $app->listform->listDef['table']; if(trim($app->listform->listDef['additional_tables']) != '' && is_array($app->listform->listDef['item']) && count($app->listform->listDef['item']) > 0) { @@ -80,17 +105,19 @@ } } $order = $prepend_table.'.'.$order; } if($_SESSION['search'][$_SESSION['s']['module']['name'].$app->listform->listDef["name"].$app->listform->listDef['table']]['order'] == $order){ $_SESSION['search'][$_SESSION['s']['module']['name'].$app->listform->listDef["name"].$app->listform->listDef['table']]['order'] = $order.' DESC'; } else { $_SESSION['search'][$_SESSION['s']['module']['name'].$app->listform->listDef["name"].$app->listform->listDef['table']]['order'] = $order; } $_SESSION['search'][$_SESSION['s']['module']['name'].$app->listform->listDef["name"].$app->listform->listDef['table']]['order_in_php'] = $php_sort; } } // If a manuel oder by like customers isset the sorting will be infront if(!empty($_SESSION['search'][$_SESSION['s']['module']['name'].$app->listform->listDef["name"].$app->listform->listDef['table']]['order'])){ if(!empty($_SESSION['search'][$_SESSION['s']['module']['name'].$app->listform->listDef["name"].$app->listform->listDef['table']]['order']) && !$_SESSION['search'][$_SESSION['s']['module']['name'].$app->listform->listDef["name"].$app->listform->listDef['table']]['order_in_php']){ if(empty($this->SQLOrderBy)){ $this->SQLOrderBy = "ORDER BY ".$_SESSION['search'][$_SESSION['s']['module']['name'].$app->listform->listDef["name"].$app->listform->listDef['table']]['order']; } else { @@ -110,6 +137,17 @@ } } if(!empty($_SESSION['search'][$_SESSION['s']['module']['name'].$app->listform->listDef["name"].$app->listform->listDef['table']]['order']) && $_SESSION['search'][$_SESSION['s']['module']['name'].$app->listform->listDef["name"].$app->listform->listDef['table']]['order_in_php']) { $order_by = $_SESSION['search'][$_SESSION['s']['module']['name'].$app->listform->listDef["name"].$app->listform->listDef['table']]['order']; $order_dir = 'ASC'; if(substr($order_by, -5) === ' DESC') { $order_by = substr($order_by, 0, -5); $order_dir = 'DESC'; } $this->sortKeys = array($order_by => $order_dir); uasort($records_new, array($this, '_sort')); } $app->tpl->setLoop('records',$records_new); $this->onShow(); interface/web/mail/lib/lang/de_user_quota_stats_list.lng
@@ -4,4 +4,5 @@ $wb['name_txt'] = 'Name'; $wb['email_txt'] = 'E-Mail Adresse'; $wb['used_txt'] = 'Verbrauchter Speicherplatz'; $wb['percentage_txt'] = 'Verbraucht in %'; ?> interface/web/mail/lib/lang/en_user_quota_stats_list.lng
@@ -4,4 +4,5 @@ $wb["name_txt"] = 'Name'; $wb["email_txt"] = 'Email Address'; $wb["used_txt"] = 'Used space'; $wb["percentage_txt"] = 'Used %'; ?> interface/web/mail/list/user_quota_stats.list.php
@@ -40,6 +40,8 @@ // Enable auth $liste["auth"] = "yes"; // mark columns for php sorting (no real mySQL columns) $liste["phpsort"] = array('used_sort', 'percentage_sort'); /***************************************************** * Suchfelder interface/web/mail/templates/user_quota_stats_list.htm
@@ -9,8 +9,9 @@ <tr class="caption"> <th class="tbl_col_email" scope="col"><tmpl_var name="email_txt"></th> <th class="tbl_col_name" scope="col"><tmpl_var name="name_txt"></th> <th class="tbl_col_used tbl_col_nosort" scope="col"><tmpl_var name="used_txt"></th> <th class="tbl_col_used_sort" scope="col"><tmpl_var name="used_txt"></th> <th class="tbl_col_quota" scope="col"><tmpl_var name="quota_txt"></th> <th class="tbl_col_percentage_sort" scope="col"><tmpl_var name="percentage_txt"></th> <th class="tbl_col_limit" scope="col">{tmpl_var name='search_limit'}</th> </tr> <tr class="filter"> @@ -18,6 +19,7 @@ <td class="tbl_col_name"><input type="text" name="search_system_user" value="{tmpl_var name='search_name'}" /></td> <td class="tbl_col_used"> </td> <td class="tbl_col_quota"> </td> <td class="tbl_col_percentage"> </td> <td class="tbl_col_buttons"> <button type="button" class="button icons16 icoFilter" name="Filter" id="Filter" value="{tmpl_var name="filter_txt"}" onclick="submitForm('pageForm','mail/user_quota_stats.php');"><span>{tmpl_var name="filter_txt"}</span></button> </td> @@ -30,18 +32,19 @@ <td class="tbl_col_name"><a href="#" onclick="loadContent('mail/mail_user_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="name"}</a></td> <td class="tbl_col_used"><a href="#" onclick="loadContent('mail/mail_user_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="used"}</a></td> <td class="tbl_col_quota"><a href="#" onclick="loadContent('mail/mail_user_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="quota"}</a></td> <td class="tbl_col_percentage"><a href="#" onclick="loadContent('mail/mail_user_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="percentage"}</a></td> <td class="tbl_col_buttons"></td> </tr> </tmpl_loop> <tmpl_unless name="records"> <tr class="tbl_row_noresults tbl_row_<tmpl_if name='__EVEN__'}even<tmpl_else>uneven</tmpl_if>"> <td colspan="5">{tmpl_var name='globalsearch_noresults_text_txt'}</td> <td colspan="6">{tmpl_var name='globalsearch_noresults_text_txt'}</td> </tr> </tmpl_unless> </tbody> <tfoot> <tr> <td class="tbl_footer tbl_paging" colspan="5"><tmpl_var name="paging"></td> <td class="tbl_footer tbl_paging" colspan="6"><tmpl_var name="paging"></td> </tr> </tfoot> </table> interface/web/mail/user_quota_stats.php
@@ -53,11 +53,16 @@ if($rec['quota'] == 0){ $rec['quota'] = $app->lng('unlimited'); $rec['percentage'] = ''; $rec['percentage_sort'] = 0; } else { $rec['percentage'] = round(100 * $rec['used'] / $rec['quota']) . '%'; $rec['percentage_sort'] = round(100 * $rec['used'] / $rec['quota']); $rec['quota'] = round($rec['quota'] / 1048576,4).' MB'; } $rec['used_sort'] = $rec['used']; if($rec['used'] < 1544000) { $rec['used'] = round($rec['used'] / 1024,4).' KB'; } else {