* Fix sort order direction
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 20 Apr 2005 20:01:25 +0000 (20:01 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 20 Apr 2005 20:01:25 +0000 (20:01 +0000)
* 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

functions/mailbox_display.php
src/right_main.php
src/search.php
templates/default/message_list.tpl

index 4a58d6dacaa9177d04751a746bc960d5029741bf..62f122c0f09dd7e496794ca4450ebb034545baac 100644 (file)
@@ -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;
 }
 
index b87d4b05fa52a46cd884ad0dedcc0df1707be7a0..058ff5b88d3d89c35a8eb42c6aafc6ca595ad92c 100644 (file)
@@ -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');
 
index ba13a033921d6bccba1591b3061deb95bdcdd1d7..a4862adb5292c737d755b702e078cf26c1611207 100644 (file)
@@ -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') {
index cbf256d0a3be143d0dcc6fd1258e88101341b5e2..148d2af179d33bfbdd95b58ee890d53ad91544a5 100644 (file)
@@ -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 = '<label for="msg[' . $i . ']">';
+            $sLabelStart = '<label for="'.$form_id."_msg$i>";
             $sLabelEnd = '</label>';
         } else {
             $sLabelStart = '';