Changeset 8397 for trunk


Ignore:
Timestamp:
Dec 30, 2010, 4:23:50 PM (13 years ago)
Author:
plg
Message:

feature 1906: report the "use the album defined sort order" in the new Batch
Manager.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/batch_manager_global.php

    r8394 r8397  
    431431display_select_cat_wrapper($query, $selected_category, 'filter_category_options', true);
    432432
    433 // Dissociate from a category : categories listed for dissociation can
    434 // only represent virtual links. Links to physical categories can't be
    435 // broken
     433// Dissociate from a category : categories listed for dissociation can only
     434// represent virtual links. We can't create orphans. Links to physical
     435// categories can't be broken.
    436436if (count($page['cat_elements_id']) > 0)
    437437{
     
    528528  $template->assign('navbar', $nav_bar);
    529529
     530  $is_category = false;
     531  if (isset($_SESSION['bulk_manager_filter']['category'])
     532      and !isset($_SESSION['bulk_manager_filter']['category_recursive']))
     533  {
     534    $is_category = true;
     535  }
     536
    530537  $query = '
    531538SELECT id,path,tn_ext,file,filesize,level,name
    532   FROM '.IMAGES_TABLE.'
    533   WHERE id IN ('.implode(',', $page['cat_elements_id']).')
     539  FROM '.IMAGES_TABLE;
     540 
     541  if ($is_category)
     542  {
     543    $category_info = get_cat_info($_SESSION['bulk_manager_filter']['category']);
     544   
     545    $conf['order_by'] = $conf['order_by_inside_category'];
     546    if (!empty($category_info['image_order']))
     547    {
     548      $conf['order_by'] = ' ORDER BY '.$category_info['image_order'];
     549    }
     550
     551    $query.= '
     552    JOIN '.IMAGE_CATEGORY_TABLE.' ON id = image_id';
     553  }
     554
     555  $query.= '
     556  WHERE id IN ('.implode(',', $page['cat_elements_id']).')';
     557
     558  if ($is_category)
     559  {
     560    $query.= '
     561    AND category_id = '.$_SESSION['bulk_manager_filter']['category'];
     562  }
     563
     564  $query.= '
    534565  '.$conf['order_by'].'
    535566  LIMIT '.$page['nb_images'].' OFFSET '.$page['start'].'
Note: See TracChangeset for help on using the changeset viewer.