mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-03-28 17:42:57 +01:00
fix #357 make orphans photos more obvious
... and easy to delete them all in one click. The orpans, if any, is shown as an entry in the "Photos" menu (link on Batch Manager). In the Batch Manager, new action "delete_orphans" next to prefilter.
This commit is contained in:
@@ -63,6 +63,21 @@ DELETE FROM '.CADDIE_TABLE.'
|
||||
|
||||
redirect(get_root_url().'admin.php?page='.$_GET['page']);
|
||||
}
|
||||
|
||||
if ('delete_orphans' == $_GET['action'])
|
||||
{
|
||||
$deleted_count = delete_elements(get_orphans(), true);
|
||||
|
||||
if ($deleted_count > 0)
|
||||
{
|
||||
$_SESSION['page_infos'][] = l10n_dec(
|
||||
'%d photo was deleted', '%d photos were deleted',
|
||||
$deleted_count
|
||||
);
|
||||
|
||||
redirect(get_root_url().'admin.php?page='.$_GET['page']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// +-----------------------------------------------------------------------+
|
||||
@@ -323,15 +338,7 @@ SELECT id
|
||||
break;
|
||||
|
||||
case 'no_album':
|
||||
$query = '
|
||||
SELECT
|
||||
id
|
||||
FROM '.IMAGES_TABLE.'
|
||||
LEFT JOIN '.IMAGE_CATEGORY_TABLE.' ON id = image_id
|
||||
WHERE category_id is null
|
||||
;';
|
||||
$filter_sets[] = query2array($query, null, 'id');
|
||||
|
||||
$filter_sets[] = get_orphans();
|
||||
break;
|
||||
|
||||
case 'no_tag':
|
||||
|
||||
Reference in New Issue
Block a user