diff options
author | plegall <plg@piwigo.org> | 2010-12-30 15:54:43 +0000 |
---|---|---|
committer | plegall <plg@piwigo.org> | 2010-12-30 15:54:43 +0000 |
commit | 71ca43c5d404b0267880b5ef3fc00eeb89261e44 (patch) | |
tree | 9406b1961952ba5707a9c11fdde25ff08398e73d /admin | |
parent | 884437a4868db4ecbb468c777d1cde1f2e5ad562 (diff) |
feature 2089: report feature:1845 in the new Batch Manager.
+ once the photos are deleted, redirect the page to reset the current photo set
and avoid being on an empty 2nd page.
git-svn-id: http://piwigo.org/svn/trunk@8398 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin')
-rw-r--r-- | admin/batch_manager_global.php | 29 | ||||
-rw-r--r-- | admin/themes/default/template/batch_manager_global.tpl | 3 |
2 files changed, 9 insertions, 23 deletions
diff --git a/admin/batch_manager_global.php b/admin/batch_manager_global.php index cd1bf2419..419ac3c35 100644 --- a/admin/batch_manager_global.php +++ b/admin/batch_manager_global.php @@ -151,6 +151,8 @@ DELETE // we remove the dissociated images if we are currently displaying the // category to dissociate from. + // + // TODO we can display the photo of a given album without the $_GET['cat'] if (is_numeric($_GET['cat']) and $_POST['dissociate'] == $_GET['cat']) { $page['cat_elements_id'] = array_diff( @@ -269,35 +271,22 @@ DELETE { if (isset($_POST['confirm_deletion']) and 1 == $_POST['confirm_deletion']) { - // filter selection on photos that have no storage_category_id (ie - // that were added via pLoader) - $query = ' -SELECT id - FROM '.IMAGES_TABLE.' - WHERE id IN ('.implode(',', $collection).') - AND storage_category_id IS NULL -;'; - $deletables = array_from_query($query, 'id'); - - if (count($deletables) > 0) + $deleted_count = delete_elements($collection, true); + if ($deleted_count > 0) { - $physical_deletion = true; - delete_elements($deletables, $physical_deletion); - - array_push( - $page['infos'], + $_SESSION['page_infos'] = array( sprintf( l10n_dec( '%d photo was deleted', '%d photos were deleted', - count($deletables) + $deleted_count ), - count($deletables) + $deleted_count ) ); - // we have to remove the deleted photos from the current set - $page['cat_elements_id'] = array_diff($page['cat_elements_id'], $deletables); + $redirect_url = get_root_url().'admin.php?page='.$_GET['page']; + redirect($redirect_url); } else { diff --git a/admin/themes/default/template/batch_manager_global.tpl b/admin/themes/default/template/batch_manager_global.tpl index 7c16efe98..f9bb4b651 100644 --- a/admin/themes/default/template/batch_manager_global.tpl +++ b/admin/themes/default/template/batch_manager_global.tpl @@ -495,9 +495,6 @@ a.removeFilter:hover {background: url(admin/themes/default/icon/remove_filter_ho <!-- delete --> <div id="action_delete" class="bulkAction"> -{if $ENABLE_SYNCHRONIZATION} - <p style="font-style:italic;width:500px;">{'Note: photo deletion does not apply to photos added by synchronization. For photos added by synchronization, remove them from the filesystem and then perform another synchronization.'|@translate}</p> -{/if} <p><label><input type="checkbox" name="confirm_deletion" value="1"> {'Are you sure?'|@translate}</label></p> </div> |