Changeset 28491 for trunk/include/functions_calendar.inc.php
- Timestamp:
- May 17, 2014, 8:09:33 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_calendar.inc.php
r26461 r28491 37 37 function initialize_calendar() 38 38 { 39 global $page, $conf, $user, $template, $ filter;39 global $page, $conf, $user, $template, $persistent_cache, $filter; 40 40 41 41 //------------------ initialize the condition on items to take into account --- … … 270 270 if ($must_show_list) 271 271 { 272 $query = 'SELECT DISTINCT id ';273 $query .= ','.$calendar->date_field;274 $query .= $calendar->inner_sql.'275 '.$calendar->get_date_where();276 272 if ( isset($page['super_order_by']) ) 277 273 { 278 $query .= ' 279 '.$conf['order_by']; 274 $order_by = $conf['order_by']; 280 275 } 281 276 else … … 294 289 'ORDER BY '.$calendar->date_field.$order, $conf['order_by'] 295 290 ); 296 $query .= ' 291 } 292 293 if ('categories'==$page['section'] && !isset($page['category']) 294 && ( count($page['chronology_date'])==0 295 OR ($page['chronology_date'][0]=='any' && count($page['chronology_date'])==1) ) 296 ) 297 { 298 $cache_key = $persistent_cache->make_key($user['id'].$user['cache_update_time'] 299 .$calendar->date_field.$order_by); 300 } 301 302 if ( !isset($cache_key) || !$persistent_cache->get($cache_key, $page['items'])) 303 { 304 $query = 'SELECT DISTINCT id ' 305 .$calendar->inner_sql.' 306 '.$calendar->get_date_where().' 297 307 '.$order_by; 298 } 299 $page['items'] = array_from_query($query, 'id'); 308 $page['items'] = array_from_query($query, 'id'); 309 if ( isset($cache_key) ) 310 $persistent_cache->set($cache_key, $page['items']); 311 } 300 312 } 301 313 pwg_debug('end initialize_calendar');
Note: See TracChangeset
for help on using the changeset viewer.