diff options
author | plegall <plg@piwigo.org> | 2010-10-30 20:03:30 +0000 |
---|---|---|
committer | plegall <plg@piwigo.org> | 2010-10-30 20:03:30 +0000 |
commit | 6fc4ec3795dd4177630cd2448d3dbec23b340069 (patch) | |
tree | 145e9eb013525bf88470d5f1ca153438908ba4ad | |
parent | 462e8aa2fc6d073e75eee6bc416e861e7653e28e (diff) |
merge r7504 from branch 2.1 to trunk
bug 1906 fixed: during batch management, for a given category, use the category
defined sort order for photos, not the generic order_by.
git-svn-id: http://piwigo.org/svn/trunk@7505 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | admin/element_set_global.php | 18 | ||||
-rw-r--r-- | admin/element_set_unit.php | 18 |
2 files changed, 34 insertions, 2 deletions
diff --git a/admin/element_set_global.php b/admin/element_set_global.php index 1a6c82b85..3824b98eb 100644 --- a/admin/element_set_global.php +++ b/admin/element_set_global.php @@ -434,7 +434,23 @@ if (count($page['cat_elements_id']) > 0) $query = ' SELECT id,path,tn_ext,file,filesize,level - FROM '.IMAGES_TABLE.' + FROM '.IMAGES_TABLE; + + if (is_numeric($_GET['cat'])) + { + $category_info = get_cat_info($_GET['cat']); + + $conf['order_by'] = $conf['order_by_inside_category']; + if (!empty($category_info['image_order'])) + { + $conf['order_by'] = ' ORDER BY '.$category_info['image_order']; + } + + $query.= ' + JOIN '.IMAGE_CATEGORY_TABLE.' ON id = image_id'; + } + + $query.= ' WHERE id IN ('.implode(',', $page['cat_elements_id']).') '.$conf['order_by'].' LIMIT '.$page['nb_images'].' OFFSET '.$page['start'].' diff --git a/admin/element_set_unit.php b/admin/element_set_unit.php index 17b83dcef..f4901a343 100644 --- a/admin/element_set_unit.php +++ b/admin/element_set_unit.php @@ -194,7 +194,23 @@ if (count($page['cat_elements_id']) > 0) $query = ' SELECT id,path,tn_ext,name,date_creation,comment,author,level,file - FROM '.IMAGES_TABLE.' + FROM '.IMAGES_TABLE; + + if (is_numeric($_GET['cat'])) + { + $category_info = get_cat_info($_GET['cat']); + + $conf['order_by'] = $conf['order_by_inside_category']; + if (!empty($category_info['image_order'])) + { + $conf['order_by'] = ' ORDER BY '.$category_info['image_order']; + } + + $query.= ' + JOIN '.IMAGE_CATEGORY_TABLE.' ON id = image_id'; + } + + $query.= ' WHERE id IN ('.implode(',', $page['cat_elements_id']).') '.$conf['order_by'].' LIMIT '.$page['nb_images'].' OFFSET '.$page['start'].' |