From: stekkel Date: Wed, 20 Apr 2005 20:01:25 +0000 (+0000) Subject: * Fix sort order direction X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=commitdiff_plain;h=49719da8ab883a085650df95fa977038f18a5e78 * Fix sort order direction * do not store sortall twice. $aMailbox['SORTALL'][$iSetIndx] is leading. * Fix for labels. Set the refering id correct. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@9364 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index 4a58d6da..62f122c0 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -702,7 +702,7 @@ function setUserPref($username, $pref, $value) { */ function _get_sorted_msgs_list($imapConnection,&$aMailbox) { $iSetIndx = (isset($aMailbox['SETINDEX'])) ? $aMailbox['SETINDEX'] : 0; - $bDirection = ($aMailbox['SORT'] % 2); + $bDirection = !($aMailbox['SORT'] % 2); $error = 0; if (!$aMailbox['SEARCH'][$iSetIndx]) { $aMailbox['SEARCH'][$iSetIndx] = 'ALL'; @@ -1055,7 +1055,6 @@ function showMessagesForMailbox($imapConnection, &$aMailbox,$aProps, &$iError) { // FIX ME, before we support multiple templates we must review the names of the vars - $aTemplate['color'] = $color; $aTemplate['form_name'] = "FormMsgs" . $safe_name; $aTemplate['form_id'] = 'mbx_'.$iFormId; @@ -1085,6 +1084,7 @@ function showMessagesForMailbox($imapConnection, &$aMailbox,$aProps, &$iError) { $aTemplate['alt_index_colors'] = (isset($aProps['config']['alt_index_colors'])) ? $aProps['config']['alt_index_colors'] : false; $aTemplate['fancy_index_highlite'] = $fancy_index_highlite; + return $aTemplate; } diff --git a/src/right_main.php b/src/right_main.php index b87d4b05..058ff5b8 100644 --- a/src/right_main.php +++ b/src/right_main.php @@ -347,7 +347,6 @@ if ($aMailbox['EXISTS'] > 0) { $oTemplate->assign('alt_index_colors', isset($alt_index_colors) ? $alt_index_colors: false); $oTemplate->assign('color', $color); $oTemplate->assign('align', $align); - $oTemplate->assign('showall', $showall); $oTemplate->display('message_list.tpl'); diff --git a/src/search.php b/src/search.php index ba13a033..a4862adb 100644 --- a/src/search.php +++ b/src/search.php @@ -1615,7 +1615,6 @@ if ($submit == $search_button_text) { $oTemplate->assign('alt_index_colors', isset($alt_index_colors) ? $alt_index_colors: false); $oTemplate->assign('color', $color); $oTemplate->assign('align', $align); - $oTemplate->assign('showall', $showall); $mailbox_display = asearch_get_mailbox_display($aMailbox['NAME']); if (strtoupper($mbx) == 'INBOX') { diff --git a/templates/default/message_list.tpl b/templates/default/message_list.tpl index cbf256d0..148d2af1 100644 --- a/templates/default/message_list.tpl +++ b/templates/default/message_list.tpl @@ -35,13 +35,13 @@ if ($pageOffset < $end_msg) { if (!($sort & SQSORT_THREAD) && $enablesort) { - $aSortSupported = array(SQM_COL_SUBJ => array(SQSORT_SUBJ_ASC , SQSORT_SUBJ_DESC), - SQM_COL_DATE => array(SQSORT_DATE_ASC , SQSORT_DATE_DESC), - SQM_COL_INT_DATE => array(SQSORT_INT_DATE_ASC, SQSORT_INT_DATE_DESC), - SQM_COL_FROM => array(SQSORT_FROM_ASC , SQSORT_FROM_DESC), - SQM_COL_TO => array(SQSORT_TO_ASC , SQSORT_TO_DESC), - SQM_COL_CC => array(SQSORT_CC_ASC , SQSORT_CC_DESC), - SQM_COL_SIZE => array(SQSORT_SIZE_ASC , SQSORT_SIZE_DESC)); + $aSortSupported = array(SQM_COL_SUBJ => array(SQSORT_SUBJ_ASC , SQSORT_SUBJ_DESC), + SQM_COL_DATE => array(SQSORT_DATE_DESC , SQSORT_DATE_ASC), + SQM_COL_INT_DATE => array(SQSORT_INT_DATE_DESC, SQSORT_INT_DATE_ASC), + SQM_COL_FROM => array(SQSORT_FROM_ASC , SQSORT_FROM_DESC), + SQM_COL_TO => array(SQSORT_TO_ASC , SQSORT_TO_DESC), + SQM_COL_CC => array(SQSORT_CC_ASC , SQSORT_CC_DESC), + SQM_COL_SIZE => array(SQSORT_SIZE_ASC , SQSORT_SIZE_DESC)); } else { $aSortSupported = array(); } @@ -454,7 +454,7 @@ $clickedColor = (empty($color[16])) ? $color[2] : $color[16]; */ foreach ($aOrder as $iCol) { if (in_array($iCol, $show_label_columns)) { - $sLabelStart = '