Changeset 1162 for branches/branch-1_6


Ignore:
Timestamp:
Apr 14, 2006, 3:41:50 AM (19 years ago)
Author:
rvelices
Message:

fix: calendar prev/next links not working properly when 'any' (All/Tout)
was selected

fix: calendar 'any' (All/Tout) not shown on for the day selection
(last calendar level) - it was meaningless

fix: calendar image ordering is by date descending for large periods (no year
selected) or ascending for small periods (week,month...)

Location:
branches/branch-1_6/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/branch-1_6/include/calendar_base.class.php

    r1107 r1162  
    196196    }
    197197
    198     if ($conf['calendar_show_any'] and $show_any and count($items) > 1)
     198    if ($conf['calendar_show_any'] and $show_any and count($items)>1 and
     199          count($date_components)<count($this->calendar_levels)-1 )
    199200    {
    200201      $label = l10n('calendar_any');
     
    300301    for ($i=0; $i<count($page['chronology_date']); $i++)
    301302    {
    302       if ( 'any' === $page['chronology_date'] )
     303      if ( 'any' === $page['chronology_date'][$i] )
    303304      {
    304305        $query .= ','.'"any"';
  • branches/branch-1_6/include/functions_calendar.inc.php

    r1125 r1162  
    260260    else
    261261    {
     262      if ( count($page['chronology_date'])==0
     263           or in_array('any', $page['chronology_date']) )
     264      {// selected period is very big so we show newest first
     265        $order = ' DESC, ';
     266      }
     267      else
     268      {// selected period is small (month,week) so we show oldest first
     269        $order = ' ASC, ';
     270      }
    262271      $order_by = str_replace(
    263272        'ORDER BY ',
    264         'ORDER BY '.$calendar->date_field.' DESC,', $conf['order_by']
     273        'ORDER BY '.$calendar->date_field.$order, $conf['order_by']
    265274        );
    266275      $query .= '
Note: See TracChangeset for help on using the changeset viewer.